aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJoakim Verona2013-03-26 16:20:17 +0100
committerJoakim Verona2013-03-26 16:20:17 +0100
commit6f6db22fc74ffb7fbdd4d805545b7e28cd59f0c8 (patch)
tree4a58903b4c3d010e90fc37fe10ea4d9895876d01 /lisp
parent62dd123f7c11ddbe156bc0e84dcb7ca1da5368bb (diff)
parent48c226c2c2592e31a47559bd1689fcc4354d9479 (diff)
downloademacs-6f6db22fc74ffb7fbdd4d805545b7e28cd59f0c8.tar.gz
emacs-6f6db22fc74ffb7fbdd4d805545b7e28cd59f0c8.zip
conflict resolve
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog271
-rw-r--r--lisp/calc/calc-ext.el88
-rw-r--r--lisp/cedet/ChangeLog177
-rw-r--r--lisp/cedet/cedet-files.el18
-rw-r--r--lisp/cedet/ede.el65
-rw-r--r--lisp/cedet/ede/auto.el4
-rw-r--r--lisp/cedet/ede/base.el36
-rw-r--r--lisp/cedet/ede/cpp-root.el67
-rw-r--r--lisp/cedet/ede/emacs.el4
-rw-r--r--lisp/cedet/ede/files.el25
-rw-r--r--lisp/cedet/ede/locate.el2
-rw-r--r--lisp/cedet/ede/pconf.el2
-rw-r--r--lisp/cedet/ede/proj-elisp.el5
-rw-r--r--lisp/cedet/ede/proj.el4
-rw-r--r--lisp/cedet/ede/util.el2
-rw-r--r--lisp/cedet/semantic.el10
-rw-r--r--lisp/cedet/semantic/analyze.el2
-rw-r--r--lisp/cedet/semantic/analyze/fcn.el2
-rw-r--r--lisp/cedet/semantic/bovine/c.el73
-rw-r--r--lisp/cedet/semantic/bovine/gcc.el6
-rw-r--r--lisp/cedet/semantic/complete.el18
-rw-r--r--lisp/cedet/semantic/db-el.el5
-rw-r--r--lisp/cedet/semantic/db-file.el4
-rw-r--r--lisp/cedet/semantic/db-find.el6
-rw-r--r--lisp/cedet/semantic/db.el6
-rw-r--r--lisp/cedet/semantic/decorate/include.el4
-rw-r--r--lisp/cedet/semantic/ede-grammar.el2
-rw-r--r--lisp/cedet/semantic/find.el9
-rw-r--r--lisp/cedet/semantic/grammar.el3
-rw-r--r--lisp/cedet/semantic/sb.el12
-rw-r--r--lisp/cedet/semantic/senator.el8
-rw-r--r--lisp/cedet/semantic/sort.el2
-rw-r--r--lisp/cedet/semantic/tag-ls.el66
-rw-r--r--lisp/cedet/srecode/args.el24
-rw-r--r--lisp/cedet/srecode/compile.el10
-rw-r--r--lisp/cedet/srecode/cpp.el3
-rw-r--r--lisp/cedet/srecode/dictionary.el8
-rw-r--r--lisp/cedet/srecode/insert.el4
-rw-r--r--lisp/cedet/srecode/java.el21
-rw-r--r--lisp/cedet/srecode/map.el3
-rw-r--r--lisp/cedet/srecode/mode.el2
-rw-r--r--lisp/cedet/srecode/srt-mode.el6
-rw-r--r--lisp/cedet/srecode/srt.el6
-rw-r--r--lisp/cedet/srecode/table.el2
-rw-r--r--lisp/desktop.el106
-rw-r--r--lisp/doc-view.el11
-rw-r--r--lisp/emacs-lisp/crm.el3
-rw-r--r--lisp/emacs-lisp/edebug.el5
-rw-r--r--lisp/emacs-lisp/eieio-datadebug.el63
-rw-r--r--lisp/emacs-lisp/eldoc.el67
-rw-r--r--lisp/emacs-lisp/lisp-mode.el2
-rw-r--r--lisp/emacs-lisp/smie.el53
-rw-r--r--lisp/eshell/em-prompt.el1
-rw-r--r--lisp/files.el5
-rw-r--r--lisp/font-lock.el4
-rw-r--r--lisp/gnus/ChangeLog12
-rw-r--r--lisp/gnus/message.el8
-rw-r--r--lisp/gnus/nnir.el587
-rw-r--r--lisp/ido.el6
-rw-r--r--lisp/info.el116
-rw-r--r--lisp/international/ja-dic-cnv.el33
-rw-r--r--lisp/mouse.el9
-rw-r--r--lisp/net/tramp-adb.el20
-rw-r--r--lisp/net/tramp-compat.el5
-rw-r--r--lisp/net/tramp-gvfs.el2
-rw-r--r--lisp/net/tramp.el13
-rw-r--r--lisp/net/trampver.el4
-rw-r--r--lisp/nxml/nxml-mode.el8
-rw-r--r--lisp/nxml/nxml-outln.el4
-rw-r--r--lisp/nxml/nxml-rap.el4
-rw-r--r--lisp/nxml/nxml-util.el21
-rw-r--r--lisp/nxml/rng-maint.el2
-rw-r--r--lisp/nxml/rng-nxml.el4
-rw-r--r--lisp/nxml/rng-valid.el79
-rw-r--r--lisp/progmodes/cfengine.el30
-rw-r--r--lisp/progmodes/compile.el8
-rw-r--r--lisp/progmodes/scheme.el3
-rw-r--r--lisp/register.el13
-rw-r--r--lisp/replace.el44
-rw-r--r--lisp/simple.el11
-rw-r--r--lisp/startup.el16
-rw-r--r--lisp/subr.el19
-rw-r--r--lisp/term/x-win.el7
-rw-r--r--lisp/thingatpt.el2
-rw-r--r--lisp/vc/diff-mode.el1
-rw-r--r--lisp/whitespace.el386
86 files changed, 1837 insertions, 1057 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 41e78c7885a..e86bc7f0a96 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,269 @@
12013-03-26 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * desktop.el (desktop--v2s): Rename from desktop-internal-v2s.
4 Change return value to be a sexp. Delay `get-buffer' to after
5 restoring the desktop (bug#13951).
6
72013-03-26 Leo Liu <sdl.web@gmail.com>
8
9 * register.el: Move semantic tag handling back to
10 cedet/semantic/senator.el. (Bug#14052)
11
122013-03-26 Stefan Monnier <monnier@iro.umontreal.ca>
13
14 * eshell/em-prompt.el (eshell-emit-prompt): Make sure we can't insert
15 into the prompt either (bug#13963).
16
172013-03-25 Stefan Monnier <monnier@iro.umontreal.ca>
18
19 * font-lock.el (lisp-font-lock-keywords-2): Don't highlight the "error"
20 part of "(error-foo)".
21
222013-03-24 Juri Linkov <juri@jurta.org>
23
24 * replace.el (list-matching-lines-prefix-face): New defcustom.
25 (occur-1): Pass `list-matching-lines-prefix-face' to the function
26 `occur-engine' if `face-differs-from-default-p' returns t.
27 (occur-engine): Add `,' inside backquote construct to evaluate
28 `prefix-face'. Propertize the prefix with the `prefix-face' face.
29 Pass `prefix-face' to the functions `occur-context-lines' and
30 `occur-engine-add-prefix'.
31 (occur-engine-add-prefix, occur-context-lines): Add optional arg
32 `prefix-face' and propertize the prefix with `prefix-face'.
33 (Bug#14017)
34
352013-03-24 Leo Liu <sdl.web@gmail.com>
36
37 * nxml/rng-valid.el (rng-validate-while-idle)
38 (rng-validate-quick-while-idle): Guard against deleted buffer.
39 (Bug#13999)
40
41 * emacs-lisp/edebug.el (edebug-mode): Make sure edebug-kill-buffer
42 is the last entry in kill-buffer-hook.
43
44 * files.el (kill-buffer-hook): Doc fix.
45
462013-03-23 Dmitry Gutov <dgutov@yandex.ru>
47
48 * emacs-lisp/lisp-mode.el (emacs-lisp-docstring-fill-column):
49 Make it safe-local.
50
51 * vc/diff-mode.el (diff-mode-shared-map): Unbind "/" (Bug#14034).
52
532013-03-23 Leo Liu <sdl.web@gmail.com>
54
55 * nxml/nxml-util.el (nxml-with-unmodifying-text-property-changes):
56 Remove.
57
58 * nxml/rng-valid.el (rng-validate-mode)
59 (rng-after-change-function, rng-do-some-validation):
60 * nxml/rng-maint.el (rng-validate-buffer):
61 * nxml/nxml-rap.el (nxml-tokenize-forward, nxml-ensure-scan-up-to-date):
62 * nxml/nxml-outln.el (nxml-show-all, nxml-set-outline-state):
63 * nxml/nxml-mode.el (nxml-mode, nxml-degrade, nxml-after-change)
64 (nxml-extend-after-change-region): Use with-silent-modifications.
65
66 * nxml/rng-nxml.el (rng-set-state-after): Do not let-bind
67 timer-idle-list.
68
69 * nxml/rng-valid.el (rng-validate-while-idle-continue-p)
70 (rng-next-error-1, rng-previous-error-1): Do not let-bind
71 timer-idle-list. (Bug#13999)
72
732013-03-23 Juri Linkov <juri@jurta.org>
74
75 * info.el (info-index-match): New face.
76 (Info-index, Info-apropos-matches): Add a nested subgroup to the
77 main pattern and add text properties with the new face to matches
78 in index entries relative to the beginning of the index entry.
79 (Bug#14015)
80
812013-03-21 Eric Ludlam <zappo@gnu.org>
82
83 * eieio/eieio-datadebug.el (data-debug/eieio-insert-slots):
84 Inhibit read only while inserting objects.
85
862013-03-22 Teodor Zlatanov <tzz@lifelogs.com>
87
88 * progmodes/cfengine.el: Update docs to mention
89 `cfengine-auto-mode'. Use \_> and \_< instead of \> and \< for
90 symbol motion. Remove "_" from the word syntax.
91
922013-03-21 Teodor Zlatanov <tzz@lifelogs.com>
93
94 * progmodes/cfengine.el (cfengine-common-syntax): Add "_" to word
95 syntax for both `cfengine2-mode' and `cfengine3-mode'.
96
972013-03-20 Juri Linkov <juri@jurta.org>
98
99 * info.el (Info-next-reference-or-link)
100 (Info-prev-reference-or-link): New functions.
101 (Info-next-reference, Info-prev-reference): Use them.
102 (Info-try-follow-nearest-node): Handle footnote navigation.
103 (Info-fontify-node): Fontify footnotes. (Bug#13989)
104
1052013-03-20 Stefan Monnier <monnier@iro.umontreal.ca>
106
107 * subr.el (posn-point, posn-string): Fix it here instead (bug#13979).
108 * mouse.el (mouse-on-link-p): Undo scroll-bar fix.
109
1102013-03-20 Paul Eggert <eggert@cs.ucla.edu>
111
112 Suppress unnecessary non-ASCII chatter during build process.
113 * international/ja-dic-cnv.el (skkdic-collect-okuri-nasi)
114 (batch-skkdic-convert): Suppress most of the chatter.
115 It's not needed so much now that machines are faster,
116 and its non-ASCII component was confusing; see Dmitry Gutov in
117 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00508.html>.
118
1192013-03-20 Leo Liu <sdl.web@gmail.com>
120
121 * ido.el (ido-chop): Fix bug#10994.
122
1232013-03-19 Dmitry Gutov <dgutov@yandex.ru>
124
125 * whitespace.el (whitespace-font-lock, whitespace-font-lock-mode):
126 Remove vars.
127 (whitespace-color-on, whitespace-color-off):
128 Use `font-lock-fontify-buffer' (Bug#13817).
129
1302013-03-19 Stefan Monnier <monnier@iro.umontreal.ca>
131
132 * mouse.el (mouse--down-1-maybe-follows-link): Fix follow-link
133 remapping in mode-line.
134 (mouse-on-link-p): Also check [mode-line follow-link] bindings.
135
1362013-03-19 Dmitry Gutov <dgutov@yandex.ru>
137
138 * whitespace.el (whitespace-color-on): Use `prepend' OVERRIDE
139 value for `whitespace-line' face (Bug#13875).
140 (whitespace-font-lock-keywords): Change description.
141 (whitespace-color-on): Don't save `font-lock-keywords' value, save
142 the constructed keywords instead.
143 (whitespace-color-off): Use `font-lock-remove-keywords' (Bug#13817).
144
1452013-03-19 Leo Liu <sdl.web@gmail.com>
146
147 * progmodes/compile.el (compilation-display-error): New command.
148 (compilation-mode-map, compilation-minor-mode-map): Bind it to
149 C-o. (Bug#13992)
150
1512013-03-18 Paul Eggert <eggert@cs.ucla.edu>
152
153 * term/x-win.el (x-keysym-pair): Add a Fixme (Bug#13936).
154
1552013-03-18 Jan Djärv <jan.h.d@swipnet.se>
156
157 * mouse.el (mouse-on-link-p): Check for scroll bar (Bug#13979).
158
1592013-03-18 Michael Albinus <michael.albinus@gmx.de>
160
161 * net/tramp-compat.el (tramp-compat-user-error): New defun.
162
163 * net/tramp-adb.el (tramp-adb-handle-shell-command):
164 * net/tramp-gvfs.el (top):
165 * net/tramp.el (tramp-find-method, tramp-dissect-file-name)
166 (tramp-handle-shell-command): Use it.
167 (tramp-dissect-file-name): Raise an error when hostname is a
168 method name, and neither method nor user is specified.
169
170 * net/trampver.el: Update release number.
171
1722013-03-18 Leo Liu <sdl.web@gmail.com>
173
174 Make sure eldoc can be turned off properly.
175 * emacs-lisp/eldoc.el (eldoc-schedule-timer): Conditionalize on
176 eldoc-mode.
177 (eldoc-display-message-p): Revert last change.
178 (eldoc-display-message-no-interference-p)
179 (eldoc-print-current-symbol-info): Tweak.
180
1812013-03-18 Tassilo Horn <tsdh@gnu.org>
182
183 * doc-view.el (doc-view-new-window-function): Check the new window
184 overlay's display property instead the char property of the
185 buffer's first char. Use `with-selected-window' instead of
186 `save-window-excursion' with `select-window'.
187 (doc-view-document->bitmap): Check the current doc-view overlay's
188 display property instead the char property of the buffer's first char.
189
1902013-03-18 Paul Eggert <eggert@cs.ucla.edu>
191
192 Automate the build of ja-dic.el (Bug#13984).
193 * international/ja-dic-cnv.el (skkdic-convert): Remove the annotations
194 from the input, rather than assume that it's been done for us by the
195 SKK script unannotate.awk. Switch ja-dic.el to UTF-8. Don't put
196 the current date into a ja-dic.el comment, as that complicates
197 regression testing.
198
1992013-03-18 Stefan Monnier <monnier@iro.umontreal.ca>
200
201 * whitespace.el: Fix double evaluation.
202 (whitespace-space, whitespace-hspace, whitespace-tab)
203 (whitespace-newline, whitespace-trailing, whitespace-line)
204 (whitespace-space-before-tab, whitespace-indentation)
205 (whitespace-empty, whitespace-space-after-tab): Turn defcustoms into
206 obsolete defvars.
207 (whitespace-hspace-regexp): Fix regexp for emacs-unicode.
208 (whitespace-color-on): Use a single font-lock-add-keywords call.
209 Fix double-evaluation of face variables.
210
2112013-03-17 Michael Albinus <michael.albinus@gmx.de>
212
213 * net/tramp-adb.el (tramp-adb-parse-device-names):
214 Use `start-process' instead of `call-process'. Otherwise, the
215 function might be blocked under MS Windows. (Bug#13299)
216
2172013-03-17 Leo Liu <sdl.web@gmail.com>
218
219 Extend eldoc to display info in the mode-line. (Bug#13978)
220 * emacs-lisp/eldoc.el (eldoc-post-insert-mode): New minor mode.
221 (eldoc-mode-line-string): New variable.
222 (eldoc-minibuffer-message): New function.
223 (eldoc-message-function): New variable.
224 (eldoc-message): Use it.
225 (eldoc-display-message-p)
226 (eldoc-display-message-no-interference-p):
227 Support eldoc-post-insert-mode.
228
229 * simple.el (eval-expression-minibuffer-setup-hook): New hook.
230 (eval-expression): Run it.
231
2322013-03-17 Roland Winkler <winkler@gnu.org>
233
234 * emacs-lisp/crm.el (completing-read-multiple): Ignore empty
235 strings in the list of return values.
236
2372013-03-17 Jay Belanger <jay.p.belanger@gmail.com>
238
239 * calc/calc-ext.el (math-read-number-fancy): Check for an explicit
240 radix before checking for HMS forms.
241
2422013-03-16 Leo Liu <sdl.web@gmail.com>
243
244 * progmodes/scheme.el: Add indentation and font-locking for λ.
245 (Bug#13975)
246
2472013-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
248
249 * emacs-lisp/smie.el (smie-auto-fill): Don't inf-loop if there's no
250 token before point (bug#13942).
251
2522013-03-16 Leo Liu <sdl.web@gmail.com>
253
254 * thingatpt.el (end-of-sexp): Fix bug#13952. Use syntax-after.
255
2562013-03-16 Glenn Morris <rgm@gnu.org>
257
258 * Version 24.3 released.
259
2602013-03-16 Eli Zaretskii <eliz@gnu.org>
261
262 * startup.el (command-line-normalize-file-name): Fix handling of
263 backslashes in DOS and Windows file names. Reported by Xue Fuqiao
264 <xfq.free@gmail.com> in
265 http://lists.gnu.org/archive/html/help-gnu-emacs/2013-03/msg00245.html.
266
12013-03-15 Michael Albinus <michael.albinus@gmx.de> 2672013-03-15 Michael Albinus <michael.albinus@gmx.de>
2 268
3 Sync with Tramp 2.2.7. 269 Sync with Tramp 2.2.7.
@@ -564,6 +830,11 @@
564 Let-bind `isearch-other-end' to `start', `isearch-forward' to t 830 Let-bind `isearch-other-end' to `start', `isearch-forward' to t
565 and `isearch-error' to nil. 831 and `isearch-error' to nil.
566 832
8332013-03-16 Fabián Ezequiel Gallina <fgallina@cuca>
834
835 * progmodes/python.el (python-info-current-defun):
836 Enhance match-data cluttering prevention.
837
5672013-02-22 Michael Albinus <michael.albinus@gmx.de> 8382013-02-22 Michael Albinus <michael.albinus@gmx.de>
568 839
569 * net/tramp.el (tramp-tramp-file-p): Fix docstring. 840 * net/tramp.el (tramp-tramp-file-p): Fix docstring.
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 57de072fdc7..2cb5bf450d5 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -2945,50 +2945,6 @@ If X is not an error form, return 1."
2945 (and x sigma (math-scalarp x) (math-anglep sigma) 2945 (and x sigma (math-scalarp x) (math-anglep sigma)
2946 (list 'sdev x sigma)))) 2946 (list 'sdev x sigma))))
2947 2947
2948 ;; Hours (or degrees)
2949 ((or (string-match "^\\([^#^]+\\)[@oOhH]\\(.*\\)$" s)
2950 (string-match "^\\([^#^]+\\)[dD][eE]?[gG]?\\(.*\\)$" s))
2951 (let* ((hours (math-match-substring s 1))
2952 (minsec (math-match-substring s 2))
2953 (hours (math-read-number hours))
2954 (minsec (if (> (length minsec) 0) (math-read-number minsec) 0)))
2955 (and hours minsec
2956 (math-num-integerp hours)
2957 (not (math-negp hours)) (not (math-negp minsec))
2958 (cond ((math-num-integerp minsec)
2959 (and (Math-lessp minsec 60)
2960 (list 'hms hours minsec 0)))
2961 ((and (eq (car-safe minsec) 'hms)
2962 (math-zerop (nth 1 minsec)))
2963 (math-add (list 'hms hours 0 0) minsec))
2964 (t nil)))))
2965
2966 ;; Minutes
2967 ((string-match "^\\([^'#^]+\\)[mM']\\(.*\\)$" s)
2968 (let* ((minutes (math-match-substring s 1))
2969 (seconds (math-match-substring s 2))
2970 (minutes (math-read-number minutes))
2971 (seconds (if (> (length seconds) 0) (math-read-number seconds) 0)))
2972 (and minutes seconds
2973 (math-num-integerp minutes)
2974 (not (math-negp minutes)) (not (math-negp seconds))
2975 (cond ((math-realp seconds)
2976 (and (Math-lessp minutes 60)
2977 (list 'hms 0 minutes seconds)))
2978 ((and (eq (car-safe seconds) 'hms)
2979 (math-zerop (nth 1 seconds))
2980 (math-zerop (nth 2 seconds)))
2981 (math-add (list 'hms 0 minutes 0) seconds))
2982 (t nil)))))
2983
2984 ;; Seconds
2985 ((string-match "^\\([^\"#^]+\\)[sS\"]$" s)
2986 (let ((seconds (math-read-number (math-match-substring s 1))))
2987 (and seconds (math-realp seconds)
2988 (not (math-negp seconds))
2989 (Math-lessp seconds 60)
2990 (list 'hms 0 0 seconds))))
2991
2992 ;; Integer+fraction with explicit radix 2948 ;; Integer+fraction with explicit radix
2993 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]*\\)[:/]\\([0-9a-zA-Z]*\\)[:/]\\([0-9a-zA-Z]\\)$" s) 2949 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]*\\)[:/]\\([0-9a-zA-Z]*\\)[:/]\\([0-9a-zA-Z]\\)$" s)
2994 (let ((radix (string-to-number (math-match-substring s 1))) 2950 (let ((radix (string-to-number (math-match-substring s 1)))
@@ -3061,6 +3017,50 @@ If X is not an error form, return 1."
3061 (let ((digs (math-match-substring s 1))) 3017 (let ((digs (math-match-substring s 1)))
3062 (math-read-radix digs 16))) 3018 (math-read-radix digs 16)))
3063 3019
3020 ;; Hours (or degrees)
3021 ((or (string-match "^\\([^#^]+\\)[@oOhH]\\(.*\\)$" s)
3022 (string-match "^\\([^#^]+\\)[dD][eE]?[gG]?\\(.*\\)$" s))
3023 (let* ((hours (math-match-substring s 1))
3024 (minsec (math-match-substring s 2))
3025 (hours (math-read-number hours))
3026 (minsec (if (> (length minsec) 0) (math-read-number minsec) 0)))
3027 (and hours minsec
3028 (math-num-integerp hours)
3029 (not (math-negp hours)) (not (math-negp minsec))
3030 (cond ((math-num-integerp minsec)
3031 (and (Math-lessp minsec 60)
3032 (list 'hms hours minsec 0)))
3033 ((and (eq (car-safe minsec) 'hms)
3034 (math-zerop (nth 1 minsec)))
3035 (math-add (list 'hms hours 0 0) minsec))
3036 (t nil)))))
3037
3038 ;; Minutes
3039 ((string-match "^\\([^'#^]+\\)[mM']\\(.*\\)$" s)
3040 (let* ((minutes (math-match-substring s 1))
3041 (seconds (math-match-substring s 2))
3042 (minutes (math-read-number minutes))
3043 (seconds (if (> (length seconds) 0) (math-read-number seconds) 0)))
3044 (and minutes seconds
3045 (math-num-integerp minutes)
3046 (not (math-negp minutes)) (not (math-negp seconds))
3047 (cond ((math-realp seconds)
3048 (and (Math-lessp minutes 60)
3049 (list 'hms 0 minutes seconds)))
3050 ((and (eq (car-safe seconds) 'hms)
3051 (math-zerop (nth 1 seconds))
3052 (math-zerop (nth 2 seconds)))
3053 (math-add (list 'hms 0 minutes 0) seconds))
3054 (t nil)))))
3055
3056 ;; Seconds
3057 ((string-match "^\\([^\"#^]+\\)[sS\"]$" s)
3058 (let ((seconds (math-read-number (math-match-substring s 1))))
3059 (and seconds (math-realp seconds)
3060 (not (math-negp seconds))
3061 (Math-lessp seconds 60)
3062 (list 'hms 0 0 seconds))))
3063
3064 ;; Fraction using "/" instead of ":" 3064 ;; Fraction using "/" instead of ":"
3065 ((string-match "^\\([0-9]+\\)/\\([0-9/]+\\)$" s) 3065 ((string-match "^\\([0-9]+\\)/\\([0-9/]+\\)$" s)
3066 (math-read-number (concat (math-match-substring s 1) ":" 3066 (math-read-number (concat (math-match-substring s 1) ":"
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
index 2ccce8bb01d..8b914e8843e 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,3 +1,180 @@
12013-03-26 Leo Liu <sdl.web@gmail.com>
2
3 * semantic/senator.el (senator-copy-tag-to-register): Move
4 register handling logic from register.el. (Bug#14052)
5
62013-03-21 Eric Ludlam <zappo@gnu.org>
7
8 * semantic.el (navigate-menu): Yank Tag :enable. Make sure
9 `senator-tag-ring' is bound.
10 (semantic-parse-region-default): Stop reversing the output of
11 parse-whole-stream.
12 (semantic-repeat-parse-whole-stream): Append returned tags
13 differently, so they come out in the right order.
14
15 * semantic/sb.el (semantic-sb-filter-tags-of-class): New option.
16 (semantic-sb-fetch-tag-table): Filter tags being bucketed to
17 exclude tags belonging to above filtered classes.
18
19 * semantic/find.el (semantic-filter-tags-by-class): New function.
20
21 * semantic/tag-ls.el (semantic-tag-similar-p-default): Add
22 short-circuit in case tag1 and 2 are identical.
23
24 * semantic/analyze/fcn.el
25 (semantic-analyze-dereference-metatype-stack): Use
26 `semantic-tag-similar-p' instead of 'eq' when comparing two tags
27 during metatype evaluation in case they are the same, but not the
28 same node. (Tweaked patch from Tomasz Gajewski) (Tiny change)
29
30 * semantic/db-find.el (semanticdb-partial-synchronize): Fix
31 require to semantic/db-typecache to be correct.
32 (semanticdb-find-tags-external-children-of-type): Make this a
33 brutish search by default.
34
35 * semantic/sort.el
36 (semantic-tag-external-member-children-default): When calling
37 `semanticdb-find-tags-external-children-of-type', pass in the
38 input tag as the place to start searching for externally defined
39 methods.
40
41 * semantic/db-file.el (semanticdb-default-save-directory): Doc
42 fix: Add ref to default value.
43
44 * semantic/complete.el (semantic-complete-post-command-hook): When
45 detecting if cursor is outside completion area, do so if cursor
46 moves before start of overlay, or the original starting location
47 of the overlay (i.e., if user deletes past beginning of the
48 overlay region).
49 (semantic-complete-inline-tag-engine): Initialize original start
50 of `semantic-complete-inline-overlay'.
51
52 * semantic/bovine/c.el (semantic-c-describe-environment): Update
53 some section titles. Test semanticdb table before printing it.
54 (semantic-c-reset-preprocessor-symbol-map): Update
55 `semantic-lex-spp-macro-symbol-obarray' outside the loop over all
56 the files contributing to its value.
57 (semantic-c-describe-environment): If there is an EDE project but
58 no spp symbols from it, say so.
59
60 * srecode/args.el (srecode-semantic-handle-:project): New argument
61 handler. Provide variable values if not in an EDE project.
62
63 * srecode/srt-mode.el (srecode-template-mode): Fix typo on srecode
64 name.
65
66 * srecode/cpp.el (srecode-semantic-handle-:c): Replace all
67 characters in FILENAME_SYMBOL that aren't valid CPP symbol chars.
68
69 * srecode/map.el (srecode-map-validate-file-for-mode): Force
70 semantic to load if it is not active in the template being added
71 to the map.
72
73 * srecode/srt.el: Add local variables for setting the autoload
74 file name.
75 (srecode-semantic-handle-:srt): New autoload cookie
76
77 * ede.el (ede-apply-preprocessor-map): Apply map to
78 `semantic-lex-spp-project-macro-symbol-obarray' instead of the
79 system one. Add require for semantic.
80
81 * ede/proj-elisp.el (ede-update-version-in-source): In case a file
82 has both a version variable and a Version: comment, always use
83 `call-next-method'.
84
85 * ede/cpp-root.el (ede-set-project-variables): Deleted.
86 `ede-preprocessor-map' does the job this function was attempting
87 to do with :spp-table.
88 (ede-preprocessor-map): Update file tests to provide better
89 messages. Do not try to get symbols from a file that is the file
90 in the current buffer.
91
92 * ede/base.el (ede-project-placeholder): Add more documentation to
93 :file slot.
94 (ede-load-cache): Use `insert-file-contents' instead of
95 `find-file-noselect' in order to avoid activating other tools.
96
972013-03-21 David Engster <deng@randomsample.de>
98
99 * semantic/bovine/c.el (semantic-get-local-variables): Also add a
100 new variable 'this' if we are in an inline member function. For
101 detecting this, we check overlays at point if there is a class
102 spanning the current function. Also, the variable 'this' has to
103 be a pointer.
104
105 * semantic/bovine/gcc.el (semantic-gcc-setup): Fail gracefully
106 when querying g++ for defines returns an error.
107
108 * srecode/srt-mode.el:
109 * srecode/compile.el:
110 * semantic/elp.el:
111 * semantic/db-el.el:
112 * semantic/complete.el:
113 * ede.el:
114 * cogre.el:
115 * srecode/table.el:
116 * srecode/mode.el:
117 * srecode/insert.el:
118 * srecode/compile.el:
119 * semantic/decorate/include.el:
120 * semantic/db.el:
121 * semantic/adebug.el:
122 * ede/auto.el:
123 * srecode/dictionary.el:
124 * semantic/ede-grammar.el:
125 * semantic/db.el:
126 * semantic/db-find.el:
127 * semantic/db-file.el:
128 * semantic/complete.el:
129 * semantic/bovine/c.el:
130 * semantic/analyze.el:
131 * ede/util.el:
132 * ede/proj.el:
133 * ede/proj-elisp.el:
134 * ede/pconf.el:
135 * ede/locate.el:
136 * ede.el: Adapt to EIEIO namespace cleanup: Rename `object-name'
137 to `eieio-object-name', `object-set-name-string' to
138 `eieio-object-set-name-string', `object-class' to
139 `eieio-object-class', `class-parent' to `eieio-class-parent',
140 `class-parents' to `eieio-class-parents', `class-children' to
141 `eieio-class-children', `object-name-string' to
142 `eieio-object-name-string', `object-class-fast' to
143 `eieio--object-class'. Also replace direct access with new
144 accessor functions.
145
1462013-03-21 Tomasz Gajewski <tomga@wp.pl> (tiny change)
147
148 * ede/cpp-root.el (ede-project-autoload, initialize-instance): Fix
149 EDE file symbol to match rename. Fix ede-cpp-root symbol to
150 include -project in name.
151
1522013-03-21 Alex Ott <alexott@gmail.com>
153
154 * cedet-files.el (cedet-files-list-recursively): New. Recursively
155 find files whose names are matching to given regex
156
157 * ede.el (ede-current-project): Rewrite to avoid imperative style.
158
159 * ede/files.el (ede-find-file): Simplify code.
160
161 * ede/base.el (ede-normalize-file/directory): Add function to
162 normalize :file or :directory slots if they are missing.
163
164 * ede/cpp-root.el (ede-cpp-root-project): Add compile-command
165 slot.
166 (project-compile-project): Compiles project using value specified
167 in :compule-command slot or in compile-command local variable.
168 Value of slot or local variable could be string or function that
169 receives project and should return string that will be invoked as
170 command.
171 (project-compile-target): Invokes compilation of whole project
172
173 * ede/files.el (ede-find-project-root): New function to
174 find root of project that contains specific file.
175 (ede-files-find-existing): New function which checks presence of
176 given directory in the list of registered projects.
177
12013-03-04 Paul Eggert <eggert@cs.ucla.edu> 1782013-03-04 Paul Eggert <eggert@cs.ucla.edu>
2 179
3 * semantic/wisent/wisent.el (wisent): Stick to ASCII in the ASCII art. 180 * semantic/wisent/wisent.el (wisent): Stick to ASCII in the ASCII art.
diff --git a/lisp/cedet/cedet-files.el b/lisp/cedet/cedet-files.el
index 36561090bd2..236040befb8 100644
--- a/lisp/cedet/cedet-files.el
+++ b/lisp/cedet/cedet-files.el
@@ -88,6 +88,24 @@ specific conversions during tests."
88 (setq file (concat "//" (substring file 1))))) 88 (setq file (concat "//" (substring file 1)))))
89 file)) 89 file))
90 90
91(defun cedet-files-list-recursively (dir re)
92 "Returns list of files in directory matching to given regex"
93 (when (file-accessible-directory-p dir)
94 (let ((files (directory-files dir t))
95 matched)
96 (dolist (file files matched)
97 (let ((fname (file-name-nondirectory file)))
98 (cond
99 ((or (string= fname ".")
100 (string= fname "..")) nil)
101 ((and (file-regular-p file)
102 (string-match re fname))
103 (setq matched (cons file matched)))
104 ((file-directory-p file)
105 (let ((tfiles (cedet-files-list-recursively file re)))
106 (when tfiles (setq matched (append matched tfiles)))))))))))
107
108
91(provide 'cedet-files) 109(provide 'cedet-files)
92 110
93;;; cedet-files.el ends here 111;;; cedet-files.el ends here
diff --git a/lisp/cedet/ede.el b/lisp/cedet/ede.el
index 3867f628b93..5fecd8b994f 100644
--- a/lisp/cedet/ede.el
+++ b/lisp/cedet/ede.el
@@ -330,14 +330,14 @@ Argument MENU-DEF is the menu definition to use."
330 (easy-menu-create-menu 330 (easy-menu-create-menu
331 "Project Forms" 331 "Project Forms"
332 (let* ((obj (ede-current-project)) 332 (let* ((obj (ede-current-project))
333 (class (if obj (object-class obj))) 333 (class (if obj (eieio-object-class obj)))
334 (menu nil)) 334 (menu nil))
335 (condition-case err 335 (condition-case err
336 (progn 336 (progn
337 (while (and class (slot-exists-p class 'menu)) 337 (while (and class (slot-exists-p class 'menu))
338 ;;(message "Looking at class %S" class) 338 ;;(message "Looking at class %S" class)
339 (setq menu (append menu (oref class menu)) 339 (setq menu (append menu (oref class menu))
340 class (class-parent class)) 340 class (eieio-class-parent class))
341 (if (listp class) (setq class (car class)))) 341 (if (listp class) (setq class (car class))))
342 (append 342 (append
343 '( [ "Add Target" ede-new-target (ede-current-project) ] 343 '( [ "Add Target" ede-new-target (ede-current-project) ]
@@ -382,7 +382,7 @@ but can also be used interactively."
382 (oref proj configuration-default))))) 382 (oref proj configuration-default)))))
383 (oset (ede-current-project) configuration-default newconfig) 383 (oset (ede-current-project) configuration-default newconfig)
384 (message "%s will now build in %s mode." 384 (message "%s will now build in %s mode."
385 (object-name (ede-current-project)) 385 (eieio-object-name (ede-current-project))
386 newconfig)) 386 newconfig))
387 387
388(defun ede-customize-forms-menu (menu-def) 388(defun ede-customize-forms-menu (menu-def)
@@ -727,7 +727,7 @@ Optional argument NAME is the name to give this project."
727 'name 727 'name
728 (let* ((l ede-project-class-files) 728 (let* ((l ede-project-class-files)
729 (cp (ede-current-project)) 729 (cp (ede-current-project))
730 (cs (when cp (object-class cp))) 730 (cs (when cp (eieio-object-class cp)))
731 (r nil)) 731 (r nil))
732 (while l 732 (while l
733 (if cs 733 (if cs
@@ -779,7 +779,7 @@ Optional argument NAME is the name to give this project."
779 :targets nil))) 779 :targets nil)))
780 (inits (oref obj initializers))) 780 (inits (oref obj initializers)))
781 ;; Force the name to match for new objects. 781 ;; Force the name to match for new objects.
782 (object-set-name-string nobj (oref nobj :name)) 782 (eieio-object-set-name-string nobj (oref nobj :name))
783 ;; Handle init args. 783 ;; Handle init args.
784 (while inits 784 (while inits
785 (eieio-oset nobj (car inits) (car (cdr inits))) 785 (eieio-oset nobj (car inits) (car (cdr inits)))
@@ -885,7 +885,7 @@ a string \"y\" or \"n\", which answers the y/n question done interactively."
885 (when (not ede-object) 885 (when (not ede-object)
886 (error "Can't add %s to target %s: Wrong file type" 886 (error "Can't add %s to target %s: Wrong file type"
887 (file-name-nondirectory (buffer-file-name)) 887 (file-name-nondirectory (buffer-file-name))
888 (object-name target))) 888 (eieio-object-name target)))
889 (ede-apply-target-options)) 889 (ede-apply-target-options))
890 890
891(defun ede-remove-file (&optional force) 891(defun ede-remove-file (&optional force)
@@ -979,12 +979,12 @@ Argument PROMPT is the prompt to use when querying the user for a target."
979(defmethod project-add-file ((ot ede-target) file) 979(defmethod project-add-file ((ot ede-target) file)
980 "Add the current buffer into project project target OT. 980 "Add the current buffer into project project target OT.
981Argument FILE is the file to add." 981Argument FILE is the file to add."
982 (error "add-file not supported by %s" (object-name ot))) 982 (error "add-file not supported by %s" (eieio-object-name ot)))
983 983
984(defmethod project-remove-file ((ot ede-target) fnnd) 984(defmethod project-remove-file ((ot ede-target) fnnd)
985 "Remove the current buffer from project target OT. 985 "Remove the current buffer from project target OT.
986Argument FNND is an argument." 986Argument FNND is an argument."
987 (error "remove-file not supported by %s" (object-name ot))) 987 (error "remove-file not supported by %s" (eieio-object-name ot)))
988 988
989(defmethod project-edit-file-target ((ot ede-target)) 989(defmethod project-edit-file-target ((ot ede-target))
990 "Edit the target OT associated with this file." 990 "Edit the target OT associated with this file."
@@ -992,45 +992,45 @@ Argument FNND is an argument."
992 992
993(defmethod project-new-target ((proj ede-project) &rest args) 993(defmethod project-new-target ((proj ede-project) &rest args)
994 "Create a new target. It is up to the project PROJ to get the name." 994 "Create a new target. It is up to the project PROJ to get the name."
995 (error "new-target not supported by %s" (object-name proj))) 995 (error "new-target not supported by %s" (eieio-object-name proj)))
996 996
997(defmethod project-new-target-custom ((proj ede-project)) 997(defmethod project-new-target-custom ((proj ede-project))
998 "Create a new target. It is up to the project PROJ to get the name." 998 "Create a new target. It is up to the project PROJ to get the name."
999 (error "New-target-custom not supported by %s" (object-name proj))) 999 (error "New-target-custom not supported by %s" (eieio-object-name proj)))
1000 1000
1001(defmethod project-delete-target ((ot ede-target)) 1001(defmethod project-delete-target ((ot ede-target))
1002 "Delete the current target OT from its parent project." 1002 "Delete the current target OT from its parent project."
1003 (error "add-file not supported by %s" (object-name ot))) 1003 (error "add-file not supported by %s" (eieio-object-name ot)))
1004 1004
1005(defmethod project-compile-project ((obj ede-project) &optional command) 1005(defmethod project-compile-project ((obj ede-project) &optional command)
1006 "Compile the entire current project OBJ. 1006 "Compile the entire current project OBJ.
1007Argument COMMAND is the command to use when compiling." 1007Argument COMMAND is the command to use when compiling."
1008 (error "compile-project not supported by %s" (object-name obj))) 1008 (error "compile-project not supported by %s" (eieio-object-name obj)))
1009 1009
1010(defmethod project-compile-target ((obj ede-target) &optional command) 1010(defmethod project-compile-target ((obj ede-target) &optional command)
1011 "Compile the current target OBJ. 1011 "Compile the current target OBJ.
1012Argument COMMAND is the command to use for compiling the target." 1012Argument COMMAND is the command to use for compiling the target."
1013 (error "compile-target not supported by %s" (object-name obj))) 1013 (error "compile-target not supported by %s" (eieio-object-name obj)))
1014 1014
1015(defmethod project-debug-target ((obj ede-target)) 1015(defmethod project-debug-target ((obj ede-target))
1016 "Run the current project target OBJ in a debugger." 1016 "Run the current project target OBJ in a debugger."
1017 (error "debug-target not supported by %s" (object-name obj))) 1017 (error "debug-target not supported by %s" (eieio-object-name obj)))
1018 1018
1019(defmethod project-run-target ((obj ede-target)) 1019(defmethod project-run-target ((obj ede-target))
1020 "Run the current project target OBJ." 1020 "Run the current project target OBJ."
1021 (error "run-target not supported by %s" (object-name obj))) 1021 (error "run-target not supported by %s" (eieio-object-name obj)))
1022 1022
1023(defmethod project-make-dist ((this ede-project)) 1023(defmethod project-make-dist ((this ede-project))
1024 "Build a distribution for the project based on THIS project." 1024 "Build a distribution for the project based on THIS project."
1025 (error "Make-dist not supported by %s" (object-name this))) 1025 (error "Make-dist not supported by %s" (eieio-object-name this)))
1026 1026
1027(defmethod project-dist-files ((this ede-project)) 1027(defmethod project-dist-files ((this ede-project))
1028 "Return a list of files that constitute a distribution of THIS project." 1028 "Return a list of files that constitute a distribution of THIS project."
1029 (error "Dist-files is not supported by %s" (object-name this))) 1029 (error "Dist-files is not supported by %s" (eieio-object-name this)))
1030 1030
1031(defmethod project-rescan ((this ede-project)) 1031(defmethod project-rescan ((this ede-project))
1032 "Rescan the EDE project THIS." 1032 "Rescan the EDE project THIS."
1033 (error "Rescanning a project is not supported by %s" (object-name this))) 1033 (error "Rescanning a project is not supported by %s" (eieio-object-name this)))
1034 1034
1035(defun ede-ecb-project-paths () 1035(defun ede-ecb-project-paths ()
1036 "Return a list of all paths for all active EDE projects. 1036 "Return a list of all paths for all active EDE projects.
@@ -1157,18 +1157,15 @@ Optional argument OBJ is an object to find the parent of."
1157(defun ede-current-project (&optional dir) 1157(defun ede-current-project (&optional dir)
1158 "Return the current project file. 1158 "Return the current project file.
1159If optional DIR is provided, get the project for DIR instead." 1159If optional DIR is provided, get the project for DIR instead."
1160 (let ((ans nil)) 1160 ;; If it matches the current directory, do we have a pre-existing project?
1161 ;; If it matches the current directory, do we have a pre-existing project? 1161 (let ((proj (when (and (or (not dir) (string= dir default-directory))
1162 (when (and (or (not dir) (string= dir default-directory)) 1162 ede-object-project)
1163 ede-object-project) 1163 ede-object-project)))
1164 (setq ans ede-object-project)
1165 )
1166 ;; No current project. 1164 ;; No current project.
1167 (when (not ans) 1165 (if proj
1166 proj
1168 (let* ((ldir (or dir default-directory))) 1167 (let* ((ldir (or dir default-directory)))
1169 (setq ans (ede-directory-get-open-project ldir)))) 1168 (ede-directory-get-open-project ldir)))))
1170 ;; Return what we found.
1171 ans))
1172 1169
1173(defun ede-buffer-object (&optional buffer projsym) 1170(defun ede-buffer-object (&optional buffer projsym)
1174 "Return the target object for BUFFER. 1171 "Return the target object for BUFFER.
@@ -1372,20 +1369,24 @@ and <root>/doc for doc sources."
1372;; C/C++ 1369;; C/C++
1373(defun ede-apply-preprocessor-map () 1370(defun ede-apply-preprocessor-map ()
1374 "Apply preprocessor tables onto the current buffer." 1371 "Apply preprocessor tables onto the current buffer."
1372 ;; TODO - what if semantic-mode isn't enabled?
1373 ;; what if we never want to load a C mode? Does this matter?
1374 ;; Note: This require is needed for the case where EDE ends up
1375 ;; in the hook order before Semantic based hooks.
1376 (require 'semantic/lex-spp)
1375 (when (and ede-object 1377 (when (and ede-object
1376 (boundp 'semantic-lex-spp-macro-symbol-obarray) 1378 (boundp 'semantic-lex-spp-project-macro-symbol-obarray))
1377 semantic-lex-spp-macro-symbol-obarray)
1378 (let* ((objs ede-object) 1379 (let* ((objs ede-object)
1379 (map (ede-preprocessor-map (if (consp objs) 1380 (map (ede-preprocessor-map (if (consp objs)
1380 (car objs) 1381 (car objs)
1381 objs)))) 1382 objs))))
1382 (when map 1383 (when map
1383 ;; We can't do a require for the below symbol. 1384 ;; We can't do a require for the below symbol.
1384 (setq semantic-lex-spp-macro-symbol-obarray 1385 (setq semantic-lex-spp-project-macro-symbol-obarray
1385 (semantic-lex-make-spp-table map))) 1386 (semantic-lex-make-spp-table map)))
1386 (when (consp objs) 1387 (when (consp objs)
1387 (message "Choosing preprocessor syms for project %s" 1388 (message "Choosing preprocessor syms for project %s"
1388 (object-name (car objs))))))) 1389 (eieio-object-name (car objs)))))))
1389 1390
1390(defmethod ede-system-include-path ((this ede-project)) 1391(defmethod ede-system-include-path ((this ede-project))
1391 "Get the system include path used by project THIS." 1392 "Get the system include path used by project THIS."
diff --git a/lisp/cedet/ede/auto.el b/lisp/cedet/ede/auto.el
index 22fce372e24..c0baf0fc8f8 100644
--- a/lisp/cedet/ede/auto.el
+++ b/lisp/cedet/ede/auto.el
@@ -199,8 +199,8 @@ added. Possible values are:
199 front of the list so more generic projects don't get priority." 199 front of the list so more generic projects don't get priority."
200 ;; First, can we identify PROJAUTO as already in the list? If so, replace. 200 ;; First, can we identify PROJAUTO as already in the list? If so, replace.
201 (let ((projlist ede-project-class-files) 201 (let ((projlist ede-project-class-files)
202 (projname (object-name-string projauto))) 202 (projname (eieio-object-name-string projauto)))
203 (while (and projlist (not (string= (object-name-string (car projlist)) projname))) 203 (while (and projlist (not (string= (eieio-object-name-string (car projlist)) projname)))
204 (setq projlist (cdr projlist))) 204 (setq projlist (cdr projlist)))
205 205
206 (if projlist 206 (if projlist
diff --git a/lisp/cedet/ede/base.el b/lisp/cedet/ede/base.el
index 1368ea348a0..5302ac3207a 100644
--- a/lisp/cedet/ede/base.el
+++ b/lisp/cedet/ede/base.el
@@ -135,7 +135,9 @@ other desired outcome.")
135 (dirinode :documentation "The inode id for :directory.") 135 (dirinode :documentation "The inode id for :directory.")
136 (file :type string 136 (file :type string
137 :initarg :file 137 :initarg :file
138 :documentation "File name where this project is stored.") 138 :documentation "The File uniquely tagging this project instance.
139For some project types, this will be the file that stores the project configuration.
140In other projects types, this file is merely a unique identifier to this type of project.")
139 (rootproject ; :initarg - no initarg, don't save this slot! 141 (rootproject ; :initarg - no initarg, don't save this slot!
140 :initform nil 142 :initform nil
141 :type (or null ede-project-placeholder-child) 143 :type (or null ede-project-placeholder-child)
@@ -350,12 +352,12 @@ All specific project types must derive from this project."
350(defun ede-load-cache () 352(defun ede-load-cache ()
351 "Load the cache of EDE projects." 353 "Load the cache of EDE projects."
352 (save-excursion 354 (save-excursion
353 (let ((cachebuffer nil)) 355 (let ((cachebuffer (get-buffer-create "*ede cache*")))
354 (condition-case nil 356 (condition-case nil
355 (progn 357 (with-current-buffer cachebuffer
356 (setq cachebuffer 358 (erase-buffer)
357 (find-file-noselect ede-project-placeholder-cache-file t)) 359 (when (file-exists-p ede-project-placeholder-cache-file)
358 (set-buffer cachebuffer) 360 (insert-file-contents ede-project-placeholder-cache-file))
359 (goto-char (point-min)) 361 (goto-char (point-min))
360 (let ((c (read (current-buffer))) 362 (let ((c (read (current-buffer)))
361 (new nil) 363 (new nil)
@@ -610,6 +612,28 @@ instead of the current project."
610 cp))))) 612 cp)))))
611 613
612 614
615;;; Utility functions
616;;
617
618(defun ede-normalize-file/directory (this project-file-name)
619 "Fills :directory or :file slots if they're missing in project THIS.
620The other slot will be used to calculate values.
621PROJECT-FILE-NAME is a name of project file (short name, like 'pom.xml', etc."
622 (when (and (or (not (slot-boundp this :file))
623 (not (oref this :file)))
624 (slot-boundp this :directory)
625 (oref this :directory))
626 (oset this :file (expand-file-name project-file-name (oref this :directory))))
627 (when (and (or (not (slot-boundp this :directory))
628 (not (oref this :directory)))
629 (slot-boundp this :file)
630 (oref this :file))
631 (oset this :directory (file-name-directory (oref this :file))))
632 )
633
634
635
636
613;;; Hooks & Autoloads 637;;; Hooks & Autoloads
614;; 638;;
615;; These let us watch various activities, and respond appropriately. 639;; These let us watch various activities, and respond appropriately.
diff --git a/lisp/cedet/ede/cpp-root.el b/lisp/cedet/ede/cpp-root.el
index d31ede723cc..cf2009ced30 100644
--- a/lisp/cedet/ede/cpp-root.el
+++ b/lisp/cedet/ede/cpp-root.el
@@ -242,11 +242,11 @@ ROOTPROJ is nil, since there is only one project."
242(ede-add-project-autoload 242(ede-add-project-autoload
243 (ede-project-autoload "cpp-root" 243 (ede-project-autoload "cpp-root"
244 :name "CPP ROOT" 244 :name "CPP ROOT"
245 :file 'ede-cpp-root 245 :file 'ede/cpp-root
246 :proj-file 'ede-cpp-root-project-file-for-dir 246 :proj-file 'ede-cpp-root-project-file-for-dir
247 :proj-root 'ede-cpp-root-project-root 247 :proj-root 'ede-cpp-root-project-root
248 :load-type 'ede-cpp-root-load 248 :load-type 'ede-cpp-root-load
249 :class-sym 'ede-cpp-root 249 :class-sym 'ede-cpp-root-project
250 :new-p nil 250 :new-p nil
251 :safe-p t) 251 :safe-p t)
252 ;; When a user creates one of these, it should override any other project 252 ;; When a user creates one of these, it should override any other project
@@ -272,10 +272,12 @@ ROOTPROJ is nil, since there is only one project."
272;; level include paths, and PreProcessor macro tables. 272;; level include paths, and PreProcessor macro tables.
273 273
274(defclass ede-cpp-root-target (ede-target) 274(defclass ede-cpp-root-target (ede-target)
275 () 275 ((project :initform nil
276 :initarg :project))
276 "EDE cpp-root project target. 277 "EDE cpp-root project target.
277All directories need at least one target.") 278All directories need at least one target.")
278 279
280;;;###autoload
279(defclass ede-cpp-root-project (ede-project eieio-instance-tracker) 281(defclass ede-cpp-root-project (ede-project eieio-instance-tracker)
280 ((tracking-symbol :initform 'ede-cpp-root-project-list) 282 ((tracking-symbol :initform 'ede-cpp-root-project-list)
281 (include-path :initarg :include-path 283 (include-path :initarg :include-path
@@ -339,6 +341,15 @@ The function symbol must take two arguments:
339It should return the fully qualified file name passed in from NAME. If that file does not 341It should return the fully qualified file name passed in from NAME. If that file does not
340exist, it should return nil." 342exist, it should return nil."
341 ) 343 )
344 (compile-command :initarg :compile-command
345 :initform nil
346 :type (or null string function)
347 :documentation
348 "Compilation command that will be used for this project.
349It could be string or function that will accept proj argument and should return string.
350The string will be passed to 'compuile' function that will be issued in root
351directory of project."
352 )
342 ) 353 )
343 "EDE cpp-root project class. 354 "EDE cpp-root project class.
344Each directory needs a project file to control it.") 355Each directory needs a project file to control it.")
@@ -366,7 +377,7 @@ Each directory needs a project file to control it.")
366 (when (or (not (file-exists-p f)) 377 (when (or (not (file-exists-p f))
367 (file-directory-p f)) 378 (file-directory-p f))
368 (delete-instance this) 379 (delete-instance this)
369 (error ":file for ede-cpp-root must be a file")) 380 (error ":file for ede-cpp-root-project must be a file"))
370 (oset this :file f) 381 (oset this :file f)
371 (oset this :directory (file-name-directory f)) 382 (oset this :directory (file-name-directory f))
372 (ede-project-directory-remove-hash (file-name-directory f)) 383 (ede-project-directory-remove-hash (file-name-directory f))
@@ -404,7 +415,8 @@ If one doesn't exist, create a new one for this directory."
404 :name (file-name-nondirectory 415 :name (file-name-nondirectory
405 (directory-file-name dir)) 416 (directory-file-name dir))
406 :path dir 417 :path dir
407 :source nil)) 418 :source nil
419 :project proj))
408 (object-add-to-list proj :targets ans) 420 (object-add-to-list proj :targets ans)
409 ) 421 )
410 ans)) 422 ans))
@@ -481,15 +493,6 @@ This is for project include paths and spp source files."
481 493
482 filename)) 494 filename))
483 495
484(defmethod ede-set-project-variables ((project ede-cpp-root-project) &optional buffer)
485 "Set variables local to PROJECT in BUFFER.
486Also set up the lexical preprocessor map."
487 (call-next-method)
488 (when (and (featurep 'semantic/bovine/c) (featurep 'semantic/lex-spp))
489 (setq semantic-lex-spp-project-macro-symbol-obarray
490 (semantic-lex-make-spp-table (oref project spp-table)))
491 ))
492
493(defmethod ede-system-include-path ((this ede-cpp-root-project)) 496(defmethod ede-system-include-path ((this ede-cpp-root-project))
494 "Get the system include path used by project THIS." 497 "Get the system include path used by project THIS."
495 (oref this system-include-path)) 498 (oref this system-include-path))
@@ -506,11 +509,18 @@ Also set up the lexical preprocessor map."
506 (table (when expfile 509 (table (when expfile
507 (semanticdb-file-table-object expfile))) 510 (semanticdb-file-table-object expfile)))
508 ) 511 )
509 (if (not table) 512 (cond
510 (message "Cannot find file %s in project." F) 513 ((not (file-exists-p expfile))
514 (message "Cannot find file %s in project." F))
515 ((string= expfile (buffer-file-name))
516 ;; Don't include this file in it's own spp table.
517 )
518 ((not table)
519 (message "No db table available for %s." expfile))
520 (t
511 (when (semanticdb-needs-refresh-p table) 521 (when (semanticdb-needs-refresh-p table)
512 (semanticdb-refresh-table table)) 522 (semanticdb-refresh-table table))
513 (setq spp (append spp (oref table lexical-table)))))) 523 (setq spp (append spp (oref table lexical-table)))))))
514 (oref this spp-files)) 524 (oref this spp-files))
515 spp)) 525 spp))
516 526
@@ -522,6 +532,29 @@ Also set up the lexical preprocessor map."
522 "Get the pre-processor map for project THIS." 532 "Get the pre-processor map for project THIS."
523 (ede-preprocessor-map (ede-target-parent this))) 533 (ede-preprocessor-map (ede-target-parent this)))
524 534
535(defmethod project-compile-project ((proj ede-cpp-root-project) &optional command)
536 "Compile the entire current project PROJ.
537Argument COMMAND is the command to use when compiling."
538 ;; we need to be in the proj root dir for this to work
539 (let* ((cmd (oref proj :compile-command))
540 (ov (oref proj :local-variables))
541 (lcmd (when ov (cdr (assoc 'compile-command ov))))
542 (cmd-str (cond
543 ((stringp cmd) cmd)
544 ((functionp cmd) (funcall cmd proj))
545 ((stringp lcmd) lcmd)
546 ((functionp lcmd) (funcall lcmd proj)))))
547 (when cmd-str
548 (let ((default-directory (ede-project-root-directory proj)))
549 (compile cmd-str)))))
550
551(defmethod project-compile-target ((obj ede-cpp-root-target) &optional command)
552 "Compile the current target OBJ.
553Argument COMMAND is the command to use for compiling the target."
554 (when (oref obj :project)
555 (project-compile-project (oref obj :project) command)))
556
557
525;;; Quick Hack 558;;; Quick Hack
526(defun ede-create-lots-of-projects-under-dir (dir projfile &rest attributes) 559(defun ede-create-lots-of-projects-under-dir (dir projfile &rest attributes)
527 "Create a bunch of projects under directory DIR. 560 "Create a bunch of projects under directory DIR.
diff --git a/lisp/cedet/ede/emacs.el b/lisp/cedet/ede/emacs.el
index 925730c8121..f5a85f4a01b 100644
--- a/lisp/cedet/ede/emacs.el
+++ b/lisp/cedet/ede/emacs.el
@@ -59,7 +59,7 @@ DIR is the directory to search from."
59 "Get the root directory for DIR." 59 "Get the root directory for DIR."
60 (when (not dir) (setq dir default-directory)) 60 (when (not dir) (setq dir default-directory))
61 (let ((case-fold-search t) 61 (let ((case-fold-search t)
62 (proj (ede-emacs-file-existing dir))) 62 (proj (ede-files-find-existing dir ede-emacs-project-list)))
63 (if proj 63 (if proj
64 (ede-up-directory (file-name-directory 64 (ede-up-directory (file-name-directory
65 (oref proj :file))) 65 (oref proj :file)))
@@ -134,7 +134,7 @@ m4_define(\\[SXEM4CS_BETA_VERSION\\], \\[\\([0-9]+\\)\\])")
134Return nil if there isn't one. 134Return nil if there isn't one.
135Argument DIR is the directory it is created for. 135Argument DIR is the directory it is created for.
136ROOTPROJ is nil, since there is only one project." 136ROOTPROJ is nil, since there is only one project."
137 (or (ede-emacs-file-existing dir) 137 (or (ede-files-find-existing dir ede-emacs-project-list)
138 ;; Doesn't already exist, so let's make one. 138 ;; Doesn't already exist, so let's make one.
139 (let* ((vertuple (ede-emacs-version dir)) 139 (let* ((vertuple (ede-emacs-version dir))
140 (proj (ede-emacs-project 140 (proj (ede-emacs-project
diff --git a/lisp/cedet/ede/files.el b/lisp/cedet/ede/files.el
index 015f4fd9663..91433add7b0 100644
--- a/lisp/cedet/ede/files.el
+++ b/lisp/cedet/ede/files.el
@@ -50,12 +50,13 @@
50There is no completion at the prompt. FILE is searched for within 50There is no completion at the prompt. FILE is searched for within
51the current EDE project." 51the current EDE project."
52 (interactive "sFile: ") 52 (interactive "sFile: ")
53 (let ((fname (ede-expand-filename (ede-current-project) file)) 53 (let* ((proj (ede-current-project))
54 (fname (ede-expand-filename proj file))
54 ) 55 )
55 (unless fname 56 (unless fname
56 (error "Could not find %s in %s" 57 (error "Could not find %s in %s"
57 file 58 file
58 (ede-project-root-directory (ede-current-project)))) 59 (ede-project-root-directory proj)))
59 (find-file fname))) 60 (find-file fname)))
60 61
61(defun ede-flush-project-hash () 62(defun ede-flush-project-hash ()
@@ -508,6 +509,26 @@ Argument DIR is the directory to trim upwards."
508 nil 509 nil
509 fnd))) 510 fnd)))
510 511
512(defun ede-find-project-root (prj-file-name &optional dir)
513 "Tries to find directory with given project file"
514 (let ((prj-dir (locate-dominating-file (or dir default-directory)
515 prj-file-name)))
516 (when prj-dir
517 (expand-file-name prj-dir))))
518
519(defun ede-files-find-existing (dir prj-list)
520 "Find a project in the list of projects stored in given variable.
521DIR is the directory to search from."
522 (let ((projs prj-list)
523 (ans nil))
524 (while (and projs (not ans))
525 (let ((root (ede-project-root-directory (car projs))))
526 (when (string-match (concat "^" (regexp-quote root)) dir)
527 (setq ans (car projs))))
528 (setq projs (cdr projs)))
529 ans))
530
531
511(provide 'ede/files) 532(provide 'ede/files)
512 533
513;; Local variables: 534;; Local variables:
diff --git a/lisp/cedet/ede/locate.el b/lisp/cedet/ede/locate.el
index 072e2c2666a..3dbe3153680 100644
--- a/lisp/cedet/ede/locate.el
+++ b/lisp/cedet/ede/locate.el
@@ -163,7 +163,7 @@ that created this EDE locate object."
163 "Create or update the database for the current project. 163 "Create or update the database for the current project.
164You cannot create projects for the baseclass." 164You cannot create projects for the baseclass."
165 (error "Cannot create/update a database of type %S" 165 (error "Cannot create/update a database of type %S"
166 (object-name loc))) 166 (eieio-object-name loc)))
167 167
168;;; LOCATE 168;;; LOCATE
169;; 169;;
diff --git a/lisp/cedet/ede/pconf.el b/lisp/cedet/ede/pconf.el
index 310014a0b64..a29e3720ea2 100644
--- a/lisp/cedet/ede/pconf.el
+++ b/lisp/cedet/ede/pconf.el
@@ -152,7 +152,7 @@ don't do it. A value of nil means to just do it.")
152(defmethod ede-proj-configure-recreate ((this ede-proj-project)) 152(defmethod ede-proj-configure-recreate ((this ede-proj-project))
153 "Delete project THIS's configure script and start over." 153 "Delete project THIS's configure script and start over."
154 (if (not (ede-proj-configure-file this)) 154 (if (not (ede-proj-configure-file this))
155 (error "Could not determine configure.ac for %S" (object-name this))) 155 (error "Could not determine configure.ac for %S" (eieio-object-name this)))
156 (let ((b (get-file-buffer (ede-proj-configure-file this)))) 156 (let ((b (get-file-buffer (ede-proj-configure-file this))))
157 ;; Destroy all evidence of the old configure.ac 157 ;; Destroy all evidence of the old configure.ac
158 (delete-file (ede-proj-configure-file this)) 158 (delete-file (ede-proj-configure-file this))
diff --git a/lisp/cedet/ede/proj-elisp.el b/lisp/cedet/ede/proj-elisp.el
index 8b426aa183f..d7720f25681 100644
--- a/lisp/cedet/ede/proj-elisp.el
+++ b/lisp/cedet/ede/proj-elisp.el
@@ -170,7 +170,7 @@ Bonus: Return a cons cell: (COMPILED . UPTODATE)."
170 (setq utd (1+ utd))))))) 170 (setq utd (1+ utd)))))))
171 171
172 (oref obj source)) 172 (oref obj source))
173 (message "All Emacs Lisp sources are up to date in %s" (object-name obj)) 173 (message "All Emacs Lisp sources are up to date in %s" (eieio-object-name obj))
174 (cons comp utd))) 174 (cons comp utd)))
175 175
176(defmethod ede-update-version-in-source ((this ede-proj-target-elisp) version) 176(defmethod ede-update-version-in-source ((this ede-proj-target-elisp) version)
@@ -194,7 +194,8 @@ is found, such as a `-version' variable, or the standard header."
194 (goto-char (match-beginning 1)) 194 (goto-char (match-beginning 1))
195 (insert version))))) 195 (insert version)))))
196 (setq vs (cdr vs))) 196 (setq vs (cdr vs)))
197 (if (not match) (call-next-method))))) 197 ;; The next method will include comments such as "Version:"
198 (call-next-method))))
198 199
199 200
200;;; Makefile generation functions 201;;; Makefile generation functions
diff --git a/lisp/cedet/ede/proj.el b/lisp/cedet/ede/proj.el
index 2da2737d377..702e35f0b1f 100644
--- a/lisp/cedet/ede/proj.el
+++ b/lisp/cedet/ede/proj.el
@@ -512,11 +512,11 @@ Optional argument COMMAND is the s the alternate command to use."
512 512
513(defmethod project-debug-target ((obj ede-proj-target)) 513(defmethod project-debug-target ((obj ede-proj-target))
514 "Run the current project target OBJ in a debugger." 514 "Run the current project target OBJ in a debugger."
515 (error "Debug-target not supported by %s" (object-name obj))) 515 (error "Debug-target not supported by %s" (eieio-object-name obj)))
516 516
517(defmethod project-run-target ((obj ede-proj-target)) 517(defmethod project-run-target ((obj ede-proj-target))
518 "Run the current project target OBJ." 518 "Run the current project target OBJ."
519 (error "Run-target not supported by %s" (object-name obj))) 519 (error "Run-target not supported by %s" (eieio-object-name obj)))
520 520
521(defmethod ede-proj-makefile-target-name ((this ede-proj-target)) 521(defmethod ede-proj-makefile-target-name ((this ede-proj-target))
522 "Return the name of the main target for THIS target." 522 "Return the name of the main target for THIS target."
diff --git a/lisp/cedet/ede/util.el b/lisp/cedet/ede/util.el
index 88a3e0a4512..71a79a1b706 100644
--- a/lisp/cedet/ede/util.el
+++ b/lisp/cedet/ede/util.el
@@ -49,7 +49,7 @@ Argument NEWVERSION is the version number to use in the current project."
49(defmethod project-update-version ((ot ede-project)) 49(defmethod project-update-version ((ot ede-project))
50 "The :version of the project OT has been updated. 50 "The :version of the project OT has been updated.
51Handle saving, or other detail." 51Handle saving, or other detail."
52 (error "project-update-version not supported by %s" (object-name ot))) 52 (error "project-update-version not supported by %s" (eieio-object-name ot)))
53 53
54(defmethod ede-update-version-in-source ((this ede-project) version) 54(defmethod ede-update-version-in-source ((this ede-project) version)
55 "Change occurrences of a version string in sources. 55 "Change occurrences of a version string in sources.
diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el
index edf2d0cb21a..3c93a8794b1 100644
--- a/lisp/cedet/semantic.el
+++ b/lisp/cedet/semantic.el
@@ -466,11 +466,10 @@ unterminated syntax."
466 (widen) 466 (widen)
467 (when (or (< end start) (> end (point-max))) 467 (when (or (< end start) (> end (point-max)))
468 (error "Invalid parse region bounds %S, %S" start end)) 468 (error "Invalid parse region bounds %S, %S" start end))
469 (nreverse 469 (semantic-repeat-parse-whole-stream
470 (semantic-repeat-parse-whole-stream
471 (or (cdr (assq start semantic-lex-block-streams)) 470 (or (cdr (assq start semantic-lex-block-streams))
472 (semantic-lex start end depth)) 471 (semantic-lex start end depth))
473 nonterminal returnonerror)))) 472 nonterminal returnonerror)))
474 473
475;;; Parsing functions 474;;; Parsing functions
476;; 475;;
@@ -756,7 +755,7 @@ This function returns semantic tags without overlays."
756 tag 'reparse-symbol nonterm)) 755 tag 'reparse-symbol nonterm))
757 tag) 756 tag)
758 (semantic--tag-expand tag)) 757 (semantic--tag-expand tag))
759 result (append tag result)) 758 result (append result tag))
760 ;; No error in this case, a purposeful nil means don't 759 ;; No error in this case, a purposeful nil means don't
761 ;; store anything. 760 ;; store anything.
762 ) 761 )
@@ -934,7 +933,8 @@ Throw away all the old tags, and recreate the tag database."
934 '("--")) 933 '("--"))
935 (define-key edit-menu [senator-yank-tag] 934 (define-key edit-menu [senator-yank-tag]
936 '(menu-item "Yank Tag" senator-yank-tag 935 '(menu-item "Yank Tag" senator-yank-tag
937 :enable (not (ring-empty-p senator-tag-ring)) 936 :enable (and (boundp 'senator-tag-ring)
937 (not (ring-empty-p senator-tag-ring)))
938 :help "Yank the head of the tag ring into the buffer")) 938 :help "Yank the head of the tag ring into the buffer"))
939 (define-key edit-menu [senator-copy-tag-to-register] 939 (define-key edit-menu [senator-copy-tag-to-register]
940 '(menu-item "Copy Tag To Register" senator-copy-tag-to-register 940 '(menu-item "Copy Tag To Register" senator-copy-tag-to-register
diff --git a/lisp/cedet/semantic/analyze.el b/lisp/cedet/semantic/analyze.el
index d1476111403..000193d4a55 100644
--- a/lisp/cedet/semantic/analyze.el
+++ b/lisp/cedet/semantic/analyze.el
@@ -800,7 +800,7 @@ CONTEXT's content is described in `semantic-analyze-current-context'."
800 (semantic-analyze-pulse context) 800 (semantic-analyze-pulse context)
801 (with-output-to-temp-buffer "*Semantic Context Analysis*" 801 (with-output-to-temp-buffer "*Semantic Context Analysis*"
802 (princ "Context Type: ") 802 (princ "Context Type: ")
803 (princ (object-name context)) 803 (princ (eieio-object-name context))
804 (princ "\n") 804 (princ "\n")
805 (princ "Bounds: ") 805 (princ "Bounds: ")
806 (princ (oref context bounds)) 806 (princ (oref context bounds))
diff --git a/lisp/cedet/semantic/analyze/fcn.el b/lisp/cedet/semantic/analyze/fcn.el
index 6ee85b298a2..42bc482a1df 100644
--- a/lisp/cedet/semantic/analyze/fcn.el
+++ b/lisp/cedet/semantic/analyze/fcn.el
@@ -255,7 +255,7 @@ Optional argument TYPE-DECLARATION is how TYPE was found referenced."
255 (nexttype (semantic-analyze-dereference-metatype type scope type-declaration)) 255 (nexttype (semantic-analyze-dereference-metatype type scope type-declaration))
256 (idx 0)) 256 (idx 0))
257 (catch 'metatype-recursion 257 (catch 'metatype-recursion
258 (while (and nexttype (not (eq (car nexttype) lasttype))) 258 (while (and nexttype (not (semantic-tag-similar-p (car nexttype) lasttype)))
259 (setq lasttype (car nexttype) 259 (setq lasttype (car nexttype)
260 lasttypedeclaration (cadr nexttype)) 260 lasttypedeclaration (cadr nexttype))
261 (setq nexttype (semantic-analyze-dereference-metatype lasttype scope lasttypedeclaration)) 261 (setq nexttype (semantic-analyze-dereference-metatype lasttype scope lasttypedeclaration))
diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el
index 7aa93a0c942..2f8cf08af3e 100644
--- a/lisp/cedet/semantic/bovine/c.el
+++ b/lisp/cedet/semantic/bovine/c.el
@@ -155,15 +155,16 @@ part of the preprocessor map.")
155 ;; not be in a buffer. 155 ;; not be in a buffer.
156 (semanticdb-refresh-table table t) 156 (semanticdb-refresh-table table t)
157 (error (message "Error updating tables for %S" 157 (error (message "Error updating tables for %S"
158 (object-name table))))) 158 (eieio-object-name table)))))
159 (setq filemap (append filemap (oref table lexical-table))) 159 (setq filemap (append filemap (oref table lexical-table)))
160 ;; Update symbol obarray 160 )))))
161 (setq-mode-local c-mode 161 ;; Update symbol obarray
162 semantic-lex-spp-macro-symbol-obarray 162 (setq-mode-local c-mode
163 (semantic-lex-make-spp-table 163 semantic-lex-spp-macro-symbol-obarray
164 (append semantic-lex-c-preprocessor-symbol-map-builtin 164 (semantic-lex-make-spp-table
165 semantic-lex-c-preprocessor-symbol-map 165 (append semantic-lex-c-preprocessor-symbol-map-builtin
166 filemap))))))))))) 166 semantic-lex-c-preprocessor-symbol-map
167 filemap))))))
167 168
168;; Make sure the preprocessor symbols are set up when mode-local kicks 169;; Make sure the preprocessor symbols are set up when mode-local kicks
169;; in. 170;; in.
@@ -1946,15 +1947,17 @@ have to be wrapped in that namespace."
1946 "Do what `semantic-get-local-variables' does, plus add `this' if needed." 1947 "Do what `semantic-get-local-variables' does, plus add `this' if needed."
1947 (let* ((origvar (semantic-get-local-variables-default)) 1948 (let* ((origvar (semantic-get-local-variables-default))
1948 (ct (semantic-current-tag)) 1949 (ct (semantic-current-tag))
1949 (p (semantic-tag-function-parent ct))) 1950 (p (when (semantic-tag-of-class-p ct 'function)
1951 (or (semantic-tag-function-parent ct)
1952 (car-safe (semantic-find-tags-by-type
1953 "class" (semantic-find-tag-by-overlay)))))))
1950 ;; If we have a function parent, then that implies we can 1954 ;; If we have a function parent, then that implies we can
1951 (if (and p (semantic-tag-of-class-p ct 'function)) 1955 (if p
1952 ;; Append a new tag THIS into our space. 1956 ;; Append a new tag THIS into our space.
1953 (cons (semantic-tag-new-variable "this" p nil) 1957 (cons (semantic-tag-new-variable "this" p nil :pointer 1)
1954 origvar) 1958 origvar)
1955 ;; No parent, just return the usual 1959 ;; No parent, just return the usual
1956 origvar) 1960 origvar)))
1957 ))
1958 1961
1959(define-mode-local-override semantic-idle-summary-current-symbol-info 1962(define-mode-local-override semantic-idle-summary-current-symbol-info
1960 c-mode () 1963 c-mode ()
@@ -2151,14 +2154,18 @@ actually in their parent which is not accessible.")
2151 (princ "\n"))) 2154 (princ "\n")))
2152 2155
2153 (princ "\n\nMacro Summary:\n") 2156 (princ "\n\nMacro Summary:\n")
2157
2154 (when semantic-lex-c-preprocessor-symbol-file 2158 (when semantic-lex-c-preprocessor-symbol-file
2155 (princ "\n Your CPP table is primed from these files:\n") 2159 (princ "\n Your CPP table is primed from these system files:\n")
2156 (dolist (file semantic-lex-c-preprocessor-symbol-file) 2160 (dolist (file semantic-lex-c-preprocessor-symbol-file)
2157 (princ " ") 2161 (princ " ")
2158 (princ file) 2162 (princ file)
2159 (princ "\n") 2163 (princ "\n")
2160 (princ " in table: ") 2164 (princ " in table: ")
2161 (princ (object-print (semanticdb-file-table-object file))) 2165 (let ((fto (semanticdb-file-table-object file)))
2166 (if fto
2167 (princ (object-print fto))
2168 (princ "No Table")))
2162 (princ "\n") 2169 (princ "\n")
2163 )) 2170 ))
2164 2171
@@ -2173,7 +2180,7 @@ actually in their parent which is not accessible.")
2173 )) 2180 ))
2174 2181
2175 (when semantic-lex-c-preprocessor-symbol-map 2182 (when semantic-lex-c-preprocessor-symbol-map
2176 (princ "\n User symbol map:\n") 2183 (princ "\n User symbol map (primed from system files):\n")
2177 (dolist (S semantic-lex-c-preprocessor-symbol-map) 2184 (dolist (S semantic-lex-c-preprocessor-symbol-map)
2178 (princ " ") 2185 (princ " ")
2179 (princ (car S)) 2186 (princ (car S))
@@ -2183,25 +2190,27 @@ actually in their parent which is not accessible.")
2183 )) 2190 ))
2184 2191
2185 (when (and (boundp 'ede-object) 2192 (when (and (boundp 'ede-object)
2186 ede-object 2193 ede-object)
2187 (arrayp semantic-lex-spp-project-macro-symbol-obarray))
2188 (princ "\n Project symbol map:\n") 2194 (princ "\n Project symbol map:\n")
2189 (when (and (boundp 'ede-object) ede-object) 2195 (when (and (boundp 'ede-object) ede-object)
2190 (princ " Your project symbol map is derived from the EDE object:\n ") 2196 (princ " Your project symbol map is also derived from the EDE object:\n ")
2191 (princ (object-print ede-object))) 2197 (princ (object-print ede-object)))
2192 (princ "\n\n") 2198 (princ "\n\n")
2193 (let ((macros nil)) 2199 (if (arrayp semantic-lex-spp-project-macro-symbol-obarray)
2194 (mapatoms 2200 (let ((macros nil))
2195 #'(lambda (symbol) 2201 (mapatoms
2196 (setq macros (cons symbol macros))) 2202 #'(lambda (symbol)
2197 semantic-lex-spp-project-macro-symbol-obarray) 2203 (setq macros (cons symbol macros)))
2198 (dolist (S macros) 2204 semantic-lex-spp-project-macro-symbol-obarray)
2199 (princ " ") 2205 (dolist (S macros)
2200 (princ (symbol-name S)) 2206 (princ " ")
2201 (princ " = ") 2207 (princ (symbol-name S))
2202 (princ (symbol-value S)) 2208 (princ " = ")
2203 (princ "\n") 2209 (princ (symbol-value S))
2204 ))) 2210 (princ "\n")
2211 ))
2212 ;; Else, not map
2213 (princ " No Symbols.\n")))
2205 2214
2206 (princ "\n\n Use: M-x semantic-lex-spp-describe RET\n") 2215 (princ "\n\n Use: M-x semantic-lex-spp-describe RET\n")
2207 (princ "\n to see the complete macro table.\n") 2216 (princ "\n to see the complete macro table.\n")
diff --git a/lisp/cedet/semantic/bovine/gcc.el b/lisp/cedet/semantic/bovine/gcc.el
index 82876adb37e..7beb8ff3203 100644
--- a/lisp/cedet/semantic/bovine/gcc.el
+++ b/lisp/cedet/semantic/bovine/gcc.el
@@ -157,7 +157,11 @@ It should also include other symbols GCC was compiled with.")
157 ;; `cpp' command in `semantic-gcc-setup' doesn't work on 157 ;; `cpp' command in `semantic-gcc-setup' doesn't work on
158 ;; Mac, try `gcc'. 158 ;; Mac, try `gcc'.
159 (apply 'semantic-gcc-query "gcc" cpp-options)))) 159 (apply 'semantic-gcc-query "gcc" cpp-options))))
160 (defines (semantic-cpp-defs query)) 160 (defines (if (stringp query)
161 (semantic-cpp-defs query)
162 (message (concat "Could not query gcc for defines. "
163 "Maybe g++ is not installed."))
164 nil))
161 (ver (cdr (assoc 'version fields))) 165 (ver (cdr (assoc 'version fields)))
162 (host (or (cdr (assoc 'target fields)) 166 (host (or (cdr (assoc 'target fields))
163 (cdr (assoc '--target fields)) 167 (cdr (assoc '--target fields))
diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el
index 194e0ee5f66..1c2ddf45c9d 100644
--- a/lisp/cedet/semantic/complete.el
+++ b/lisp/cedet/semantic/complete.el
@@ -678,7 +678,8 @@ a reasonable distance."
678 ;;(message "Inline Hook installed, but overlay deleted.") 678 ;;(message "Inline Hook installed, but overlay deleted.")
679 (semantic-complete-inline-exit)) 679 (semantic-complete-inline-exit))
680 ;; Exit if commands caused us to exit the area of interest 680 ;; Exit if commands caused us to exit the area of interest
681 (let ((s (semantic-overlay-start semantic-complete-inline-overlay)) 681 (let ((os (semantic-overlay-get semantic-complete-inline-overlay 'semantic-original-start))
682 (s (semantic-overlay-start semantic-complete-inline-overlay))
682 (e (semantic-overlay-end semantic-complete-inline-overlay)) 683 (e (semantic-overlay-end semantic-complete-inline-overlay))
683 (b (semantic-overlay-buffer semantic-complete-inline-overlay)) 684 (b (semantic-overlay-buffer semantic-complete-inline-overlay))
684 (txt nil) 685 (txt nil)
@@ -686,8 +687,10 @@ a reasonable distance."
686 (cond 687 (cond
687 ;; EXIT when we are no longer in a good place. 688 ;; EXIT when we are no longer in a good place.
688 ((or (not (eq b (current-buffer))) 689 ((or (not (eq b (current-buffer)))
689 (<= (point) s) 690 (< (point) s)
690 (> (point) e)) 691 (< (point) os)
692 (> (point) e)
693 )
691 ;;(message "Exit: %S %S %S" s e (point)) 694 ;;(message "Exit: %S %S %S" s e (point))
692 (semantic-complete-inline-exit) 695 (semantic-complete-inline-exit)
693 ) 696 )
@@ -710,7 +713,6 @@ a reasonable distance."
710 (t 713 (t
711 ;; Else, show completions now 714 ;; Else, show completions now
712 (semantic-complete-inline-force-display) 715 (semantic-complete-inline-force-display)
713
714 )))) 716 ))))
715 ;; If something goes terribly wrong, clean up after ourselves. 717 ;; If something goes terribly wrong, clean up after ourselves.
716 (error (semantic-complete-inline-exit)))) 718 (error (semantic-complete-inline-exit))))
@@ -761,6 +763,10 @@ END is at the end of the current symbol being completed."
761 (semantic-overlay-put semantic-complete-inline-overlay 763 (semantic-overlay-put semantic-complete-inline-overlay
762 'window-config-start 764 'window-config-start
763 (current-window-configuration)) 765 (current-window-configuration))
766 ;; Save the original start. We need to exit completion if START
767 ;; moves.
768 (semantic-overlay-put semantic-complete-inline-overlay
769 'semantic-original-start start)
764 ;; Install our command hooks 770 ;; Install our command hooks
765 (add-hook 'pre-command-hook 'semantic-complete-pre-command-hook) 771 (add-hook 'pre-command-hook 'semantic-complete-pre-command-hook)
766 (add-hook 'post-command-hook 'semantic-complete-post-command-hook) 772 (add-hook 'post-command-hook 'semantic-complete-post-command-hook)
@@ -1171,7 +1177,7 @@ These collectors track themselves on a per-buffer basis."
1171 (let ((old nil) 1177 (let ((old nil)
1172 (bl semantic-collector-per-buffer-list)) 1178 (bl semantic-collector-per-buffer-list))
1173 (while (and bl (null old)) 1179 (while (and bl (null old))
1174 (if (eq (object-class (car bl)) this) 1180 (if (eq (eieio-object-class (car bl)) this)
1175 (setq old (car bl)))) 1181 (setq old (car bl))))
1176 (unless old 1182 (unless old
1177 (let ((new (call-next-method))) 1183 (let ((new (call-next-method)))
@@ -1510,7 +1516,7 @@ one in the source buffer."
1510 (insert (semantic-format-tag-summarize tag nil t) "\n\n") 1516 (insert (semantic-format-tag-summarize tag nil t) "\n\n")
1511 (when table 1517 (when table
1512 (insert "From table: \n") 1518 (insert "From table: \n")
1513 (insert (object-name table) "\n\n")) 1519 (insert (eieio-object-name table) "\n\n"))
1514 (when buf 1520 (when buf
1515 (insert "In buffer: \n\n") 1521 (insert "In buffer: \n\n")
1516 (insert (format "%S" buf))) 1522 (insert (format "%S" buf)))
diff --git a/lisp/cedet/semantic/db-el.el b/lisp/cedet/semantic/db-el.el
index 260f964c191..1b0f3292ad3 100644
--- a/lisp/cedet/semantic/db-el.el
+++ b/lisp/cedet/semantic/db-el.el
@@ -216,9 +216,8 @@ TOKTYPE is a hint to the type of tag desired."
216 (symbol-name sym) 216 (symbol-name sym)
217 "class" 217 "class"
218 (semantic-elisp-desymbolify 218 (semantic-elisp-desymbolify
219 (aref (class-v semanticdb-project-database) 219 (eieio--class-public-a (class-v semanticdb-project-database))) ;; slots
220 class-public-a)) ;; slots 220 (semantic-elisp-desymbolify (eieio-class-parents sym)) ;; parents
221 (semantic-elisp-desymbolify (class-parents sym)) ;; parents
222 )) 221 ))
223 ((not toktype) 222 ((not toktype)
224 ;; Figure it out on our own. 223 ;; Figure it out on our own.
diff --git a/lisp/cedet/semantic/db-file.el b/lisp/cedet/semantic/db-file.el
index 269ff264126..2ef4fba1288 100644
--- a/lisp/cedet/semantic/db-file.el
+++ b/lisp/cedet/semantic/db-file.el
@@ -44,6 +44,8 @@
44(defcustom semanticdb-default-save-directory 44(defcustom semanticdb-default-save-directory
45 (locate-user-emacs-file "semanticdb" ".semanticdb") 45 (locate-user-emacs-file "semanticdb" ".semanticdb")
46 "Directory name where semantic cache files are stored. 46 "Directory name where semantic cache files are stored.
47By default, it is either ~/.emacs.d/semanticdb, or ~/.semanticdb depending
48on which exists.
47If this value is nil, files are saved in the current directory. If the value 49If this value is nil, files are saved in the current directory. If the value
48is a valid directory, then it overrides `semanticdb-default-file-name' and 50is a valid directory, then it overrides `semanticdb-default-file-name' and
49stores caches in a coded file name in this directory." 51stores caches in a coded file name in this directory."
@@ -316,7 +318,7 @@ Argument OBJ is the object to write."
316 (data-debug-new-buffer (concat "*SEMANTICDB ERROR*")) 318 (data-debug-new-buffer (concat "*SEMANTICDB ERROR*"))
317 (data-debug-insert-thing obj "*" "") 319 (data-debug-insert-thing obj "*" "")
318 (setq semanticdb-data-debug-on-write-error nil)) 320 (setq semanticdb-data-debug-on-write-error nil))
319 (message "Error Writing Table: %s" (object-name obj)) 321 (message "Error Writing Table: %s" (eieio-object-name obj))
320 (error "%S" (car (cdr tableerror))))) 322 (error "%S" (car (cdr tableerror)))))
321 323
322 ;; Clear the dirty bit. 324 ;; Clear the dirty bit.
diff --git a/lisp/cedet/semantic/db-find.el b/lisp/cedet/semantic/db-find.el
index 77fd10fc7aa..2e4ca319a9d 100644
--- a/lisp/cedet/semantic/db-find.el
+++ b/lisp/cedet/semantic/db-find.el
@@ -244,7 +244,7 @@ This class will cache data derived during various searches.")
244 (let ((tab-idx (semanticdb-get-table-index tab))) 244 (let ((tab-idx (semanticdb-get-table-index tab)))
245 ;; Not a full reset? 245 ;; Not a full reset?
246 (when (oref tab-idx type-cache) 246 (when (oref tab-idx type-cache)
247 (require 'db-typecache) 247 (require 'semantic/db-typecache)
248 (semanticdb-typecache-notify-reset 248 (semanticdb-typecache-notify-reset
249 (oref tab-idx type-cache))) 249 (oref tab-idx type-cache)))
250 ))) 250 )))
@@ -919,7 +919,7 @@ but should be good enough for debugging assertions."
919 (if (< (length result) 2) 919 (if (< (length result) 2)
920 (concat "#<FIND RESULT " 920 (concat "#<FIND RESULT "
921 (mapconcat (lambda (a) 921 (mapconcat (lambda (a)
922 (concat "(" (object-name (car a) ) " . " 922 (concat "(" (eieio-object-name (car a) ) " . "
923 "#<TAG LIST " (number-to-string (length (cdr a))) ">)")) 923 "#<TAG LIST " (number-to-string (length (cdr a))) ">)"))
924 result 924 result
925 " ") 925 " ")
@@ -1285,7 +1285,7 @@ associated with that tag should be loaded into a buffer."
1285 (semanticdb-find-tags-collector 1285 (semanticdb-find-tags-collector
1286 (lambda (table tags) 1286 (lambda (table tags)
1287 (semanticdb-find-tags-external-children-of-type-method table type tags)) 1287 (semanticdb-find-tags-external-children-of-type-method table type tags))
1288 path find-file-match)) 1288 path find-file-match t))
1289 1289
1290(defun semanticdb-find-tags-subclasses-of-type 1290(defun semanticdb-find-tags-subclasses-of-type
1291 (type &optional path find-file-match) 1291 (type &optional path find-file-match)
diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el
index a6088231c61..e8784c4f85c 100644
--- a/lisp/cedet/semantic/db.el
+++ b/lisp/cedet/semantic/db.el
@@ -190,7 +190,7 @@ If one doesn't exist, create it."
190 (oref obj index) 190 (oref obj index)
191 (let ((idx nil)) 191 (let ((idx nil))
192 (setq idx (funcall semanticdb-default-find-index-class 192 (setq idx (funcall semanticdb-default-find-index-class
193 (concat (object-name obj) " index") 193 (concat (eieio-object-name obj) " index")
194 ;; Fill in the defaults 194 ;; Fill in the defaults
195 :table obj 195 :table obj
196 )) 196 ))
@@ -469,7 +469,7 @@ other than :table."
469 (let ((cache (oref table cache)) 469 (let ((cache (oref table cache))
470 (obj nil)) 470 (obj nil))
471 (while (and (not obj) cache) 471 (while (and (not obj) cache)
472 (if (eq (object-class-fast (car cache)) desired-class) 472 (if (eq (eieio--object-class (car cache)) desired-class)
473 (setq obj (car cache))) 473 (setq obj (car cache)))
474 (setq cache (cdr cache))) 474 (setq cache (cdr cache)))
475 (if obj 475 (if obj
@@ -520,7 +520,7 @@ other than :table."
520 (let ((cache (oref db cache)) 520 (let ((cache (oref db cache))
521 (obj nil)) 521 (obj nil))
522 (while (and (not obj) cache) 522 (while (and (not obj) cache)
523 (if (eq (object-class-fast (car cache)) desired-class) 523 (if (eq (eieio--object-class (car cache)) desired-class)
524 (setq obj (car cache))) 524 (setq obj (car cache)))
525 (setq cache (cdr cache))) 525 (setq cache (cdr cache)))
526 (if obj 526 (if obj
diff --git a/lisp/cedet/semantic/decorate/include.el b/lisp/cedet/semantic/decorate/include.el
index 3a08db2b0d0..0451ad44fe8 100644
--- a/lisp/cedet/semantic/decorate/include.el
+++ b/lisp/cedet/semantic/decorate/include.el
@@ -797,7 +797,7 @@ Argument EVENT describes the event that caused this function to be called."
797 (dolist (p path) 797 (dolist (p path)
798 (if (slot-boundp p 'tags) 798 (if (slot-boundp p 'tags)
799 (princ (format "\n %s :\t%d tags, %d are includes. %s" 799 (princ (format "\n %s :\t%d tags, %d are includes. %s"
800 (object-name-string p) 800 (eieio-object-name-string p)
801 (length (oref p tags)) 801 (length (oref p tags))
802 (length (semantic-find-tags-by-class 802 (length (semantic-find-tags-by-class
803 'include p)) 803 'include p))
@@ -810,7 +810,7 @@ Argument EVENT describes the event that caused this function to be called."
810 " Needs to be parsed.") 810 " Needs to be parsed.")
811 (t "")))) 811 (t ""))))
812 (princ (format "\n %s :\tUnparsed" 812 (princ (format "\n %s :\tUnparsed"
813 (object-name-string p)))) 813 (eieio-object-name-string p))))
814 ))) 814 )))
815 ))) 815 )))
816 816
diff --git a/lisp/cedet/semantic/ede-grammar.el b/lisp/cedet/semantic/ede-grammar.el
index 094832a8258..cb2a1faaac0 100644
--- a/lisp/cedet/semantic/ede-grammar.el
+++ b/lisp/cedet/semantic/ede-grammar.el
@@ -162,7 +162,7 @@ Lays claim to all -by.el, and -wy.el files."
162 (setq comp (1+ comp)) 162 (setq comp (1+ comp))
163 (setq utd (1+ utd)))))))) 163 (setq utd (1+ utd))))))))
164 (oref obj source)) 164 (oref obj source))
165 (message "All Semantic Grammar sources are up to date in %s" (object-name obj)) 165 (message "All Semantic Grammar sources are up to date in %s" (eieio-object-name obj))
166 (cons comp utd))) 166 (cons comp utd)))
167 167
168;;; Makefile generation functions 168;;; Makefile generation functions
diff --git a/lisp/cedet/semantic/find.el b/lisp/cedet/semantic/find.el
index aa42a77725e..f660c69ec3d 100644
--- a/lisp/cedet/semantic/find.el
+++ b/lisp/cedet/semantic/find.el
@@ -313,6 +313,15 @@ TABLE is a tag table. See `semantic-something-to-tag-table'."
313 (eq ,class (semantic-tag-class (car tags))) 313 (eq ,class (semantic-tag-class (car tags)))
314 ,table)) 314 ,table))
315 315
316(defmacro semantic-filter-tags-by-class (class &optional table)
317 "Find all tags of class not in the list CLASS in TABLE.
318CLASS is a list of symbols representing the class of the token,
319such as 'variable, of 'function..
320TABLE is a tag table. See `semantic-something-to-tag-table'."
321 `(semantic--find-tags-by-macro
322 (not (memq (semantic-tag-class (car tags)) ,class))
323 ,table))
324
316(defmacro semantic-find-tags-by-type (type &optional table) 325(defmacro semantic-find-tags-by-type (type &optional table)
317 "Find all tags of with a type TYPE in TABLE. 326 "Find all tags of with a type TYPE in TABLE.
318TYPE is a string or tag representing a data type as defined in the 327TYPE is a string or tag representing a data type as defined in the
diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el
index ba4570e692b..9cb0f60b80a 100644
--- a/lisp/cedet/semantic/grammar.el
+++ b/lisp/cedet/semantic/grammar.el
@@ -51,6 +51,9 @@
51(declare-function semantic-grammar-wy--install-parser 51(declare-function semantic-grammar-wy--install-parser
52 "semantic/gram-wy-fallback") 52 "semantic/gram-wy-fallback")
53 53
54(declare-function semantic-grammar-wy--install-parser
55 "semantic/gram-wy-fallback")
56
54 57
55;;;; 58;;;;
56;;;; Set up lexer 59;;;; Set up lexer
diff --git a/lisp/cedet/semantic/sb.el b/lisp/cedet/semantic/sb.el
index e2d143b529e..32117da1af5 100644
--- a/lisp/cedet/semantic/sb.el
+++ b/lisp/cedet/semantic/sb.el
@@ -43,6 +43,11 @@ This will replace the named bucket that would have usually occurred here."
43 :group 'speedbar 43 :group 'speedbar
44 :type 'integer) 44 :type 'integer)
45 45
46(defvar semantic-sb-filter-tags-of-class '(code)
47 "Tags classes to not display in speedbar.
48Make this buffer local for modes that have different types of tags
49that should be ignored.")
50
46(defcustom semantic-sb-button-format-tag-function 'semantic-format-tag-abbreviate 51(defcustom semantic-sb-button-format-tag-function 'semantic-format-tag-abbreviate
47 "*Function called to create the text for a but from a token." 52 "*Function called to create the text for a but from a token."
48 :group 'speedbar 53 :group 'speedbar
@@ -405,7 +410,12 @@ Returns the tag list, or t for an error."
405 (setq out (semantic-adopt-external-members out)) 410 (setq out (semantic-adopt-external-members out))
406 ;; Dump all the tokens into buckets. 411 ;; Dump all the tokens into buckets.
407 (semantic-sb-with-tag-buffer (car out) 412 (semantic-sb-with-tag-buffer (car out)
408 (semantic-bucketize out))) 413 (semantic-bucketize out nil
414 (lambda (tagsin)
415 ;; Remove all boring tags.
416 (semantic-filter-tags-by-class
417 semantic-sb-filter-tags-of-class
418 tagsin)))))
409 (error t)) 419 (error t))
410 t))) 420 t)))
411 421
diff --git a/lisp/cedet/semantic/senator.el b/lisp/cedet/semantic/senator.el
index a79e70a7f61..157223ff192 100644
--- a/lisp/cedet/semantic/senator.el
+++ b/lisp/cedet/semantic/senator.el
@@ -727,7 +727,13 @@ kill ring."
727 (semantic-fetch-tags) 727 (semantic-fetch-tags)
728 (let ((ft (semantic-obtain-foreign-tag))) 728 (let ((ft (semantic-obtain-foreign-tag)))
729 (when ft 729 (when ft
730 (set-register register ft) 730 (set-register
731 register (registerv-make
732 ft
733 :insert-func #'semantic-insert-foreign-tag
734 :jump-func (lambda (v)
735 (switch-to-buffer (semantic-tag-buffer v))
736 (goto-char (semantic-tag-start v)))))
731 (if kill-flag 737 (if kill-flag
732 (kill-region (semantic-tag-start ft) 738 (kill-region (semantic-tag-start ft)
733 (semantic-tag-end ft)))))) 739 (semantic-tag-end ft))))))
diff --git a/lisp/cedet/semantic/sort.el b/lisp/cedet/semantic/sort.el
index 6b58689524c..b32e11290ac 100644
--- a/lisp/cedet/semantic/sort.el
+++ b/lisp/cedet/semantic/sort.el
@@ -522,7 +522,7 @@ See `semantic-tag-external-member-children' for details."
522 (semanticdb-minor-mode-p) 522 (semanticdb-minor-mode-p)
523 (require 'semantic/db-find)) 523 (require 'semantic/db-find))
524 (let ((m (semanticdb-find-tags-external-children-of-type 524 (let ((m (semanticdb-find-tags-external-children-of-type
525 (semantic-tag-name tag)))) 525 (semantic-tag-name tag) tag)))
526 (if m (apply #'append (mapcar #'cdr m)))) 526 (if m (apply #'append (mapcar #'cdr m))))
527 (semantic--find-tags-by-function 527 (semantic--find-tags-by-function
528 `(lambda (tok) 528 `(lambda (tok)
diff --git a/lisp/cedet/semantic/tag-ls.el b/lisp/cedet/semantic/tag-ls.el
index 7e5913334ea..53da7b65661 100644
--- a/lisp/cedet/semantic/tag-ls.el
+++ b/lisp/cedet/semantic/tag-ls.el
@@ -146,36 +146,42 @@ are the same.
146IGNORABLE-ATTRIBUTES are tag attributes that can be ignored. 146IGNORABLE-ATTRIBUTES are tag attributes that can be ignored.
147 147
148See `semantic-tag-similar-p' for details." 148See `semantic-tag-similar-p' for details."
149 (let* ((ignore (append ignorable-attributes semantic-tag-similar-ignorable-attributes)) 149 (or
150 (A1 (and (semantic--tag-similar-names-p tag1 tag2 (memq :name ignore)) 150 ;; Tags are similar if they have the exact same lisp object
151 (semantic--tag-similar-types-p tag1 tag2) 151 ;; Added for performance when testing a relatively common case in some uses
152 (semantic-tag-of-class-p tag1 (semantic-tag-class tag2)))) 152 ;; of this code.
153 (attr1 (semantic-tag-attributes tag1)) 153 (eq tag1 tag2)
154 (attr2 (semantic-tag-attributes tag2)) 154 ;; More complex similarness test.
155 (A2 t) 155 (let* ((ignore (append ignorable-attributes semantic-tag-similar-ignorable-attributes))
156 (A3 t) 156 (A1 (and (semantic--tag-similar-names-p tag1 tag2 (memq :name ignore))
157 ) 157 (semantic--tag-similar-types-p tag1 tag2)
158 ;; Test if there are non-ignorable attributes in A2 which are not present in A1 158 (semantic-tag-of-class-p tag1 (semantic-tag-class tag2))))
159 (while (and A2 attr2) 159 (attr1 (semantic-tag-attributes tag1))
160 (let ((a (car attr2))) 160 (attr2 (semantic-tag-attributes tag2))
161 (unless (or (eq a :type) (memq a ignore)) 161 (A2 t)
162 (setq A2 (semantic-tag-get-attribute tag1 a))) 162 (A3 t)
163 (setq attr2 (cdr (cdr attr2))))) 163 )
164 (while (and A2 attr1 A3) 164 ;; Test if there are non-ignorable attributes in A2 which are not present in A1
165 (let ((a (car attr1))) 165 (while (and A2 attr2)
166 166 (let ((a (car attr2)))
167 (cond ((or (eq a :type) ;; already tested above. 167 (unless (or (eq a :type) (memq a ignore))
168 (memq a ignore)) ;; Ignore them... 168 (setq A2 (semantic-tag-get-attribute tag1 a)))
169 nil) 169 (setq attr2 (cdr (cdr attr2)))))
170 170 (while (and A2 attr1 A3)
171 (t 171 (let ((a (car attr1)))
172 (setq A3 172
173 (semantic--tag-attribute-similar-p 173 (cond ((or (eq a :type) ;; already tested above.
174 a (car (cdr attr1)) (semantic-tag-get-attribute tag2 a) 174 (memq a ignore)) ;; Ignore them...
175 ignorable-attributes))) 175 nil)
176 )) 176
177 (setq attr1 (cdr (cdr attr1)))) 177 (t
178 (and A1 A2 A3))) 178 (setq A3
179 (semantic--tag-attribute-similar-p
180 a (car (cdr attr1)) (semantic-tag-get-attribute tag2 a)
181 ignorable-attributes)))
182 ))
183 (setq attr1 (cdr (cdr attr1))))
184 (and A1 A2 A3))))
179 185
180;;; FULL NAMES 186;;; FULL NAMES
181;; 187;;
diff --git a/lisp/cedet/srecode/args.el b/lisp/cedet/srecode/args.el
index b91f96f611d..d6798f7523d 100644
--- a/lisp/cedet/srecode/args.el
+++ b/lisp/cedet/srecode/args.el
@@ -157,6 +157,30 @@ do not contain any text from preceding or following text."
157 (srecode-dictionary-show-section dict "RCS") 157 (srecode-dictionary-show-section dict "RCS")
158 ))) 158 )))
159 159
160;;; :project ARGUMENT HANDLING
161;;
162;; When the :project argument is required, fill the dictionary with
163;; information that the current project (from EDE) might know
164(defun srecode-semantic-handle-:project (dict)
165 "Add macros into the dictionary DICT based on the current ede project."
166 (let* ((bfn (buffer-file-name))
167 (dir (file-name-directory bfn)))
168 (if (ede-toplevel)
169 (let* ((projecttop (ede-toplevel-project default-directory))
170 (relfname (file-relative-name bfn projecttop))
171 (reldir (file-relative-name dir projecttop))
172 )
173 (srecode-dictionary-set-value dict "PROJECT_FILENAME" relfname)
174 (srecode-dictionary-set-value dict "PROJECT_DIRECTORY" reldir)
175 (srecode-dictionary-set-value dict "PROJECT_NAME" (ede-name (ede-toplevel)))
176 (srecode-dictionary-set-value dict "PROJECT_VERSION" (oref (ede-toplevel) :version))
177 )
178 ;; If there is no EDE project, then put in some base values.
179 (srecode-dictionary-set-value dict "PROJECT_FILENAME" bfn)
180 (srecode-dictionary-set-value dict "PROJECT_DIRECTORY" dir)
181 (srecode-dictionary-set-value dict "PROJECT_NAME" "N/A")
182 (srecode-dictionary-set-value dict "PROJECT_VERSION" "1.0"))))
183
160;;; :system ARGUMENT HANDLING 184;;; :system ARGUMENT HANDLING
161;; 185;;
162;; When a :system argument is required, fill the dictionary with 186;; When a :system argument is required, fill the dictionary with
diff --git a/lisp/cedet/srecode/compile.el b/lisp/cedet/srecode/compile.el
index 170b99c1fd2..0d68036c433 100644
--- a/lisp/cedet/srecode/compile.el
+++ b/lisp/cedet/srecode/compile.el
@@ -510,12 +510,12 @@ to the inserter constructor."
510 ;;(message "Compile: %s %S" name props) 510 ;;(message "Compile: %s %S" name props)
511 (if (not key) 511 (if (not key)
512 (apply 'srecode-template-inserter-variable name props) 512 (apply 'srecode-template-inserter-variable name props)
513 (let ((classes (class-children srecode-template-inserter)) 513 (let ((classes (eieio-class-children srecode-template-inserter))
514 (new nil)) 514 (new nil))
515 ;; Loop over the various subclasses and 515 ;; Loop over the various subclasses and
516 ;; create the correct inserter. 516 ;; create the correct inserter.
517 (while (and (not new) classes) 517 (while (and (not new) classes)
518 (setq classes (append classes (class-children (car classes)))) 518 (setq classes (append classes (eieio-class-children (car classes))))
519 ;; Do we have a match? 519 ;; Do we have a match?
520 (when (and (not (class-abstract-p (car classes))) 520 (when (and (not (class-abstract-p (car classes)))
521 (equal (oref (car classes) key) key)) 521 (equal (oref (car classes) key) key))
@@ -594,7 +594,7 @@ A list of defined variables VARS provides a variable table."
594(defmethod srecode-dump ((tmp srecode-template)) 594(defmethod srecode-dump ((tmp srecode-template))
595 "Dump the contents of the SRecode template tmp." 595 "Dump the contents of the SRecode template tmp."
596 (princ "== Template \"") 596 (princ "== Template \"")
597 (princ (object-name-string tmp)) 597 (princ (eieio-object-name-string tmp))
598 (princ "\" in context ") 598 (princ "\" in context ")
599 (princ (oref tmp context)) 599 (princ (oref tmp context))
600 (princ "\n") 600 (princ "\n")
@@ -640,12 +640,12 @@ Argument INDENT specifies the indentation level for the list."
640(defmethod srecode-dump ((ins srecode-template-inserter) indent) 640(defmethod srecode-dump ((ins srecode-template-inserter) indent)
641 "Dump the state of the SRecode template inserter INS." 641 "Dump the state of the SRecode template inserter INS."
642 (princ "INS: \"") 642 (princ "INS: \"")
643 (princ (object-name-string ins)) 643 (princ (eieio-object-name-string ins))
644 (when (oref ins :secondname) 644 (when (oref ins :secondname)
645 (princ "\" : \"") 645 (princ "\" : \"")
646 (princ (oref ins :secondname))) 646 (princ (oref ins :secondname)))
647 (princ "\" type \"") 647 (princ "\" type \"")
648 (let* ((oc (symbol-name (object-class ins))) 648 (let* ((oc (symbol-name (eieio-object-class ins)))
649 (junk (string-match "srecode-template-inserter-" oc)) 649 (junk (string-match "srecode-template-inserter-" oc))
650 (on (if junk 650 (on (if junk
651 (substring oc (match-end 0)) 651 (substring oc (match-end 0))
diff --git a/lisp/cedet/srecode/cpp.el b/lisp/cedet/srecode/cpp.el
index 94b394a1631..fd500b6d9a3 100644
--- a/lisp/cedet/srecode/cpp.el
+++ b/lisp/cedet/srecode/cpp.el
@@ -70,8 +70,7 @@ HEADER - Shown section if in a header file."
70 (srecode-dictionary-show-section dict "NOTHEADER")) 70 (srecode-dictionary-show-section dict "NOTHEADER"))
71 71
72 ;; Strip out bad characters 72 ;; Strip out bad characters
73 (while (string-match "\\.\\| " fsym) 73 (setq fsym (replace-regexp-in-string "[^a-zA-Z0-9_]" "_" fsym))
74 (setq fsym (replace-match "_" t t fsym)))
75 (srecode-dictionary-set-value dict "FILENAME_SYMBOL" fsym) 74 (srecode-dictionary-set-value dict "FILENAME_SYMBOL" fsym)
76 ) 75 )
77 ) 76 )
diff --git a/lisp/cedet/srecode/dictionary.el b/lisp/cedet/srecode/dictionary.el
index bac05666726..bbc791f09d8 100644
--- a/lisp/cedet/srecode/dictionary.el
+++ b/lisp/cedet/srecode/dictionary.el
@@ -175,7 +175,7 @@ associated with a buffer or parent."
175 ((srecode-dictionary-child-p buffer-or-parent) 175 ((srecode-dictionary-child-p buffer-or-parent)
176 (setq parent buffer-or-parent 176 (setq parent buffer-or-parent
177 buffer (oref buffer-or-parent buffer) 177 buffer (oref buffer-or-parent buffer)
178 origin (concat (object-name buffer-or-parent) " in " 178 origin (concat (eieio-object-name buffer-or-parent) " in "
179 (if buffer (buffer-name buffer) 179 (if buffer (buffer-name buffer)
180 "no buffer"))) 180 "no buffer")))
181 (when buffer 181 (when buffer
@@ -454,12 +454,12 @@ If you subclass `srecode-dictionary-compound-value' then this
454method could return nil, but if it does that, it must insert 454method could return nil, but if it does that, it must insert
455the value itself using `princ', or by detecting if the current 455the value itself using `princ', or by detecting if the current
456standard out is a buffer, and using `insert'." 456standard out is a buffer, and using `insert'."
457 (object-name cp)) 457 (eieio-object-name cp))
458 458
459(defmethod srecode-dump ((cp srecode-dictionary-compound-value) 459(defmethod srecode-dump ((cp srecode-dictionary-compound-value)
460 &optional indent) 460 &optional indent)
461 "Display information about this compound value." 461 "Display information about this compound value."
462 (princ (object-name cp)) 462 (princ (eieio-object-name cp))
463 ) 463 )
464 464
465(defmethod srecode-compound-toString ((cp srecode-dictionary-compound-variable) 465(defmethod srecode-compound-toString ((cp srecode-dictionary-compound-variable)
@@ -654,7 +654,7 @@ STATE is the current compiler state."
654 4))) 654 4)))
655 (while entry 655 (while entry
656 (princ " --> SUBDICTIONARY ") 656 (princ " --> SUBDICTIONARY ")
657 (princ (object-name dict)) 657 (princ (eieio-object-name dict))
658 (princ "\n") 658 (princ "\n")
659 (srecode-dump (car entry) newindent) 659 (srecode-dump (car entry) newindent)
660 (setq entry (cdr entry)) 660 (setq entry (cdr entry))
diff --git a/lisp/cedet/srecode/insert.el b/lisp/cedet/srecode/insert.el
index 466efae3b9c..0d647bb56c5 100644
--- a/lisp/cedet/srecode/insert.el
+++ b/lisp/cedet/srecode/insert.el
@@ -809,7 +809,7 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
809 (srecode-insert-report-error 809 (srecode-insert-report-error
810 dict 810 dict
811 "Only section dictionaries allowed for `%s'" 811 "Only section dictionaries allowed for `%s'"
812 (object-name-string sti))) 812 (eieio-object-name-string sti)))
813 813
814 ;; Output the code from the sub-template. 814 ;; Output the code from the sub-template.
815 (srecode-insert-method (slot-value sti slot) dict)) 815 (srecode-insert-method (slot-value sti slot) dict))
@@ -866,7 +866,7 @@ Return the remains of INPUT."
866 (let* ((out (srecode-compile-split-code tag input STATE 866 (let* ((out (srecode-compile-split-code tag input STATE
867 (oref ins :object-name)))) 867 (oref ins :object-name))))
868 (oset ins template (srecode-template 868 (oset ins template (srecode-template
869 (object-name-string ins) 869 (eieio-object-name-string ins)
870 :context nil 870 :context nil
871 :args nil 871 :args nil
872 :code (cdr out))) 872 :code (cdr out)))
diff --git a/lisp/cedet/srecode/java.el b/lisp/cedet/srecode/java.el
index db4d2deee28..29a8465c45c 100644
--- a/lisp/cedet/srecode/java.el
+++ b/lisp/cedet/srecode/java.el
@@ -42,9 +42,24 @@ FILENAME_AS_CLASS - file converted to a Java class name."
42 ) 42 )
43 (while (string-match "\\.\\| " fpak) 43 (while (string-match "\\.\\| " fpak)
44 (setq fpak (replace-match "_" t t fpak))) 44 (setq fpak (replace-match "_" t t fpak)))
45 (if (string-match "src/" dir) 45 ;; We can extract package from:
46 (setq dir (substring dir (match-end 0))) 46 ;; 1) a java EDE project source paths,
47 (setq dir (file-name-nondirectory (directory-file-name dir)))) 47 (cond ((ede-current-project)
48 (let* ((proj (ede-current-project))
49 (pths (ede-source-paths proj 'java-mode))
50 (pth)
51 (res))
52 (while (and (not res)
53 (setq pth (expand-file-name (car pths))))
54 (when (string-match pth dir)
55 (setq res (substring dir (match-end 0))))
56 (setq pths (cdr pths)))
57 (setq dir res)))
58 ;; 2) a simple heuristic
59 ((string-match "src/" dir)
60 (setq dir (substring dir (match-end 0))))
61 ;; 3) outer directory as a fallback
62 (t (setq dir (file-name-nondirectory (directory-file-name dir)))))
48 (setq dir (directory-file-name dir)) 63 (setq dir (directory-file-name dir))
49 (while (string-match "/" dir) 64 (while (string-match "/" dir)
50 (setq dir (replace-match "." t t dir))) 65 (setq dir (replace-match "." t t dir)))
diff --git a/lisp/cedet/srecode/map.el b/lisp/cedet/srecode/map.el
index cbe602f3299..1dd9ba4cf47 100644
--- a/lisp/cedet/srecode/map.el
+++ b/lisp/cedet/srecode/map.el
@@ -363,6 +363,9 @@ Return non-nil if the map changed."
363 (let ((semantic-init-hook nil)) 363 (let ((semantic-init-hook nil))
364 (semantic-new-buffer-fcn)) 364 (semantic-new-buffer-fcn))
365 ) 365 )
366 ;; Force semantic to be enabled in this buffer.
367 (unless (semantic-active-p)
368 (semantic-new-buffer-fcn))
366 369
367 (semantic-fetch-tags) 370 (semantic-fetch-tags)
368 (let* ((mode-tag 371 (let* ((mode-tag
diff --git a/lisp/cedet/srecode/mode.el b/lisp/cedet/srecode/mode.el
index 8c4a53ec891..e8e1c78198e 100644
--- a/lisp/cedet/srecode/mode.el
+++ b/lisp/cedet/srecode/mode.el
@@ -225,7 +225,7 @@ MENU-DEF is the menu to bind this into."
225 (ctxtcons (assoc ctxt alltabs)) 225 (ctxtcons (assoc ctxt alltabs))
226 (bind (if (slot-boundp temp 'binding) 226 (bind (if (slot-boundp temp 'binding)
227 (oref temp binding))) 227 (oref temp binding)))
228 (name (object-name-string temp))) 228 (name (eieio-object-name-string temp)))
229 229
230 (when (not ctxtcons) 230 (when (not ctxtcons)
231 (if (string= context ctxt) 231 (if (string= context ctxt)
diff --git a/lisp/cedet/srecode/srt-mode.el b/lisp/cedet/srecode/srt-mode.el
index 455895c003d..2f43dc3872b 100644
--- a/lisp/cedet/srecode/srt-mode.el
+++ b/lisp/cedet/srecode/srt-mode.el
@@ -187,7 +187,7 @@ we can tell font lock about them.")
187 "Keymap used in srecode mode.") 187 "Keymap used in srecode mode.")
188 188
189;;;###autoload 189;;;###autoload
190(define-derived-mode srecode-template-mode fundamental-mode "SRecorder" 190(define-derived-mode srecode-template-mode fundamental-mode "SRecode"
191 "Major-mode for writing SRecode macros." 191 "Major-mode for writing SRecode macros."
192 (set (make-local-variable 'comment-start) ";;") 192 (set (make-local-variable 'comment-start) ";;")
193 (set (make-local-variable 'comment-end) "") 193 (set (make-local-variable 'comment-end) "")
@@ -232,7 +232,7 @@ we can tell font lock about them.")
232 "Provide help for working with macros in a template." 232 "Provide help for working with macros in a template."
233 (interactive) 233 (interactive)
234 (let* ((root 'srecode-template-inserter) 234 (let* ((root 'srecode-template-inserter)
235 (chl (aref (class-v root) class-children)) 235 (chl (eieio--class-children (class-v root)))
236 (ess (srecode-template-get-escape-start)) 236 (ess (srecode-template-get-escape-start))
237 (ees (srecode-template-get-escape-end)) 237 (ees (srecode-template-get-escape-end))
238 ) 238 )
@@ -248,7 +248,7 @@ we can tell font lock about them.")
248 (showexample t) 248 (showexample t)
249 ) 249 )
250 (setq chl (cdr chl)) 250 (setq chl (cdr chl))
251 (setq chl (append (aref (class-v C) class-children) chl)) 251 (setq chl (append (eieio--class-children (class-v C)) chl))
252 252
253 (catch 'skip 253 (catch 'skip
254 (when (eq C 'srecode-template-inserter-section-end) 254 (when (eq C 'srecode-template-inserter-section-end)
diff --git a/lisp/cedet/srecode/srt.el b/lisp/cedet/srecode/srt.el
index 3875246cb37..1fad31dafd6 100644
--- a/lisp/cedet/srecode/srt.el
+++ b/lisp/cedet/srecode/srt.el
@@ -69,6 +69,7 @@ DEFAULT is the default if RET is hit."
69 nil initial (or hist 'srecode-read-major-mode-history)) 69 nil initial (or hist 'srecode-read-major-mode-history))
70 ) 70 )
71 71
72;;;###autoload
72(defun srecode-semantic-handle-:srt (dict) 73(defun srecode-semantic-handle-:srt (dict)
73 "Add macros into the dictionary DICT based on the current SRT file. 74 "Add macros into the dictionary DICT based on the current SRT file.
74Adds the following: 75Adds the following:
@@ -104,4 +105,9 @@ MODE - The mode of this buffer. If not declared yet, guess."
104 105
105(provide 'srecode/srt) 106(provide 'srecode/srt)
106 107
108;; Local variables:
109;; generated-autoload-file: "loaddefs.el"
110;; generated-autoload-load-name: "srecode/srt"
111;; End:
112
107;;; srecode/srt.el ends here 113;;; srecode/srt.el ends here
diff --git a/lisp/cedet/srecode/table.el b/lisp/cedet/srecode/table.el
index 802740ba063..26163bd1e51 100644
--- a/lisp/cedet/srecode/table.el
+++ b/lisp/cedet/srecode/table.el
@@ -251,7 +251,7 @@ Use PREDICATE is the same as for the `sort' function."
251(defmethod srecode-dump ((tab srecode-template-table)) 251(defmethod srecode-dump ((tab srecode-template-table))
252 "Dump the contents of the SRecode template table TAB." 252 "Dump the contents of the SRecode template table TAB."
253 (princ "Template Table for ") 253 (princ "Template Table for ")
254 (princ (object-name-string tab)) 254 (princ (eieio-object-name-string tab))
255 (princ "\nPriority: ") 255 (princ "\nPriority: ")
256 (prin1 (oref tab :priority)) 256 (prin1 (oref tab :priority))
257 (when (oref tab :application) 257 (when (oref tab :application)
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 1151bd434bc..9c95f597fff 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -697,83 +697,69 @@ is nil, ask the user where to save the desktop."
697 ll))) 697 ll)))
698 698
699;; ---------------------------------------------------------------------------- 699;; ----------------------------------------------------------------------------
700(defun desktop-internal-v2s (value) 700(defun desktop--v2s (value)
701 "Convert VALUE to a pair (QUOTE . TXT); (eval (read TXT)) gives VALUE. 701 "Convert VALUE to a pair (QUOTE . SEXP); (eval SEXP) gives VALUE.
702TXT is a string that when read and evaluated yields VALUE. 702SEXP is an sexp that when evaluated yields VALUE.
703QUOTE may be `may' (value may be quoted), 703QUOTE may be `may' (value may be quoted),
704`must' (value must be quoted), or nil (value must not be quoted)." 704`must' (value must be quoted), or nil (value must not be quoted)."
705 (cond 705 (cond
706 ((or (numberp value) (null value) (eq t value) (keywordp value)) 706 ((or (numberp value) (null value) (eq t value) (keywordp value))
707 (cons 'may (prin1-to-string value))) 707 (cons 'may value))
708 ((stringp value) 708 ((stringp value)
709 (let ((copy (copy-sequence value))) 709 (let ((copy (copy-sequence value)))
710 (set-text-properties 0 (length copy) nil copy) 710 (set-text-properties 0 (length copy) nil copy)
711 ;; Get rid of text properties because we cannot read them 711 ;; Get rid of text properties because we cannot read them.
712 (cons 'may (prin1-to-string copy)))) 712 (cons 'may copy)))
713 ((symbolp value) 713 ((symbolp value)
714 (cons 'must (prin1-to-string value))) 714 (cons 'must value))
715 ((vectorp value) 715 ((vectorp value)
716 (let* ((special nil) 716 (let* ((pass1 (mapcar #'desktop--v2s value))
717 (pass1 (mapcar 717 (special (assq nil pass1)))
718 (lambda (el)
719 (let ((res (desktop-internal-v2s el)))
720 (if (null (car res))
721 (setq special t))
722 res))
723 value)))
724 (if special 718 (if special
725 (cons nil (concat "(vector " 719 (cons nil `(vector
726 (mapconcat (lambda (el) 720 ,@(mapcar (lambda (el)
727 (if (eq (car el) 'must) 721 (if (eq (car el) 'must)
728 (concat "'" (cdr el)) 722 `',(cdr el) (cdr el)))
729 (cdr el))) 723 pass1)))
730 pass1 724 (cons 'may `[,@(mapcar #'cdr pass1)]))))
731 " ")
732 ")"))
733 (cons 'may (concat "[" (mapconcat 'cdr pass1 " ") "]")))))
734 ((consp value) 725 ((consp value)
735 (let ((p value) 726 (let ((p value)
736 newlist 727 newlist
737 use-list* 728 use-list*
738 anynil) 729 anynil)
739 (while (consp p) 730 (while (consp p)
740 (let ((q.txt (desktop-internal-v2s (car p)))) 731 (let ((q.sexp (desktop--v2s (car p))))
741 (or anynil (setq anynil (null (car q.txt)))) 732 (push q.sexp newlist))
742 (setq newlist (cons q.txt newlist)))
743 (setq p (cdr p))) 733 (setq p (cdr p)))
744 (if p 734 (when p
745 (let ((last (desktop-internal-v2s p))) 735 (let ((last (desktop--v2s p)))
746 (or anynil (setq anynil (null (car last)))) 736 (setq use-list* t)
747 (or anynil 737 (push last newlist)))
748 (setq newlist (cons '(must . ".") newlist))) 738 (if (assq nil newlist)
749 (setq use-list* t)
750 (setq newlist (cons last newlist))))
751 (setq newlist (nreverse newlist))
752 (if anynil
753 (cons nil 739 (cons nil
754 (concat (if use-list* "(desktop-list* " "(list ") 740 `(,(if use-list* 'desktop-list* 'list)
755 (mapconcat (lambda (el) 741 ,@(mapcar (lambda (el)
756 (if (eq (car el) 'must) 742 (if (eq (car el) 'must)
757 (concat "'" (cdr el)) 743 `',(cdr el) (cdr el)))
758 (cdr el))) 744 (nreverse newlist))))
759 newlist
760 " ")
761 ")"))
762 (cons 'must 745 (cons 'must
763 (concat "(" (mapconcat 'cdr newlist " ") ")"))))) 746 `(,@(mapcar #'cdr
747 (nreverse (if use-list* (cdr newlist) newlist)))
748 ,@(if use-list* (cdar newlist)))))))
764 ((subrp value) 749 ((subrp value)
765 (cons nil (concat "(symbol-function '" 750 (cons nil `(symbol-function
766 (substring (prin1-to-string value) 7 -1) 751 ',(intern-soft (substring (prin1-to-string value) 7 -1)))))
767 ")")))
768 ((markerp value) 752 ((markerp value)
769 (let ((pos (prin1-to-string (marker-position value))) 753 (let ((pos (marker-position value))
770 (buf (prin1-to-string (buffer-name (marker-buffer value))))) 754 (buf (buffer-name (marker-buffer value))))
771 (cons nil (concat "(let ((mk (make-marker)))" 755 (cons nil
772 " (add-hook 'desktop-delay-hook" 756 `(let ((mk (make-marker)))
773 " (list 'lambda '() (list 'set-marker mk " 757 (add-hook 'desktop-delay-hook
774 pos " (get-buffer " buf ")))) mk)")))) 758 `(lambda ()
775 (t ; save as text 759 (set-marker ,mk ,,pos (get-buffer ,,buf))))
776 (cons 'may "\"Unprintable entity\"")))) 760 mk))))
761 (t ; Save as text.
762 (cons 'may "Unprintable entity"))))
777 763
778;; ---------------------------------------------------------------------------- 764;; ----------------------------------------------------------------------------
779(defun desktop-value-to-string (value) 765(defun desktop-value-to-string (value)
@@ -781,9 +767,11 @@ QUOTE may be `may' (value may be quoted),
781Not all types of values are supported." 767Not all types of values are supported."
782 (let* ((print-escape-newlines t) 768 (let* ((print-escape-newlines t)
783 (float-output-format nil) 769 (float-output-format nil)
784 (quote.txt (desktop-internal-v2s value)) 770 (quote.sexp (desktop--v2s value))
785 (quote (car quote.txt)) 771 (quote (car quote.sexp))
786 (txt (cdr quote.txt))) 772 (txt
773 (let ((print-quoted t))
774 (prin1-to-string (cdr quote.sexp)))))
787 (if (eq quote 'must) 775 (if (eq quote 'must)
788 (concat "'" txt) 776 (concat "'" txt)
789 txt))) 777 txt)))
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index ee77f397746..6217f5d0a3f 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -326,7 +326,7 @@ of the page moves to the previous page."
326 (delete-overlay ol)) 326 (delete-overlay ol))
327 (image-mode-window-put 'overlay ol winprops) 327 (image-mode-window-put 'overlay ol winprops)
328 (when (windowp (car winprops)) 328 (when (windowp (car winprops))
329 (if (stringp (get-char-property (point-min) 'display)) 329 (if (stringp (overlay-get ol 'display))
330 ;; We're not already displaying an image, so this is the 330 ;; We're not already displaying an image, so this is the
331 ;; initial window showing the document. 331 ;; initial window showing the document.
332 (run-with-timer nil nil 332 (run-with-timer nil nil
@@ -338,12 +338,11 @@ of the page moves to the previous page."
338 (with-selected-window (car winprops) 338 (with-selected-window (car winprops)
339 (doc-view-goto-page 1))))) 339 (doc-view-goto-page 1)))))
340 ;; We've split the window showing the document. All we need 340 ;; We've split the window showing the document. All we need
341 ;; to do is selecting the new window to make the image appear 341 ;; to do is selecting the new window to cause a redisplay to
342 ;; there, too. 342 ;; make the image appear there, too.
343 (run-with-timer nil nil 343 (run-with-timer nil nil
344 (lambda () 344 (lambda ()
345 (save-window-excursion 345 (with-selected-window (car winprops))))))))
346 (select-window (car winprops)))))))))
347 346
348(defvar doc-view-current-files nil 347(defvar doc-view-current-files nil
349 "Only used internally.") 348 "Only used internally.")
@@ -1026,7 +1025,7 @@ Start by converting PAGES, and then the rest."
1026 ;; not sufficient. 1025 ;; not sufficient.
1027 (dolist (win (get-buffer-window-list (current-buffer) nil 'visible)) 1026 (dolist (win (get-buffer-window-list (current-buffer) nil 'visible))
1028 (with-selected-window win 1027 (with-selected-window win
1029 (when (stringp (get-char-property (point-min) 'display)) 1028 (when (stringp (overlay-get (doc-view-current-overlay) 'display))
1030 (doc-view-goto-page (doc-view-current-page))))) 1029 (doc-view-goto-page (doc-view-current-page)))))
1031 ;; Convert the rest of the pages. 1030 ;; Convert the rest of the pages.
1032 (doc-view-pdf/ps->png pdf png))))))) 1031 (doc-view-pdf/ps->png pdf png)))))))
diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el
index f88cb0ef9bb..e1e1847dd59 100644
--- a/lisp/emacs-lisp/crm.el
+++ b/lisp/emacs-lisp/crm.el
@@ -287,7 +287,8 @@ INHERIT-INPUT-METHOD."
287 prompt initial-input map 287 prompt initial-input map
288 nil hist def inherit-input-method))) 288 nil hist def inherit-input-method)))
289 (and def (string-equal input "") (setq input def)) 289 (and def (string-equal input "") (setq input def))
290 (split-string input crm-separator))) 290 ;; Ignore empty strings in the list of return values.
291 (split-string input crm-separator t)))
291 (remove-hook 'choose-completion-string-functions 292 (remove-hook 'choose-completion-string-functions
292 'crm--choose-completion-string))) 293 'crm--choose-completion-string)))
293 294
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 4cbd02a6e0d..41b02da82fe 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -3875,7 +3875,10 @@ Options:
3875 ;; If the user kills the buffer in which edebug is currently active, 3875 ;; If the user kills the buffer in which edebug is currently active,
3876 ;; exit to top level, because the edebug command loop can't usefully 3876 ;; exit to top level, because the edebug command loop can't usefully
3877 ;; continue running in such a case. 3877 ;; continue running in such a case.
3878 (add-hook 'kill-buffer-hook 'edebug-kill-buffer nil t) 3878 ;;
3879 ;; Append `edebug-kill-buffer' to the hook to avoid interfering with
3880 ;; other entries that are ungarded against deleted buffer.
3881 (add-hook 'kill-buffer-hook 'edebug-kill-buffer t t)
3879 (use-local-map edebug-mode-map)) 3882 (use-local-map edebug-mode-map))
3880 3883
3881(defun edebug-kill-buffer () 3884(defun edebug-kill-buffer ()
diff --git a/lisp/emacs-lisp/eieio-datadebug.el b/lisp/emacs-lisp/eieio-datadebug.el
index 7daa24257a1..d3ae8b191e1 100644
--- a/lisp/emacs-lisp/eieio-datadebug.el
+++ b/lisp/emacs-lisp/eieio-datadebug.el
@@ -80,38 +80,39 @@ PREBUTTONTEXT is some text between PREFIX and the object button."
80;; Each object should have an opportunity to show stuff about itself. 80;; Each object should have an opportunity to show stuff about itself.
81 81
82(defmethod data-debug/eieio-insert-slots ((obj eieio-default-superclass) 82(defmethod data-debug/eieio-insert-slots ((obj eieio-default-superclass)
83 prefix) 83 prefix)
84 "Insert the slots of OBJ into the current DDEBUG buffer." 84 "Insert the slots of OBJ into the current DDEBUG buffer."
85 (data-debug-insert-thing (eieio-object-name-string obj) 85 (let ((inhibit-read-only t))
86 prefix 86 (data-debug-insert-thing (eieio-object-name-string obj)
87 "Name: ") 87 prefix
88 (let* ((cl (eieio-object-class obj)) 88 "Name: ")
89 (cv (class-v cl))) 89 (let* ((cl (eieio-object-class obj))
90 (data-debug-insert-thing (class-constructor cl) 90 (cv (class-v cl)))
91 prefix 91 (data-debug-insert-thing (class-constructor cl)
92 "Class: ") 92 prefix
93 ;; Loop over all the public slots 93 "Class: ")
94 (let ((publa (eieio--class-public-a cv)) 94 ;; Loop over all the public slots
95 ) 95 (let ((publa (eieio--class-public-a cv))
96 (while publa 96 )
97 (if (slot-boundp obj (car publa)) 97 (while publa
98 (let* ((i (class-slot-initarg cl (car publa))) 98 (if (slot-boundp obj (car publa))
99 (v (eieio-oref obj (car publa)))) 99 (let* ((i (class-slot-initarg cl (car publa)))
100 (data-debug-insert-thing 100 (v (eieio-oref obj (car publa))))
101 v prefix (concat 101 (data-debug-insert-thing
102 (if i (symbol-name i) 102 v prefix (concat
103 (symbol-name (car publa))) 103 (if i (symbol-name i)
104 " "))) 104 (symbol-name (car publa)))
105 ;; Unbound case 105 " ")))
106 (let ((i (class-slot-initarg cl (car publa)))) 106 ;; Unbound case
107 (data-debug-insert-custom 107 (let ((i (class-slot-initarg cl (car publa))))
108 "#unbound" prefix 108 (data-debug-insert-custom
109 (concat (if i (symbol-name i) 109 "#unbound" prefix
110 (symbol-name (car publa))) 110 (concat (if i (symbol-name i)
111 " ") 111 (symbol-name (car publa)))
112 'font-lock-keyword-face)) 112 " ")
113 ) 113 'font-lock-keyword-face))
114 (setq publa (cdr publa)))))) 114 )
115 (setq publa (cdr publa)))))))
115 116
116;;; Augment the Data debug thing display list. 117;;; Augment the Data debug thing display list.
117(data-debug-add-specialized-thing (lambda (thing) (object-p thing)) 118(data-debug-add-specialized-thing (lambda (thing) (object-p thing))
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 5a6b486dcd0..4efbdcb22cb 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -146,6 +146,10 @@ directly. Instead, use `eldoc-add-command' and `eldoc-remove-command'.")
146 "Idle time delay currently in use by timer. 146 "Idle time delay currently in use by timer.
147This is used to determine if `eldoc-idle-delay' is changed by the user.") 147This is used to determine if `eldoc-idle-delay' is changed by the user.")
148 148
149(defvar eldoc-message-function 'eldoc-minibuffer-message
150 "The function used by `eldoc-message' to display messages.
151It should receive the same arguments as `message'.")
152
149 153
150;;;###autoload 154;;;###autoload
151(define-minor-mode eldoc-mode 155(define-minor-mode eldoc-mode
@@ -170,6 +174,20 @@ expression point is on."
170 (remove-hook 'pre-command-hook 'eldoc-pre-command-refresh-echo-area))) 174 (remove-hook 'pre-command-hook 'eldoc-pre-command-refresh-echo-area)))
171 175
172;;;###autoload 176;;;###autoload
177(define-minor-mode eldoc-post-insert-mode nil
178 :group 'eldoc :lighter (:eval (if eldoc-mode ""
179 (concat eldoc-minor-mode-string "|i")))
180 (setq eldoc-last-message nil)
181 (let ((prn-info (lambda ()
182 (unless eldoc-mode
183 (eldoc-print-current-symbol-info)))))
184 (if eldoc-post-insert-mode
185 (add-hook 'post-self-insert-hook prn-info nil t)
186 (remove-hook 'post-self-insert-hook prn-info t))))
187
188(add-hook 'eval-expression-minibuffer-setup-hook 'eldoc-post-insert-mode)
189
190;;;###autoload
173(defun turn-on-eldoc-mode () 191(defun turn-on-eldoc-mode ()
174 "Unequivocally turn on ElDoc mode (see command `eldoc-mode')." 192 "Unequivocally turn on ElDoc mode (see command `eldoc-mode')."
175 (interactive) 193 (interactive)
@@ -180,14 +198,46 @@ expression point is on."
180 (or (and eldoc-timer 198 (or (and eldoc-timer
181 (memq eldoc-timer timer-idle-list)) 199 (memq eldoc-timer timer-idle-list))
182 (setq eldoc-timer 200 (setq eldoc-timer
183 (run-with-idle-timer eldoc-idle-delay t 201 (run-with-idle-timer
184 'eldoc-print-current-symbol-info))) 202 eldoc-idle-delay t
203 (lambda () (and eldoc-mode (eldoc-print-current-symbol-info))))))
185 204
186 ;; If user has changed the idle delay, update the timer. 205 ;; If user has changed the idle delay, update the timer.
187 (cond ((not (= eldoc-idle-delay eldoc-current-idle-delay)) 206 (cond ((not (= eldoc-idle-delay eldoc-current-idle-delay))
188 (setq eldoc-current-idle-delay eldoc-idle-delay) 207 (setq eldoc-current-idle-delay eldoc-idle-delay)
189 (timer-set-idle-time eldoc-timer eldoc-idle-delay t)))) 208 (timer-set-idle-time eldoc-timer eldoc-idle-delay t))))
190 209
210(defvar eldoc-mode-line-string nil)
211(put 'eldoc-mode-line-string 'risky-local-variable t)
212
213(defun eldoc-minibuffer-message (format-string &rest args)
214 "Display messages in the mode-line when in the minibuffer.
215Otherwise work like `message'."
216 (if (minibufferp)
217 (progn
218 (with-current-buffer
219 (window-buffer
220 (or (window-in-direction 'above (minibuffer-window))
221 (minibuffer-selected-window)
222 (get-largest-window)))
223 (unless (and (listp mode-line-format)
224 (assq 'eldoc-mode-line-string mode-line-format))
225 (setq mode-line-format
226 (list "" '(eldoc-mode-line-string
227 (" " eldoc-mode-line-string " "))
228 mode-line-format))))
229 (add-hook 'minibuffer-exit-hook
230 (lambda () (setq eldoc-mode-line-string nil))
231 nil t)
232 (cond
233 ((null format-string)
234 (setq eldoc-mode-line-string nil))
235 ((stringp format-string)
236 (setq eldoc-mode-line-string
237 (apply 'format format-string args))))
238 (force-mode-line-update))
239 (apply 'message format-string args)))
240
191(defun eldoc-message (&rest args) 241(defun eldoc-message (&rest args)
192 (let ((omessage eldoc-last-message)) 242 (let ((omessage eldoc-last-message))
193 (setq eldoc-last-message 243 (setq eldoc-last-message
@@ -203,8 +253,9 @@ expression point is on."
203 ;; they are Legion. 253 ;; they are Legion.
204 ;; Emacs way of preventing log messages. 254 ;; Emacs way of preventing log messages.
205 (let ((message-log-max nil)) 255 (let ((message-log-max nil))
206 (cond (eldoc-last-message (message "%s" eldoc-last-message)) 256 (cond (eldoc-last-message
207 (omessage (message nil))))) 257 (funcall eldoc-message-function "%s" eldoc-last-message))
258 (omessage (funcall eldoc-message-function nil)))))
208 eldoc-last-message) 259 eldoc-last-message)
209 260
210;; This function goes on pre-command-hook for XEmacs or when using idle 261;; This function goes on pre-command-hook for XEmacs or when using idle
@@ -236,11 +287,7 @@ expression point is on."
236(defun eldoc-display-message-no-interference-p () 287(defun eldoc-display-message-no-interference-p ()
237 (and eldoc-mode 288 (and eldoc-mode
238 (not executing-kbd-macro) 289 (not executing-kbd-macro)
239 (not (and (boundp 'edebug-active) edebug-active)) 290 (not (and (boundp 'edebug-active) edebug-active))))
240 ;; Having this mode operate in an active minibuffer/echo area causes
241 ;; interference with what's going on there.
242 (not cursor-in-echo-area)
243 (not (eq (selected-window) (minibuffer-window)))))
244 291
245 292
246;;;###autoload 293;;;###autoload
@@ -262,7 +309,7 @@ Emacs Lisp mode) that support ElDoc.")
262 309
263(defun eldoc-print-current-symbol-info () 310(defun eldoc-print-current-symbol-info ()
264 (condition-case err 311 (condition-case err
265 (and (eldoc-display-message-p) 312 (and (or (eldoc-display-message-p) eldoc-post-insert-mode)
266 (if eldoc-documentation-function 313 (if eldoc-documentation-function
267 (eldoc-message (funcall eldoc-documentation-function)) 314 (eldoc-message (funcall eldoc-documentation-function))
268 (let* ((current-symbol (eldoc-current-symbol)) 315 (let* ((current-symbol (eldoc-current-symbol))
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 4ebaa0a49d5..b528dd11316 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1436,6 +1436,8 @@ Any non-integer value means do not use a different value of
1436 :type '(choice (integer) 1436 :type '(choice (integer)
1437 (const :tag "Use the current `fill-column'" t)) 1437 (const :tag "Use the current `fill-column'" t))
1438 :group 'lisp) 1438 :group 'lisp)
1439(put 'emacs-lisp-docstring-fill-column 'safe-local-variable
1440 (lambda (x) (or (eq x t) (integerp x))))
1439 1441
1440(defun lisp-fill-paragraph (&optional justify) 1442(defun lisp-fill-paragraph (&optional justify)
1441 "Like \\[fill-paragraph], but handle Emacs Lisp comments and docstrings. 1443 "Like \\[fill-paragraph], but handle Emacs Lisp comments and docstrings.
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index eb3fa8f3b09..18cc0e811ce 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -1631,31 +1631,34 @@ to which that point should be aligned, if we were to reindent it.")
1631(defun smie-auto-fill () 1631(defun smie-auto-fill ()
1632 (let ((fc (current-fill-column))) 1632 (let ((fc (current-fill-column)))
1633 (while (and fc (> (current-column) fc)) 1633 (while (and fc (> (current-column) fc))
1634 (cond 1634 (or (unless (or (nth 8 (save-excursion
1635 ((not (or (nth 8 (save-excursion 1635 (syntax-ppss (line-beginning-position))))
1636 (syntax-ppss (line-beginning-position)))) 1636 (nth 8 (syntax-ppss)))
1637 (nth 8 (syntax-ppss)))) 1637 (save-excursion
1638 (save-excursion 1638 (let ((end (point))
1639 (beginning-of-line) 1639 (bsf (progn (beginning-of-line)
1640 (smie-indent-forward-token) 1640 (smie-indent-forward-token)
1641 (let ((bsf (point)) 1641 (point)))
1642 (gain 0) 1642 (gain 0)
1643 curcol) 1643 curcol)
1644 (while (<= (setq curcol (current-column)) fc) 1644 (while (and (<= (point) end)
1645 ;; FIXME? `smie-indent-calculate' can (and often will) 1645 (<= (setq curcol (current-column)) fc))
1646 ;; return a result that actually depends on the presence/absence 1646 ;; FIXME? `smie-indent-calculate' can (and often will)
1647 ;; of a newline, so the gain computed here may not be accurate, 1647 ;; return a result that actually depends on the
1648 ;; but in practice it seems to works well enough. 1648 ;; presence/absence of a newline, so the gain computed here
1649 (let* ((newcol (smie-indent-calculate)) 1649 ;; may not be accurate, but in practice it seems to works
1650 (newgain (- curcol newcol))) 1650 ;; well enough.
1651 (when (> newgain gain) 1651 (let* ((newcol (smie-indent-calculate))
1652 (setq gain newgain) 1652 (newgain (- curcol newcol)))
1653 (setq bsf (point)))) 1653 (when (> newgain gain)
1654 (smie-indent-forward-token)) 1654 (setq gain newgain)
1655 (when (> gain 0) 1655 (setq bsf (point))))
1656 (goto-char bsf) 1656 (smie-indent-forward-token))
1657 (newline-and-indent))))) 1657 (when (> gain 0)
1658 (t (do-auto-fill)))))) 1658 (goto-char bsf)
1659 (newline-and-indent)
1660 'done))))
1661 (do-auto-fill)))))
1659 1662
1660 1663
1661(defun smie-setup (grammar rules-function &rest keywords) 1664(defun smie-setup (grammar rules-function &rest keywords)
diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el
index c1c4d4730f9..c5429c59bd6 100644
--- a/lisp/eshell/em-prompt.el
+++ b/lisp/eshell/em-prompt.el
@@ -122,6 +122,7 @@ arriving, or after."
122 (add-text-properties 0 (length prompt) 122 (add-text-properties 0 (length prompt)
123 '(read-only t 123 '(read-only t
124 face eshell-prompt 124 face eshell-prompt
125 front-sticky (face read-only)
125 rear-nonsticky (face read-only)) 126 rear-nonsticky (face read-only))
126 prompt)) 127 prompt))
127 (eshell-interactive-print prompt))) 128 (eshell-interactive-print prompt)))
diff --git a/lisp/files.el b/lisp/files.el
index 9da9ac6fd53..06958622d14 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1516,7 +1516,10 @@ expand wildcards (if any) and replace the file with multiple files."
1516(defvar kill-buffer-hook nil 1516(defvar kill-buffer-hook nil
1517 "Hook run when a buffer is killed. 1517 "Hook run when a buffer is killed.
1518The buffer being killed is current while the hook is running. 1518The buffer being killed is current while the hook is running.
1519See `kill-buffer'.") 1519See `kill-buffer'.
1520
1521Note: Be careful with let-binding this hook considering it is
1522frequently used for cleanup.")
1520 1523
1521(defun find-alternate-file (filename &optional wildcards) 1524(defun find-alternate-file (filename &optional wildcards)
1522 "Find file FILENAME, select its buffer, kill previous buffer. 1525 "Find file FILENAME, select its buffer, kill previous buffer.
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 9436012ee59..f9b75243494 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -2323,12 +2323,12 @@ in which C preprocessor directives are used. e.g. `asm-mode' and
2323 "\\_>") 2323 "\\_>")
2324 . 1) 2324 . 1)
2325 ;; Exit/Feature symbols as constants. 2325 ;; Exit/Feature symbols as constants.
2326 (,(concat "(\\(catch\\|throw\\|featurep\\|provide\\|require\\)\\>" 2326 (,(concat "(\\(catch\\|throw\\|featurep\\|provide\\|require\\)\\_>"
2327 "[ \t']*\\(\\(?:\\sw\\|\\s_\\)+\\)?") 2327 "[ \t']*\\(\\(?:\\sw\\|\\s_\\)+\\)?")
2328 (1 font-lock-keyword-face) 2328 (1 font-lock-keyword-face)
2329 (2 font-lock-constant-face nil t)) 2329 (2 font-lock-constant-face nil t))
2330 ;; Erroneous structures. 2330 ;; Erroneous structures.
2331 ("(\\(abort\\|assert\\|warn\\|check-type\\|cerror\\|error\\|signal\\)\\>" 1 font-lock-warning-face) 2331 ("(\\(abort\\|assert\\|warn\\|check-type\\|cerror\\|error\\|signal\\)\\_>" 1 font-lock-warning-face)
2332 ;; Words inside \\[] tend to be for `substitute-command-keys'. 2332 ;; Words inside \\[] tend to be for `substitute-command-keys'.
2333 ("\\\\\\\\\\[\\(\\(?:\\sw\\|\\s_\\)+\\)\\]" 2333 ("\\\\\\\\\\[\\(\\(?:\\sw\\|\\s_\\)+\\)\\]"
2334 (1 font-lock-constant-face prepend)) 2334 (1 font-lock-constant-face prepend))
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 870164023d5..9fffc4f1a45 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,15 @@
12013-03-26 Andrew Cohen <cohen@bu.edu>
2
3 * nnir.el: Major rewrite. Cleaner separation between searches and group
4 management. Marks are now shown in nnir summary buffers. Rudimentary
5 support for real (i.e. not ephemeral) nnir groups.
6 (gnus-summary-make-nnir-group): New function for initiating searches
7 from a summary buffer.
8
92013-03-18 Sam Steingold <sds@gnu.org>
10
11 * message.el (message-bury): Minor cleanup.
12
12013-03-06 Katsumi Yamaoka <yamaoka@jpl.org> 132013-03-06 Katsumi Yamaoka <yamaoka@jpl.org>
2 14
3 * nndir.el (nndir-request-list): Remove 2nd argument passed to 15 * nndir.el (nndir-request-list): Remove 2nd argument passed to
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index a6638097b47..2b2a0a94413 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -4097,11 +4097,9 @@ Instead, just auto-save the buffer and then bury it."
4097 4097
4098(defun message-bury (buffer) 4098(defun message-bury (buffer)
4099 "Bury this mail BUFFER." 4099 "Bury this mail BUFFER."
4100 (if message-return-action 4100 (bury-buffer buffer)
4101 (progn 4101 (when message-return-action
4102 (bury-buffer buffer) 4102 (apply (car message-return-action) (cdr message-return-action))))
4103 (apply (car message-return-action) (cdr message-return-action)))
4104 (with-current-buffer buffer (bury-buffer))))
4105 4103
4106(defun message-send (&optional arg) 4104(defun message-send (&optional arg)
4107 "Send the message in the current buffer. 4105 "Send the message in the current buffer.
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el
index cf5a813c5a8..cabd08b0653 100644
--- a/lisp/gnus/nnir.el
+++ b/lisp/gnus/nnir.el
@@ -29,10 +29,6 @@
29 29
30;;; Commentary: 30;;; Commentary:
31 31
32;; TODO: Documentation in the Gnus manual
33
34;; Where in the existing gnus manual would this fit best?
35
36;; What does it do? Well, it allows you to search your mail using 32;; What does it do? Well, it allows you to search your mail using
37;; some search engine (imap, namazu, swish-e, gmane and others -- see 33;; some search engine (imap, namazu, swish-e, gmane and others -- see
38;; later) by typing `G G' in the Group buffer. You will then get a 34;; later) by typing `G G' in the Group buffer. You will then get a
@@ -136,17 +132,26 @@
136;; other backend. 132;; other backend.
137 133
138;; The interface between the two layers consists of the single 134;; The interface between the two layers consists of the single
139;; function `nnir-run-query', which just selects the appropriate 135;; function `nnir-run-query', which dispatches the search to the
140;; function for the search engine one is using. The input to 136;; proper search function. The argument of `nnir-run-query' is an
141;; `nnir-run-query' is a string, representing the query as input by 137;; alist with two keys: 'nnir-query-spec and 'nnir-group-spec. The
142;; the user. The output of `nnir-run-query' is supposed to be a 138;; value for 'nnir-query-spec is an alist. The only required key/value
143;; vector, each element of which should in turn be a three-element 139;; pair is (query . "query") specifying the search string to pass to
144;; vector. The first element should be full group name of the article, 140;; the query engine. Individual engines may have other elements. The
145;; the second element should be the article number, and the third 141;; value of 'nnir-group-spec is a list with the specification of the
146;; element should be the Retrieval Status Value (RSV) as returned from 142;; groups/servers to search. The format of the 'nnir-group-spec is
147;; the search engine. An RSV is the score assigned to the document by 143;; (("server1" ("group11" "group12")) ("server2" ("group21"
148;; the search engine. For Boolean search engines, the 144;; "group22"))). If any of the group lists is absent then all groups
149;; RSV is always 1000 (or 1 or 100, or whatever you like). 145;; on that server are searched.
146
147;; The output of `nnir-run-query' is supposed to be a vector, each
148;; element of which should in turn be a three-element vector. The
149;; first element should be full group name of the article, the second
150;; element should be the article number, and the third element should
151;; be the Retrieval Status Value (RSV) as returned from the search
152;; engine. An RSV is the score assigned to the document by the search
153;; engine. For Boolean search engines, the RSV is always 1000 (or 1
154;; or 100, or whatever you like).
150 155
151;; The sorting order of the articles in the summary buffer created by 156;; The sorting order of the articles in the summary buffer created by
152;; nnir is based on the order of the articles in the above mentioned 157;; nnir is based on the order of the articles in the above mentioned
@@ -179,26 +184,21 @@
179 184
180;;; Internal Variables: 185;;; Internal Variables:
181 186
182(defvar nnir-current-query nil 187(defvar nnir-memo-query nil
183 "Internal: stores current query (= group name).") 188 "Internal: stores current query.")
184
185(defvar nnir-current-server nil
186 "Internal: stores current server (does it ever change?).")
187 189
188(defvar nnir-current-group-marked nil 190(defvar nnir-memo-server nil
189 "Internal: stores current list of process-marked groups.") 191 "Internal: stores current server.")
190 192
191(defvar nnir-artlist nil 193(defvar nnir-artlist nil
192 "Internal: stores search result.") 194 "Internal: stores search result.")
193 195
194(defvar nnir-tmp-buffer " *nnir*"
195 "Internal: temporary buffer.")
196
197(defvar nnir-search-history () 196(defvar nnir-search-history ()
198 "Internal: the history for querying search options in nnir") 197 "Internal: the history for querying search options in nnir")
199 198
200(defvar nnir-extra-parms nil 199(defconst nnir-tmp-buffer " *nnir*"
201 "Internal: stores request for extra search parms") 200 "Internal: temporary buffer.")
201
202 202
203;; Imap variables 203;; Imap variables
204 204
@@ -290,14 +290,14 @@ is `(valuefunc member)'."
290 (autoload 'nnimap-command "nnimap") 290 (autoload 'nnimap-command "nnimap")
291 (autoload 'nnimap-possibly-change-group "nnimap") 291 (autoload 'nnimap-possibly-change-group "nnimap")
292 (autoload 'nnimap-make-thread-query "nnimap") 292 (autoload 'nnimap-make-thread-query "nnimap")
293 (autoload 'gnus-registry-action "gnus-registry")) 293 (autoload 'gnus-registry-action "gnus-registry")
294 (autoload 'gnus-registry-get-id-key "gnus-registry")
295 (autoload 'gnus-group-topic-name "gnus-topic"))
296
294 297
295(nnoo-declare nnir) 298(nnoo-declare nnir)
296(nnoo-define-basics nnir) 299(nnoo-define-basics nnir)
297 300
298(defvoo nnir-address nil
299 "The address of the nnir server.")
300
301(gnus-declare-backend "nnir" 'mail 'virtual) 301(gnus-declare-backend "nnir" 'mail 'virtual)
302 302
303 303
@@ -344,7 +344,7 @@ result, `gnus-retrieve-headers' will be called instead."
344(defcustom nnir-imap-default-search-key "whole message" 344(defcustom nnir-imap-default-search-key "whole message"
345 "*The default IMAP search key for an nnir search. Must be one of 345 "*The default IMAP search key for an nnir search. Must be one of
346 the keys in `nnir-imap-search-arguments'. To use raw imap queries 346 the keys in `nnir-imap-search-arguments'. To use raw imap queries
347 by default set this to \"Imap\"." 347 by default set this to \"imap\"."
348 :version "24.1" 348 :version "24.1"
349 :type `(choice ,@(mapcar (lambda (elem) (list 'const (car elem))) 349 :type `(choice ,@(mapcar (lambda (elem) (list 'const (car elem)))
350 nnir-imap-search-arguments)) 350 nnir-imap-search-arguments))
@@ -546,17 +546,17 @@ that it is for notmuch, not Namazu."
546 ,nnir-imap-default-search-key ; default 546 ,nnir-imap-default-search-key ; default
547 ))) 547 )))
548 (gmane nnir-run-gmane 548 (gmane nnir-run-gmane
549 ((author . "Gmane Author: "))) 549 ((gmane-author . "Gmane Author: ")))
550 (swish++ nnir-run-swish++ 550 (swish++ nnir-run-swish++
551 ((group . "Swish++ Group spec: "))) 551 ((swish++-group . "Swish++ Group spec: ")))
552 (swish-e nnir-run-swish-e 552 (swish-e nnir-run-swish-e
553 ((group . "Swish-e Group spec: "))) 553 ((swish-e-group . "Swish-e Group spec: ")))
554 (namazu nnir-run-namazu 554 (namazu nnir-run-namazu
555 ()) 555 ())
556 (notmuch nnir-run-notmuch 556 (notmuch nnir-run-notmuch
557 ()) 557 ())
558 (hyrex nnir-run-hyrex 558 (hyrex nnir-run-hyrex
559 ((group . "Hyrex Group spec: "))) 559 ((hyrex-group . "Hyrex Group spec: ")))
560 (find-grep nnir-run-find-grep 560 (find-grep nnir-run-find-grep
561 ((grep-options . "Grep options: ")))) 561 ((grep-options . "Grep options: "))))
562 "Alist of supported search engines. 562 "Alist of supported search engines.
@@ -576,69 +576,113 @@ needs the variables `nnir-namazu-program',
576 576
577Add an entry here when adding a new search engine.") 577Add an entry here when adding a new search engine.")
578 578
579(defcustom nnir-method-default-engines 579(defcustom nnir-method-default-engines '((nnimap . imap) (nttp . gmane))
580 '((nnimap . imap)
581 (nntp . gmane))
582 "*Alist of default search engines keyed by server method." 580 "*Alist of default search engines keyed by server method."
583 :version "24.1" 581 :version "24.1"
582 :group 'nnir
584 :type `(repeat (cons (choice (const nnimap) (const nttp) (const nnspool) 583 :type `(repeat (cons (choice (const nnimap) (const nttp) (const nnspool)
585 (const nneething) (const nndir) (const nnmbox) 584 (const nneething) (const nndir) (const nnmbox)
586 (const nnml) (const nnmh) (const nndraft) 585 (const nnml) (const nnmh) (const nndraft)
587 (const nnfolder) (const nnmaildir)) 586 (const nnfolder) (const nnmaildir))
588 (choice 587 (choice
589 ,@(mapcar (lambda (elem) (list 'const (car elem))) 588 ,@(mapcar (lambda (elem) (list 'const (car elem)))
590 nnir-engines)))) 589 nnir-engines)))))
591 :group 'nnir)
592 590
593;; Gnus glue. 591;; Gnus glue.
594 592
595(defun gnus-group-make-nnir-group (nnir-extra-parms &optional parms) 593(defun gnus-group-make-nnir-group (nnir-extra-parms &optional specs)
596 "Create an nnir group. Asks for query." 594 "Create an nnir group. Prompt for a search query and determine
595the groups to search as follows: if called from the *Server*
596buffer search all groups belonging to the server on the current
597line; if called from the *Group* buffer search any marked groups,
598or the group on the current line, or all the groups under the
599current topic. Calling with a prefix-arg prompts for additional
600search-engine specific constraints. A non-nil `specs' arg must be
601an alist with `nnir-query-spec' and `nnir-group-spec' keys, and
602skips all prompting."
597 (interactive "P") 603 (interactive "P")
598 (setq nnir-current-query nil 604 (let* ((group-spec
599 nnir-current-server nil 605 (or (cdr (assoc 'nnir-group-spec specs))
600 nnir-current-group-marked nil 606 (if (gnus-server-server-name)
601 nnir-artlist nil) 607 (list (list (gnus-server-server-name)))
602 (let* ((query (unless parms (read-string "Query: " nil 'nnir-search-history))) 608 (nnir-categorize
603 (parms (or parms (list (cons 'query query)))) 609 (or gnus-group-marked
604 (srv (or (cdr (assq 'server parms)) (gnus-server-server-name) "nnir"))) 610 (if (gnus-group-group-name)
605 (add-to-list 'parms (cons 'unique-id (message-unique-id)) t) 611 (list (gnus-group-group-name))
612 (cdr (assoc (gnus-group-topic-name) gnus-topic-alist))))
613 gnus-group-server))))
614 (query-spec
615 (or (cdr (assoc 'nnir-query-spec specs))
616 (apply
617 'append
618 (list (cons 'query
619 (read-string "Query: " nil 'nnir-search-history)))
620 (when nnir-extra-parms
621 (mapcar
622 (lambda (x)
623 (nnir-read-parms (nnir-server-to-search-engine (car x))))
624 group-spec))))))
606 (gnus-group-read-ephemeral-group 625 (gnus-group-read-ephemeral-group
607 (concat "nnir:" (prin1-to-string parms)) (list 'nnir srv) t 626 (concat "nnir-" (message-unique-id))
608 (cons (current-buffer) gnus-current-window-configuration) 627 (list 'nnir "nnir")
609 nil))) 628 nil
629; (cons (current-buffer) gnus-current-window-configuration)
630 nil
631 nil nil
632 (list
633 (cons 'nnir-specs (list (cons 'nnir-query-spec query-spec)
634 (cons 'nnir-group-spec group-spec)))
635 (cons 'nnir-artlist nil)))))
636
637(defun gnus-summary-make-nnir-group (nnir-extra-parms)
638 "Search a group from the summary buffer."
639 (interactive "P")
640 (gnus-warp-to-article)
641 (let ((spec
642 (list
643 (cons 'nnir-group-spec
644 (list (list
645 (gnus-group-server gnus-newsgroup-name)
646 (list gnus-newsgroup-name)))))))
647 (gnus-group-make-nnir-group nnir-extra-parms spec)))
610 648
611 649
612;; Gnus backend interface functions. 650;; Gnus backend interface functions.
613 651
614(deffoo nnir-open-server (server &optional definitions) 652(deffoo nnir-open-server (server &optional definitions)
615 ;; Just set the server variables appropriately. 653 ;; Just set the server variables appropriately.
616 (add-hook 'gnus-summary-mode-hook 'nnir-mode) 654 (let ((backend (car (gnus-server-to-method server))))
617 (nnoo-change-server 'nnir server definitions)) 655 (if backend
618 656 (nnoo-change-server backend server definitions)
619(deffoo nnir-request-group (group &optional server fast info) 657 (add-hook 'gnus-summary-mode-hook 'nnir-mode)
620 "GROUP is the query string." 658 (nnoo-change-server 'nnir server definitions))))
621 (nnir-possibly-change-server server) 659
622 ;; Check for cache and return that if appropriate. 660(deffoo nnir-request-group (group &optional server dont-check info)
623 (if (and (equal group nnir-current-query) 661 (nnir-possibly-change-group group server)
624 (equal gnus-group-marked nnir-current-group-marked) 662 (let ((pgroup (if (gnus-group-prefixed-p group)
625 (or (null server) 663 group
626 (equal server nnir-current-server))) 664 (gnus-group-prefixed-name group '(nnir "nnir"))))
627 nnir-artlist 665 length)
628 ;; Cache miss. 666 ;; Check for cached search result or run the query and cache the
629 (setq nnir-artlist (nnir-run-query group))) 667 ;; result.
630 (with-current-buffer nntp-server-buffer 668 (unless (and nnir-artlist dont-check)
631 (setq nnir-current-query group) 669 (gnus-group-set-parameter
632 (when server (setq nnir-current-server server)) 670 pgroup 'nnir-artlist
633 (setq nnir-current-group-marked gnus-group-marked) 671 (setq nnir-artlist
634 (if (zerop (length nnir-artlist)) 672 (nnir-run-query
635 (nnheader-report 'nnir "Search produced empty results.") 673 (gnus-group-get-parameter pgroup 'nnir-specs t))))
636 ;; Remember data for cache. 674 (nnir-request-update-info pgroup (gnus-get-info pgroup)))
637 (nnheader-insert "211 %d %d %d %s\n" 675 (with-current-buffer nntp-server-buffer
638 (nnir-artlist-length nnir-artlist) ; total # 676 (if (zerop (setq length (nnir-artlist-length nnir-artlist)))
639 1 ; first # 677 (progn
640 (nnir-artlist-length nnir-artlist) ; last # 678 (nnir-close-group group)
641 group)))) ; group name 679 (nnheader-report 'nnir "Search produced empty results."))
680 (nnheader-insert "211 %d %d %d %s\n"
681 length ; total #
682 1 ; first #
683 length ; last #
684 group)))) ; group name
685 nnir-artlist)
642 686
643(deffoo nnir-retrieve-headers (articles &optional group server fetch-old) 687(deffoo nnir-retrieve-headers (articles &optional group server fetch-old)
644 (with-current-buffer nntp-server-buffer 688 (with-current-buffer nntp-server-buffer
@@ -654,13 +698,7 @@ Add an entry here when adding a new search engine.")
654 (server (gnus-group-server artgroup)) 698 (server (gnus-group-server artgroup))
655 (gnus-override-method (gnus-server-to-method server)) 699 (gnus-override-method (gnus-server-to-method server))
656 parsefunc) 700 parsefunc)
657 ;; (or (numberp art) 701 ;; (nnir-possibly-change-group nil server)
658 ;; (nnheader-report
659 ;; 'nnir
660 ;; "nnir-retrieve-headers doesn't grok message ids: %s"
661 ;; art))
662 (nnir-possibly-change-server server)
663 ;; is this needed?
664 (erase-buffer) 702 (erase-buffer)
665 (case (setq gnus-headers-retrieved-by 703 (case (setq gnus-headers-retrieved-by
666 (or 704 (or
@@ -694,6 +732,7 @@ Add an entry here when adding a new search engine.")
694 'nov))) 732 'nov)))
695 733
696(deffoo nnir-request-article (article &optional group server to-buffer) 734(deffoo nnir-request-article (article &optional group server to-buffer)
735 (nnir-possibly-change-group group server)
697 (if (and (stringp article) 736 (if (and (stringp article)
698 (not (eq 'nnimap (car (gnus-server-to-method server))))) 737 (not (eq 'nnimap (car (gnus-server-to-method server)))))
699 (nnheader-report 738 (nnheader-report
@@ -702,35 +741,35 @@ Add an entry here when adding a new search engine.")
702 server) 741 server)
703 (save-excursion 742 (save-excursion
704 (let ((article article) 743 (let ((article article)
705 query) 744 query)
706 (when (stringp article) 745 (when (stringp article)
707 (setq gnus-override-method (gnus-server-to-method server)) 746 (setq gnus-override-method (gnus-server-to-method server))
708 (setq query 747 (setq query
709 (list 748 (list
710 (cons 'query (format "HEADER Message-ID %s" article)) 749 (cons 'query (format "HEADER Message-ID %s" article))
711 (cons 'unique-id article) 750 (cons 'criteria "")
712 (cons 'criteria "") 751 (cons 'shortcut t)))
713 (cons 'shortcut t))) 752 (unless (and nnir-artlist (equal query nnir-memo-query)
714 (unless (and (equal query nnir-current-query) 753 (equal server nnir-memo-server))
715 (equal server nnir-current-server)) 754 (setq nnir-artlist (nnir-run-imap query server)
716 (setq nnir-artlist (nnir-run-imap query server)) 755 nnir-memo-query query
717 (setq nnir-current-query query) 756 nnir-memo-server server))
718 (setq nnir-current-server server)) 757 (setq article 1))
719 (setq article 1)) 758 (unless (zerop (nnir-artlist-length nnir-artlist))
720 (unless (zerop (length nnir-artlist)) 759 (let ((artfullgroup (nnir-article-group article))
721 (let ((artfullgroup (nnir-article-group article)) 760 (artno (nnir-article-number article)))
722 (artno (nnir-article-number article))) 761 (message "Requesting article %d from group %s"
723 (message "Requesting article %d from group %s" 762 artno artfullgroup)
724 artno artfullgroup) 763 (if to-buffer
725 (if to-buffer 764 (with-current-buffer to-buffer
726 (with-current-buffer to-buffer 765 (let ((gnus-article-decode-hook nil))
727 (let ((gnus-article-decode-hook nil)) 766 (gnus-request-article-this-buffer artno artfullgroup)))
728 (gnus-request-article-this-buffer artno artfullgroup))) 767 (gnus-request-article artno artfullgroup))
729 (gnus-request-article artno artfullgroup)) 768 (cons artfullgroup artno)))))))
730 (cons artfullgroup artno)))))))
731 769
732(deffoo nnir-request-move-article (article group server accept-form 770(deffoo nnir-request-move-article (article group server accept-form
733 &optional last internal-move-group) 771 &optional last internal-move-group)
772 (nnir-possibly-change-group group server)
734 (let* ((artfullgroup (nnir-article-group article)) 773 (let* ((artfullgroup (nnir-article-group article))
735 (artno (nnir-article-number article)) 774 (artno (nnir-article-number article))
736 (to-newsgroup (nth 1 accept-form)) 775 (to-newsgroup (nth 1 accept-form))
@@ -751,6 +790,7 @@ Add an entry here when adding a new search engine.")
751 (gnus-group-real-name to-newsgroup))))) 790 (gnus-group-real-name to-newsgroup)))))
752 791
753(deffoo nnir-request-expire-articles (articles group &optional server force) 792(deffoo nnir-request-expire-articles (articles group &optional server force)
793 (nnir-possibly-change-group group server)
754 (if force 794 (if force
755 (let ((articles-by-group (nnir-categorize 795 (let ((articles-by-group (nnir-categorize
756 articles nnir-article-group nnir-article-ids)) 796 articles nnir-article-group nnir-article-ids))
@@ -772,20 +812,79 @@ Add an entry here when adding a new search engine.")
772 articles)) 812 articles))
773 813
774(deffoo nnir-warp-to-article () 814(deffoo nnir-warp-to-article ()
815 (nnir-possibly-change-group gnus-newsgroup-name)
775 (let* ((cur (if (> (gnus-summary-article-number) 0) 816 (let* ((cur (if (> (gnus-summary-article-number) 0)
776 (gnus-summary-article-number) 817 (gnus-summary-article-number)
777 (error "This is not a real article"))) 818 (error "Can't warp to a pseudo-article")))
778 (backend-article-group (nnir-article-group cur)) 819 (backend-article-group (nnir-article-group cur))
779 (backend-article-number (nnir-article-number cur)) 820 (backend-article-number (nnir-article-number cur))
780 (quit-config (gnus-ephemeral-group-p gnus-newsgroup-name))) 821 (quit-config (gnus-ephemeral-group-p gnus-newsgroup-name)))
781 ;; first exit from the nnir summary buffer. 822
782 (gnus-summary-exit) 823 ;; what should we do here? we could leave all the buffers around
824 ;; and assume that we have to exit from them one by one. or we can
825 ;; try to clean up directly
826
827 ;;first exit from the nnir summary buffer.
828; (gnus-summary-exit)
783 ;; and if the nnir summary buffer in turn came from another 829 ;; and if the nnir summary buffer in turn came from another
784 ;; summary buffer we have to clean that summary up too. 830 ;; summary buffer we have to clean that summary up too.
785 (when (eq (cdr quit-config) 'summary) 831 ; (when (not (eq (cdr quit-config) 'group))
786 (gnus-summary-exit)) 832; (gnus-summary-exit))
787 (gnus-summary-read-group-1 backend-article-group t t nil 833 (gnus-summary-read-group-1 backend-article-group t t nil
788 nil (list backend-article-number)))) 834 nil (list backend-article-number))))
835
836
837(deffoo nnir-request-update-info (group info &optional server)
838 (let ((articles-by-group
839 (nnir-categorize
840 (number-sequence 1 (nnir-artlist-length nnir-artlist))
841 nnir-article-group nnir-article-ids)))
842 (gnus-set-active group
843 (cons 1 (nnir-artlist-length nnir-artlist)))
844 (while (not (null articles-by-group))
845 (let* ((group-articles (pop articles-by-group))
846 (articleids (reverse (cadr group-articles)))
847 (group-info (gnus-get-info (car group-articles)))
848 (marks (gnus-info-marks group-info))
849 (read (gnus-info-read group-info)))
850 (gnus-info-set-read
851 info
852 (gnus-add-to-range
853 (gnus-info-read info)
854 (remove nil (mapcar (lambda (art)
855 (let ((num (cdr art)))
856 (when (gnus-member-of-range num read)
857 (car art)))) articleids))))
858 (mapc (lambda (mark)
859 (let ((type (car mark))
860 (range (cdr mark)))
861 (gnus-add-marked-articles
862 group
863 type
864 (remove nil
865 (mapcar
866 (lambda (art)
867 (let ((num (cdr art)))
868 (when (gnus-member-of-range num range)
869 (car art))))
870 articleids))))) marks)))))
871
872
873(deffoo nnir-close-group (group &optional server)
874 (let ((pgroup (if (gnus-group-prefixed-p group)
875 group
876 (gnus-group-prefixed-name group '(nnir "nnir")))))
877 (when (and nnir-artlist (not (gnus-ephemeral-group-p pgroup)))
878 (gnus-group-set-parameter pgroup 'nnir-artlist nnir-artlist))
879 (setq nnir-artlist nil)
880 (when (gnus-ephemeral-group-p pgroup)
881 (gnus-kill-ephemeral-group pgroup)
882 (setq gnus-ephemeral-servers
883 (delq (assq 'nnir gnus-ephemeral-servers)
884 gnus-ephemeral-servers)))))
885;; (gnus-opened-servers-remove
886;; (car (assoc '(nnir "nnir-ephemeral" (nnir-address "nnir"))
887;; gnus-opened-servers))))
789 888
790(nnoo-define-skeleton nnir) 889(nnoo-define-skeleton nnir)
791 890
@@ -813,7 +912,7 @@ ready to be added to the list of search results."
813 ;; remove trailing slash and, for nnmaildir, cur/new/tmp 912 ;; remove trailing slash and, for nnmaildir, cur/new/tmp
814 (setq dirnam 913 (setq dirnam
815 (substring dirnam 0 914 (substring dirnam 0
816 (if (string-match "^nnmaildir:" (gnus-group-server server)) 915 (if (string-match "\\`nnmaildir:" (gnus-group-server server))
817 -5 -1))) 916 -5 -1)))
818 917
819 ;; Set group to dirnam without any leading dots or slashes, 918 ;; Set group to dirnam without any leading dots or slashes,
@@ -823,7 +922,7 @@ ready to be added to the list of search results."
823 "[/\\]" "." t))) 922 "[/\\]" "." t)))
824 923
825 (vector (gnus-group-full-name group server) 924 (vector (gnus-group-full-name group server)
826 (if (string-match "^nnmaildir:" (gnus-group-server server)) 925 (if (string-match "\\`nnmaildir:" (gnus-group-server server))
827 (nnmaildir-base-name-to-article-number 926 (nnmaildir-base-name-to-article-number
828 (substring article 0 (string-match ":" article)) 927 (substring article 0 (string-match ":" article))
829 group nil) 928 group nil)
@@ -850,35 +949,36 @@ details on the language and supported extensions."
850 (apply 949 (apply
851 'vconcat 950 'vconcat
852 (catch 'found 951 (catch 'found
853 (mapcar 952 (mapcar
854 (lambda (group) 953 (lambda (group)
855 (let (artlist) 954 (let (artlist)
856 (condition-case () 955 (condition-case ()
857 (when (nnimap-possibly-change-group 956 (when (nnimap-possibly-change-group
858 (gnus-group-short-name group) server) 957 (gnus-group-short-name group) server)
859 (with-current-buffer (nnimap-buffer) 958 (with-current-buffer (nnimap-buffer)
860 (message "Searching %s..." group) 959 (message "Searching %s..." group)
861 (let ((arts 0) 960 (let ((arts 0)
862 (result (nnimap-command "UID SEARCH %s" 961 (result (nnimap-command "UID SEARCH %s"
863 (if (string= criteria "") 962 (if (string= criteria "")
864 qstring 963 qstring
865 (nnir-imap-make-query 964 (nnir-imap-make-query
866 criteria qstring))))) 965 criteria qstring)))))
867 (mapc 966 (mapc
868 (lambda (artnum) 967 (lambda (artnum)
869 (let ((artn (string-to-number artnum))) 968 (let ((artn (string-to-number artnum)))
870 (when (> artn 0) 969 (when (> artn 0)
871 (push (vector group artn 100) 970 (push (vector group artn 100)
872 artlist) 971 artlist)
873 (when (assq 'shortcut query) 972 (when (assq 'shortcut query)
874 (throw 'found (list artlist))) 973 (throw 'found (list artlist)))
875 (setq arts (1+ arts))))) 974 (setq arts (1+ arts)))))
876 (and (car result) (cdr (assoc "SEARCH" (cdr result))))) 975 (and (car result)
877 (message "Searching %s... %d matches" group arts))) 976 (cdr (assoc "SEARCH" (cdr result)))))
878 (message "Searching %s...done" group)) 977 (message "Searching %s... %d matches" group arts)))
879 (quit nil)) 978 (message "Searching %s...done" group))
880 (nreverse artlist))) 979 (quit nil))
881 groups)))))) 980 (nreverse artlist)))
981 groups))))))
882 982
883(defun nnir-imap-make-query (criteria qstring) 983(defun nnir-imap-make-query (criteria qstring)
884 "Parse the query string and criteria into an appropriate IMAP search 984 "Parse the query string and criteria into an appropriate IMAP search
@@ -1073,14 +1173,14 @@ Windows NT 4.0."
1073 1173
1074 (save-excursion 1174 (save-excursion
1075 (let ( (qstring (cdr (assq 'query query))) 1175 (let ( (qstring (cdr (assq 'query query)))
1076 (groupspec (cdr (assq 'group query))) 1176 (groupspec (cdr (assq 'swish++-group query)))
1077 (prefix (nnir-read-server-parm 'nnir-swish++-remove-prefix server)) 1177 (prefix (nnir-read-server-parm 'nnir-swish++-remove-prefix server))
1078 artlist 1178 artlist
1079 ;; nnml-use-compressed-files might be any string, but probably this 1179 ;; nnml-use-compressed-files might be any string, but probably this
1080 ;; is sufficient. Note that we can't only use the value of 1180 ;; is sufficient. Note that we can't only use the value of
1081 ;; nnml-use-compressed-files because old articles might have been 1181 ;; nnml-use-compressed-files because old articles might have been
1082 ;; saved with a different value. 1182 ;; saved with a different value.
1083 (article-pattern (if (string-match "^nnmaildir:" 1183 (article-pattern (if (string-match "\\`nnmaildir:"
1084 (gnus-group-server server)) 1184 (gnus-group-server server))
1085 ":[0-9]+" 1185 ":[0-9]+"
1086 "^[0-9]+\\(\\.[a-z0-9]+\\)?$")) 1186 "^[0-9]+\\(\\.[a-z0-9]+\\)?$"))
@@ -1247,7 +1347,7 @@ Tested with swish-e-2.0.1 on Windows NT 4.0."
1247(defun nnir-run-hyrex (query server &optional group) 1347(defun nnir-run-hyrex (query server &optional group)
1248 (save-excursion 1348 (save-excursion
1249 (let ((artlist nil) 1349 (let ((artlist nil)
1250 (groupspec (cdr (assq 'group query))) 1350 (groupspec (cdr (assq 'hyrex-group query)))
1251 (qstring (cdr (assq 'query query))) 1351 (qstring (cdr (assq 'query query)))
1252 (prefix (nnir-read-server-parm 'nnir-hyrex-remove-prefix server)) 1352 (prefix (nnir-read-server-parm 'nnir-hyrex-remove-prefix server))
1253 score artno dirnam) 1353 score artno dirnam)
@@ -1323,7 +1423,7 @@ Tested with Namazu 2.0.6 on a GNU/Linux system."
1323 ;; (when group 1423 ;; (when group
1324 ;; (error "The Namazu backend cannot search specific groups")) 1424 ;; (error "The Namazu backend cannot search specific groups"))
1325 (save-excursion 1425 (save-excursion
1326 (let ((article-pattern (if (string-match "^nnmaildir:" 1426 (let ((article-pattern (if (string-match "\\`nnmaildir:"
1327 (gnus-group-server server)) 1427 (gnus-group-server server))
1328 ":[0-9]+" 1428 ":[0-9]+"
1329 "^[0-9]+$")) 1429 "^[0-9]+$"))
@@ -1394,10 +1494,10 @@ actually)."
1394 1494
1395 (save-excursion 1495 (save-excursion
1396 (let ( (qstring (cdr (assq 'query query))) 1496 (let ( (qstring (cdr (assq 'query query)))
1397 (groupspec (cdr (assq 'group query))) 1497 (groupspec (cdr (assq 'notmuch-group query)))
1398 (prefix (nnir-read-server-parm 'nnir-notmuch-remove-prefix server)) 1498 (prefix (nnir-read-server-parm 'nnir-notmuch-remove-prefix server))
1399 artlist 1499 artlist
1400 (article-pattern (if (string-match "^nnmaildir:" 1500 (article-pattern (if (string-match "\\`nnmaildir:"
1401 (gnus-group-server server)) 1501 (gnus-group-server server))
1402 ":[0-9]+" 1502 ":[0-9]+"
1403 "^[0-9]+$")) 1503 "^[0-9]+$"))
@@ -1467,24 +1567,23 @@ actually)."
1467 (directory (cadr (assoc sym (cddr method)))) 1567 (directory (cadr (assoc sym (cddr method))))
1468 (regexp (cdr (assoc 'query query))) 1568 (regexp (cdr (assoc 'query query)))
1469 (grep-options (cdr (assoc 'grep-options query))) 1569 (grep-options (cdr (assoc 'grep-options query)))
1470 (grouplist (or grouplist (nnir-get-active server))) 1570 (grouplist (or grouplist (nnir-get-active server))))
1471 artlist)
1472 (unless directory 1571 (unless directory
1473 (error "No directory found in method specification of server %s" 1572 (error "No directory found in method specification of server %s"
1474 server)) 1573 server))
1475 (apply 1574 (apply
1476 'vconcat 1575 'vconcat
1477 (mapcar (lambda (x) 1576 (mapcar (lambda (x)
1478 (let ((group x)) 1577 (let ((group x)
1578 artlist)
1479 (message "Searching %s using find-grep..." 1579 (message "Searching %s using find-grep..."
1480 (or group server)) 1580 (or group server))
1481 (save-window-excursion 1581 (save-window-excursion
1482 (set-buffer (get-buffer-create nnir-tmp-buffer)) 1582 (set-buffer (get-buffer-create nnir-tmp-buffer))
1483 (erase-buffer)
1484 (if (> gnus-verbose 6) 1583 (if (> gnus-verbose 6)
1485 (pop-to-buffer (current-buffer))) 1584 (pop-to-buffer (current-buffer)))
1486 (cd directory) ; Using relative paths simplifies 1585 (cd directory) ; Using relative paths simplifies
1487 ; postprocessing. 1586 ; postprocessing.
1488 (let ((group 1587 (let ((group
1489 (if (not group) 1588 (if (not group)
1490 "." 1589 "."
@@ -1507,7 +1606,8 @@ actually)."
1507 (save-excursion 1606 (save-excursion
1508 (apply 1607 (apply
1509 'call-process "find" nil t 1608 'call-process "find" nil t
1510 "find" group "-type" "f" "-name" "[0-9]*" "-exec" 1609 "find" group "-maxdepth" "1" "-type" "f"
1610 "-name" "[0-9]*" "-exec"
1511 "grep" 1611 "grep"
1512 `("-l" ,@(and grep-options 1612 `("-l" ,@(and grep-options
1513 (split-string grep-options "\\s-" t)) 1613 (split-string grep-options "\\s-" t))
@@ -1557,8 +1657,8 @@ actually)."
1557 (error "Can't search non-gmane groups: %s" x))) 1657 (error "Can't search non-gmane groups: %s" x)))
1558 groups " ")) 1658 groups " "))
1559 (authorspec 1659 (authorspec
1560 (if (assq 'author query) 1660 (if (assq 'gmane-author query)
1561 (format "author:%s" (cdr (assq 'author query))) "")) 1661 (format "author:%s" (cdr (assq 'gmane-author query))) ""))
1562 (search (format "%s %s %s" 1662 (search (format "%s %s %s"
1563 qstring groupspec authorspec)) 1663 qstring groupspec authorspec))
1564 (gnus-inhibit-demon t) 1664 (gnus-inhibit-demon t)
@@ -1594,11 +1694,10 @@ actually)."
1594 1694
1595;;; Util Code: 1695;;; Util Code:
1596 1696
1597(defun nnir-read-parms (query nnir-search-engine) 1697(defun nnir-read-parms (nnir-search-engine)
1598 "Reads additional search parameters according to `nnir-engines'." 1698 "Reads additional search parameters according to `nnir-engines'."
1599 (let ((parmspec (caddr (assoc nnir-search-engine nnir-engines)))) 1699 (let ((parmspec (caddr (assoc nnir-search-engine nnir-engines))))
1600 (append query 1700 (mapcar 'nnir-read-parm parmspec)))
1601 (mapcar 'nnir-read-parm parmspec))))
1602 1701
1603(defun nnir-read-parm (parmspec) 1702(defun nnir-read-parm (parmspec)
1604 "Reads a single search parameter. 1703 "Reads a single search parameter.
@@ -1612,46 +1711,23 @@ actually)."
1612 (cons sym (format (cdr mapping) result))) 1711 (cons sym (format (cdr mapping) result)))
1613 (cons sym (read-string prompt))))) 1712 (cons sym (read-string prompt)))))
1614 1713
1615(autoload 'gnus-group-topic-name "gnus-topic") 1714(defun nnir-run-query (specs)
1616 1715 "Invoke appropriate search engine function (see `nnir-engines')."
1617(defun nnir-run-query (query) 1716 (apply 'vconcat
1618 "Invoke appropriate search engine function (see `nnir-engines'). 1717 (mapcar
1619 If some groups were process-marked, run the query for each of the groups 1718 (lambda (x)
1620 and concat the results." 1719 (let* ((server (car x))
1621 (let ((q (car (read-from-string query))) 1720 (search-engine (nnir-server-to-search-engine server))
1622 (groups (if (not (string= "nnir" nnir-address)) 1721 (search-func (cadr (assoc search-engine nnir-engines))))
1623 (list (list nnir-address)) 1722 (and search-func
1624 (nnir-categorize 1723 (funcall search-func (cdr (assq 'nnir-query-spec specs))
1625 (or gnus-group-marked 1724 server (cadr x)))))
1626 (if (gnus-group-group-name) 1725 (cdr (assq 'nnir-group-spec specs)))))
1627 (list (gnus-group-group-name)) 1726
1628 (cdr (assoc (gnus-group-topic-name) 1727(defun nnir-server-to-search-engine (server)
1629 gnus-topic-alist)))) 1728 (or (nnir-read-server-parm 'nnir-search-engine server t)
1630 gnus-group-server)))) 1729 (cdr (assoc (car (gnus-server-to-method server))
1631 (apply 'vconcat 1730 nnir-method-default-engines))))
1632 (mapcar
1633 (lambda (x)
1634 (let* ((server (car x))
1635 (nnir-search-engine
1636 (or (nnir-read-server-parm 'nnir-search-engine
1637 server t)
1638 (cdr (assoc (car
1639 (gnus-server-to-method server))
1640 nnir-method-default-engines))))
1641 search-func)
1642 (setq search-func (cadr (assoc nnir-search-engine
1643 nnir-engines)))
1644 (if search-func
1645 (funcall
1646 search-func
1647 (if nnir-extra-parms
1648 (or (and (eq nnir-search-engine 'imap)
1649 (assq 'criteria q) q)
1650 (setq q (nnir-read-parms q nnir-search-engine)))
1651 q)
1652 server (cadr x))
1653 nil)))
1654 groups))))
1655 1731
1656(defun nnir-read-server-parm (key server &optional not-global) 1732(defun nnir-read-server-parm (key server &optional not-global)
1657 "Returns the parameter value corresponding to `key' for 1733 "Returns the parameter value corresponding to `key' for
@@ -1663,36 +1739,43 @@ environment unless `not-global' is non-nil."
1663 ((and (not not-global) (boundp key)) (symbol-value key)) 1739 ((and (not not-global) (boundp key)) (symbol-value key))
1664 (t nil)))) 1740 (t nil))))
1665 1741
1742(defun nnir-possibly-change-group (group &optional server)
1743 (or (not server) (nnir-server-opened server) (nnir-open-server server))
1744 (when (and group (string-match "\\`nnir" group))
1745 (setq nnir-artlist (gnus-group-get-parameter
1746 (gnus-group-prefixed-name
1747 (gnus-group-short-name group) '(nnir "nnir"))
1748 'nnir-artlist t))))
1666 1749
1667(defun nnir-possibly-change-server (server) 1750(defun nnir-server-opened (&optional server)
1668 (unless (and server (nnir-server-opened server)) 1751 (let ((backend (car (gnus-server-to-method server))))
1669 (nnir-open-server server))) 1752 (nnoo-current-server-p (or backend 'nnir) server)))
1670
1671 1753
1672(defun nnir-search-thread (header) 1754(defun nnir-search-thread (header)
1673 "Make an nnir group based on the thread containing the article header" 1755 "Make an nnir group based on the thread containing the article
1674 (let ((parm (list 1756header. The current server will be searched. If the registry is
1675 (cons 'query 1757installed, the server that the registry reports the current
1676 (nnimap-make-thread-query header)) 1758article came from is also searched."
1677 (cons 'criteria "") 1759 (let* ((query
1678 (cons 'server (gnus-method-to-server 1760 (list (cons 'query (nnimap-make-thread-query header))
1679 (gnus-find-method-for-group 1761 (cons 'criteria "")))
1680 gnus-newsgroup-name)))))) 1762 (server
1681 (gnus-group-make-nnir-group nil parm) 1763 (list (list (gnus-method-to-server
1764 (gnus-find-method-for-group gnus-newsgroup-name)))))
1765 (registry-group (and
1766 (gnus-bound-and-true-p 'gnus-registry-enabled)
1767 (car (gnus-registry-get-id-key
1768 (mail-header-id header) 'group))))
1769 (registry-server
1770 (and registry-group
1771 (gnus-method-to-server
1772 (gnus-find-method-for-group registry-group)))))
1773 (when registry-server (add-to-list 'server (list registry-server)))
1774 (gnus-group-make-nnir-group nil (list
1775 (cons 'nnir-query-spec query)
1776 (cons 'nnir-group-spec server)))
1682 (gnus-summary-goto-subject (gnus-id-to-article (mail-header-id header))))) 1777 (gnus-summary-goto-subject (gnus-id-to-article (mail-header-id header)))))
1683 1778
1684;; unused?
1685(defun nnir-artlist-groups (artlist)
1686 "Returns a list of all groups in the given ARTLIST."
1687 (let ((res nil)
1688 (with-dups nil))
1689 ;; from each artitem, extract group component
1690 (setq with-dups (mapcar 'nnir-artitem-group artlist))
1691 ;; remove duplicates from above
1692 (mapc (function (lambda (x) (add-to-list 'res x)))
1693 with-dups)
1694 res))
1695
1696(defun nnir-get-active (srv) 1779(defun nnir-get-active (srv)
1697 (let ((method (gnus-server-to-method srv)) 1780 (let ((method (gnus-server-to-method srv))
1698 groups) 1781 groups)
@@ -1758,6 +1841,46 @@ environment unless `not-global' is non-nil."
1758 1841
1759 1842
1760 1843
1844(deffoo nnir-request-create-group (group &optional server args)
1845 (message "Creating nnir group %s" group)
1846 (let ((group (gnus-group-prefixed-name group '(nnir "nnir")))
1847 (query-spec
1848 (list (cons 'query
1849 (read-string "Query: " nil 'nnir-search-history))))
1850 (group-spec (list (list (read-string "Server: " nil nil)))))
1851 (gnus-group-set-parameter
1852 group 'nnir-specs
1853 (list (cons 'nnir-query-spec query-spec)
1854 (cons 'nnir-group-spec group-spec)))
1855 (gnus-group-set-parameter
1856 group 'nnir-artlist
1857 (setq nnir-artlist
1858 (nnir-run-query
1859 (list (cons 'nnir-query-spec query-spec)
1860 (cons 'nnir-group-spec group-spec)))))
1861 (nnir-request-update-info group (gnus-get-info group)))
1862 t)
1863
1864(deffoo nnir-request-delete-group (group &optional force server)
1865 t)
1866
1867(deffoo nnir-request-list (&optional server)
1868 t)
1869
1870(deffoo nnir-request-scan (group method)
1871 (if group
1872 (let ((pgroup (if (gnus-group-prefixed-p group)
1873 group
1874 (gnus-group-prefixed-name group '(nnir "nnir")))))
1875 (gnus-group-set-parameter
1876 pgroup 'nnir-artlist
1877 (setq nnir-artlist
1878 (nnir-run-query
1879 (gnus-group-get-parameter pgroup 'nnir-specs t))))
1880 (nnir-request-update-info pgroup (gnus-get-info pgroup)))
1881 t))
1882
1883
1761;; The end. 1884;; The end.
1762(provide 'nnir) 1885(provide 'nnir)
1763 1886
diff --git a/lisp/ido.el b/lisp/ido.el
index 589f44175eb..7ace1811daa 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -3150,13 +3150,15 @@ for first matching file."
3150 (exit-minibuffer))) 3150 (exit-minibuffer)))
3151 3151
3152(defun ido-chop (items elem) 3152(defun ido-chop (items elem)
3153 "Remove all elements before ELEM and put them at the end of ITEMS." 3153 "Remove all elements before ELEM and put them at the end of ITEMS.
3154Use `eq' for comparison."
3154 (let ((ret nil) 3155 (let ((ret nil)
3155 (next nil) 3156 (next nil)
3156 (sofar nil)) 3157 (sofar nil))
3157 (while (not ret) 3158 (while (not ret)
3158 (setq next (car items)) 3159 (setq next (car items))
3159 (if (equal next elem) 3160 ;; Use `eq' to avoid bug http://debbugs.gnu.org/10994
3161 (if (eq next elem)
3160 (setq ret (append items (nreverse sofar))) 3162 (setq ret (append items (nreverse sofar)))
3161 ;; else 3163 ;; else
3162 (progn 3164 (progn
diff --git a/lisp/info.el b/lisp/info.el
index 3792857d47a..4679b51b999 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -158,6 +158,12 @@ A header-line does not scroll with the rest of the buffer."
158 "Face for Info nodes in a node header." 158 "Face for Info nodes in a node header."
159 :group 'info) 159 :group 'info)
160 160
161(defface info-index-match
162 '((t :inherit match))
163 "Face used to highlight matches in an index entry."
164 :group 'info
165 :version "24.4")
166
161;; This is a defcustom largely so that we can get the benefit 167;; This is a defcustom largely so that we can get the benefit
162;; of custom-initialize-delay. Perhaps it would work to make it a 168;; of custom-initialize-delay. Perhaps it would work to make it a
163;; defvar and explicitly give it a standard-value property, and 169;; defvar and explicitly give it a standard-value property, and
@@ -3057,6 +3063,38 @@ See `Info-scroll-down'."
3057 (select-window (posn-window (event-start e)))) 3063 (select-window (posn-window (event-start e))))
3058 (Info-scroll-down))) 3064 (Info-scroll-down)))
3059 3065
3066(defun Info-next-reference-or-link (pat prop)
3067 "Move point to the next pattern-based cross-reference or property-based link.
3068The next cross-reference is searched using the regexp PAT, and the next link
3069is searched using the text property PROP. Move point to the closest found position
3070of either a cross-reference found by `re-search-forward' or a link found by
3071`next-single-char-property-change'. Return the new position of point, or nil."
3072 (let ((pxref (save-excursion (re-search-forward pat nil t)))
3073 (plink (next-single-char-property-change (point) prop)))
3074 (when (and (< plink (point-max)) (not (get-char-property plink prop)))
3075 (setq plink (next-single-char-property-change plink prop)))
3076 (if (< plink (point-max))
3077 (if (and pxref (<= pxref plink))
3078 (goto-char (or (match-beginning 1) (match-beginning 0)))
3079 (goto-char plink))
3080 (if pxref (goto-char (or (match-beginning 1) (match-beginning 0)))))))
3081
3082(defun Info-prev-reference-or-link (pat prop)
3083 "Move point to the previous pattern-based cross-reference or property-based link.
3084The previous cross-reference is searched using the regexp PAT, and the previous link
3085is searched using the text property PROP. Move point to the closest found position
3086of either a cross-reference found by `re-search-backward' or a link found by
3087`previous-single-char-property-change'. Return the new position of point, or nil."
3088 (let ((pxref (save-excursion (re-search-backward pat nil t)))
3089 (plink (previous-single-char-property-change (point) prop)))
3090 (when (and (> plink (point-min)) (not (get-char-property plink prop)))
3091 (setq plink (previous-single-char-property-change plink prop)))
3092 (if (> plink (point-min))
3093 (if (and pxref (>= pxref plink))
3094 (goto-char (or (match-beginning 1) (match-beginning 0)))
3095 (goto-char plink))
3096 (if pxref (goto-char (or (match-beginning 1) (match-beginning 0)))))))
3097
3060(defun Info-next-reference (&optional recur count) 3098(defun Info-next-reference (&optional recur count)
3061 "Move cursor to the next cross-reference or menu item in the node. 3099 "Move cursor to the next cross-reference or menu item in the node.
3062If COUNT is non-nil (interactively with a prefix arg), jump over 3100If COUNT is non-nil (interactively with a prefix arg), jump over
@@ -3071,14 +3109,13 @@ COUNT cross-references."
3071 (old-pt (point)) 3109 (old-pt (point))
3072 (case-fold-search t)) 3110 (case-fold-search t))
3073 (or (eobp) (forward-char 1)) 3111 (or (eobp) (forward-char 1))
3074 (or (re-search-forward pat nil t) 3112 (or (Info-next-reference-or-link pat 'link)
3075 (progn 3113 (progn
3076 (goto-char (point-min)) 3114 (goto-char (point-min))
3077 (or (re-search-forward pat nil t) 3115 (or (Info-next-reference-or-link pat 'link)
3078 (progn 3116 (progn
3079 (goto-char old-pt) 3117 (goto-char old-pt)
3080 (user-error "No cross references in this node"))))) 3118 (user-error "No cross references in this node")))))
3081 (goto-char (or (match-beginning 1) (match-beginning 0)))
3082 (if (looking-at "\\* Menu:") 3119 (if (looking-at "\\* Menu:")
3083 (if recur 3120 (if recur
3084 (user-error "No cross references in this node") 3121 (user-error "No cross references in this node")
@@ -3099,14 +3136,13 @@ COUNT cross-references."
3099 (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://") 3136 (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://")
3100 (old-pt (point)) 3137 (old-pt (point))
3101 (case-fold-search t)) 3138 (case-fold-search t))
3102 (or (re-search-backward pat nil t) 3139 (or (Info-prev-reference-or-link pat 'link)
3103 (progn 3140 (progn
3104 (goto-char (point-max)) 3141 (goto-char (point-max))
3105 (or (re-search-backward pat nil t) 3142 (or (Info-prev-reference-or-link pat 'link)
3106 (progn 3143 (progn
3107 (goto-char old-pt) 3144 (goto-char old-pt)
3108 (user-error "No cross references in this node"))))) 3145 (user-error "No cross references in this node")))))
3109 (goto-char (or (match-beginning 1) (match-beginning 0)))
3110 (if (looking-at "\\* Menu:") 3146 (if (looking-at "\\* Menu:")
3111 (if recur 3147 (if recur
3112 (user-error "No cross references in this node") 3148 (user-error "No cross references in this node")
@@ -3246,7 +3282,7 @@ Give an empty topic name to go to the Index node itself."
3246 (= (aref topic 0) ?:)) 3282 (= (aref topic 0) ?:))
3247 (setq topic (substring topic 1))) 3283 (setq topic (substring topic 1)))
3248 (let ((orignode Info-current-node) 3284 (let ((orignode Info-current-node)
3249 (pattern (format "\n\\* +\\([^\n]*%s[^\n]*\\):[ \t]+\\([^\n]*\\)\\.\\(?:[ \t\n]*(line +\\([0-9]+\\))\\)?" 3285 (pattern (format "\n\\* +\\([^\n]*\\(%s\\)[^\n]*\\):[ \t]+\\([^\n]*\\)\\.\\(?:[ \t\n]*(line +\\([0-9]+\\))\\)?"
3250 (regexp-quote topic))) 3286 (regexp-quote topic)))
3251 node (nodes (Info-index-nodes)) 3287 node (nodes (Info-index-nodes))
3252 (ohist-list Info-history-list) 3288 (ohist-list Info-history-list)
@@ -3265,12 +3301,14 @@ Give an empty topic name to go to the Index node itself."
3265 (progn 3301 (progn
3266 (goto-char (point-min)) 3302 (goto-char (point-min))
3267 (while (re-search-forward pattern nil t) 3303 (while (re-search-forward pattern nil t)
3268 (push (list (match-string-no-properties 1) 3304 (let ((entry (match-string-no-properties 1))
3269 (match-string-no-properties 2) 3305 (nodename (match-string-no-properties 3))
3270 Info-current-node 3306 (line (string-to-number (concat "0" (match-string 4)))))
3271 (string-to-number (concat "0" 3307 (add-text-properties
3272 (match-string 3)))) 3308 (- (match-beginning 2) (match-beginning 1))
3273 matches)) 3309 (- (match-end 2) (match-beginning 1))
3310 '(face info-index-match) entry)
3311 (push (list entry nodename Info-current-node line) matches)))
3274 (setq nodes (cdr nodes) node (car nodes))) 3312 (setq nodes (cdr nodes) node (car nodes)))
3275 (Info-goto-node node)) 3313 (Info-goto-node node))
3276 (or matches 3314 (or matches
@@ -3496,7 +3534,7 @@ MATCHES is a list of index matches found by `Info-apropos-matches'.")
3496Return a list of matches where each element is in the format 3534Return a list of matches where each element is in the format
3497\((FILENAME INDEXTEXT NODENAME LINENUMBER))." 3535\((FILENAME INDEXTEXT NODENAME LINENUMBER))."
3498 (unless (string= string "") 3536 (unless (string= string "")
3499 (let ((pattern (format "\n\\* +\\([^\n]*%s[^\n]*\\):[ \t]+\\([^\n]+\\)\\.\\(?:[ \t\n]*(line +\\([0-9]+\\))\\)?" 3537 (let ((pattern (format "\n\\* +\\([^\n]*\\(%s\\)[^\n]*\\):[ \t]+\\([^\n]+\\)\\.\\(?:[ \t\n]*(line +\\([0-9]+\\))\\)?"
3500 (regexp-quote string))) 3538 (regexp-quote string)))
3501 (ohist Info-history) 3539 (ohist Info-history)
3502 (ohist-list Info-history-list) 3540 (ohist-list Info-history-list)
@@ -3529,12 +3567,15 @@ Return a list of matches where each element is in the format
3529 (progn 3567 (progn
3530 (goto-char (point-min)) 3568 (goto-char (point-min))
3531 (while (re-search-forward pattern nil t) 3569 (while (re-search-forward pattern nil t)
3532 (setq matches 3570 (let ((entry (match-string-no-properties 1))
3533 (cons (list manual 3571 (nodename (match-string-no-properties 3))
3534 (match-string-no-properties 1) 3572 (line (match-string-no-properties 4)))
3535 (match-string-no-properties 2) 3573 (add-text-properties
3536 (match-string-no-properties 3)) 3574 (- (match-beginning 2) (match-beginning 1))
3537 matches))) 3575 (- (match-end 2) (match-beginning 1))
3576 '(face info-index-match) entry)
3577 (setq matches (cons (list manual entry nodename line)
3578 matches))))
3538 (setq nodes (cdr nodes) node (car nodes))) 3579 (setq nodes (cdr nodes) node (car nodes)))
3539 (Info-goto-node node)))) 3580 (Info-goto-node node))))
3540 (error 3581 (error
@@ -3840,7 +3881,25 @@ If FORK is non-nil, it is passed to `Info-goto-node'."
3840 ((setq node (Info-get-token (point) "File: " "File: \\([^,\n\t]*\\)")) 3881 ((setq node (Info-get-token (point) "File: " "File: \\([^,\n\t]*\\)"))
3841 (Info-goto-node "Top" fork)) 3882 (Info-goto-node "Top" fork))
3842 ((setq node (Info-get-token (point) "Prev: " "Prev: \\([^,\n\t]*\\)")) 3883 ((setq node (Info-get-token (point) "Prev: " "Prev: \\([^,\n\t]*\\)"))
3843 (Info-goto-node node fork))) 3884 (Info-goto-node node fork))
3885 ;; footnote
3886 ((setq node (Info-get-token (point) "(" "\\(([0-9]+)\\)"))
3887 (let ((old-point (point)) new-point)
3888 (save-excursion
3889 (goto-char (point-min))
3890 (when (re-search-forward "^[ \t]*-+ Footnotes -+$" nil t)
3891 (setq new-point (if (< old-point (point))
3892 ;; Go to footnote reference
3893 (and (search-forward node nil t)
3894 ;; Put point at beginning of link
3895 (match-beginning 0))
3896 ;; Go to footnote definition
3897 (search-backward node nil t)))))
3898 (if new-point
3899 (progn
3900 (goto-char new-point)
3901 (setq node t))
3902 (setq node nil)))))
3844 node)) 3903 node))
3845 3904
3846(defun Info-mouse-follow-link (click) 3905(defun Info-mouse-follow-link (click)
@@ -4896,6 +4955,21 @@ first line or header line, and for breadcrumb links.")
4896 mouse-face highlight 4955 mouse-face highlight
4897 help-echo "mouse-2: go to this URL")))) 4956 help-echo "mouse-2: go to this URL"))))
4898 4957
4958 ;; Fontify footnotes
4959 (goto-char (point-min))
4960 (when (and not-fontified-p (re-search-forward "^[ \t]*-+ Footnotes -+$" nil t))
4961 (let ((limit (point)))
4962 (goto-char (point-min))
4963 (while (re-search-forward "\\(([0-9]+)\\)" nil t)
4964 (add-text-properties (match-beginning 0) (match-end 0)
4965 `(font-lock-face info-xref
4966 link t
4967 mouse-face highlight
4968 help-echo
4969 ,(if (< (point) limit)
4970 "mouse-2: go to footnote definition"
4971 "mouse-2: go to footnote reference"))))))
4972
4899 ;; Hide empty lines at the end of the node. 4973 ;; Hide empty lines at the end of the node.
4900 (goto-char (point-max)) 4974 (goto-char (point-max))
4901 (skip-chars-backward "\n") 4975 (skip-chars-backward "\n")
diff --git a/lisp/international/ja-dic-cnv.el b/lisp/international/ja-dic-cnv.el
index c0fcf19d841..41a31004194 100644
--- a/lisp/international/ja-dic-cnv.el
+++ b/lisp/international/ja-dic-cnv.el
@@ -279,9 +279,9 @@
279 skkdic-okuri-nasi-entries-count 279 skkdic-okuri-nasi-entries-count
280 (1+ skkdic-okuri-nasi-entries-count)) 280 (1+ skkdic-okuri-nasi-entries-count))
281 (setq ratio (floor (/ (* (point) 100.0) (point-max)))) 281 (setq ratio (floor (/ (* (point) 100.0) (point-max))))
282 (if (/= ratio prev-ratio) 282 (if (/= (/ prev-ratio 10) (/ ratio 10))
283 (progn 283 (progn
284 (message "collected %2d%% %s ..." ratio kana) 284 (message "collected %2d%% ..." ratio)
285 (setq prev-ratio ratio))) 285 (setq prev-ratio ratio)))
286 (while candidates 286 (while candidates
287 (let ((entry (lookup-nested-alist (car candidates) 287 (let ((entry (lookup-nested-alist (car candidates)
@@ -304,12 +304,12 @@
304 (while l 304 (while l
305 (let ((kana (car (car l))) 305 (let ((kana (car (car l)))
306 (candidates (cdr (car l)))) 306 (candidates (cdr (car l))))
307 (setq ratio (/ (* count 1000) skkdic-okuri-nasi-entries-count) 307 (setq ratio (/ (* count 100) skkdic-okuri-nasi-entries-count)
308 count (1+ count)) 308 count (1+ count))
309 (if (/= prev-ratio (/ ratio 10)) 309 (if (/= (/ prev-ratio 10) (/ ratio 10))
310 (progn 310 (progn
311 (message "processed %2d%% %s ..." (/ ratio 10) kana) 311 (message "processed %2d%% ..." ratio)
312 (setq prev-ratio (/ ratio 10)))) 312 (setq prev-ratio ratio)))
313 (if (setq candidates 313 (if (setq candidates
314 (skkdic-reduced-candidates skkbuf kana candidates)) 314 (skkdic-reduced-candidates skkbuf kana candidates))
315 (progn 315 (progn
@@ -330,16 +330,21 @@ The name of generated file is specified by the variable `ja-dic-filename'."
330 (interactive "FSKK dictionary file: ") 330 (interactive "FSKK dictionary file: ")
331 (message "Reading file \"%s\" ..." filename) 331 (message "Reading file \"%s\" ..." filename)
332 (let* ((coding-system-for-read 'euc-japan) 332 (let* ((coding-system-for-read 'euc-japan)
333 (skkbuf(find-file-noselect (expand-file-name filename))) 333 (skkbuf (get-buffer-create " *skkdic-unannotated*"))
334 (buf (get-buffer-create "*skkdic-work*"))) 334 (buf (get-buffer-create "*skkdic-work*")))
335 ;; Set skkbuf to an unannotated copy of the dictionary.
336 (with-current-buffer skkbuf
337 (insert-file-contents (expand-file-name filename))
338 (re-search-forward "^[^;]")
339 (while (re-search-forward ";[^\n/]*/" nil t)
340 (replace-match "/")))
335 ;; Setup and generate the header part of working buffer. 341 ;; Setup and generate the header part of working buffer.
336 (with-current-buffer buf 342 (with-current-buffer buf
337 (erase-buffer) 343 (erase-buffer)
338 (buffer-disable-undo) 344 (buffer-disable-undo)
339 (insert ";;; ja-dic.el --- dictionary for Japanese input method" 345 (insert ";;; ja-dic.el --- dictionary for Japanese input method"
340 " -*-coding: euc-japan; -*-\n" 346 " -*-coding: utf-8; -*-\n"
341 ";;\tGenerated by the command `skkdic-convert'\n" 347 ";;\tGenerated by the command `skkdic-convert'\n"
342 ";;\tDate: " (current-time-string) "\n"
343 ";;\tOriginal SKK dictionary file: " 348 ";;\tOriginal SKK dictionary file: "
344 (file-relative-name (expand-file-name filename) dirname) 349 (file-relative-name (expand-file-name filename) dirname)
345 "\n\n" 350 "\n\n"
@@ -348,7 +353,6 @@ The name of generated file is specified by the variable `ja-dic-filename'."
348 ";; Do byte-compile this file again after any modification.\n\n" 353 ";; Do byte-compile this file again after any modification.\n\n"
349 ";;; Start of the header of the original SKK dictionary.\n\n") 354 ";;; Start of the header of the original SKK dictionary.\n\n")
350 (set-buffer skkbuf) 355 (set-buffer skkbuf)
351 (widen)
352 (goto-char 1) 356 (goto-char 1)
353 (let (pos) 357 (let (pos)
354 (search-forward ";; okuri-ari") 358 (search-forward ";; okuri-ari")
@@ -399,7 +403,7 @@ The name of generated file is specified by the variable `ja-dic-filename'."
399 ;; Save the working buffer. 403 ;; Save the working buffer.
400 (set-buffer buf) 404 (set-buffer buf)
401 (set-visited-file-name (expand-file-name ja-dic-filename dirname) t) 405 (set-visited-file-name (expand-file-name ja-dic-filename dirname) t)
402 (set-buffer-file-coding-system 'euc-japan) 406 (set-buffer-file-coding-system 'utf-8)
403 (save-buffer 0)) 407 (save-buffer 0))
404 (kill-buffer skkbuf) 408 (kill-buffer skkbuf)
405 (switch-to-buffer buf))) 409 (switch-to-buffer buf)))
@@ -429,12 +433,7 @@ To get complete usage, invoke:
429 (setq targetdir (expand-file-name (car command-line-args-left))) 433 (setq targetdir (expand-file-name (car command-line-args-left)))
430 (setq command-line-args-left (cdr command-line-args-left)))) 434 (setq command-line-args-left (cdr command-line-args-left))))
431 (setq filename (expand-file-name (car command-line-args-left))) 435 (setq filename (expand-file-name (car command-line-args-left)))
432 (message "Converting %s to %s ..." filename ja-dic-filename) 436 (skkdic-convert filename targetdir)))
433 (message "It takes around 10 minutes even on Sun SS20.")
434 (skkdic-convert filename targetdir)
435 (message "Do byte-compile the created file by:")
436 (message " %% emacs -batch -f batch-byte-compile %s" ja-dic-filename)
437 ))
438 (kill-emacs 0)) 437 (kill-emacs 0))
439 438
440 439
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 51601bca8df..0367cad87b8 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -128,7 +128,11 @@ Expects to be bound to `down-mouse-1' in `key-translation-map'."
128 (put newup 'event-kind (get (car event) 'event-kind)) 128 (put newup 'event-kind (get (car event) 'event-kind))
129 (put newdown 'event-kind (get (car this-event) 'event-kind)) 129 (put newdown 'event-kind (get (car this-event) 'event-kind))
130 (push (cons newup (cdr event)) unread-command-events) 130 (push (cons newup (cdr event)) unread-command-events)
131 (vector (cons newdown (cdr this-event)))) 131 ;; Modify the event in place, so read-key-sequence doesn't
132 ;; generate a second fake prefix key (see fake_prefixed_keys in
133 ;; src/keyboard.c).
134 (setcar this-event newdown)
135 (vector this-event))
132 (push event unread-command-events) 136 (push event unread-command-events)
133 nil)))))) 137 nil))))))
134 138
@@ -759,6 +763,9 @@ at the same position."
759 mouse-1-click-in-non-selected-windows 763 mouse-1-click-in-non-selected-windows
760 (eq (selected-window) (posn-window pos))) 764 (eq (selected-window) (posn-window pos)))
761 (or (mouse-posn-property pos 'follow-link) 765 (or (mouse-posn-property pos 'follow-link)
766 (let ((area (posn-area pos)))
767 (when area
768 (key-binding (vector area 'follow-link) nil t pos)))
762 (key-binding [follow-link] nil t pos))))) 769 (key-binding [follow-link] nil t pos)))))
763 (cond 770 (cond
764 ((eq action 'mouse-face) 771 ((eq action 'mouse-face)
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 2d683a4d3d2..a71df54db58 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -155,12 +155,18 @@ pass to the OPERATION."
155 "Return a list of (nil host) tuples allowed to access." 155 "Return a list of (nil host) tuples allowed to access."
156 (with-timeout (10) 156 (with-timeout (10)
157 (with-temp-buffer 157 (with-temp-buffer
158 (when (zerop (call-process tramp-adb-program nil t nil "devices")) 158 ;; `call-process' does not react on timer under MS Windows.
159 (let (result) 159 ;; That's why we use `start-process'.
160 (goto-char (point-min)) 160 (let ((p (start-process
161 (while (search-forward-regexp "^\\(\\S-+\\)[[:space:]]+device$" nil t) 161 tramp-adb-program (current-buffer) tramp-adb-program "devices"))
162 (add-to-list 'result (list nil (match-string 1)))) 162 result)
163 result))))) 163 (tramp-compat-set-process-query-on-exit-flag p nil)
164 (while (eq 'run (process-status p))
165 (sleep-for 0.1))
166 (goto-char (point-min))
167 (while (search-forward-regexp "^\\(\\S-+\\)[[:space:]]+device$" nil t)
168 (add-to-list 'result (list nil (match-string 1))))
169 result))))
164 170
165(defun tramp-adb-handle-expand-file-name (name &optional dir) 171(defun tramp-adb-handle-expand-file-name (name &optional dir)
166 "Like `expand-file-name' for Tramp files." 172 "Like `expand-file-name' for Tramp files."
@@ -850,7 +856,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
850 (when p 856 (when p
851 (if (yes-or-no-p "A command is running. Kill it? ") 857 (if (yes-or-no-p "A command is running. Kill it? ")
852 (ignore-errors (kill-process p)) 858 (ignore-errors (kill-process p))
853 (error "Shell command in progress"))) 859 (tramp-compat-user-error "Shell command in progress")))
854 860
855 (if current-buffer-p 861 (if current-buffer-p
856 (progn 862 (progn
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index d4639817b18..ed61fbcfa76 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -533,6 +533,11 @@ EOL-TYPE can be one of `dos', `unix', or `mac'."
533 "`dos', `unix', or `mac'"))))) 533 "`dos', `unix', or `mac'")))))
534 (t (error "Can't change EOL conversion -- is MULE missing?")))) 534 (t (error "Can't change EOL conversion -- is MULE missing?"))))
535 535
536;; `user-error' has been added to Emacs 24.3.
537(defun tramp-compat-user-error (format &rest args)
538 "Signal a pilot error."
539 (apply (if (fboundp 'user-error) 'user-error 'error) format args))
540
536(add-hook 'tramp-unload-hook 541(add-hook 'tramp-unload-hook
537 (lambda () 542 (lambda ()
538 (unload-feature 'tramp-compat 'force))) 543 (unload-feature 'tramp-compat 'force)))
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index e3850653263..6f066f56a2b 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -153,7 +153,7 @@
153(unless (and (tramp-compat-funcall 'dbus-get-unique-name :session) 153(unless (and (tramp-compat-funcall 'dbus-get-unique-name :session)
154 (or (tramp-compat-process-running-p "gvfs-fuse-daemon") 154 (or (tramp-compat-process-running-p "gvfs-fuse-daemon")
155 (tramp-compat-process-running-p "gvfsd-fuse"))) 155 (tramp-compat-process-running-p "gvfsd-fuse")))
156 (error "Package `tramp-gvfs' not supported")) 156 (tramp-compat-user-error "Package `tramp-gvfs' not supported"))
157 157
158(defconst tramp-gvfs-path-mounttracker "/org/gtk/vfs/mounttracker" 158(defconst tramp-gvfs-path-mounttracker "/org/gtk/vfs/mounttracker"
159 "The object path of the GVFS daemon.") 159 "The object path of the GVFS daemon.")
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index dc3dffd857b..86f7f338b27 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1203,7 +1203,7 @@ their replacement."
1203 result (substring result 0 -1)) 1203 result (substring result 0 -1))
1204 (unless (y-or-n-p (format "Method %s is obsolete, use %s? " 1204 (unless (y-or-n-p (format "Method %s is obsolete, use %s? "
1205 result (substring result 0 -1))) 1205 result (substring result 0 -1)))
1206 (error 'file-error "Method \"%s\" not supported" result))) 1206 (tramp-compat-user-error "Method \"%s\" not supported" result)))
1207 (add-to-list 'tramp-warned-obsolete-methods result)) 1207 (add-to-list 'tramp-warned-obsolete-methods result))
1208 ;; This works with the current set of `tramp-obsolete-methods'. 1208 ;; This works with the current set of `tramp-obsolete-methods'.
1209 ;; Must be improved, if their are more sophisticated replacements. 1209 ;; Must be improved, if their are more sophisticated replacements.
@@ -1249,7 +1249,7 @@ non-nil, the file name parts are not expanded to their default
1249values." 1249values."
1250 (save-match-data 1250 (save-match-data
1251 (let ((match (string-match (nth 0 tramp-file-name-structure) name))) 1251 (let ((match (string-match (nth 0 tramp-file-name-structure) name)))
1252 (unless match (error "Not a Tramp file name: %s" name)) 1252 (unless match (tramp-compat-user-error "Not a Tramp file name: %s" name))
1253 (let ((method (match-string (nth 1 tramp-file-name-structure) name)) 1253 (let ((method (match-string (nth 1 tramp-file-name-structure) name))
1254 (user (match-string (nth 2 tramp-file-name-structure) name)) 1254 (user (match-string (nth 2 tramp-file-name-structure) name))
1255 (host (match-string (nth 3 tramp-file-name-structure) name)) 1255 (host (match-string (nth 3 tramp-file-name-structure) name))
@@ -1259,7 +1259,12 @@ values."
1259 (when (string-match tramp-prefix-ipv6-regexp host) 1259 (when (string-match tramp-prefix-ipv6-regexp host)
1260 (setq host (replace-match "" nil t host))) 1260 (setq host (replace-match "" nil t host)))
1261 (when (string-match tramp-postfix-ipv6-regexp host) 1261 (when (string-match tramp-postfix-ipv6-regexp host)
1262 (setq host (replace-match "" nil t host)))) 1262 (setq host (replace-match "" nil t host)))
1263 (when (and (equal tramp-syntax 'ftp) (null method) (null user)
1264 (member host (mapcar 'car tramp-methods))
1265 (not (tramp-completion-mode-p)))
1266 (tramp-compat-user-error
1267 "Host name must not match method `%s'" host)))
1263 (if nodefault 1268 (if nodefault
1264 (vector method user host localname hop) 1269 (vector method user host localname hop)
1265 (vector 1270 (vector
@@ -3179,7 +3184,7 @@ User is always nil."
3179 (when p 3184 (when p
3180 (if (yes-or-no-p "A command is running. Kill it? ") 3185 (if (yes-or-no-p "A command is running. Kill it? ")
3181 (ignore-errors (kill-process p)) 3186 (ignore-errors (kill-process p))
3182 (error "Shell command in progress"))) 3187 (tramp-compat-user-error "Shell command in progress")))
3183 3188
3184 (if current-buffer-p 3189 (if current-buffer-p
3185 (progn 3190 (progn
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index 64053c202b7..0e54cd60d98 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -31,7 +31,7 @@
31;; should be changed only there. 31;; should be changed only there.
32 32
33;;;###tramp-autoload 33;;;###tramp-autoload
34(defconst tramp-version "2.2.7" 34(defconst tramp-version "2.2.8-pre"
35 "This version of Tramp.") 35 "This version of Tramp.")
36 36
37;;;###tramp-autoload 37;;;###tramp-autoload
@@ -44,7 +44,7 @@
44 (= emacs-major-version 21) 44 (= emacs-major-version 21)
45 (>= emacs-minor-version 4))) 45 (>= emacs-minor-version 4)))
46 "ok" 46 "ok"
47 (format "Tramp 2.2.7 is not fit for %s" 47 (format "Tramp 2.2.8-pre is not fit for %s"
48 (when (string-match "^.*$" (emacs-version)) 48 (when (string-match "^.*$" (emacs-version))
49 (match-string 0 (emacs-version))))))) 49 (match-string 0 (emacs-version)))))))
50 (unless (string-match "\\`ok\\'" x) (error "%s" x))) 50 (unless (string-match "\\`ok\\'" x) (error "%s" x)))
diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el
index 2ee73235dd0..44271a689cf 100644
--- a/lisp/nxml/nxml-mode.el
+++ b/lisp/nxml/nxml-mode.el
@@ -540,7 +540,7 @@ Many aspects this mode can be customized using
540 (widen) 540 (widen)
541 (nxml-clear-dependent-regions (point-min) (point-max)) 541 (nxml-clear-dependent-regions (point-min) (point-max))
542 (setq nxml-scan-end (copy-marker (point-min) nil)) 542 (setq nxml-scan-end (copy-marker (point-min) nil))
543 (nxml-with-unmodifying-text-property-changes 543 (with-silent-modifications
544 (nxml-clear-inside (point-min) (point-max)) 544 (nxml-clear-inside (point-min) (point-max))
545 (nxml-with-invisible-motion 545 (nxml-with-invisible-motion
546 (nxml-scan-prolog))))) 546 (nxml-scan-prolog)))))
@@ -601,7 +601,7 @@ Many aspects this mode can be customized using
601 (save-excursion 601 (save-excursion
602 (save-restriction 602 (save-restriction
603 (widen) 603 (widen)
604 (nxml-with-unmodifying-text-property-changes 604 (with-silent-modifications
605 (nxml-clear-inside (point-min) (point-max)))))) 605 (nxml-clear-inside (point-min) (point-max))))))
606 606
607;;; Change management 607;;; Change management
@@ -625,7 +625,7 @@ Many aspects this mode can be customized using
625 (widen) 625 (widen)
626 (save-match-data 626 (save-match-data
627 (nxml-with-invisible-motion 627 (nxml-with-invisible-motion
628 (nxml-with-unmodifying-text-property-changes 628 (with-silent-modifications
629 (nxml-after-change1 629 (nxml-after-change1
630 start end pre-change-length))))))))) 630 start end pre-change-length)))))))))
631 631
@@ -910,7 +910,7 @@ Called with `font-lock-beg' and `font-lock-end' dynamically bound."
910 (widen) 910 (widen)
911 (save-match-data 911 (save-match-data
912 (nxml-with-invisible-motion 912 (nxml-with-invisible-motion
913 (nxml-with-unmodifying-text-property-changes 913 (with-silent-modifications
914 (nxml-extend-after-change-region1 914 (nxml-extend-after-change-region1
915 start end pre-change-length))))))))) 915 start end pre-change-length)))))))))
916 (if (consp region) region)))) 916 (if (consp region) region))))
diff --git a/lisp/nxml/nxml-outln.el b/lisp/nxml/nxml-outln.el
index e30aee3de53..dab22f7559f 100644
--- a/lisp/nxml/nxml-outln.el
+++ b/lisp/nxml/nxml-outln.el
@@ -149,7 +149,7 @@ See the variable `nxml-section-element-name-regexp' for more details."
149(defun nxml-show-all () 149(defun nxml-show-all ()
150 "Show all elements in the buffer normally." 150 "Show all elements in the buffer normally."
151 (interactive) 151 (interactive)
152 (nxml-with-unmodifying-text-property-changes 152 (with-silent-modifications
153 (remove-text-properties (point-min) 153 (remove-text-properties (point-min)
154 (point-max) 154 (point-max)
155 '(nxml-outline-state nil))) 155 '(nxml-outline-state nil)))
@@ -370,7 +370,7 @@ customize which elements are recognized as sections and headings."
370 (get-text-property pos 'nxml-outline-state)) 370 (get-text-property pos 'nxml-outline-state))
371 371
372(defun nxml-set-outline-state (pos state) 372(defun nxml-set-outline-state (pos state)
373 (nxml-with-unmodifying-text-property-changes 373 (with-silent-modifications
374 (if state 374 (if state
375 (put-text-property pos (1+ pos) 'nxml-outline-state state) 375 (put-text-property pos (1+ pos) 'nxml-outline-state state)
376 (remove-text-properties pos (1+ pos) '(nxml-outline-state nil))))) 376 (remove-text-properties pos (1+ pos) '(nxml-outline-state nil)))))
diff --git a/lisp/nxml/nxml-rap.el b/lisp/nxml/nxml-rap.el
index bc87044cde6..5bc4d74456b 100644
--- a/lisp/nxml/nxml-rap.el
+++ b/lisp/nxml/nxml-rap.el
@@ -293,7 +293,7 @@ Sets variables like `nxml-token-after'."
293 (cond ((memq xmltok-type '(comment 293 (cond ((memq xmltok-type '(comment
294 cdata-section 294 cdata-section
295 processing-instruction)) 295 processing-instruction))
296 (nxml-with-unmodifying-text-property-changes 296 (with-silent-modifications
297 (nxml-set-inside (1+ xmltok-start) (point) xmltok-type))) 297 (nxml-set-inside (1+ xmltok-start) (point) xmltok-type)))
298 (xmltok-dependent-regions 298 (xmltok-dependent-regions
299 (nxml-mark-parse-dependent-regions))) 299 (nxml-mark-parse-dependent-regions)))
@@ -338,7 +338,7 @@ Leave point unmoved if it is not inside anything special."
338 '(comment 338 '(comment
339 processing-instruction 339 processing-instruction
340 cdata-section)) 340 cdata-section))
341 (nxml-with-unmodifying-text-property-changes 341 (with-silent-modifications
342 (nxml-set-inside (1+ xmltok-start) 342 (nxml-set-inside (1+ xmltok-start)
343 (point) 343 (point)
344 xmltok-type))) 344 xmltok-type)))
diff --git a/lisp/nxml/nxml-util.el b/lisp/nxml/nxml-util.el
index b2d9cdde183..6ba6d21f7ed 100644
--- a/lisp/nxml/nxml-util.el
+++ b/lisp/nxml/nxml-util.el
@@ -78,27 +78,6 @@ This is the inverse of `nxml-make-namespace'."
78 (nxml-degrade ,context ,error-symbol)))) 78 (nxml-degrade ,context ,error-symbol))))
79 `(progn ,@body))) 79 `(progn ,@body)))
80 80
81(defmacro nxml-with-unmodifying-text-property-changes (&rest body)
82 "Evaluate BODY without any text property changes modifying the buffer.
83Any text properties changes happen as usual but the changes are not treated as
84modifications to the buffer."
85 (let ((modified (make-symbol "modified")))
86 `(let ((,modified (buffer-modified-p))
87 (inhibit-read-only t)
88 (inhibit-modification-hooks t)
89 (buffer-undo-list t)
90 (deactivate-mark nil)
91 ;; Apparently these avoid file locking problems.
92 (buffer-file-name nil)
93 (buffer-file-truename nil))
94 (unwind-protect
95 (progn ,@body)
96 (unless ,modified
97 (restore-buffer-modified-p nil))))))
98
99(put 'nxml-with-unmodifying-text-property-changes 'lisp-indent-function 0)
100(def-edebug-spec nxml-with-unmodifying-text-property-changes t)
101
102(defmacro nxml-with-invisible-motion (&rest body) 81(defmacro nxml-with-invisible-motion (&rest body)
103 "Evaluate body without calling any point motion hooks." 82 "Evaluate body without calling any point motion hooks."
104 `(let ((inhibit-point-motion-hooks t)) 83 `(let ((inhibit-point-motion-hooks t))
diff --git a/lisp/nxml/rng-maint.el b/lisp/nxml/rng-maint.el
index 74192f213dc..ff73e3718ec 100644
--- a/lisp/nxml/rng-maint.el
+++ b/lisp/nxml/rng-maint.el
@@ -259,7 +259,7 @@
259(defun rng-validate-buffer () 259(defun rng-validate-buffer ()
260 (save-restriction 260 (save-restriction
261 (widen) 261 (widen)
262 (nxml-with-unmodifying-text-property-changes 262 (with-silent-modifications
263 (rng-clear-cached-state (point-min) (point-max))) 263 (rng-clear-cached-state (point-min) (point-max)))
264 ;; 1+ to clear empty overlays at (point-max) 264 ;; 1+ to clear empty overlays at (point-max)
265 (rng-clear-overlays (point-min) (1+ (point-max)))) 265 (rng-clear-overlays (point-min) (1+ (point-max))))
diff --git a/lisp/nxml/rng-nxml.el b/lisp/nxml/rng-nxml.el
index cfb8e33cccb..bc070136adb 100644
--- a/lisp/nxml/rng-nxml.el
+++ b/lisp/nxml/rng-nxml.el
@@ -380,9 +380,7 @@ set `xmltok-dtd'. Returns the position of the end of the token."
380 (< rng-validate-up-to-date-end pos)) 380 (< rng-validate-up-to-date-end pos))
381 ;; Display percentage validated. 381 ;; Display percentage validated.
382 (force-mode-line-update) 382 (force-mode-line-update)
383 ;; Force redisplay but don't allow idle timers to run. 383 (sit-for 0))
384 (let ((timer-idle-list nil))
385 (sit-for 0)))
386 (message "Parsing...done")) 384 (message "Parsing...done"))
387 (save-excursion 385 (save-excursion
388 (save-restriction 386 (save-restriction
diff --git a/lisp/nxml/rng-valid.el b/lisp/nxml/rng-valid.el
index a87ab2532ce..e1140980813 100644
--- a/lisp/nxml/rng-valid.el
+++ b/lisp/nxml/rng-valid.el
@@ -244,7 +244,7 @@ to use for finding the schema."
244 (> (prefix-numeric-value arg) 0))) 244 (> (prefix-numeric-value arg) 0)))
245 (save-restriction 245 (save-restriction
246 (widen) 246 (widen)
247 (nxml-with-unmodifying-text-property-changes 247 (with-silent-modifications
248 (rng-clear-cached-state (point-min) (point-max))) 248 (rng-clear-cached-state (point-min) (point-max)))
249 ;; 1+ to clear empty overlays at (point-max) 249 ;; 1+ to clear empty overlays at (point-max)
250 (rng-clear-overlays (point-min) (1+ (point-max))) 250 (rng-clear-overlays (point-min) (1+ (point-max)))
@@ -305,7 +305,7 @@ The schema is set like `rng-auto-set-schema'."
305 305
306(defun rng-after-change-function (start end pre-change-len) 306(defun rng-after-change-function (start end pre-change-len)
307 (setq rng-message-overlay-inhibit-point nil) 307 (setq rng-message-overlay-inhibit-point nil)
308 (nxml-with-unmodifying-text-property-changes 308 (with-silent-modifications
309 (rng-clear-cached-state start end)) 309 (rng-clear-cached-state start end))
310 ;; rng-validate-up-to-date-end holds the position before the change 310 ;; rng-validate-up-to-date-end holds the position before the change
311 ;; Adjust it to reflect the change. 311 ;; Adjust it to reflect the change.
@@ -414,26 +414,17 @@ The schema is set like `rng-auto-set-schema'."
414(defvar rng-validate-display-modified-p nil) 414(defvar rng-validate-display-modified-p nil)
415 415
416(defun rng-validate-while-idle-continue-p () 416(defun rng-validate-while-idle-continue-p ()
417 ;; input-pending-p and sit-for run timers that are 417 (and (not (input-pending-p))
418 ;; ripe. Binding timer-idle-list to nil prevents 418 ;; Fake rng-validate-up-to-date-end so that the mode line
419 ;; this. If we don't do this, then any ripe timers 419 ;; shows progress. Also use this to save point.
420 ;; will get run, and we won't get any chance to 420 (let ((rng-validate-up-to-date-end (point)))
421 ;; validate until Emacs becomes idle again or until 421 (goto-char rng-validate-display-point)
422 ;; the other lower priority timers finish (which 422 (when (not rng-validate-display-modified-p)
423 ;; can take a very long time in the case of 423 (restore-buffer-modified-p nil))
424 ;; jit-lock). 424 (force-mode-line-update)
425 (let ((timer-idle-list nil)) 425 (let ((continue (sit-for 0)))
426 (and (not (input-pending-p)) 426 (goto-char rng-validate-up-to-date-end)
427 ;; Fake rng-validate-up-to-date-end so that the mode line 427 continue))))
428 ;; shows progress. Also use this to save point.
429 (let ((rng-validate-up-to-date-end (point)))
430 (goto-char rng-validate-display-point)
431 (when (not rng-validate-display-modified-p)
432 (restore-buffer-modified-p nil))
433 (force-mode-line-update)
434 (let ((continue (sit-for 0)))
435 (goto-char rng-validate-up-to-date-end)
436 continue)))))
437 428
438;; Calling rng-do-some-validation once with a continue-p function, as 429;; Calling rng-do-some-validation once with a continue-p function, as
439;; opposed to calling it repeatedly, helps on initial validation of a 430;; opposed to calling it repeatedly, helps on initial validation of a
@@ -442,24 +433,26 @@ The schema is set like `rng-auto-set-schema'."
442;; validation process down. 433;; validation process down.
443 434
444(defun rng-validate-while-idle (buffer) 435(defun rng-validate-while-idle (buffer)
445 (with-current-buffer buffer 436 (when (buffer-live-p buffer) ; bug#13999
446 (if rng-validate-mode 437 (with-current-buffer buffer
447 (if (let ((rng-validate-display-point (point)) 438 (if rng-validate-mode
448 (rng-validate-display-modified-p (buffer-modified-p))) 439 (if (let ((rng-validate-display-point (point))
449 (rng-do-some-validation 'rng-validate-while-idle-continue-p)) 440 (rng-validate-display-modified-p (buffer-modified-p)))
450 (force-mode-line-update) 441 (rng-do-some-validation 'rng-validate-while-idle-continue-p))
451 (rng-validate-done)) 442 (force-mode-line-update)
452 ;; must have done kill-all-local-variables 443 (rng-validate-done))
453 (rng-kill-timers)))) 444 ;; must have done kill-all-local-variables
445 (rng-kill-timers)))))
454 446
455(defun rng-validate-quick-while-idle (buffer) 447(defun rng-validate-quick-while-idle (buffer)
456 (with-current-buffer buffer 448 (when (buffer-live-p buffer) ; bug#13999
457 (if rng-validate-mode 449 (with-current-buffer buffer
458 (if (rng-do-some-validation) 450 (if rng-validate-mode
459 (force-mode-line-update) 451 (if (rng-do-some-validation)
460 (rng-validate-done)) 452 (force-mode-line-update)
461 ;; must have done kill-all-local-variables 453 (rng-validate-done))
462 (rng-kill-timers)))) 454 ;; must have done kill-all-local-variables
455 (rng-kill-timers)))))
463 456
464(defun rng-validate-done () 457(defun rng-validate-done ()
465 (when (or (not (current-message)) 458 (when (or (not (current-message))
@@ -478,7 +471,7 @@ The schema is set like `rng-auto-set-schema'."
478 (condition-case-unless-debug err 471 (condition-case-unless-debug err
479 (and (rng-validate-prepare) 472 (and (rng-validate-prepare)
480 (let ((rng-dt-namespace-context-getter '(nxml-ns-get-context))) 473 (let ((rng-dt-namespace-context-getter '(nxml-ns-get-context)))
481 (nxml-with-unmodifying-text-property-changes 474 (with-silent-modifications
482 (rng-do-some-validation-1 continue-p-function)))) 475 (rng-do-some-validation-1 continue-p-function))))
483 ;; errors signaled from a function run by an idle timer 476 ;; errors signaled from a function run by an idle timer
484 ;; are ignored; if we don't catch them, validation 477 ;; are ignored; if we don't catch them, validation
@@ -880,9 +873,7 @@ means goto the first error."
880 (< rng-validate-up-to-date-end (point-max))) 873 (< rng-validate-up-to-date-end (point-max)))
881 ;; Display percentage validated. 874 ;; Display percentage validated.
882 (force-mode-line-update) 875 (force-mode-line-update)
883 ;; Force redisplay but don't allow idle timers to run. 876 (sit-for 0)
884 (let ((timer-idle-list nil))
885 (sit-for 0))
886 (setq pos 877 (setq pos
887 (max pos (1- rng-validate-up-to-date-end))) 878 (max pos (1- rng-validate-up-to-date-end)))
888 t))))) 879 t)))))
@@ -905,9 +896,7 @@ means goto the first error."
905 (while (and (rng-do-some-validation) 896 (while (and (rng-do-some-validation)
906 (< rng-validate-up-to-date-end (min pos (point-max)))) 897 (< rng-validate-up-to-date-end (min pos (point-max))))
907 (force-mode-line-update) 898 (force-mode-line-update)
908 ;; Force redisplay but don't allow idle timers to run. 899 (sit-for 0))
909 (let ((timer-idle-list nil))
910 (sit-for 0)))
911 (while (and (> arg 0) 900 (while (and (> arg 0)
912 (setq err (rng-find-previous-error-overlay pos))) 901 (setq err (rng-find-previous-error-overlay pos)))
913 (setq pos (overlay-start err)) 902 (setq pos (overlay-start err))
diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el
index 74b81b0cd01..11eb0eeaf49 100644
--- a/lisp/progmodes/cfengine.el
+++ b/lisp/progmodes/cfengine.el
@@ -30,11 +30,13 @@
30;; The CFEngine 3.x support doesn't have Imenu support but patches are 30;; The CFEngine 3.x support doesn't have Imenu support but patches are
31;; welcome. 31;; welcome.
32 32
33;; By default, CFEngine 3.x syntax is used.
34
33;; You can set it up so either `cfengine2-mode' (2.x and earlier) or 35;; You can set it up so either `cfengine2-mode' (2.x and earlier) or
34;; `cfengine3-mode' (3.x) will be picked, depending on the buffer 36;; `cfengine3-mode' (3.x) will be picked, depending on the buffer
35;; contents: 37;; contents:
36 38
37;; (add-to-list 'auto-mode-alist '("\\.cf\\'" . cfengine-mode)) 39;; (add-to-list 'auto-mode-alist '("\\.cf\\'" . cfengine-auto-mode))
38 40
39;; OR you can choose to always use a specific version, if you prefer 41;; OR you can choose to always use a specific version, if you prefer
40;; it: 42;; it:
@@ -181,7 +183,7 @@ This includes those for cfservd as well as cfagent.")
181 ("$(\\([[:alnum:]_]+\\))" 1 font-lock-variable-name-face) 183 ("$(\\([[:alnum:]_]+\\))" 1 font-lock-variable-name-face)
182 ("${\\([[:alnum:]_]+\\)}" 1 font-lock-variable-name-face) 184 ("${\\([[:alnum:]_]+\\)}" 1 font-lock-variable-name-face)
183 ;; Variable definitions. 185 ;; Variable definitions.
184 ("\\<\\([[:alnum:]_]+\\)[ \t]*=[ \t]*(" 1 font-lock-variable-name-face) 186 ("\\_<\\([[:alnum:]_]+\\)[ \t]*=[ \t]*(" 1 font-lock-variable-name-face)
185 ;; File, acl &c in group: { token ... } 187 ;; File, acl &c in group: { token ... }
186 ("{[ \t]*\\([^ \t\n]+\\)" 1 font-lock-constant-face))) 188 ("{[ \t]*\\([^ \t\n]+\\)" 1 font-lock-constant-face)))
187 189
@@ -189,9 +191,9 @@ This includes those for cfservd as well as cfagent.")
189 `( 191 `(
190 ;; Defuns. This happens early so they don't get caught by looser 192 ;; Defuns. This happens early so they don't get caught by looser
191 ;; patterns. 193 ;; patterns.
192 (,(concat "\\<" cfengine3-defuns-regex "\\>" 194 (,(concat "\\_<" cfengine3-defuns-regex "\\_>"
193 "[ \t]+\\<\\([[:alnum:]_.:]+\\)\\>" 195 "[ \t]+\\_<\\([[:alnum:]_.:]+\\)\\_>"
194 "[ \t]+\\<\\([[:alnum:]_.:]+\\)" 196 "[ \t]+\\_<\\([[:alnum:]_.:]+\\)"
195 ;; Optional parentheses with variable names inside. 197 ;; Optional parentheses with variable names inside.
196 "\\(?:(\\([^)]*\\))\\)?") 198 "\\(?:(\\([^)]*\\))\\)?")
197 (1 font-lock-builtin-face) 199 (1 font-lock-builtin-face)
@@ -212,10 +214,10 @@ This includes those for cfservd as well as cfagent.")
212 ("[@$]{\\([[:alnum:]_.:]+\\)}" 1 font-lock-variable-name-face) 214 ("[@$]{\\([[:alnum:]_.:]+\\)}" 1 font-lock-variable-name-face)
213 215
214 ;; Variable definitions. 216 ;; Variable definitions.
215 ("\\<\\([[:alnum:]_]+\\)[ \t]*=[ \t]*(" 1 font-lock-variable-name-face) 217 ("\\_<\\([[:alnum:]_]+\\)[ \t]*=[ \t]*(" 1 font-lock-variable-name-face)
216 218
217 ;; Variable types. 219 ;; Variable types.
218 (,(concat "\\<" (eval-when-compile (regexp-opt cfengine3-vartypes t)) "\\>") 220 (,(concat "\\_<" (eval-when-compile (regexp-opt cfengine3-vartypes t)) "\\_>")
219 1 font-lock-type-face))) 221 1 font-lock-type-face)))
220 222
221(defvar cfengine2-imenu-expression 223(defvar cfengine2-imenu-expression
@@ -223,9 +225,9 @@ This includes those for cfservd as well as cfagent.")
223 (regexp-opt cfengine2-actions t)) 225 (regexp-opt cfengine2-actions t))
224 ":[^:]") 226 ":[^:]")
225 1) 227 1)
226 ("Variables/classes" "\\<\\([[:alnum:]_]+\\)[ \t]*=[ \t]*(" 1) 228 ("Variables/classes" "\\_<\\([[:alnum:]_]+\\)[ \t]*=[ \t]*(" 1)
227 ("Variables/classes" "\\<define=\\([[:alnum:]_]+\\)" 1) 229 ("Variables/classes" "\\_<define=\\([[:alnum:]_]+\\)" 1)
228 ("Variables/classes" "\\<DefineClass\\>[ \t]+\\([[:alnum:]_]+\\)" 1)) 230 ("Variables/classes" "\\_<DefineClass\\>[ \t]+\\([[:alnum:]_]+\\)" 1))
229 "`imenu-generic-expression' for CFEngine mode.") 231 "`imenu-generic-expression' for CFEngine mode.")
230 232
231(defun cfengine2-outline-level () 233(defun cfengine2-outline-level ()
@@ -338,7 +340,7 @@ Intended as the value of `indent-line-function'."
338Treats body/bundle blocks as defuns." 340Treats body/bundle blocks as defuns."
339 (unless (<= (current-column) (current-indentation)) 341 (unless (<= (current-column) (current-indentation))
340 (end-of-line)) 342 (end-of-line))
341 (if (re-search-backward (concat "^[ \t]*" cfengine3-defuns-regex "\\>") nil t) 343 (if (re-search-backward (concat "^[ \t]*" cfengine3-defuns-regex "\\_>") nil t)
342 (beginning-of-line) 344 (beginning-of-line)
343 (goto-char (point-min))) 345 (goto-char (point-min)))
344 t) 346 t)
@@ -347,7 +349,7 @@ Treats body/bundle blocks as defuns."
347 "`end-of-defun' function for Cfengine 3 mode. 349 "`end-of-defun' function for Cfengine 3 mode.
348Treats body/bundle blocks as defuns." 350Treats body/bundle blocks as defuns."
349 (end-of-line) 351 (end-of-line)
350 (if (re-search-forward (concat "^[ \t]*" cfengine3-defuns-regex "\\>") nil t) 352 (if (re-search-forward (concat "^[ \t]*" cfengine3-defuns-regex "\\_>") nil t)
351 (beginning-of-line) 353 (beginning-of-line)
352 (goto-char (point-max))) 354 (goto-char (point-max)))
353 t) 355 t)
@@ -366,7 +368,7 @@ Intended as the value of `indent-line-function'."
366 368
367 (cond 369 (cond
368 ;; Body/bundle blocks start at 0. 370 ;; Body/bundle blocks start at 0.
369 ((looking-at (concat cfengine3-defuns-regex "\\>")) 371 ((looking-at (concat cfengine3-defuns-regex "\\_>"))
370 (indent-line-to 0)) 372 (indent-line-to 0))
371 ;; Categories are indented one step. 373 ;; Categories are indented one step.
372 ((looking-at (concat cfengine3-category-regex "[ \t]*\\(#.*\\)*$")) 374 ((looking-at (concat cfengine3-category-regex "[ \t]*\\(#.*\\)*$"))
@@ -583,7 +585,7 @@ on the buffer contents"
583 (save-restriction 585 (save-restriction
584 (goto-char (point-min)) 586 (goto-char (point-min))
585 (while (not (or (eobp) v3)) 587 (while (not (or (eobp) v3))
586 (setq v3 (looking-at (concat cfengine3-defuns-regex "\\>"))) 588 (setq v3 (looking-at (concat cfengine3-defuns-regex "\\_>")))
587 (forward-line))) 589 (forward-line)))
588 (if v3 (cfengine3-mode) (cfengine2-mode)))) 590 (if v3 (cfengine3-mode) (cfengine2-mode))))
589 591
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 9e9e2f0b090..98a89bb2363 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1814,6 +1814,7 @@ Returns the compilation buffer created."
1814 (define-key map [follow-link] 'mouse-face) 1814 (define-key map [follow-link] 'mouse-face)
1815 (define-key map "\C-c\C-c" 'compile-goto-error) 1815 (define-key map "\C-c\C-c" 'compile-goto-error)
1816 (define-key map "\C-m" 'compile-goto-error) 1816 (define-key map "\C-m" 'compile-goto-error)
1817 (define-key map "\C-o" 'compilation-display-error)
1817 (define-key map "\C-c\C-k" 'kill-compilation) 1818 (define-key map "\C-c\C-k" 'kill-compilation)
1818 (define-key map "\M-n" 'compilation-next-error) 1819 (define-key map "\M-n" 'compilation-next-error)
1819 (define-key map "\M-p" 'compilation-previous-error) 1820 (define-key map "\M-p" 'compilation-previous-error)
@@ -1858,6 +1859,7 @@ Returns the compilation buffer created."
1858 (define-key map [follow-link] 'mouse-face) 1859 (define-key map [follow-link] 'mouse-face)
1859 (define-key map "\C-c\C-c" 'compile-goto-error) 1860 (define-key map "\C-c\C-c" 'compile-goto-error)
1860 (define-key map "\C-m" 'compile-goto-error) 1861 (define-key map "\C-m" 'compile-goto-error)
1862 (define-key map "\C-o" 'compilation-display-error)
1861 (define-key map "\C-c\C-k" 'kill-compilation) 1863 (define-key map "\C-c\C-k" 'kill-compilation)
1862 (define-key map "\M-n" 'compilation-next-error) 1864 (define-key map "\M-n" 'compilation-next-error)
1863 (define-key map "\M-p" 'compilation-previous-error) 1865 (define-key map "\M-p" 'compilation-previous-error)
@@ -2299,6 +2301,12 @@ Prefix arg N says how many files to move backwards (or forwards, if negative)."
2299 (interactive "p") 2301 (interactive "p")
2300 (compilation-next-file (- n))) 2302 (compilation-next-file (- n)))
2301 2303
2304(defun compilation-display-error ()
2305 "Display the source for current error in another window."
2306 (interactive)
2307 (setq compilation-current-error (point))
2308 (next-error-no-select 0))
2309
2302(defun kill-compilation () 2310(defun kill-compilation ()
2303 "Kill the process made by the \\[compile] or \\[grep] commands." 2311 "Kill the process made by the \\[compile] or \\[grep] commands."
2304 (interactive) 2312 (interactive)
diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el
index aae5526ea82..fab20102097 100644
--- a/lisp/progmodes/scheme.el
+++ b/lisp/progmodes/scheme.el
@@ -310,7 +310,7 @@ See `run-hooks'."
310 "(" (regexp-opt 310 "(" (regexp-opt
311 '("begin" "call-with-current-continuation" "call/cc" 311 '("begin" "call-with-current-continuation" "call/cc"
312 "call-with-input-file" "call-with-output-file" "case" "cond" 312 "call-with-input-file" "call-with-output-file" "case" "cond"
313 "do" "else" "for-each" "if" "lambda" 313 "do" "else" "for-each" "if" "lambda" "λ"
314 "let" "let*" "let-syntax" "letrec" "letrec-syntax" 314 "let" "let*" "let-syntax" "letrec" "letrec-syntax"
315 ;; SRFI 11 usage comes up often enough. 315 ;; SRFI 11 usage comes up often enough.
316 "let-values" "let*-values" 316 "let-values" "let*-values"
@@ -410,6 +410,7 @@ that variable's value is a string."
410(put 'make 'scheme-indent-function 1) 410(put 'make 'scheme-indent-function 1)
411(put 'style 'scheme-indent-function 1) 411(put 'style 'scheme-indent-function 1)
412(put 'root 'scheme-indent-function 1) 412(put 'root 'scheme-indent-function 1)
413(put 'λ 'scheme-indent-function 1)
413 414
414(defvar dsssl-font-lock-keywords 415(defvar dsssl-font-lock-keywords
415 (eval-when-compile 416 (eval-when-compile
diff --git a/lisp/register.el b/lisp/register.el
index ae2f7cf3e2a..4876c614642 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -31,10 +31,6 @@
31 31
32(eval-when-compile (require 'cl-lib)) 32(eval-when-compile (require 'cl-lib))
33 33
34(declare-function semantic-insert-foreign-tag "semantic/tag" (foreign-tag))
35(declare-function semantic-tag-buffer "semantic/tag" (tag))
36(declare-function semantic-tag-start "semantic/tag" (tag))
37
38;;; Code: 34;;; Code:
39 35
40(cl-defstruct 36(cl-defstruct
@@ -174,11 +170,6 @@ delete any existing frames that the frame configuration doesn't mention.
174 (error "Register access aborted")) 170 (error "Register access aborted"))
175 (find-file (nth 1 val)) 171 (find-file (nth 1 val))
176 (goto-char (nth 2 val))) 172 (goto-char (nth 2 val)))
177 ((and (fboundp 'semantic-foreign-tag-p)
178 semantic-mode
179 (semantic-foreign-tag-p val))
180 (switch-to-buffer (semantic-tag-buffer val))
181 (goto-char (semantic-tag-start val)))
182 (t 173 (t
183 (error "Register doesn't contain a buffer position or configuration"))))) 174 (error "Register doesn't contain a buffer position or configuration")))))
184 175
@@ -349,10 +340,6 @@ Interactively, second arg is non-nil if prefix arg is supplied."
349 (princ val (current-buffer))) 340 (princ val (current-buffer)))
350 ((and (markerp val) (marker-position val)) 341 ((and (markerp val) (marker-position val))
351 (princ (marker-position val) (current-buffer))) 342 (princ (marker-position val) (current-buffer)))
352 ((and (fboundp 'semantic-foreign-tag-p)
353 semantic-mode
354 (semantic-foreign-tag-p val))
355 (semantic-insert-foreign-tag val))
356 (t 343 (t
357 (error "Register does not contain text")))) 344 (error "Register does not contain text"))))
358 (if (not arg) (exchange-point-and-mark))) 345 (if (not arg) (exchange-point-and-mark)))
diff --git a/lisp/replace.el b/lisp/replace.el
index 17eea19edd8..1bebff448fa 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1125,6 +1125,14 @@ If the value is nil, don't highlight the buffer names specially."
1125 :type 'face 1125 :type 'face
1126 :group 'matching) 1126 :group 'matching)
1127 1127
1128(defcustom list-matching-lines-prefix-face 'shadow
1129 "Face used by \\[list-matching-lines] to show the prefix column.
1130If the face doesn't differ from the default face,
1131don't highlight the prefix with line numbers specially."
1132 :type 'face
1133 :group 'matching
1134 :version "24.4")
1135
1128(defcustom occur-excluded-properties 1136(defcustom occur-excluded-properties
1129 '(read-only invisible intangible field mouse-face help-echo local-map keymap 1137 '(read-only invisible intangible field mouse-face help-echo local-map keymap
1130 yank-handler follow-link) 1138 yank-handler follow-link)
@@ -1334,7 +1342,9 @@ See also `multi-occur'."
1334 (isearch-no-upper-case-p regexp t) 1342 (isearch-no-upper-case-p regexp t)
1335 case-fold-search) 1343 case-fold-search)
1336 list-matching-lines-buffer-name-face 1344 list-matching-lines-buffer-name-face
1337 nil list-matching-lines-face 1345 (if (face-differs-from-default-p list-matching-lines-prefix-face)
1346 list-matching-lines-prefix-face)
1347 list-matching-lines-face
1338 (not (eq occur-excluded-properties t)))))) 1348 (not (eq occur-excluded-properties t))))))
1339 (let* ((bufcount (length active-bufs)) 1349 (let* ((bufcount (length active-bufs))
1340 (diff (- (length bufs) bufcount))) 1350 (diff (- (length bufs) bufcount)))
@@ -1423,7 +1433,7 @@ See also `multi-occur'."
1423 (apply #'propertize (format "%7d:" lines) 1433 (apply #'propertize (format "%7d:" lines)
1424 (append 1434 (append
1425 (when prefix-face 1435 (when prefix-face
1426 `(font-lock-face prefix-face)) 1436 `(font-lock-face ,prefix-face))
1427 `(occur-prefix t mouse-face (highlight) 1437 `(occur-prefix t mouse-face (highlight)
1428 ;; Allow insertion of text at 1438 ;; Allow insertion of text at
1429 ;; the end of the prefix (for 1439 ;; the end of the prefix (for
@@ -1447,7 +1457,9 @@ See also `multi-occur'."
1447 ;; of multi-line matches. 1457 ;; of multi-line matches.
1448 (replace-regexp-in-string 1458 (replace-regexp-in-string
1449 "\n" 1459 "\n"
1450 "\n :" 1460 (if prefix-face
1461 (propertize "\n :" 'font-lock-face prefix-face)
1462 "\n :")
1451 match-str) 1463 match-str)
1452 ;; Add marker at eol, but no mouse props. 1464 ;; Add marker at eol, but no mouse props.
1453 (propertize "\n" 'occur-target marker))) 1465 (propertize "\n" 'occur-target marker)))
@@ -1458,7 +1470,8 @@ See also `multi-occur'."
1458 ;; The complex multi-line display style. 1470 ;; The complex multi-line display style.
1459 (setq ret (occur-context-lines 1471 (setq ret (occur-context-lines
1460 out-line nlines keep-props begpt endpt 1472 out-line nlines keep-props begpt endpt
1461 lines prev-lines prev-after-lines)) 1473 lines prev-lines prev-after-lines
1474 prefix-face))
1462 ;; Set first elem of the returned list to `data', 1475 ;; Set first elem of the returned list to `data',
1463 ;; and the second elem to `prev-after-lines'. 1476 ;; and the second elem to `prev-after-lines'.
1464 (setq prev-after-lines (nth 1 ret)) 1477 (setq prev-after-lines (nth 1 ret))
@@ -1482,7 +1495,7 @@ See also `multi-occur'."
1482 (when prev-after-lines 1495 (when prev-after-lines
1483 (with-current-buffer out-buf 1496 (with-current-buffer out-buf
1484 (insert (apply #'concat (occur-engine-add-prefix 1497 (insert (apply #'concat (occur-engine-add-prefix
1485 prev-after-lines))))))) 1498 prev-after-lines prefix-face)))))))
1486 (when (not (zerop matches)) ;; is the count zero? 1499 (when (not (zerop matches)) ;; is the count zero?
1487 (setq globalcount (+ globalcount matches)) 1500 (setq globalcount (+ globalcount matches))
1488 (with-current-buffer out-buf 1501 (with-current-buffer out-buf
@@ -1537,10 +1550,13 @@ See also `multi-occur'."
1537 str) 1550 str)
1538 (buffer-substring-no-properties beg end))) 1551 (buffer-substring-no-properties beg end)))
1539 1552
1540(defun occur-engine-add-prefix (lines) 1553(defun occur-engine-add-prefix (lines &optional prefix-face)
1541 (mapcar 1554 (mapcar
1542 #'(lambda (line) 1555 #'(lambda (line)
1543 (concat " :" line "\n")) 1556 (concat (if prefix-face
1557 (propertize " :" 'font-lock-face prefix-face)
1558 " :")
1559 line "\n"))
1544 lines)) 1560 lines))
1545 1561
1546(defun occur-accumulate-lines (count &optional keep-props pt) 1562(defun occur-accumulate-lines (count &optional keep-props pt)
@@ -1569,7 +1585,8 @@ See also `multi-occur'."
1569;; Generate a list of lines, add prefixes to all but OUT-LINE, 1585;; Generate a list of lines, add prefixes to all but OUT-LINE,
1570;; then concatenate them all together. 1586;; then concatenate them all together.
1571(defun occur-context-lines (out-line nlines keep-props begpt endpt 1587(defun occur-context-lines (out-line nlines keep-props begpt endpt
1572 lines prev-lines prev-after-lines) 1588 lines prev-lines prev-after-lines
1589 &optional prefix-face)
1573 ;; Find after- and before-context lines of the current match. 1590 ;; Find after- and before-context lines of the current match.
1574 (let ((before-lines 1591 (let ((before-lines
1575 (nreverse (cdr (occur-accumulate-lines 1592 (nreverse (cdr (occur-accumulate-lines
@@ -1609,10 +1626,13 @@ See also `multi-occur'."
1609 ;; Return a list where the first element is the output line. 1626 ;; Return a list where the first element is the output line.
1610 (apply #'concat 1627 (apply #'concat
1611 (append 1628 (append
1612 (and prev-after-lines 1629 (if prev-after-lines
1613 (occur-engine-add-prefix prev-after-lines)) 1630 (occur-engine-add-prefix prev-after-lines prefix-face))
1614 (and separator (list separator)) 1631 (if separator
1615 (occur-engine-add-prefix before-lines) 1632 (list (if prefix-face
1633 (propertize separator 'font-lock-face prefix-face)
1634 separator)))
1635 (occur-engine-add-prefix before-lines prefix-face)
1616 (list out-line))) 1636 (list out-line)))
1617 ;; And the second element is the list of context after-lines. 1637 ;; And the second element is the list of context after-lines.
1618 (if (> nlines 0) after-lines)))) 1638 (if (> nlines 0) after-lines))))
diff --git a/lisp/simple.el b/lisp/simple.el
index 3ef700a6058..9baa1b7c884 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1291,6 +1291,9 @@ display the result of expression evaluation."
1291 (format " (#o%o, #x%x, %s)" value value char-string) 1291 (format " (#o%o, #x%x, %s)" value value char-string)
1292 (format " (#o%o, #x%x)" value value))))) 1292 (format " (#o%o, #x%x)" value value)))))
1293 1293
1294(defvar eval-expression-minibuffer-setup-hook nil
1295 "Hook run by `eval-expression' when entering the minibuffer.")
1296
1294;; We define this, rather than making `eval' interactive, 1297;; We define this, rather than making `eval' interactive,
1295;; for the sake of completion of names like eval-region, eval-buffer. 1298;; for the sake of completion of names like eval-region, eval-buffer.
1296(defun eval-expression (exp &optional insert-value) 1299(defun eval-expression (exp &optional insert-value)
@@ -1308,9 +1311,11 @@ If `eval-expression-debug-on-error' is non-nil, which is the default,
1308this command arranges for all errors to enter the debugger." 1311this command arranges for all errors to enter the debugger."
1309 (interactive 1312 (interactive
1310 (list (let ((minibuffer-completing-symbol t)) 1313 (list (let ((minibuffer-completing-symbol t))
1311 (read-from-minibuffer "Eval: " 1314 (minibuffer-with-setup-hook
1312 nil read-expression-map t 1315 (lambda () (run-hooks 'eval-expression-minibuffer-setup-hook))
1313 'read-expression-history)) 1316 (read-from-minibuffer "Eval: "
1317 nil read-expression-map t
1318 'read-expression-history)))
1314 current-prefix-arg)) 1319 current-prefix-arg))
1315 1320
1316 (if (null eval-expression-debug-on-error) 1321 (if (null eval-expression-debug-on-error)
diff --git a/lisp/startup.el b/lisp/startup.el
index ad31a7a2a45..db84a5b11b2 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -2399,13 +2399,17 @@ A fancy display is used on graphic displays, normal otherwise."
2399 ;; Use arg 1 so that we don't collapse // at the start of the file name. 2399 ;; Use arg 1 so that we don't collapse // at the start of the file name.
2400 ;; That is significant on some systems. 2400 ;; That is significant on some systems.
2401 ;; However, /// at the beginning is supposed to mean just /, not //. 2401 ;; However, /// at the beginning is supposed to mean just /, not //.
2402 (if (string-match "^///+" file) 2402 (if (string-match
2403 (if (memq system-type '(ms-dos windows-nt))
2404 "^\\([\\/][\\/][\\/]\\)+"
2405 "^///+")
2406 file)
2403 (setq file (replace-match "/" t t file))) 2407 (setq file (replace-match "/" t t file)))
2404 (and (memq system-type '(ms-dos windows-nt)) 2408 (if (memq system-type '(ms-dos windows-nt))
2405 (string-match "^[A-Za-z]:\\(\\\\[\\\\/]\\)" file) ; C:\/ or C:\\ 2409 (while (string-match "\\([\\/][\\/]\\)+" file 1)
2406 (setq file (replace-match "/" t t file 1))) 2410 (setq file (replace-match "/" t t file)))
2407 (while (string-match "//+" file 1) 2411 (while (string-match "//+" file 1)
2408 (setq file (replace-match "/" t t file))) 2412 (setq file (replace-match "/" t t file))))
2409 file)) 2413 file))
2410 2414
2411;;; startup.el ends here 2415;;; startup.el ends here
diff --git a/lisp/subr.el b/lisp/subr.el
index 9a7b94208fe..4eb46ec2b01 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1044,14 +1044,17 @@ and `event-end' functions."
1044 (nth 1 position)))) 1044 (nth 1 position))))
1045 (and (symbolp area) area))) 1045 (and (symbolp area) area)))
1046 1046
1047(defsubst posn-point (position) 1047(defun posn-point (position)
1048 "Return the buffer location in POSITION. 1048 "Return the buffer location in POSITION.
1049POSITION should be a list of the form returned by the `event-start' 1049POSITION should be a list of the form returned by the `event-start'
1050and `event-end' functions." 1050and `event-end' functions.
1051Returns nil if POSITION does not correspond to any buffer location (e.g.
1052a click on a scroll bar)."
1051 (or (nth 5 position) 1053 (or (nth 5 position)
1052 (if (consp (nth 1 position)) 1054 (let ((pt (nth 1 position)))
1053 (car (nth 1 position)) 1055 (or (car-safe pt)
1054 (nth 1 position)))) 1056 ;; Apparently this can also be `vertical-scroll-bar' (bug#13979).
1057 (if (integerp pt) pt)))))
1055 1058
1056(defun posn-set-point (position) 1059(defun posn-set-point (position)
1057 "Move point to POSITION. 1060 "Move point to POSITION.
@@ -1124,12 +1127,14 @@ POSITION should be a list of the form returned by the `event-start'
1124and `event-end' functions." 1127and `event-end' functions."
1125 (nth 3 position)) 1128 (nth 3 position))
1126 1129
1127(defsubst posn-string (position) 1130(defun posn-string (position)
1128 "Return the string object of POSITION. 1131 "Return the string object of POSITION.
1129Value is a cons (STRING . STRING-POS), or nil if not a string. 1132Value is a cons (STRING . STRING-POS), or nil if not a string.
1130POSITION should be a list of the form returned by the `event-start' 1133POSITION should be a list of the form returned by the `event-start'
1131and `event-end' functions." 1134and `event-end' functions."
1132 (nth 4 position)) 1135 (let ((x (nth 4 position)))
1136 ;; Apparently this can also be `handle' or `below-handle' (bug#13979).
1137 (when (consp x) x)))
1133 1138
1134(defsubst posn-image (position) 1139(defsubst posn-image (position)
1135 "Return the image object of POSITION. 1140 "Return the image object of POSITION.
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 63ef2b402b0..84d6ddbf46c 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -427,7 +427,9 @@ as returned by `x-server-vendor'."
427 (#x3fe . ?,D~(B) 427 (#x3fe . ?,D~(B)
428 ;; Kana: Fixme: needs conversion to Japanese charset -- seems 428 ;; Kana: Fixme: needs conversion to Japanese charset -- seems
429 ;; to require jisx0213, for which the Unicode translation 429 ;; to require jisx0213, for which the Unicode translation
430 ;; isn't clear. 430 ;; isn't clear. Using Emacs to convert this to Unicode and back changes
431 ;; this from "(J~(B" (i.e., bytes "ESC ( J ~ ESC ( B") to "$(G"#(B" (i.e., bytes
432 ;; "ESC $ ( G " # ESC ( B").
431 (#x47e . ?(J~(B) 433 (#x47e . ?(J~(B)
432 (#x4a1 . ?$A!#(B) 434 (#x4a1 . ?$A!#(B)
433 (#x4a2 . ?\$A!8(B) 435 (#x4a2 . ?\$A!8(B)
@@ -1127,6 +1129,9 @@ as returned by `x-server-vendor'."
1127 (#x20a8 . ?$,1tH(B) 1129 (#x20a8 . ?$,1tH(B)
1128 (#x20aa . ?$,1tJ(B) 1130 (#x20aa . ?$,1tJ(B)
1129 (#x20ab . ?$,1tK(B) 1131 (#x20ab . ?$,1tK(B)
1132 ;; Kana: Fixme: needs checking. Using Emacs to convert this to Unicode
1133 ;; and back changes this from ",b$(B" (i.e., bytes "ESC , b $ ESC ( B") to
1134 ;; ",F$(B" (i.e., bytes "ESC , F $ ESC ( B").
1130 (#x20ac . ?,b$(B))) 1135 (#x20ac . ?,b$(B)))
1131 (puthash (car pair) (cdr pair) x-keysym-table)) 1136 (puthash (car pair) (cdr pair) x-keysym-table))
1132 1137
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index 9526cb76e74..259cd772b12 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -182,7 +182,7 @@ The bounds of THING are determined by `bounds-of-thing-at-point'."
182(defun end-of-sexp () 182(defun end-of-sexp ()
183 "Move point to the end of the current sexp. 183 "Move point to the end of the current sexp.
184\[This is an internal function.]" 184\[This is an internal function.]"
185 (let ((char-syntax (char-syntax (char-after)))) 185 (let ((char-syntax (syntax-after (point))))
186 (if (or (eq char-syntax ?\)) 186 (if (or (eq char-syntax ?\))
187 (and (eq char-syntax ?\") (in-string-p))) 187 (and (eq char-syntax ?\") (in-string-p)))
188 (forward-char 1) 188 (forward-char 1)
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index d9224b29c2e..e945d6ef160 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -124,7 +124,6 @@ when editing big diffs)."
124 ("A" . diff-ediff-patch) 124 ("A" . diff-ediff-patch)
125 ("r" . diff-restrict-view) 125 ("r" . diff-restrict-view)
126 ("R" . diff-reverse-direction) 126 ("R" . diff-reverse-direction)
127 ("/" . diff-undo)
128 ([remap undo] . diff-undo)) 127 ([remap undo] . diff-undo))
129 "Basic keymap for `diff-mode', bound to various prefix keys." 128 "Basic keymap for `diff-mode', bound to various prefix keys."
130 :inherit special-mode-map) 129 :inherit special-mode-map)
diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index 975b89f2fc2..c32155f5430 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -554,13 +554,10 @@ See also `whitespace-display-mappings' for documentation."
554 (const :tag "(Mark) NEWLINEs" newline-mark))) 554 (const :tag "(Mark) NEWLINEs" newline-mark)))
555 :group 'whitespace) 555 :group 'whitespace)
556 556
557 557(defvar whitespace-space 'whitespace-space
558(defcustom whitespace-space 'whitespace-space
559 "Symbol face used to visualize SPACE. 558 "Symbol face used to visualize SPACE.
560 559Used when `whitespace-style' includes the value `spaces'.")
561Used when `whitespace-style' includes the value `spaces'." 560(make-obsolete-variable 'whitespace-space "use the face instead" "24.4")
562 :type 'face
563 :group 'whitespace)
564 561
565 562
566(defface whitespace-space 563(defface whitespace-space
@@ -573,13 +570,10 @@ Used when `whitespace-style' includes the value `spaces'."
573 :group 'whitespace) 570 :group 'whitespace)
574 571
575 572
576(defcustom whitespace-hspace 'whitespace-hspace 573(defvar whitespace-hspace 'whitespace-hspace
577 "Symbol face used to visualize HARD SPACE. 574 "Symbol face used to visualize HARD SPACE.
578 575Used when `whitespace-style' includes the value `spaces'.")
579Used when `whitespace-style' includes the value `spaces'." 576(make-obsolete-variable 'whitespace-hspace "use the face instead" "24.4")
580 :type 'face
581 :group 'whitespace)
582
583 577
584(defface whitespace-hspace ; 'nobreak-space 578(defface whitespace-hspace ; 'nobreak-space
585 '((((class color) (background dark)) 579 '((((class color) (background dark))
@@ -591,13 +585,10 @@ Used when `whitespace-style' includes the value `spaces'."
591 :group 'whitespace) 585 :group 'whitespace)
592 586
593 587
594(defcustom whitespace-tab 'whitespace-tab 588(defvar whitespace-tab 'whitespace-tab
595 "Symbol face used to visualize TAB. 589 "Symbol face used to visualize TAB.
596 590Used when `whitespace-style' includes the value `tabs'.")
597Used when `whitespace-style' includes the value `tabs'." 591(make-obsolete-variable 'whitespace-tab "use the face instead" "24.4")
598 :type 'face
599 :group 'whitespace)
600
601 592
602(defface whitespace-tab 593(defface whitespace-tab
603 '((((class color) (background dark)) 594 '((((class color) (background dark))
@@ -609,16 +600,12 @@ Used when `whitespace-style' includes the value `tabs'."
609 :group 'whitespace) 600 :group 'whitespace)
610 601
611 602
612(defcustom whitespace-newline 'whitespace-newline 603(defvar whitespace-newline 'whitespace-newline
613 "Symbol face used to visualize NEWLINE char mapping. 604 "Symbol face used to visualize NEWLINE char mapping.
614
615See `whitespace-display-mappings'. 605See `whitespace-display-mappings'.
616
617Used when `whitespace-style' includes the values `newline-mark' 606Used when `whitespace-style' includes the values `newline-mark'
618and `newline'." 607and `newline'.")
619 :type 'face 608(make-obsolete-variable 'whitespace-newline "use the face instead" "24.4")
620 :group 'whitespace)
621
622 609
623(defface whitespace-newline 610(defface whitespace-newline
624 '((default :weight normal) 611 '((default :weight normal)
@@ -634,13 +621,10 @@ See `whitespace-display-mappings'."
634 :group 'whitespace) 621 :group 'whitespace)
635 622
636 623
637(defcustom whitespace-trailing 'whitespace-trailing 624(defvar whitespace-trailing 'whitespace-trailing
638 "Symbol face used to visualize trailing blanks. 625 "Symbol face used to visualize trailing blanks.
639 626Used when `whitespace-style' includes the value `trailing'.")
640Used when `whitespace-style' includes the value `trailing'." 627(make-obsolete-variable 'whitespace-trailing "use the face instead" "24.4")
641 :type 'face
642 :group 'whitespace)
643
644 628
645(defface whitespace-trailing ; 'trailing-whitespace 629(defface whitespace-trailing ; 'trailing-whitespace
646 '((default :weight bold) 630 '((default :weight bold)
@@ -650,15 +634,11 @@ Used when `whitespace-style' includes the value `trailing'."
650 :group 'whitespace) 634 :group 'whitespace)
651 635
652 636
653(defcustom whitespace-line 'whitespace-line 637(defvar whitespace-line 'whitespace-line
654 "Symbol face used to visualize \"long\" lines. 638 "Symbol face used to visualize \"long\" lines.
655
656See `whitespace-line-column'. 639See `whitespace-line-column'.
657 640Used when `whitespace-style' includes the value `line'.")
658Used when `whitespace-style' includes the value `line'." 641(make-obsolete-variable 'whitespace-line "use the face instead" "24.4")
659 :type 'face
660 :group 'whitespace)
661
662 642
663(defface whitespace-line 643(defface whitespace-line
664 '((((class mono)) :inverse-video t :weight bold :underline t) 644 '((((class mono)) :inverse-video t :weight bold :underline t)
@@ -669,13 +649,11 @@ See `whitespace-line-column'."
669 :group 'whitespace) 649 :group 'whitespace)
670 650
671 651
672(defcustom whitespace-space-before-tab 'whitespace-space-before-tab 652(defvar whitespace-space-before-tab 'whitespace-space-before-tab
673 "Symbol face used to visualize SPACEs before TAB. 653 "Symbol face used to visualize SPACEs before TAB.
674 654Used when `whitespace-style' includes the value `space-before-tab'.")
675Used when `whitespace-style' includes the value `space-before-tab'." 655(make-obsolete-variable 'whitespace-space-before-tab
676 :type 'face 656 "use the face instead" "24.4")
677 :group 'whitespace)
678
679 657
680(defface whitespace-space-before-tab 658(defface whitespace-space-before-tab
681 '((((class mono)) :inverse-video t :weight bold :underline t) 659 '((((class mono)) :inverse-video t :weight bold :underline t)
@@ -684,13 +662,10 @@ Used when `whitespace-style' includes the value `space-before-tab'."
684 :group 'whitespace) 662 :group 'whitespace)
685 663
686 664
687(defcustom whitespace-indentation 'whitespace-indentation 665(defvar whitespace-indentation 'whitespace-indentation
688 "Symbol face used to visualize 8 or more SPACEs at beginning of line. 666 "Symbol face used to visualize 8 or more SPACEs at beginning of line.
689 667Used when `whitespace-style' includes the value `indentation'.")
690Used when `whitespace-style' includes the value `indentation'." 668(make-obsolete-variable 'whitespace-indentation "use the face instead" "24.4")
691 :type 'face
692 :group 'whitespace)
693
694 669
695(defface whitespace-indentation 670(defface whitespace-indentation
696 '((((class mono)) :inverse-video t :weight bold :underline t) 671 '((((class mono)) :inverse-video t :weight bold :underline t)
@@ -699,13 +674,10 @@ Used when `whitespace-style' includes the value `indentation'."
699 :group 'whitespace) 674 :group 'whitespace)
700 675
701 676
702(defcustom whitespace-empty 'whitespace-empty 677(defvar whitespace-empty 'whitespace-empty
703 "Symbol face used to visualize empty lines at beginning and/or end of buffer. 678 "Symbol face used to visualize empty lines at beginning and/or end of buffer.
704 679Used when `whitespace-style' includes the value `empty'.")
705Used when `whitespace-style' includes the value `empty'." 680(make-obsolete-variable 'whitespace-empty "use the face instead" "24.4")
706 :type 'face
707 :group 'whitespace)
708
709 681
710(defface whitespace-empty 682(defface whitespace-empty
711 '((((class mono)) :inverse-video t :weight bold :underline t) 683 '((((class mono)) :inverse-video t :weight bold :underline t)
@@ -714,13 +686,11 @@ Used when `whitespace-style' includes the value `empty'."
714 :group 'whitespace) 686 :group 'whitespace)
715 687
716 688
717(defcustom whitespace-space-after-tab 'whitespace-space-after-tab 689(defvar whitespace-space-after-tab 'whitespace-space-after-tab
718 "Symbol face used to visualize 8 or more SPACEs after TAB. 690 "Symbol face used to visualize 8 or more SPACEs after TAB.
719 691Used when `whitespace-style' includes the value `space-after-tab'.")
720Used when `whitespace-style' includes the value `space-after-tab'." 692(make-obsolete-variable 'whitespace-space-after-tab
721 :type 'face 693 "use the face instead" "24.4")
722 :group 'whitespace)
723
724 694
725(defface whitespace-space-after-tab 695(defface whitespace-space-after-tab
726 '((((class mono)) :inverse-video t :weight bold :underline t) 696 '((((class mono)) :inverse-video t :weight bold :underline t)
@@ -730,15 +700,9 @@ Used when `whitespace-style' includes the value `space-after-tab'."
730 700
731 701
732(defcustom whitespace-hspace-regexp 702(defcustom whitespace-hspace-regexp
733 "\\(\\(\xA0\\|\x8A0\\|\x920\\|\xE20\\|\xF20\\)+\\)" 703 "\\(\u00A0+\\)"
734 "Specify HARD SPACE characters regexp. 704 "Specify HARD SPACE characters regexp.
735 705
736If you're using `mule' package, there may be other characters besides:
737
738 \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \"\\xF20\"
739
740that should be considered HARD SPACE.
741
742Here are some examples: 706Here are some examples:
743 707
744 \"\\\\(^\\xA0+\\\\)\" \ 708 \"\\\\(^\\xA0+\\\\)\" \
@@ -806,7 +770,7 @@ Used when `whitespace-style' includes `tabs'."
806 "\\([\t \u00A0]+\\)$" 770 "\\([\t \u00A0]+\\)$"
807 "Specify trailing characters regexp. 771 "Specify trailing characters regexp.
808 772
809If you're using `mule' package, there may be other characters besides: 773There may be other characters besides:
810 774
811 \" \" \"\\t\" \"\\u00A0\" 775 \" \" \"\\t\" \"\\u00A0\"
812 776
@@ -823,13 +787,6 @@ Used when `whitespace-style' includes `trailing'."
823(defcustom whitespace-space-before-tab-regexp "\\( +\\)\\(\t+\\)" 787(defcustom whitespace-space-before-tab-regexp "\\( +\\)\\(\t+\\)"
824 "Specify SPACEs before TAB regexp. 788 "Specify SPACEs before TAB regexp.
825 789
826If you're using `mule' package, there may be other characters besides:
827
828 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
829\"\\xF20\"
830
831that should be considered blank.
832
833Used when `whitespace-style' includes `space-before-tab', 790Used when `whitespace-style' includes `space-before-tab',
834`space-before-tab::tab' or `space-before-tab::space'." 791`space-before-tab::tab' or `space-before-tab::space'."
835 :type '(regexp :tag "SPACEs Before TAB") 792 :type '(regexp :tag "SPACEs Before TAB")
@@ -844,13 +801,6 @@ Used when `whitespace-style' includes `space-before-tab',
844It is a cons where the cons car is used for SPACEs visualization 801It is a cons where the cons car is used for SPACEs visualization
845and the cons cdr is used for TABs visualization. 802and the cons cdr is used for TABs visualization.
846 803
847If you're using `mule' package, there may be other characters besides:
848
849 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
850\"\\xF20\"
851
852that should be considered blank.
853
854Used when `whitespace-style' includes `indentation', 804Used when `whitespace-style' includes `indentation',
855`indentation::tab' or `indentation::space'." 805`indentation::tab' or `indentation::space'."
856 :type '(cons (regexp :tag "Indentation SPACEs") 806 :type '(cons (regexp :tag "Indentation SPACEs")
@@ -861,13 +811,6 @@ Used when `whitespace-style' includes `indentation',
861(defcustom whitespace-empty-at-bob-regexp "^\\(\\([ \t]*\n\\)+\\)" 811(defcustom whitespace-empty-at-bob-regexp "^\\(\\([ \t]*\n\\)+\\)"
862 "Specify regexp for empty lines at beginning of buffer. 812 "Specify regexp for empty lines at beginning of buffer.
863 813
864If you're using `mule' package, there may be other characters besides:
865
866 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
867\"\\xF20\"
868
869that should be considered blank.
870
871Used when `whitespace-style' includes `empty'." 814Used when `whitespace-style' includes `empty'."
872 :type '(regexp :tag "Empty Lines At Beginning Of Buffer") 815 :type '(regexp :tag "Empty Lines At Beginning Of Buffer")
873 :group 'whitespace) 816 :group 'whitespace)
@@ -876,13 +819,6 @@ Used when `whitespace-style' includes `empty'."
876(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]+\\)" 819(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]+\\)"
877 "Specify regexp for empty lines at end of buffer. 820 "Specify regexp for empty lines at end of buffer.
878 821
879If you're using `mule' package, there may be other characters besides:
880
881 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
882\"\\xF20\"
883
884that should be considered blank.
885
886Used when `whitespace-style' includes `empty'." 822Used when `whitespace-style' includes `empty'."
887 :type '(regexp :tag "Empty Lines At End Of Buffer") 823 :type '(regexp :tag "Empty Lines At End Of Buffer")
888 :group 'whitespace) 824 :group 'whitespace)
@@ -896,13 +832,6 @@ Used when `whitespace-style' includes `empty'."
896It is a cons where the cons car is used for SPACEs visualization 832It is a cons where the cons car is used for SPACEs visualization
897and the cons cdr is used for TABs visualization. 833and the cons cdr is used for TABs visualization.
898 834
899If you're using `mule' package, there may be other characters besides:
900
901 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
902\"\\xF20\"
903
904that should be considered blank.
905
906Used when `whitespace-style' includes `space-after-tab', 835Used when `whitespace-style' includes `space-after-tab',
907`space-after-tab::tab' or `space-after-tab::space'." 836`space-after-tab::tab' or `space-after-tab::space'."
908 :type '(regexp :tag "SPACEs After TAB") 837 :type '(regexp :tag "SPACEs After TAB")
@@ -1932,14 +1861,8 @@ cleaning up these problems."
1932;;;; Internal functions 1861;;;; Internal functions
1933 1862
1934 1863
1935(defvar whitespace-font-lock-mode nil
1936 "Used to remember whether a buffer had font lock mode on or not.")
1937
1938(defvar whitespace-font-lock nil
1939 "Used to remember whether a buffer initially had font lock on or not.")
1940
1941(defvar whitespace-font-lock-keywords nil 1864(defvar whitespace-font-lock-keywords nil
1942 "Used to save locally `font-lock-keywords' value.") 1865 "Used to save the value `whitespace-color-on' adds to `font-lock-keywords'.")
1943 1866
1944 1867
1945(defconst whitespace-help-text 1868(defconst whitespace-help-text
@@ -2177,8 +2100,6 @@ resultant list will be returned."
2177 ;; prepare local hooks 2100 ;; prepare local hooks
2178 (add-hook 'write-file-functions 'whitespace-write-file-hook nil t) 2101 (add-hook 'write-file-functions 'whitespace-write-file-hook nil t)
2179 ;; create whitespace local buffer environment 2102 ;; create whitespace local buffer environment
2180 (set (make-local-variable 'whitespace-font-lock-mode) nil)
2181 (set (make-local-variable 'whitespace-font-lock) nil)
2182 (set (make-local-variable 'whitespace-font-lock-keywords) nil) 2103 (set (make-local-variable 'whitespace-font-lock-keywords) nil)
2183 (set (make-local-variable 'whitespace-display-table) nil) 2104 (set (make-local-variable 'whitespace-display-table) nil)
2184 (set (make-local-variable 'whitespace-display-table-was-local) nil) 2105 (set (make-local-variable 'whitespace-display-table-was-local) nil)
@@ -2228,10 +2149,6 @@ resultant list will be returned."
2228(defun whitespace-color-on () 2149(defun whitespace-color-on ()
2229 "Turn on color visualization." 2150 "Turn on color visualization."
2230 (when (whitespace-style-face-p) 2151 (when (whitespace-style-face-p)
2231 (unless whitespace-font-lock
2232 (setq whitespace-font-lock t
2233 whitespace-font-lock-keywords
2234 (copy-sequence font-lock-keywords)))
2235 ;; save current point and refontify when necessary 2152 ;; save current point and refontify when necessary
2236 (set (make-local-variable 'whitespace-point) 2153 (set (make-local-variable 'whitespace-point)
2237 (point)) 2154 (point))
@@ -2245,163 +2162,98 @@ resultant list will be returned."
2245 nil) 2162 nil)
2246 (add-hook 'post-command-hook #'whitespace-post-command-hook nil t) 2163 (add-hook 'post-command-hook #'whitespace-post-command-hook nil t)
2247 (add-hook 'before-change-functions #'whitespace-buffer-changed nil t) 2164 (add-hook 'before-change-functions #'whitespace-buffer-changed nil t)
2248 ;; turn off font lock 2165 ;; Add whitespace-mode color into font lock.
2249 (set (make-local-variable 'whitespace-font-lock-mode) 2166 (setq
2250 font-lock-mode) 2167 whitespace-font-lock-keywords
2251 (font-lock-mode 0) 2168 `(
2252 ;; add whitespace-mode color into font lock 2169 ,@(when (memq 'spaces whitespace-active-style)
2253 (when (memq 'spaces whitespace-active-style) 2170 ;; Show SPACEs.
2254 (font-lock-add-keywords 2171 `((,whitespace-space-regexp 1 whitespace-space t)
2255 nil 2172 ;; Show HARD SPACEs.
2256 (list 2173 (,whitespace-hspace-regexp 1 whitespace-hspace t)))
2257 ;; Show SPACEs 2174 ,@(when (memq 'tabs whitespace-active-style)
2258 (list whitespace-space-regexp 1 whitespace-space t) 2175 ;; Show TABs.
2259 ;; Show HARD SPACEs 2176 `((,whitespace-tab-regexp 1 whitespace-tab t)))
2260 (list whitespace-hspace-regexp 1 whitespace-hspace t)) 2177 ,@(when (memq 'trailing whitespace-active-style)
2261 t)) 2178 ;; Show trailing blanks.
2262 (when (memq 'tabs whitespace-active-style) 2179 `((,#'whitespace-trailing-regexp 1 whitespace-trailing t)))
2263 (font-lock-add-keywords 2180 ,@(when (or (memq 'lines whitespace-active-style)
2264 nil 2181 (memq 'lines-tail whitespace-active-style))
2265 (list 2182 ;; Show "long" lines.
2266 ;; Show TABs 2183 `((,(let ((line-column (or whitespace-line-column fill-column)))
2267 (list whitespace-tab-regexp 1 whitespace-tab t)) 2184 (format
2268 t)) 2185 "^\\([^\t\n]\\{%s\\}\\|[^\t\n]\\{0,%s\\}\t\\)\\{%d\\}%s\\(.+\\)$"
2269 (when (memq 'trailing whitespace-active-style) 2186 whitespace-tab-width
2270 (font-lock-add-keywords 2187 (1- whitespace-tab-width)
2271 nil 2188 (/ line-column whitespace-tab-width)
2272 (list 2189 (let ((rem (% line-column whitespace-tab-width)))
2273 ;; Show trailing blanks 2190 (if (zerop rem)
2274 (list #'whitespace-trailing-regexp 1 whitespace-trailing t)) 2191 ""
2275 t)) 2192 (format ".\\{%d\\}" rem)))))
2276 (when (or (memq 'lines whitespace-active-style) 2193 ,(if (memq 'lines whitespace-active-style)
2277 (memq 'lines-tail whitespace-active-style)) 2194 0 ; whole line
2278 (font-lock-add-keywords 2195 2) ; line tail
2279 nil 2196 whitespace-line prepend)))
2280 (list 2197 ,@(when (or (memq 'space-before-tab whitespace-active-style)
2281 ;; Show "long" lines 2198 (memq 'space-before-tab::tab whitespace-active-style)
2282 (list 2199 (memq 'space-before-tab::space whitespace-active-style))
2283 (let ((line-column (or whitespace-line-column fill-column))) 2200 `((,whitespace-space-before-tab-regexp
2284 (format 2201 ,(cond
2285 "^\\([^\t\n]\\{%s\\}\\|[^\t\n]\\{0,%s\\}\t\\)\\{%d\\}%s\\(.+\\)$" 2202 ((memq 'space-before-tab whitespace-active-style)
2286 whitespace-tab-width 2203 ;; Show SPACEs before TAB (indent-tabs-mode).
2287 (1- whitespace-tab-width) 2204 (if whitespace-indent-tabs-mode 1 2))
2288 (/ line-column whitespace-tab-width) 2205 ((memq 'space-before-tab::tab whitespace-active-style)
2289 (let ((rem (% line-column whitespace-tab-width))) 2206 1)
2290 (if (zerop rem) 2207 ((memq 'space-before-tab::space whitespace-active-style)
2291 "" 2208 2))
2292 (format ".\\{%d\\}" rem))))) 2209 whitespace-space-before-tab t)))
2293 (if (memq 'lines whitespace-active-style) 2210 ,@(when (or (memq 'indentation whitespace-active-style)
2294 0 ; whole line 2211 (memq 'indentation::tab whitespace-active-style)
2295 2) ; line tail 2212 (memq 'indentation::space whitespace-active-style))
2296 whitespace-line t)) 2213 `((,(cond
2297 t)) 2214 ((memq 'indentation whitespace-active-style)
2298 (cond 2215 ;; Show indentation SPACEs (indent-tabs-mode).
2299 ((memq 'space-before-tab whitespace-active-style) 2216 (whitespace-indentation-regexp))
2300 (font-lock-add-keywords 2217 ((memq 'indentation::tab whitespace-active-style)
2301 nil 2218 ;; Show indentation SPACEs (SPACEs).
2302 (list 2219 (whitespace-indentation-regexp 'tab))
2303 ;; Show SPACEs before TAB (indent-tabs-mode) 2220 ((memq 'indentation::space whitespace-active-style)
2304 (list whitespace-space-before-tab-regexp 2221 ;; Show indentation SPACEs (TABs).
2305 (if whitespace-indent-tabs-mode 1 2) 2222 (whitespace-indentation-regexp 'space)))
2306 whitespace-space-before-tab t)) 2223 1 whitespace-indentation t)))
2307 t)) 2224 ,@(when (memq 'empty whitespace-active-style)
2308 ((memq 'space-before-tab::tab whitespace-active-style) 2225 ;; Show empty lines at beginning of buffer.
2309 (font-lock-add-keywords 2226 `((,#'whitespace-empty-at-bob-regexp
2310 nil 2227 1 whitespace-empty t)
2311 (list 2228 ;; Show empty lines at end of buffer.
2312 ;; Show SPACEs before TAB (SPACEs) 2229 (,#'whitespace-empty-at-eob-regexp
2313 (list whitespace-space-before-tab-regexp 2230 1 whitespace-empty t)))
2314 1 whitespace-space-before-tab t)) 2231 ,@(when (or (memq 'space-after-tab whitespace-active-style)
2315 t)) 2232 (memq 'space-after-tab::tab whitespace-active-style)
2316 ((memq 'space-before-tab::space whitespace-active-style) 2233 (memq 'space-after-tab::space whitespace-active-style))
2317 (font-lock-add-keywords 2234 `((,(cond
2318 nil 2235 ((memq 'space-after-tab whitespace-active-style)
2319 (list 2236 ;; Show SPACEs after TAB (indent-tabs-mode).
2320 ;; Show SPACEs before TAB (TABs) 2237 (whitespace-space-after-tab-regexp))
2321 (list whitespace-space-before-tab-regexp 2238 ((memq 'space-after-tab::tab whitespace-active-style)
2322 2 whitespace-space-before-tab t)) 2239 ;; Show SPACEs after TAB (SPACEs).
2323 t))) 2240 (whitespace-space-after-tab-regexp 'tab))
2324 (cond 2241 ((memq 'space-after-tab::space whitespace-active-style)
2325 ((memq 'indentation whitespace-active-style) 2242 ;; Show SPACEs after TAB (TABs).
2326 (font-lock-add-keywords 2243 (whitespace-space-after-tab-regexp 'space)))
2327 nil 2244 1 whitespace-space-after-tab t)))))
2328 (list 2245 (font-lock-add-keywords nil whitespace-font-lock-keywords t)
2329 ;; Show indentation SPACEs (indent-tabs-mode) 2246 (font-lock-fontify-buffer)))
2330 (list (whitespace-indentation-regexp)
2331 1 whitespace-indentation t))
2332 t))
2333 ((memq 'indentation::tab whitespace-active-style)
2334 (font-lock-add-keywords
2335 nil
2336 (list
2337 ;; Show indentation SPACEs (SPACEs)
2338 (list (whitespace-indentation-regexp 'tab)
2339 1 whitespace-indentation t))
2340 t))
2341 ((memq 'indentation::space whitespace-active-style)
2342 (font-lock-add-keywords
2343 nil
2344 (list
2345 ;; Show indentation SPACEs (TABs)
2346 (list (whitespace-indentation-regexp 'space)
2347 1 whitespace-indentation t))
2348 t)))
2349 (when (memq 'empty whitespace-active-style)
2350 (font-lock-add-keywords
2351 nil
2352 (list
2353 ;; Show empty lines at beginning of buffer
2354 (list #'whitespace-empty-at-bob-regexp
2355 1 whitespace-empty t))
2356 t)
2357 (font-lock-add-keywords
2358 nil
2359 (list
2360 ;; Show empty lines at end of buffer
2361 (list #'whitespace-empty-at-eob-regexp
2362 1 whitespace-empty t))
2363 t))
2364 (cond
2365 ((memq 'space-after-tab whitespace-active-style)
2366 (font-lock-add-keywords
2367 nil
2368 (list
2369 ;; Show SPACEs after TAB (indent-tabs-mode)
2370 (list (whitespace-space-after-tab-regexp)
2371 1 whitespace-space-after-tab t))
2372 t))
2373 ((memq 'space-after-tab::tab whitespace-active-style)
2374 (font-lock-add-keywords
2375 nil
2376 (list
2377 ;; Show SPACEs after TAB (SPACEs)
2378 (list (whitespace-space-after-tab-regexp 'tab)
2379 1 whitespace-space-after-tab t))
2380 t))
2381 ((memq 'space-after-tab::space whitespace-active-style)
2382 (font-lock-add-keywords
2383 nil
2384 (list
2385 ;; Show SPACEs after TAB (TABs)
2386 (list (whitespace-space-after-tab-regexp 'space)
2387 1 whitespace-space-after-tab t))
2388 t)))
2389 ;; now turn on font lock and highlight blanks
2390 (font-lock-mode 1)))
2391 2247
2392 2248
2393(defun whitespace-color-off () 2249(defun whitespace-color-off ()
2394 "Turn off color visualization." 2250 "Turn off color visualization."
2395 ;; turn off font lock 2251 ;; turn off font lock
2396 (when (whitespace-style-face-p) 2252 (when (whitespace-style-face-p)
2397 (font-lock-mode 0)
2398 (remove-hook 'post-command-hook #'whitespace-post-command-hook t) 2253 (remove-hook 'post-command-hook #'whitespace-post-command-hook t)
2399 (remove-hook 'before-change-functions #'whitespace-buffer-changed t) 2254 (remove-hook 'before-change-functions #'whitespace-buffer-changed t)
2400 (when whitespace-font-lock 2255 (font-lock-remove-keywords nil whitespace-font-lock-keywords)
2401 (setq whitespace-font-lock nil 2256 (font-lock-fontify-buffer)))
2402 font-lock-keywords whitespace-font-lock-keywords))
2403 ;; restore original font lock state
2404 (font-lock-mode whitespace-font-lock-mode)))
2405 2257
2406 2258
2407(defun whitespace-trailing-regexp (limit) 2259(defun whitespace-trailing-regexp (limit)