My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
diff -uNr -x CVS cscope-15.7a/contrib/xcscope/cscope-indexer cscope-new/contrib/xcscope/cscope-indexer
--- cscope-15.7a/contrib/xcscope/cscope-indexer 2001-06-28 12:39:48.000000000 +0800
+++ cscope-new/contrib/xcscope/cscope-indexer 2010-06-24 22:21:51.000000000 +0800
@@ -42,7 +42,7 @@
#
# Usage:
#
-# cscope-indexer [ -v ] [-f database_file ] [-i list_file ] [ -l ] [ -r ]
+# cscope-indexer [ -v ] [-f database_file ] [-i list_file ] [ -l ] [ -r ] [ -k ] [ -u ]
#
# where:
#
@@ -62,6 +62,12 @@
# Without this option, only the current directory is
# searched.
#
+# -k
+# Don't use /usr/include for #include files.
+#
+# -u
+# Reuse the list file if it already exists.
+#
# -v
# Be verbose. Output simple progress messages.
#
@@ -79,6 +85,8 @@
DATABASE_FILE='cscope.out'
RECURSE=
VERBOSE=
+KERNEL_MODE=
+REUSE_LIST_FILE=
export DIR RECURSE # Need to pass these to subprocesses

while [ -n "$1" ]
@@ -111,6 +119,12 @@
-v)
VERBOSE=1
;;
+ -k)
+ KERNEL_MODE="-k"
+ ;;
+ -u)
+ REUSE_LIST_FILE=1
+ ;;
*)
DIR="$1"
;;
@@ -120,30 +134,35 @@

cd $DIR

-if [ "X$VERBOSE" != "X" ]
+if [ -r "$LIST_FILE" -a "X$REUSE_LIST_FILE" != "X" ]
then
- echo "Creating list of files to index ..."
-fi
-
-(
- if [ "X$RECURSE" = "X" ]
+ echo "List file $LIST_FILE already exists, reuse it instead of listing file again."
+else
+ if [ "X$VERBOSE" != "X" ]
then
- # Ugly, inefficient, but it works.
- for f in *
- do
- echo "$DIR/$f"
- done
- else
- find $DIR \( -type f -o -type l \)
+ echo "Creating list of files to index ..."
fi
-) | \
- egrep -i '\.([chly](xx|pp)*|cc|hh)$' | \
- sed -e '/\/CVS\//d' -e '/\/RCS\//d' -e 's/^\.\///' | \
- sort > $LIST_FILE

-if [ "X$VERBOSE" != "X" ]
-then
- echo "Creating list of files to index ... done"
+ (
+ if [ "X$RECURSE" = "X" ]
+ then
+ # Ugly, inefficient, but it works.
+ for f in *
+ do
+ echo "$DIR/$f"
+ done
+ else
+ find $DIR \( -type f -o -type l \)
+ fi
+ ) | \
+ egrep -i '\.([chly](xx|pp)*|cc|hh)$' | \
+ sed -e '/\/CVS\//d' -e '/\/RCS\//d' -e 's/^\.\///' | \
+ sort > $LIST_FILE
+
+ if [ "X$VERBOSE" != "X" ]
+ then
+ echo "Creating list of files to index ... done"
+ fi
fi

if [ "X$LIST_ONLY" != "X" ]
@@ -156,7 +175,7 @@
echo "Indexing files ..."
fi

-cscope -b -i $LIST_FILE -f $DATABASE_FILE
+cscope -b ${KERNEL_MODE} -i $LIST_FILE -f $DATABASE_FILE

if [ "X$VERBOSE" != "X" ]
then
diff -uNr -x CVS cscope-15.7a/contrib/xcscope/xcscope.el cscope-new/contrib/xcscope/xcscope.el
--- cscope-15.7a/contrib/xcscope/xcscope.el 2002-04-11 00:59:00.000000000 +0800
+++ cscope-new/contrib/xcscope/xcscope.el 2010-06-24 22:34:48.000000000 +0800
@@ -114,7 +114,7 @@
;; (define-key global-map [(control f11)] 'cscope-prev-symbol)
;; (define-key global-map [(control f12)] 'cscope-prev-file)
;; (define-key global-map [(meta f9)] 'cscope-display-buffer)
-;; (defin-ekey global-map [(meta f10)] 'cscope-display-buffer-toggle)
+;; (define-key global-map [(meta f10)] 'cscope-display-buffer-toggle)
;;
;; 6. Restart (X)Emacs. That's it.
;;
@@ -356,6 +356,12 @@
;; list of files to index, or when creating the list of files and
;; the corresponding cscope database.
;;
+;; "cscope-kernel-mode"
+;; Don't use /usr/include for #include files.
+;;
+;; "cscope-reuse-list-file"
+;; Reuse the list file if it already exists.
+;;
;; "cscope-name-line-width"
;; The width of the combined "function name:line number" field in
;; the cscope results buffer. If negative, the field is
@@ -777,6 +783,18 @@
:group 'cscope)


+(defcustom cscope-kernel-mode nil
+ "*if non-nil, don't use /usr/include for #include files."
+ :type 'boolean
+ :group 'cscope)
+
+
+(defcustom cscope-reuse-list-file nil
+ "Reuse the list file if it already exists."
+ :type 'boolean
+ :group 'cscope)
+
+
(defcustom cscope-no-mouse-prompts nil
"*If non-nil, use the symbol under the cursor instead of prompting.
Do not prompt for a value, except for when seaching for a egrep pattern
@@ -1220,6 +1238,14 @@
(setq cscope-use-relative-paths
(not cscope-use-relative-paths))
:style toggle :selected cscope-use-relative-paths ]
+ [ "Kernel mode"
+ (setq cscope-kernel-mode
+ (not cscope-kernel-mode))
+ :style toggle :selected cscope-kernel-mode ]
+ [ "Reuse list file"
+ (setq cscope-reuse-list-file
+ (not cscope-reuse-list-file))
+ :style toggle :selected cscope-reuse-list-file ]
[ "No mouse prompts" (setq cscope-no-mouse-prompts
(not cscope-no-mouse-prompts))
:style toggle :selected cscope-no-mouse-prompts ]
@@ -2120,6 +2146,10 @@
"." top-directory))))
(if cscope-index-recursively
(setq args (cons "-r" args)))
+ (if cscope-reuse-list-file
+ (setq args (cons "-u" args)))
+ (if cscope-kernel-mode
+ (setq args (cons "-k" args)))
(setq cscope-unix-index-process
(apply 'start-process "cscope-indexer"
cscope-unix-index-process-buffer

Change log

r163 by sevenever on Jun 24, 2010   Diff
fix bug of construct cscope-indexer's args
in xcscope.el

Go to: 
Sign in to write a code review

Older revisions

r151 by sevenever on May 9, 2010   Diff
rename xcscope-path to xcscope-patch
r150 by sevenever on May 4, 2010   Diff
xcscope-path added
All revisions of this file

File info

Size: 5129 bytes, 182 lines
Powered by Google Project Hosting