aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog1457
-rw-r--r--lisp/align.el6
-rw-r--r--lisp/button.el1
-rw-r--r--lisp/calendar/appt.el5
-rw-r--r--lisp/calendar/cal-bahai.el2
-rw-r--r--lisp/calendar/cal-china.el4
-rw-r--r--lisp/calendar/cal-coptic.el4
-rw-r--r--lisp/calendar/cal-dst.el4
-rw-r--r--lisp/calendar/cal-french.el4
-rw-r--r--lisp/calendar/cal-hebrew.el4
-rw-r--r--lisp/calendar/cal-islam.el4
-rw-r--r--lisp/calendar/cal-iso.el3
-rw-r--r--lisp/calendar/cal-julian.el4
-rw-r--r--lisp/calendar/cal-mayan.el4
-rw-r--r--lisp/calendar/cal-menu.el3
-rw-r--r--lisp/calendar/cal-move.el3
-rw-r--r--lisp/calendar/cal-persia.el4
-rw-r--r--lisp/calendar/cal-tex.el4
-rw-r--r--lisp/calendar/cal-x.el3
-rw-r--r--lisp/calendar/calendar.el2
-rw-r--r--lisp/calendar/diary-lib.el4
-rw-r--r--lisp/calendar/holidays.el4
-rw-r--r--lisp/calendar/lunar.el4
-rw-r--r--lisp/calendar/parse-time.el3
-rw-r--r--lisp/calendar/solar.el3
-rw-r--r--lisp/calendar/time-date.el5
-rw-r--r--lisp/calendar/timeclock.el3
-rw-r--r--lisp/calendar/todo-mode.el3
-rw-r--r--lisp/compare-w.el4
-rw-r--r--lisp/cus-edit.el8
-rw-r--r--lisp/emacs-lisp/lisp.el13
-rw-r--r--lisp/emulation/cua-base.el71
-rw-r--r--lisp/emulation/cua-rect.el16
-rw-r--r--lisp/files.el4
-rw-r--r--lisp/foldout.el40
-rw-r--r--lisp/gnus/ChangeLog201
-rw-r--r--lisp/gnus/gnus-agent.el123
-rw-r--r--lisp/gnus/gnus-art.el3
-rw-r--r--lisp/gnus/gnus-cache.el25
-rw-r--r--lisp/gnus/gnus-start.el1
-rw-r--r--lisp/gnus/imap.el7
-rw-r--r--lisp/gnus/mm-decode.el74
-rw-r--r--lisp/gnus/mm-view.el26
-rw-r--r--lisp/gnus/nnmail.el10
-rw-r--r--lisp/gnus/nntp.el22
-rw-r--r--lisp/gnus/rfc2231.el12
-rw-r--r--lisp/help.el3
-rw-r--r--lisp/hi-lock.el63
-rw-r--r--lisp/ibuf-ext.el10
-rw-r--r--lisp/ido.el97
-rw-r--r--lisp/info.el1
-rw-r--r--lisp/international/ucs-tables.el4
-rw-r--r--lisp/isearch.el26
-rw-r--r--lisp/locate.el3
-rw-r--r--lisp/mail/mail-extr.el7
-rw-r--r--lisp/mail/rmail.el13
-rw-r--r--lisp/mail/sendmail.el5
-rw-r--r--lisp/mail/smtpmail.el1
-rw-r--r--lisp/menu-bar.el2
-rw-r--r--lisp/mh-e/ChangeLog9
-rw-r--r--lisp/mh-e/mh-customize.el17
-rw-r--r--lisp/mh-e/mh-init.el57
-rw-r--r--lisp/pcvs.el1
-rw-r--r--lisp/progmodes/gud.el93
-rw-r--r--lisp/progmodes/octave-mod.el3
-rw-r--r--lisp/recentf.el385
-rw-r--r--lisp/replace.el2
-rw-r--r--lisp/simple.el2
-rw-r--r--lisp/term/mac-win.el216
-rw-r--r--lisp/textmodes/ispell.el8
-rw-r--r--lisp/textmodes/org.el77
-rw-r--r--lisp/tooltip.el59
-rw-r--r--lisp/wid-edit.el1
-rw-r--r--lisp/window.el262
74 files changed, 2905 insertions, 736 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 84232e0a2be..377f2ce0fc2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,1439 @@
12005-12-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * term/mac-win.el: Create keymap for mac-apple-event-map.
4
52005-12-11 Nick Roberts <nickrob@snap.net.nz>
6
7 * tooltip.el (tooltip-mode): Move to start of file so that it
8 appears at top of customize buffer.
9
10 * progmodes/gud.el (gud-tooltip-modes, gud-tooltip-display):
11 Add the gud groupname.
12 (gud-tooltip-mode): Add the tooltip groupname.
13 (gud-tooltip-echo-area): Add the gud groupname. Remove tag to
14 avoid conflict with tooltip-use-echo-area.
15
162005-12-10 Romain Francoise <romain@orebokech.com>
17
18 * help.el (help-for-help-internal): Add `r' in doc string.
19
202005-12-10 Johan Bockg,Ae(Brd <bojohan@dd.chalmers.se>
21
22 * align.el (align-regexp, align-highlight-rule): Use
23 region-beginning and region-end instead of point and mark, so that
24 repetition (with `repeat-complex-command') recomputes the region
25 bounds.
26
272005-12-10 Lennart Borgman <lennart.borgman.073@student.lu.se>
28
29 * window.el (bw-get-tree, bw-get-tree-1, bw-find-tree-sub)
30 (bw-find-tree-sub-1, bw-l, bw-t, bw-r, bw-b, bw-dir, bw-eqdir)
31 (bw-refresh-edges, bw-adjust-window, bw-balance-sub): New functions.
32 (balance-windows): Rewrite using the above new functions.
33
342005-12-10 David Koppelman <koppel@ece.lsu.edu>
35
36 * hi-lock.el: (hi-lock-mode) Renamed from hi-lock-buffer-mode;
37 react if global-hi-lock-mode seems intended.
38 (global-hi-lock-mode) Renamed from hi-lock-mode.
39 (hi-lock-archaic-interface-message-used)
40 (hi-lock-archaic-interface-deduce): New variables.
41 (turn-on-hi-lock-if-enabled, hi-lock-line-face-buffer)
42 (hi-lock-face-buffer, hi-lock-face-phrase-buffer)
43 (hi-lock-find-patterns, hi-lock-font-lock-hook): Replace
44 hi-lock-buffer-mode with hi-lock-mode.
45
462005-12-10 Kevin Rodgers <ihs_4664@ihs.com>
47
48 * emacs-lisp/lisp.el (lisp-complete-symbol): Regenerate the
49 completion list, even after a partial completion has been
50 inserted in the current buffer. If there are more than 1
51 completion, redisplay the *Completions* buffer; if the
52 completion is unique, delete the *Completions* window.
53
542005-12-10 Eli Zaretskii <eliz@gnu.org>
55
56 * mail/rmail.el (rmail-next-same-subject): Handle multiple "Re: "
57 strings and long subject lines that were broken into multiple
58 lines at arbitrary places. Handle subjects that have "Re: " in
59 the middle.
60
612005-12-10 John W. Eaton <jwe@octave.org>
62
63 * emacs/octave-mod.el (octave-electric-space): Don't indent
64 comments or strings if octave-auto-indent is nil.
65
662005-12-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
67
68 * term/mac-win.el: Require url when compiling. Call
69 mac-process-deferred-apple-events after loading init files.
70 (mac-apple-event-map): New defvar. Define event handlers in it.
71 (core-event, internet-event): New Apple event class symbols.
72 (open-application, reopen-application, open-documents)
73 (print-documents, open-contents, quit-application)
74 (application-died, show-preferences, autosave-now, get-url): New
75 Apple event ID symbols.
76 (about): New HICommand ID symbol.
77 (mac-event-spec, mac-event-ae): New macros.
78 (mac-ae-parameter, mac-ae-list, mac-bytes-to-integer)
79 (mac-ae-selection-range, mac-ae-text-for-search)
80 (mac-ae-open-documents, mac-ae-text, mac-ae-get-url): New functions.
81 (mac-application-menu-map): Remove keymap. Handlers for HICommand
82 and Services menu events are now defined in mac-apple-event-map.
83 (mac-drag-n-drop): Remove selection range handling.
84
852005-12-10 Kenichi Handa <handa@m17n.org>
86
87 * simple.el (zap-to-char): Translate CHAR by
88 translation-table-for-input.
89
90 * isearch.el (isearch-process-search-char): Translate CHAR by
91 translation-table-for-input.
92
932005-12-09 Chong Yidong <cyd@stupidchicken.com>
94
95 * foldout.el (foldout-exit-fold): Properly hide subtree.
96
972005-12-09 Reiner Steib <Reiner.Steib@gmx.de>
98
99 * files.el (save-buffer):
100 * international/ucs-tables.el (ucs-set-table-for-input):
101 * mail/mail-extr.el (mail-extract-address-components):
102 * mail/sendmail.el (mail-mode): Reformat doc string.
103
1042005-12-09 Juri Linkov <juri@jurta.org>
105
106 * isearch.el (isearch-highlight): Change main overlay priority
107 from 1 to 1001. Simplify.
108 (isearch-lazy-highlight-update): Change lazy overlay priority
109 from 0 to 1000.
110
111 * replace.el (replace-highlight): Change overlay priority from
112 1 to 1001.
113
114 * textmodes/ispell.el (ispell-highlight-spelling-error-overlay):
115 Change overlay priority from 1 to 1001. Reuse existing overlay.
116
117 * compare-w.el (compare-windows-highlight): Change overlay
118 priority from 1 to 1000.
119
120 * menu-bar.el (menu-bar-edit-menu): Add listp around
121 pending-undo-list to disable menu item "undo" when pending
122 undo list is empty.
123
124 * locate.el (locate): Disable undo in *Locate* buffer.
125
1262005-12-09 Kim F. Storm <storm@cua.dk>
127
128 * mail/smtpmail.el (smtpmail-via-smtp): Disable undo in SMTP buffer.
129
1302005-12-09 David Ponce <david@dponce.com>
131
132 * recentf.el: Improvement of the menu code.
133 (recentf-enabled-p): Move before first use. Use `kill-emacs-hook'
134 instead of menu hook.
135 (recentf-show-menu, recentf-hide-menu): New functions.
136 (recentf-menu-customization-changed, recentf-mode): Use them.
137 (recentf-menu-action, recentf-max-menu-items)
138 (recentf-menu-open-all-flag, recentf-menu-append-commands-flag)
139 (recentf-arrange-by-rule-others)
140 (recentf-arrange-by-rules-min-items)
141 (recentf-arrange-by-rule-subfilter) : Don't use
142 `recentf-menu-customization-changed'.
143 (recentf-arrange-rules): Likewise. Accept functions to compute
144 sub-menu titles.
145 (recentf-menu-filter): Likewise. Doc fix.
146 (recentf-menu-value-shortcut): Doc fix.
147 (recentf-dump-variable): Quote atom value.
148 (recentf-make-menu-items): Update to use it as a menu filter.
149 (recentf-match-rule): New function.
150 (recentf-arrange-by-rule): Use it.
151 (recentf-indirect-mode-rule): New function.
152 (recentf-build-mode-rules): Use it.
153 (recentf-dir-rule): New function.
154 (recentf-arrange-by-dir): Use it.
155 (recentf-filter-changer-current): Rename from
156 `recentf-filter-changer-state'. All references updated.
157 (recentf-filter-changer-alist): Update filter names.
158 (recentf-filter-changer-select): New function.
159 (recentf-filter-changer): Use it. Make a sub-menu from filters
160 available in `recentf-filter-changer-alist'.
161 (recentf-data-cache, recentf-clear-data)
162 (recentf-update-menu): Remove. All references updated.
163 (recentf-match-rule-p, recentf-build-dir-rules)
164 (recentf-filter-changer-goto-next)
165 (recentf-filter-changer-get-current)
166 (recentf-filter-changer-get-next): Remove.
167
1682005-12-08 Luc Teirlinck <teirllm@auburn.edu>
169
170 * cus-edit.el (custom-buffer-create-internal): Relabel the whole
171 buffer "Reset" button to "Reset to Current" for consistency with
172 the State buttons.
173
1742005-12-08 John Paul Wallington <jpw@pobox.com>
175
176 * ibuf-ext.el (define-ibuffer-filter filename):
177 If `dired-directory' is a list then really use its car.
178
1792005-12-08 Kim F. Storm <storm@cua.dk>
180
181 * emulation/cua-rect.el (cua--rectangle-aux-replace): Fix
182 indention of text on right side of replaced rectangle.
183
1842005-12-09 Nick Roberts <nickrob@snap.net.nz>
185
186 * progmodes/gud.el (gud-speedbar-buttons, gud-tooltip-tips):
187 No need to check gud-comint-buffer is bound.
188 (gdb): Prevent multiple debugging when first session uses gdba.
189
1902005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
191
192 CC Mode update to 5.31.
193
194 * progmodes/cc-subword.el: Add a dummy `c-subword-mode' for
195 Emacsen which lack `define-minor-mode'. (Currently Emacs <21. We
196 might do this function properly in the future).
197
198 * progmodes/cc-cmds.el, cc-defs.el, cc-styles.el, cc-vars.el: New
199 macros c-sentence-end and c-default-value-sentence end, to cope
200 with Emacs 22's new function `sentence-end'.
201
2022005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
203
204 * progmodes/cc-cmds.el (c-show-syntactic-information): Solved the
205 compat issue using `c-put-overlay' and `c-delete-overlay'.
206
207 * progmodes/cc-defs.el (c-put-overlay, c-delete-overlay): New
208 compat macros to handle overlays/extents.
209
2102005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
211
212 * progmodes/cc-fix.el: Add definitions of the macros push and pop
213 (for GNU Emacs 20.4)
214
215 * progmodes/cc-defs.el:
216 (i) Load cc-fix.elc for `push' and `pop' (for GNU Emacs 20.4)
217
218 * progmodes/cc-cmds.el (c-show-syntactic-information): change the
219 highlighting mechanism so it will work in XEmacs too.
220
221 * progmodes/cc-defs.el: Insert c-int-to-char.
222
223 * progmodes/cc-langs.el (c-nonsymbol-token-char-list): Insert a
224 call to the new macro c-int-to-char. This solves XEmacs's
225 regarding characters as different from integers.
226
2272005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
228
229 * progmodes/cc-fonts.el (c-make-syntactic-matcher): New internal
230 helper.
231
232 (c-cpp-matchers, c-basic-matchers-before): Use the `eval'
233 construct to make the indirect face lookup work in XEmacs.
234
235 (c-cpp-matchers): Append the negation char face to the existing
236 fontification, so that the cpp face doesn't disappear. Use
237 `c-make-syntactic-matcher' to avoid negation chars in comments and
238 strings.
239
240 * progmodes/cc-fonts.el (c-negation-char-face-name): New variable
241 to map to `font-lock-negation-char-face' in emacsen where it
242 exists.
243
2442005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
245
246 * progmodes/cc-mode.el: Bind c-subword-mode to C-c C-w.
247
248 * progmodes/cc-subword.el, cc-cmds.el, cc-mode.el: Rename
249 "c-subword-move-mode" as "c-subword-mode".
250
251 * progmodes/cc-mode.el: Added tty suitable bindings for C-c
252 <delete> and C-c C-<delete>. (To the c-hungry- delete functions).
253
2542005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
255
256 * progmodes/cc-mode.el: Added autoload directive for
257 `c-subword-move-mode' for use in older emacsen.
258
2592005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
260
261 * progmodes/cc-mode.el:
262 (i) Insert a binding for C-c C-backspace into
263 c-bind-special-erase-keys which works in TTYs.
264 (ii) Make sure that when file styles are used, any explicitly
265 given style variables take priority over those in the style. Do
266 this by calling `hack-local-variables' a second time.
267
268 * progmodes/cc-vars.el: Add language specific customization
269 widgets for AWK to c-doc-comment-style, c-require-final-newline
270 and c-default-style. Add a defcustom for awk-mode-hook. Give
271 c-syntactic-element and c-syntactic-context doc-strings by
272 directly setting their `variable-documentation' propery. This
273 allows Emacs 22.1 to read these with C-h v.
274
275 * progmodes/cc-awk.el: Apply a tidy-up patch (from Stefan
276 Monnier).
277
2782005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
279
280 * progmodes/cc-fonts.el, cc-vars.el
281 (gtkdoc-font-lock-doc-comments, gtkdoc-font-lock-doc-protection,
282 gtkdoc-font-lock-keywords): GtkDoc patterns contributed by
283 Masatake YAMATO.
284
285 (c-doc-comment-style): Made GtkDoc default in C mode.
286
287 * progmodes/cc-mode.el: Fixed key bindings for C-c C-<backspace>
288 and C-c C-<delete>.
289
290 (c-bind-special-erase-keys): New function for use on
291 `normal-erase-is-backspace-hook' to bind C-c C-<delete> correctly.
292
293 * progmodes/cc-cmds.el (c-hungry-delete): New function to fix
294 <delete> key behavior in XEmacs according to `delete-forward-p'.
295 C.f. `c-electric-delete'.
296
2972005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
298
299 * progmodes/cc-mode.el: Give c-hungry-backspace and
300 c-hungry-delete-forward permanent key bindings.
301
302 * progmodes/cc-cmds.el (c-electric-semi&comma): Bind
303 c-syntactic-context for calls to "criteria functions", for
304 consistency with other calls to user functions.
305
306 * progmodes/cc-cmds.el (c-indent-command): expunge use of
307 `current-prefix-arg', since this might be the prefix arg to a
308 command which calls c-indent-command as a function. Change the
309 interactive spec from "p" to "P".
310
311 * progmodes/cc-styles.el: Amend the doc-string of c-set-style, in
312 reponse to a report from Joseph Kiniry <kiniry@acm.org> that it
313 was difficult to understand.
314
3152005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
316
317 * progmodes/cc-engine.el (c-on-identifier): Fixed bug when at the
318 first char of an identifier.
319
320 * progmodes/cc-engine.el (c-on-identifier): Handle the "operator
321 +" syntax in C++.
322
3232005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
324
325 * progmodes/cc-cmds.el (c-mask-paragraph): correct, so that
326 auto-fill doesn't split a c-comment's last word from a hanging
327 "*/" when a space is typed between them after fill-column.
328
329 * progmodes/cc-defs.el: New macro c-delete-and-extract-region.
330
331 * progmodes/cc-styles.el (c-set-style,
332 c-setup-paragraph-variables): Abort the command if we're not in a
333 CC Mode buffer.
334
335 * progmodes/cc-align.el (c-lineup-C-comments): Correct indentation
336 with blank comment-prefix, and a blank line as the comment's
337 second line.
338
3392005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
340
341 * progmodes/cc-fonts.el (c-cpp-matchers, c-basic-matchers-before):
342 Incorporated the patterns added in the Emacs development branch
343 for the new Emacs 22 face `font-lock-negation-char-face'.
344
345 * progmodes/cc-fonts.el (c-invalid-face-name): Use "red1" instead
346 of "red" since it stands out better in xterms and DOS terminals.
347
348 * progmodes/cc-engine.el (c-literal-faces): Added
349 `font-lock-comment-delimiter-face' which is new in Emacs 22.
350
3512005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
352
353 * progmodes/cc-cmds.el: Make C-c C-a (`c-toggle-auto-newline')
354 forcibly enable c-electric-flag.
355
356 * progmodes/cc-vars.el, cc-cmds.el: New clean-up
357 `comment-close-slash' on c-electric-slash: if enabled, typing `/'
358 just after the comment-prefix of a C-style comment will close that
359 comment.
360
3612005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
362
363 * progmodes/cc-fonts.el (c-basic-matchers-before,
364 c-complex-decl-matchers): Fixed the "not-arrow-prefix" regexp used
365 in Pike.
366
367 * progmodes/cc-langs.el (c-other-op-syntax-tokens): Only C++ has
368 digraphs.
369
370 * progmodes/cc-fonts.el, cc-langs.el, cc-engine.el
371 (c-cpp-message-directives, c-cpp-include-directives,
372 c-opt-cpp-macro-define, c-opt-cpp-macro-define-start,
373 c-cpp-expr-directives): Introduced new language constants to
374 control cpp syntax in a cleaner way.
375
376 (c-cpp-expr-functions): Renamed from c-cpp-defined-fns.
377
378 (c-cpp-matchers, c-forward-to-cpp-define-body): Use them.
379
380 * progmodes/cc-langs.el, cc-fonts.el (c-string-escaped-newlines,
381 c-multiline-string-start-char): New language constants and
382 variables to specify how newlines in string literals work.
383
384 (c-font-lock-invalid-string): Use them.
385
386 * progmodes/cc-cmds.el (c-try-one-liner): Robustness fix if an
387 unbalanced close brace is entered. Optimization by avoiding going
388 back over arbitrarily large blocks. Removed hints that this
389 function only would be relevant/useful in AWK.
390
391 (c-electric-brace): Indent syntactically after the cleanups since
392 lineup functions might do it differently then.
393
394 * progmodes/cc-engine.el, cc-langs.el
395 (c-opt-op-identifier-prefix): New language constant and variable.
396
397 (c-just-after-func-arglist-p, c-after-special-operator-id,
398 c-search-decl-header-end, c-inside-bracelist-p): Use it.
399
400 * progmodes/cc-align.el, cc-engine.el
401 (c-after-special-operator-id): New helper to handle C++ operator
402 identifiers.
403
404 (c-lineup-topmost-intro-cont, c-just-after-func-arglist-p,
405 c-guess-basic-syntax): Handle C++ operator identifiers in
406 declarations.
407
408 * progmodes/cc-langs.el (c-assignment-operators): Added the
409 trigraph version of ^= too.
410
411 * progmodes/cc-langs.el (c-assignment-operators): Added the
412 trigraph version of |= in C++.
413
414 * progmodes/cc-fonts.el (c-font-lock-declarators): Handle
415 `c-decl-hangon-kwds' after the identifier name.
416
417 * progmodes/cc-engine.el (c-guess-basic-syntax): When deciding
418 whether an arglist is "nonempty", ignore a comment after the open
419 paren if it isn't followed by a non-comment token on the same
420 line.
421
422 * progmodes/cc-engine.el (c-guess-basic-syntax): Case 4: Enable
423 heuristics below the point to cope with classes inside special
424 brace lists in Pike.
425
4262005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
427
428 * progmodes/cc-cmds.el: Amend c-point-syntax to handle macros.
429
4302005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
431
432 * progmodes/cc-guess.el (cc-guess-install): New function to
433 install an already guessed style in another buffer.
434
435 * progmodes/cc-defs.el (c-tentative-buffer-changes): No longer
436 sets `inhibit-read-only' - `c-save-buffer-state' should be used
437 anyway if the change always is undone.
438
4392005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
440
441 Implement togglable electricity:
442
443 * progmodes/cc-defs.el: Enhance c-save-buffer-state's doc-string,
444 saying when it should be used.
445
446 * progmodes/cc-engine.el: Add the new buffer-local variable,
447 c-electric-flag.
448
449 * progmodes/cc-langs.el: Change the name of c-toggle-auto-state to
450 c-toggle-auto-newline.
451
452 * progmodes/cc-mode.el: Rename c-toggle-auto-state to
453 c-toggle-auto-newline. Remove the binding for
454 c-toggle-auto-hungry-state. Add the binding C-c C-l for the new
455 c-toggle-electric-state.
456
457 * progmodes/cc-vars.el: Make c-syntactic-indentation buffer local.
458
459 * progmodes/cc-cmds.el: Add `c-bytecomp-defun's for
460 c-\(forward\|backward\)-subword.
461 (c-update-modeline): Add the new modeline flag `l' for
462 `c-electric-flag'. Make the auto-newline flag `a' dependent on
463 `l'.
464 (c-toggle-auto-state): Rename it to `c-toggle-auto-newline'. Make
465 the old name an alias of the new name.
466 (c-toggle-electric-state): New function.
467 c-electric-\(pound\|brace\|slash\|star\|semi&comma\|colon\|lt-gt\|paren\|continued-statement\):
468 Adapt these functions to do electric things only when
469 c-electric-flag is non-nil.
470 (c-point-syntax, c-brace-newlines, c-try-oneliner): Extract these
471 new functions from c-electric-brace.
472 (c-point-syntax): Add a check for "virtual semicolons" in AWK
473 mode, so that the tentative extra newline doesn't change the
474 syntax of the following brace.
475 (c-electric-brace): restructure by extracting the above functions.
476 Tidy up the coding somewhat.
477 (c-electric-semi&comma, c-electric-colon, c-electric-paren):
478 restructure a bit.
479
4802005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
481
482 * progmodes/cc-cmds.el (c-show-syntactic-information): Show the
483 anchor position(s) using faces. Thanks to Masatake YAMATO for the
484 idea.
485
486 * progmodes/cc-mode.el, cc-cmds.el, cc-defs.el, cc-engine.el
487 (c-submode-indicators): Changed name from `c-auto-hungry-string'
488 since it's now used to track another submode.
489
490 (c-update-modeline): Converted to function and extended to check
491 `c-subword-move-mode'.
492
493 (c-forward-into-nomenclature, c-backward-into-nomenclature):
494 Converted to compat aliases for `c-forward-subword' and
495 `c-backward-subword'.
496
497 * progmodes/cc-subword.el: New functions and minor mode to handle
498 SillyCapsedStyleIndentifiers, contributed by Masatake YAMATO:
499
500 (c-forward-subword, c-backward-subword, c-mark-subword,
501 c-kill-subword, c-backward-kill-subword, c-transpose-subwords,
502 c-capitalize-subword, c-downcase-subword, c-upcase-subword):
503 Functions corresponding to the standard word handling functions.
504
505 (c-subword-move-mode): Minor mode that replaces all the standard
506 word handling functions with their subword equivalences.
507
5082005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
509
510 * progmodes/cc-vars.el (c-cleanup-list): Insert a customization
511 entry for one-liner-defun.
512
513 * progmodes/cc-defs.el: Give c-tentative-buffer-changes its own
514 name in its def-edebug-spec.
515
516 * progmodes/cc-cmds.el (c-electric-brace): Make the
517 one-liner-defun clean-up work with empty-defun-braces. o-l-d now
518 compacts space before a comment, if this will make things fit on
519 one line.
520
521 Introduce an "awk" style, mainly for auto-newline and clean-ups.
522
523 * progmodes/cc-align.el: new function c-snug-1line-defun-close
524
525 * progmodes/cc-cmds.el: In c-electric-brace, add code for new
526 clean-up one-liner-defun.
527
528 * progmodes/cc-styles.el: Add the new "awk" style.
529
530 * progmodes/cc-vars.el: Add description of one-liner-defun to
531 c-cleanup-list's doc-string. New user options,
532 c-max-one-liner-length. In c-default-style, set the default style
533 for AWK to "awk".
534
5352005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
536
537 * progmodes/cc-engine.el (c-forward-label): Fixed fontification of
538 macros inside labels.
539
540 * progmodes/cc-engine.el (c-looking-at-bos): Obsoleted in favor of
541 `c-at-statement-start-p' and `c-at-expression-start-p'.
542
543 * progmodes/cc-defs.el (c-tnt-chng-record-state): Don't signal an
544 error if the mark isn't set.
545
546 * progmodes/cc-engine.el (c-guess-continued-construct,
547 c-guess-basic-syntax): Use `c-forward-decl-or-cast-1' to more
548 accurately detect functions inside functions.
549
550 * progmodes/cc-engine.el (c-at-expression-start-p): New function
551 like `c-at-statement-start-p' that additionally recognizes commas
552 and expression parentheses as delimiters.
553
554 * progmodes/cc-engine.el (c-looking-at-inexpr-block): Added flag
555 to avoid heuristics that doesn't work for unclosed blocks.
556
557 (c-at-statement-start-p): New function.
558
559 * progmodes/cc-engine.el, cc-fonts.el: Fixes in handling of
560 Objective-C directives, e.g. directives spanning lines should work
561 reasonably well now.
562
563 (c-put-c-type-property, c-clear-c-type-property): New helpers.
564
565 (c-forward-objc-directive): New function to move over any ObjC
566 directive.
567
568 (c-just-after-func-arglist-p, c-guess-basic-syntax,
569 c-basic-matchers-before): Use it.
570
571 (c-font-lock-objc-iip-decl): Removed.
572
573 * progmodes/cc-engine.el (c-guess-basic-syntax): Some improvement
574 in the template arglist recognition.
575
576 * progmodes/cc-styles.el (c-style-alist): Fixed several
577 inconsistencies in the Whitesmith style.
578
579 * progmodes/cc-align.el (c-lineup-after-whitesmith-blocks): New
580 lineup function to get lines after Whitesmith style blocks
581 correctly indented.
582
583 (c-lineup-whitesmith-in-block): Backed out the compensation for
584 opening parens since it's done using `add' lists in the style
585 definition instead. Don't use the anchor position since it varies
586 too much between the syntactic symbols. :P
587
588 * progmodes/cc-vars.el (c-valid-offset): Updated.
589
590 * progmodes/cc-engine.el (c-evaluate-offset): Extended to handle
591 lists where the offsets are combined according to several
592 different methods: `first', `min', `max', and `add'. Report
593 offset evaluation errors with `c-benign-error' so that some kind
594 of reindentation still is done.
595
596 * progmodes/cc-engine.el (c-guess-basic-syntax): Anchor
597 `arglist-intro' the same way as `arglist-cont-nonempty' and
598 `arglist-close'.
599
600 * progmodes/cc-engine.el (c-guess-basic-syntax): Fixed similar
601 situations for `arglist-cont-nonempty' and `arglist-close'.
602
603 * progmodes/cc-langs.el (c-opt-identifier-concat-key-depth): New
604 constant.
605
606 * progmodes/cc-defs.el: Use `cc-bytecomp-fboundp' and
607 cc-bytecomp-boundp' in a number of places.
608
609 * progmodes/cc-engine.el (c-beginning-of-statement-1): Fixed a
610 macro related issue.
611
6122005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
613
614 * progmodes/cc-awk.el: Change the terminology of regexps: A char
615 list is now
616 [asdf], a char class [:alpha:]. Include code for char classes.
617 Set c-awk-NL-prop on lines ending in open strings. (Bug fix.)
618 Add character classes (e.g. "[:alpha:]") into AWK Mode's regexps.
619
620 Remove (nearly all of) the cruft associated with AWK Mode's former
621 concept of "virtual semicolons":
622
623 Adapt c-beginning-of-statement, c-end-of-statement (together with
624 subfunctions) to use the new notion of "virtual semicolon" in
625 place of the old awkward special handling for AWK. There remains
626 much cruft in cc-awk.el, cc-cmds.el and cc-engine.el to clear out.
627 * progmodes/cc-cmds.el:
628 (c-ascertain-adjacent-literal): In the backwards direction, now
629 recognises AWK regexp delimiters as string delimiters.
630 (c-after-statement-terminator-p): Adapt for virtual semicolons;
631 check more rigorously for "end of macro".
632 (c-back-over-illiterals, c-forward-over-illiterals): Adapt for
633 virtual semicolons;
634 (c-beginning-of-statement): Adapt for virtual semicolons; Separate
635 out the code for forward movement into ...
636 (c-end-of-statement): Now contains the code for forward movement,
637 adapted for virtual semicolons.
638
639 * progmodes/cc-engine.el:
640 (c-ws*-string-limit-regexp): new regexp.
641 (c-forward-single-comment, c-backward-single-comment): Comment out
642 the (now redundant) "special" AWK stuff.
643
644 * progmodes/cc-styles.el, cc-vars.el: Change the settings of
645 c-string-par-start, c-string-par-separate to be more like Text
646 Mode than Fundamental Mode.
647
6482005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
649
650 * progmodes/cc-fonts.el (c-font-lock-declarations): Always narrow
651 to the fontified region so that fontification doesn't occur
652 outside it
653 (could happen e.g. when fontifying a line with an unfinished
654 declaration).
655
6562005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
657
658 * progmodes/cc-awk.el: Regexps for analysing AWK code have been
659 moved to near the start of the file. ^L now separate sections of
660 the file. New defconsts: c-awk-non-eol-esc-pair-re,
661 c-awk-blank-or-comment-line-re,
662 c-awk-one-line-possibly-open-string-re,
663 c-awk-regexp-one-line-possibly-open-char-class-re,
664 c-awk-one-line-possibly-open-regexp-re,
665 c-awk-one-line-non-syn-ws*-re. New functions: c-awk-at-vsemi-p,
666 c-awk-vsemi-status-unknown-p.
667
668 Amend the concept of "virtual semicolons" (in the indentation
669 engine) for languages like AWK, such that they are now
670 conceptually attached to end of the last token of a statement, not
671 the end of the line. (In AWK Mode, however, the pertinent text
672 property is still physically set on the EOL.) Remove the specific
673 tests for awk-mode, thus facilitating the introduction of other
674 language modes where EOLs can end statements. (Note: The
675 funtionality in cc-cmds.el, specifically
676 c-beginning/end-of-statement has yet to be amended.)
677
678 * progmodes/cc-defs.el: New macros c-at-vsemi-p,
679 c-vsemi-status-unknown-p.
680
681 * progmodes/cc-langs.el: Added `#' into AWK Mode's value of
682 c-stmt-delim-chars. New c-lang-defvars: c-at-vsemi-p-fn,
683 c-vsemi-status-unknown-p-fn (in a new page).
684
685 * progmodes/cc-engine.el: In c-beginning-of-statement-1,
686 c-crosses-statement-barrier-p, c-guess-basic-syntax, replace
687 numerous awkward forms like
688 (if (c-major-mode-is 'awk-mode) (c-awk-prev-line-incomplete-p))
689 with
690 (c-at-vsemi-p). Fix a few typos. In c-guess-basic-syntax, new
691 variable before-ws-ip, the place just after char-before-ip
692 appears.
693
694 * progmodes/cc-mode.el: Fix what's almost a semantic ambiguity in
695 a comment.
696
6972005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
698
699 * progmodes/cc-cmds.el (c-electric-brace): Cleaned up using
700 `c-tentative-buffer-changes'.
701
702 * progmodes/cc-defs.el (c-region-is-active-p): Simplified and
703 converted to macro to choose between Emacs and XEmacs at compile
704 time.
705
706 (c-set-region-active): New set counterpart to
707 `c-region-is-active-p'.
708
709 (c-tentative-buffer-changes): New macro to handle temporary buffer
710 changes in a convenient way.
711
712 (c-tnt-chng-record-state, c-tnt-chng-cleanup): Internal helpers
713 for `c-tentative-buffer-changes'.
714
715 * progmodes/cc-engine.el (c-looking-at-inexpr-block): Tightened up
716 the checks for paren sexps between the point and the keyword, to
717 avoid some false alarms.
718
719 * progmodes/cc-engine.el, cc-langs.el (c-looking-at-inexpr-block):
720 Fixed a situation where an error could be thrown for unbalanced
721 parens. Changed to make use of c-keyword-member' to avoid some
722 repeated regexp matches.
723
724 (c-opt-lambda-key, c-opt-inexpr-block-key,
725 c-opt-inexpr-class-key): These language variable are no longer
726 necessary.
727
728 (c-block-stmt-kwds): New language constant used by
729 c-looking-at-inexpr-block'.
730
731 (c-guess-basic-syntax): Removed an optional check that looked at
732 the existence of the now removed language variables.
733
734 * progmodes/cc-engine.el (c-fdoc-shift-type-backward,
735 c-forward-decl-or-cast-1): Fixed invalid recognition of C++ style
736 object instantiation expressions as declarations in some contexts.
737 This bug only affected languages where the declarator can't be
738 enclosed in parentheses.
739
740 * progmodes/cc-styles.el (c-style-alist): Fixed the GNU style to
741 insert newlines before and after substatement braces.
742
743 * progmodes/cc-engine.el: Improved the heuristics for recognizing
744 function declaration headers and the handling of C++ style member
745 init lists.
746
747 (c-just-after-func-arglist-p): Rewritten to use
748 `c-forward-decl-or-cast-1'. Now behaves a bit differently too.
749
750 (c-beginning-of-member-init-list): Removed since it isn't used
751 anymore.
752
753 (c-guess-basic-syntax): Case 5B adapted for the new
754 `c-just-after-func-arglist-p'. Cases 5B.1 and 5B.3 merged. Cases
755 5D.1 and 5D.2 removed since they aren't trigged anymore (case 5B.1
756 covers all cases now).
757
758 * progmodes/cc-defs.el (c-point): Added 'bosws and 'eosws.
759
7602005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
761
762 * progmodes/cc-cmds.el, cc-styles.el, cc-vars.el: New variables
763 c-string-par-start/separate c-sentence-end-with-esc-eol,
764 initialised in c-setup-paragraph-variables, used in string
765 scanning subroutines of c-beginning-of-statement.
766
767 * progmodes/cc-cmds.el (c-electric-brace): don't delete a comment
768 which precedes the newly inserted `{'.
769
7702005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
771
772 * progmodes/cc-engine.el, cc-langs.el: Rewrote the recognition
773 function for declaration level blocks. It should now cope with
774 templates better and also be a lot more comprehensible.
775
776 (c-looking-at-decl-block): The new function.
777
778 (c-search-uplist-for-classkey): The old one. It's now a wrapper
779 for compatibility.
780
781 (c-add-class-syntax, c-guess-continued-construct,
782 c-guess-basic-syntax): Adapted for `c-looking-at-decl-block'.
783
784 (c-decl-block-key): Changed to tell apart ambiguous and
785 unambiguous keywords. Pike specials are now handled directly in
786 the code instead.
787
788 (c-block-prefix-disallowed-chars, c-block-prefix-charset): New
789 language constants and variables to make the backward skip in
790 `c-looking-at-decl-block' as tight as possible.
791
792 (c-nonsymbol-token-char-list): New language constant.
793
794 * progmodes/cc-engine.el (c-backward-<>-arglist): New function to
795 find balanced template arglists backwards.
796
797 * progmodes/cc-defs.el (c-make-bare-char-alt): New helper for
798 making char classes for `c-syntactic-skip-backward'.
799
800 * progmodes/cc-engine.el (c-guess-basic-syntax): Simplified case
801 16D - can't be a class-close at that point.
802
803 * progmodes/cc-engine.el (c-guess-basic-syntax,
804 c-add-class-syntax): Don't narrow out the enclosing declaration
805 level. This makes everything a lot easier, and it was actually
806 only four small places that needed it to work. Some places that
807 previously did `widen' are removed now, which has the effect that
808 `c-guess-basic-syntax' never will look at things outside the
809 current narrowment now. The anchor position for `topmost-intro'
810 is affected by this, but it was so bogus it was basically useless
811 before, and now it's equally bogus but in a slightly different
812 way.
813
814 (c-narrow-out-enclosing-class): Gone.
815
816 (c-most-enclosing-brace, c-least-enclosing-brace): Don't filter to
817 the narrowed region.
818
819 (c-least-enclosing-brace): Removed silly optional argument.
820
821 * progmodes/cc-engine.el (c-beginning-of-decl-1): Fixed bug where
822 the point could be left directly after an open paren when finding
823 the beginning of the first decl in the block.
824
825 * progmodes/cc-engine.el, cc-fonts.el (c-forward-keyword-clause):
826 Specify which submatch to use.
827
828 * progmodes/cc-langs.el (c-symbol-start): Include '@' in ObjC.
829
830 (c-decl-start-re): No no longer any need for special treatment of
831 ObjC due to the above.
832
833 (c-other-block-decl-kwds): Handle "extern" in ObjC too since it
834 presumably follows C in that regard.
835
836 * progmodes/cc-langs.el (c-identifier-ops, c-after-id-concat-ops):
837 New language constants to specify operator tokens inside
838 identifiers in a more high level way.
839
840 (c-opt-identifier-prefix-key): New internal language constant.
841
842 (c-opt-identifier-concat-key, c-opt-after-id-concat-key,
843 c-identifier-start, c-identifier-key): Now completely calculated
844 from other constants.
845
846 (c-identifier-last-sym-match): Decommissioned since it's no longer
847 used.
848
849 (c-operators): Use `c-identifier-ops'. Documented
850 `postfix-if-paren'.
851
852 * progmodes/cc-engine.el (c-forward-name): Removed the
853 optimization when c-identifier-key is equal to c-symbol-key since
854 it doesn't work in byte compiled files. Don't record empty
855 regions as identifiers.
856
857 * progmodes/cc-langs.el (c-filter-ops): New helper function to
858 simplify access to `c-operators' and its likes.
859
860 (c-operator-list, c-all-op-syntax-tokens,
861 c-nonsymbol-token-regexp, c-<>-multichar-token-regexp,
862 c-<-op-cont-regexp, c->-op-cont-regexp, c-expr-kwds,
863 c-primary-expr-regexp, c-cast-parens): Use it.
864
865 * progmodes/cc-defs.el (c-lang-const): Fixes to allow use without
866 an explicit language in functions.
867
868 * progmodes/cc-defs.el (c-make-keywords-re): Added an appendable
869 variant of adornment.
870
871 * progmodes/cc-langs.el (c-any-class-key): Removed unused language
872 variable.
873
874 (c-type-decl-prefix-key): Removed some now unnecessary cruft from
875 the Pike value.
876
877 * progmodes/cc-engine.el (c-on-identifier,
878 c-simple-skip-symbol-backward): Small fix for handling "-"
879 correctly in `skip-chars-backward'. Affected the operator lfun
880 syntax in Pike.
881
882 * progmodes/cc-langs.el (c-make-init-lang-vars-fun): Disabled the
883 diagnostic message about precompiled language vars not being used.
884
885 * progmodes/cc-langs.el (c-paren-nontype-kwds): The GCC keyword
886 "__attribute__" is followed by a parenthesis.
887
888 (c-type-start-kwds, c-prefix-spec-kwds, c-prefix-spec-kwds-re,
889 c-specifier-key, c-not-decl-init-keywords): Some cleanup using new
890 language constants `c-type-start-kwds' and `c-prefix-spec-kwds'.
891
892 * progmodes/cc-fonts.el, cc-langs.el, cc-engine.el: Internal
893 cleanups to properly detect the declared identifiers in various
894 declarations.
895
896 (c-decl-start-kwds): New language constant to recognize
897 declarations that can start anywhere. Used for class declarations
898 in Pike.
899
900 (c-specifier-key, c-not-decl-init-keywords,
901 c-decl-prefix-or-start-re, c-find-decl-prefix-search,
902 c-find-decl-spots): Implement `c-decl-start-kwds'.
903
904 (c-other-decl-kwds, c-postfix-decl-spec-kwds, c-decl-hangon-kwds,
905 c-decl-hangon-key, c-forward-decl-or-cast-1): Separated the
906 handling of the compiler specific extension keywords into a new
907 language constant `c-decl-hangon-kwds' that defines keyword
908 clauses to be ignored in declarations.
909
910 (c-forward-id-comma-list, c-forward-keyword-clause): Don't skip
911 past unrecognized tokens when handling `c-colon-type-list-kwds'.
912 Necessary to stop at the declared identifier in e.g. IDL valuetype
913 declarations.
914
915 (c-typedef-decl-kwds, c-typeless-decl-kwds, c-type-list-kwds,
916 c-prefix-spec-kwds-re, c-postfix-spec-kwds,
917 c-after-suffixed-type-decl-key, c-opt-postfix-decl-spec-key,
918 c-forward-decl-or-cast-1): Recognize the declared identifier in
919 class and enum declarations as such and not as part of the type.
920
921 (c-forward-decl-or-cast-1, c-forward-label): Relaxed the
922 interpretation of PRECEDING-TOKEN-END when there's no preceding
923 token.
924
925 (c-forward-decl-or-cast-1): Don't disregard sure signs of
926 declarations when there's some syntax error later on.
927
928 (c-complex-decl-matchers): Did away with a reference to
929 `c-specifier-key'.
930
931 * progmodes/cc-engine.el (c-maybe-labelp): Provide no default
932 value - this variable is always dynamically bound.
933
934 * progmodes/cc-engine.el, cc-fonts.el, cc-langs.el, cc-menus.el,
935 cc-mode.el, cc-styles.el, cc-vars.el, cc-align.el, cc-awk.el,
936 cc-cmds.el, cc-defs.el: Changed the policy for marking up
937 functions that might do hidden buffer changes: All such internal
938 functions are now marked instead of those that don't.
939
940 (c-beginning-of-macro, c-end-of-macro, c-(forward|backward)-comments,
941 c-(forward|backward)-single-comment, c-parse-state, c-on-identifier,
942 c-(fast-|slow-|)in-literal, c-literal-limits, c-collect-line-comments,
943 c-literal-type): Allow these functions to make hidden buffer changes,
944 so that they are free to use text property caching later on.
945
946 (c-electric-backspace, c-electric-delete-forward, c-electric-pound,
947 c-electric-brace, c-electric-slash, c-electric-star,
948 c-electric-semi&comma, c-electric-colon, c-electric-lt-gt,
949 c-electric-paren, c-electric-continued-statement, c-indent-command,
950 c-indent-region, c-mask-paragraph, c-indent-new-comment-line,
951 c-context-line-break): Added `c-save-buffer-state' calls to comply
952 with the changed semantics of the functions above.
953
954 * progmodes/cc-engine.el (c-beginning-of-statement-1): Fixed a bug
955 when macros occur in obscure places. Optimized the sexp movement
956 a bit.
957
9582005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
959
960 Enhancements for c-beginning-of-statement to work in AWK Mode:
961
962 * progmodes/cc-awk.el: Supersede c-awk-NL-prop value `;'
963 (completed statement) with `}' (statement completed by closing
964 brace or semicolon) and `$' (statement completed by EOL).
965
966 (c-awk-virtual-semicolon-ends-prev-line-p,
967 c-awk-virtual-semicolon-ends-line-p,
968 c-awk-skip-semantic-ws-forward, c-awk-skip-semantic-ws-backward,
969 c-awk-at-statement-end-p): new functions
970
971 * progmodes/cc-cmds.el: Simplify the structure of functions
972 c-forward-over-illiterals, c-back-over-illiterals. Enhance these
973 two functions and c-beginning-of-statement to handle AWK Mode.
974
975 * progmodes/cc-engine.el: Enhance c-forward-single-comment,
976 c-backward-single-comment for AWK mode. Attempt to clarify their
977 doc-strings.
978
979 * progmodes/cc-mode.el: Put M-a and M-e into awk-mode-map.
980
9812005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
982
983 * progmodes/cc-engine.el, cc-fonts.el, cc-langs.el: Cleaned up the
984 label handling. Labels are now recognized in a uniform and more
985 robust way, regardless of context. Text properties are put on all
986 labels to recognize the following declarations better. Multiword
987 labels are handled both in indentation and fontification for the
988 benefit of language extensions like Qt. For consistency, keywords
989 in labels are now fontified with the label face instead. That
990 also applies to "case" and "default".
991
992 (c-beginning-of-statement-1): Fixed some bugs in the label
993 handling. Disregard `c-nonlabel-token-key' in labels that begin
994 with `c-label-kwds'.
995
996 (c-find-decl-spots): Support that the callback adds more
997 `c-decl-end' spots to find.
998
999 (c-forward-decl-or-cast-1): Don't treat a list of plain
1000 identifiers followed by a colon as a declaration.
1001
1002 (c-forward-label): New function to recognize labels.
1003
1004 (c-guess-basic-syntax): Replaced uses of `c-label-key' with
1005 `c-forward-label'. Moved the label recognition cases (14 and 15)
1006 earlier since they aren't so context sensitive now. Handle labels
1007 on the top level gracefully. Moved access label recognition to
1008 the generic label case (CASE 15) - removed CASE 5E.
1009
1010 (c-font-lock-declarations): Added recognition of labels in the
1011 same round since we need to handle labels in parallell with other
1012 declarations to recognize both accurately. It should also improve
1013 speed.
1014
1015 (c-simple-decl-matchers, c-basic-matchers-after): Moved
1016 `c-font-lock-labels' so that it only is used on decoration level 2
1017 since `c-font-lock-declarations' handles it otherwise.
1018
1019 (c-complex-decl-matchers): Removed the simplistic recognition of
1020 access labels.
1021
1022 (c-decl-prefix-re): Removed the kludges that was necessary to cope
1023 with labels earlier.
1024
1025 (c-decl-start-re): New language variable to make
1026 `c-font-lock-declarations' stop for the special protection labels
1027 in Objective-C that start with '@'.
1028
1029 (c-label-key): Removed since it's no longer used.
1030
1031 (c-recognize-colon-labels, c-label-prefix-re): New language
1032 constants to support recognition of generic colon-terminated
1033 labels.
1034
1035 (c-type-decl-end-used): `c-decl-end' is now used whenever there
1036 are colon terminated labels.
1037
1038 * progmodes/cc-align.el (c-lineup-arglist): Fixed bug when the
1039 first argument starts with a special brace list.
1040
1041 * progmodes/cc-engine.el, cc-fonts.el (c-forward-decl-or-cast-1,
1042 c-font-lock-declarations): Broke out the declaration and cast
1043 recognition from `c-font-lock-declarations' to a new function, so
1044 that it can be used in the indentation engine.
1045
1046 * progmodes/cc-engine.el (c-find-decl-spots): Fixed bug in backing
1047 up to the start of the literal. Fixed bug with the point on the
1048 wrong side of the search limit that could happen when the start
1049 position is inside a literal.
1050
1051 * progmodes/cc-engine.el (c-parse-state,
1052 c-invalidate-state-cache): Modified the use of `c-state-cache-end'
1053 so that it's kept a little bit back to increase the hit rate.
1054
1055 (c-parse-state): Changed the macro handling and fixed some
1056 glitches. Macro context is checked more often than necessary now,
1057 but otoh less garbage conses are generated.
1058
1059 * progmodes/cc-engine.el (c-parse-state,
1060 c-invalidate-state-cache): Cache the last position where
1061 `c-state-cache' applies. This can speed up refontification quite
1062 a bit in blocks where there are many non-brace parens before the
1063 point.
1064
1065 (c-state-cache-end): New variable for this.
1066
1067 (c-guess-basic-syntax, c-debug-parse-state): Adapted for the new
1068 cache variable.
1069
1070 * progmodes/cc-engine.el (c-find-decl-spots): Take more care to
1071 get close initial continue positions when the start position is
1072 inside a literal or macro. Do not call the callback for spots
1073 before the start position (which can happen e.g. for `c-decl-end'
1074 spots inside comments). Optimize better in special cases when the
1075 region is a single line inside a literal or macro (typically when
1076 the current line is refontified).
1077
1078 * progmodes/cc-engine.el (c-guess-basic-syntax): Simplified calls
1079 to `c-add-stmt-syntax' - there's no need to explicitly whack off
1080 entries from the paren state.
1081
1082 * progmodes/cc-engine.el (c-add-stmt-syntax): Narrowed down the
1083 special case for "else if" clauses.
1084
1085 * progmodes/cc-engine.el (c-looking-at-inexpr-block,
1086 c-add-stmt-syntax): Use `c-recognize-paren-inexpr-blocks'.
1087
1088 * progmodes/cc-langs.el (c-recognize-paren-inexpr-blocks): New
1089 language variable to recognize the gcc extension with statement
1090 blocks inside expressions.
1091
1092 * progmodes/cc-engine.el (c-add-stmt-syntax): Restructured to make
1093 it somewhat more comprehensible. The argument AT-BLOCK-START is
1094 no longer used and hence removed.
1095
1096 (c-guess-continued-construct, c-guess-basic-syntax): Updated calls
1097 to `c-add-stmt-syntax'.
1098
1099 * progmodes/cc-engine.el (c-backward-to-decl-anchor): Use
1100 `c-beginning-of-statement-1' instead of duplicating parts of it.
1101 This fixes bogus label recognition.
1102
1103 * progmodes/cc-engine.el (c-add-type, c-check-type,
1104 c-forward-name, c-forward-type): Improved storage of template
1105 types in `c-found-types' so that they can be recognized better.
1106
1107 (c-syntactic-content): Added option to skip past nested parens.
1108
1109 * progmodes/cc-engine.el (c-forward-name): Set
1110 `c-last-identifier-range' all the time. It's less work that way.
1111 Handle that there might not be an identifier to store in
1112 `c-last-identifier-range'.
1113
1114 (c-forward-type): Handle that `c-last-identifier-range' might be
1115 nil from `c-forward-name'.
1116
1117 * progmodes/cc-defs.el: (c-safe-scan-lists,
1118 c-(go-)?(up|down)-list-(forward|backward)): Added limit arguments.
1119
1120 * progmodes/cc-defs.el (c-save-buffer-state): Use `unwind-protect'
1121 to work even if the form fails.
1122
1123 * progmodes/cc-engine.el (c-parse-state): Speedup when moving far
1124 down in a large file in one go.
1125
1126 (c-get-fallback-start-pos): New helper function for
1127 `c-parse-state'.
1128
1129 * progmodes/cc-align.el (c-lineup-assignments): New lineup
1130 function which is like `c-lineup-math' but returns nil instead of
1131 `c-basic-offset' when it doesn't match.
1132
1133 (c-lineup-math): Changed to use `c-lineup-assignments'.
1134
11352005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
1136
1137 * progmodes/cc-cmds.el: Fix some bugs in subfunctions of
1138 c-beginning-of-statement. New subfunctions
1139 c-in-comment-line-prefix-p, c-narrow-to-comment-innards.
1140
11412005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
1142
1143 * progmodes/cc-fonts.el, cc-langs.el: Use `c-simple-ws' instead of
1144 hardcoded char classes whereever possible. Changed a couple of
1145 places to use skip by syntax instead of skip by char class.
1146
1147 * progmodes/cc-langs.el (c-unterminated-block-comment-regexp):
1148 Fixed a bug in the regexp that caused extreme backtracking.
1149
1150 * progmodes/cc-langs.el (c-block-comment-starter,
1151 c-block-comment-ender): New language constants to specify in a
1152 single place how block comments look.
1153
1154 (c-comment-start-regexp, c-block-comment-start-regexp,
1155 comment-start, comment-end, comment-start-skip,
1156 c-syntactic-ws-start, c-syntactic-ws-end, c-nonwhite-syntactic-ws,
1157 c-syntactic-ws, c-nonempty-syntactic-ws,
1158 c-single-line-syntactic-ws, c-syntactic-eol): Now built from
1159 `c-line-comment-starter', `c-block-comment-starter' and
1160 `c-block-comment-ender'.
1161
1162 (c-block-comment-regexp, c-unterminated-block-comment-regexp): New
1163 language constants to break up things a bit.
1164
1165 (c-simple-ws): New language constant for simple whitespace.
1166
1167 * progmodes/cc-defs.el (c-concat-separated): New convenience
1168 function.
1169
1170 * progmodes/cc-defs.el (c-make-keywords-re): Added kludge for bug
1171 in `regexp-opt' in Emacs 20 and XEmacs when strings contain
1172 newlines. Allow and ignore nil elements in the list.
1173
11742005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
1175
1176 * progmodes/cc-cmds.el: Comment out a (n almost certainly
1177 superfluous) check, (eq here (point-max)) in
1178 c-beginning-of-statement.
1179
1180 * progmodes/cc-cmds.el: Tidy up the comments in
1181 c-beginning-of-statement and subfunctions.
1182
1183 * progmodes/cc-awk.el: Replace calls to put-text-property to the
1184 more flexible c-put-char-property and c-clear-char-properties.
1185 Add the author's email address.
1186
1187 * progmodes/cc-langs.el: New variable,
1188 c-block-comment-start-regexp.
1189
1190 * progmodes/cc-cmds.el: Fix bug with M-e, when point is inside the
1191 closing "*/" of a block comment.
1192
1193 * progmodes/cc-cmds.el: Tidy c-beginning-of-sentence (and
1194 subfunctions) so that it works at BOB and EOB.
1195
1196 * progmodes/cc-cmds.el, cc-vars.el: More updating of
1197 c-beginning-of-statement, including new variable
1198 c-block-comment-start-regexp.
1199
12002005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
1201
1202 * progmodes/cc-langs.el (c-known-type-key): Optimize simple
1203 symbols from `*-font-lock-extra-types' so that there's no need to
1204 use `regexp-opt' on those lists.
1205
1206 * progmodes/cc-langs.el (c-type-decl-suffix-key): Fix when
1207 `c-type-modifier-kwds' is empty.
1208
1209 * progmodes/cc-fonts.el (c-font-lock-invalid-string): Fix when
1210 there are several strings on the same line.
1211
1212 * progmodes/cc-engine.el (c-literal-limits): Removed the
1213 compatibility function for older emacsen. `c-literal-limits-fast'
1214 has now taken the place of this function.
1215
1216 * progmodes/cc-vars.el (c-emacs-features): Removed compatibility
1217 with older emacsen: We now require 'pps-extended-state.
1218
12192005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
1220
1221 * progmodes/cc-cmds.el: New function c-beginning-of-sentence,
1222 which obviates the need to hack sentence-end. This now handles
1223 escaped newlines in strings correctly. Correct minor bugs in
1224 c-move-over-sentence and in c-beginning-of-statement.
1225
1226 * progmodes/cc-cmds.el (c-beginning-of-statement (and
1227 subfunctions)): Adapt c-\(back\|forward\)-over-illiterals such
1228 that movement over macros and code are rigorously separated from
1229 eachother. Correct a few incidental bugs.
1230
1231 * progmodes/cc-cmds.el: Restructure c-beginning-of-statement:
1232 Improve its doc-string. Improve the handling of certain specific
1233 cases.
1234
12352005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
1236
1237 * progmodes/cc-engine.el, cc-fonts.el, cc-langs.el
1238 (c-guess-basic-syntax): Changed the way class-level labels are
1239 recognized; they can now contain essentially any symbols.
1240
1241 (c-opt-extra-label-key): New language variable to cope with the
1242 special protection label syntax in Objective-C.
1243
1244 (c-opt-access-key): Removed; this is now handled better by
1245 `c-nonlabel-token-key' and `c-opt-extra-label-key'.
1246
1247 (c-complex-decl-matchers): Update to handle that
1248 `c-opt-access-key' no longer exists.
1249
1250 * progmodes/cc-engine.el (c-guess-basic-syntax): Make use of the
1251 improved label recognition in `c-beginning-of-statement-1'.
1252
1253 * progmodes/cc-engine.el (c-beginning-of-member-init-list):
1254 Recognize bitfields better.
1255
1256 * progmodes/cc-engine.el (c-beginning-of-inheritance-list):
1257 Removed some cruft and fixed a bug that could cause it to go to a
1258 position further down.
1259
1260 * progmodes/cc-langs.el, cc-engine.el
1261 (c-beginning-of-statement-1): Improved detection of labels in
1262 declaration contexts.
1263
1264 (c-beginning-of-decl-1): Use it.
1265
1266 (c-nonlabel-token-key): New language constant and variable needed
1267 by `c-beginning-of-statement-1'.
1268
1269 * progmodes/cc-engine.el (c-guess-basic-syntax): Fixed bug that
1270 manifested itself due to the correction in `c-forward-sexp'.
1271
1272 * progmodes/cc-defs.el (c-forward-sexp, c-backward-sexp): Made
1273 these behave as documented when used at the buffer limits.
1274
1275 * progmodes/cc-mode.el, cc-engine.el, cc-langs.el
1276 (c-type-decl-end-used): Made this a language variable.
1277
1278 * progmodes/cc-mode.el (c-after-change): Widen the buffer to work
1279 correctly when `combine-after-change-calls' is used together with
1280 temporary narrowings.
1281
1282 * progmodes/cc-engine.el (c-beginning-of-statement-1): Report
1283 labels correctly when the start point is immediately after the
1284 colon.
1285
1286 * progmodes/cc-defs.el (c-parse-sexp-lookup-properties): Removed
1287 since it isn't used anymore.
1288
1289 * progmodes/cc-cmds.el (c-electric-lt-gt): Detect and mark angle
1290 bracket arglists such as template parens in C++.
1291
1292 * progmodes/cc-engine.el (c-syntactic-skip-backward): Fixed a bug
1293 in the last check-in. Some optimization.
1294
1295 * progmodes/cc-engine.el (c-syntactic-skip-backward): Fixed bug
1296 where it could stop at the same level in a preceding sexp when
1297 PAREN-LEVEL is set.
1298
1299 * progmodes/cc-mode.el (c-basic-common-init): Turn on syntax-table
1300 text property lookup only when it's needed.
1301
1302 * progmodes/cc-langs.el, cc-engine.el, cc-fonts.el, cc-mode.el:
1303 Changed the policy for paren marked angle brackets to be more
1304 persistent; once marked they remain marked even when they're found
1305 to be unbalanced in the searched region. This should keep the
1306 paren syntax around even when individual lines are refontified in
1307 multiline template arglists.
1308
1309 (c-parse-and-markup-<>-arglists): New dynamically bound variable
1310 to control markup so that incorrect angle bracket arglists aren't
1311 marked in contexts where the correct value for
1312 `c-disallow-comma-in-<>-arglists' isn't known.
1313
1314 (c-forward-<>-arglist, c-forward-<>-arglist-recur): The reparse
1315 argument has become `c-parse-and-markup-<>-arglists'.
1316
1317 (c-remove-<>-arglist-properties): Removed - no longer used.
1318
1319 (c-after-change-check-<>-operators): New function used on
1320 `after-change-functions' to avoid that "<" and ">" characters that
1321 are part of longer operators have paren syntax.
1322
1323 (c-<>-multichar-token-regexp): New language variable used by
1324 `c-after-change-check-<>-operators'.
1325
1326 (c-after-change): Call `c-after-change-check-<>-operators'.
1327
1328 (c-font-lock-<>-arglists): Use the context properties set by
1329 `c-font-lock-declarations' to set
1330 `c-disallow-comma-in-<>-arglists' correctly to avoid doing invalid
1331 markup.
1332
1333 (c-font-lock-declarations): Removed code that undoes the invalid
1334 markup done by `c-font-lock-<>-arglists'.
1335
1336 (c-complex-decl-matchers): `c-font-lock-<>-arglists' now runs
1337 after `c-font-lock-declarations'.
1338
1339 * progmodes/cc-engine.el (c-syntactic-skip-backward): Added
1340 paren-level feature.
1341
1342 (c-guess-basic-syntax): Improved the anchor position for
1343 `template-args-cont' in nested template arglists. There's still
1344 much to be desired in this area, though.
1345
13462005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
1347
1348 * progmodes/cc-cmds.el, cc-engine.el, cc-langs.el, cc-vars.el:
1349 Make the "Text Filling and Line Breaking" commands work for AWK
1350 buffers.
1351
13522005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
1353
1354 * progmodes/cc-defs.el, cc-engine.el (c-mode-is-new-awk-p):
1355 Removed;
1356 (c-major-mode-is 'awk-mode) can be used instead now.
1357
1358 * progmodes/cc-mode.el: Always set up AWK mode since emacsen where
1359 it doesn't work no longer are supported.
1360
1361 * progmodes/cc-mode.el, cc-styles.el, cc-vars.el, cc-defs.el,
1362 cc-engine.el, cc-fonts.el, cc-langs.el, cc-cmds.el: CC Mode now
1363 requires support for the syntax-table' text property, which rules
1364 out Emacs 19 and XEmacs < 21.4. Removed various compatibility
1365 cruft associated with those versions.
1366
1367 * progmodes/cc-defs.el, cc-fix.el: CC Mode now requires support
1368 for the `syntax-table' text property, which rules out Emacs 19 and
1369 XEmacs < 21.4. Removed various compatibility cruft associated
1370 with those versions.
1371
1372 * progmodes/cc-vars.el (c-emacs-features): CC Mode now requires
1373 support for the `syntax-table' text property.
1374
1375 * progmodes/cc-fonts.el (c-nonbreakable-space-face): Remove the
1376 variable and use an extra quoted face name instead. All the
1377 emacsen flavors handle that correctly.
1378
1379 * progmodes/cc-fonts.el (c-font-lock-complex-decl-prepare,
1380 c-font-lock-declarators, c-font-lock-declarations,
1381 c-complex-decl-matchers, c-basic-matchers-after): Use a text
1382 property to mark the items in in declarator lists to handle
1383 refontification inside multiline declarations better.
1384
1385 * progmodes/cc-fonts.el (c-font-lock-declarations): Recognize a
1386 construct like "a * b = c;" as a declaration.
1387
13882005-12-08 Kim F. Storm <storm@cua.dk>
1389
1390 * emulation/cua-base.el (cua-use-hyper-key): Replaced by ...
1391 (cua-rectangle-modifier-key): ... this. New defcustom. Can now
1392 select either meta, hyper, or super modifier for rectangle commands.
1393 (cua--rectangle-modifier-key): New defvar.
1394 (cua--M/H-key): Use it. Remove special case for 'space.
1395 (cua--init-keymaps): Initialize it from cua-rectangle-modifier-key
1396 on X, to meta otherwise. Always bind C-return to toggle
1397 rectangle. Pass ?\s instead of 'space to cua--M/H-key.
1398
1399 * emulation/cua-rect.el (cua-help-for-rectangle): Use
1400 cua--rectangle-modifier-key. Handle super modifier too.
1401 (cua--init-rectangles): Always bind C-return to toggle rectangle.
1402 Pass ?\s instead of 'space to cua--M/H-key and cua--rect-M/H-key.
1403
1404 * ido.el: Move Acknowledgements and History after Commentary.
1405 Minor changes to Commentary.
1406
1407 * emulation/cua-base.el (cua--select-keymaps): Enable repeat
1408 keymap if cua--prefix-override-timer equals 'shift.
1409 (cua--shift-control-prefix): New function; emulate "type prefix
1410 key twice" functionality to handle shifted prefix key override.
1411 (cua--shift-control-c-prefix, cua--shift-control-x-prefix): New
1412 commands.
1413 (cua--init-keymaps): Bind them to S-C-c and S-C-x.
1414
14152005-12-08 Carsten Dominik <dominik@science.uva.nl>
1416
1417 * textmodes/org.el (org-insert-heading): Try to do items before
1418 headings.
1419 (org-agenda-mode): Quote `org-agenda-mode-hook'.
1420 (org-insert-item): New function.
1421 (org-renumber-ordered-list): Don't skip to higher level lists.
1422
14232005-12-08 Juri Linkov <juri@jurta.org>
1424
1425 * info.el (Info-mode-map): Bind M-TAB to `Info-prev-reference'.
1426
1427 * button.el (button-buffer-map): Bind M-TAB to `backward-button'.
1428
1429 * wid-edit.el (widget-keymap): Bind M-TAB to `widget-backward'.
1430
1431 * pcvs.el (defun-cvs-mode): Put `definition-name' property on
1432 the constructed function name fun-1.
1433
1434 * cus-edit.el (custom-add-parent-links): Filter out custom-group-link,
1435 because such links don't lead to parent documentation.
1436
12005-12-08 Kenichi Handa <handa@m17n.org> 14372005-12-08 Kenichi Handa <handa@m17n.org>
2 1438
3 * descr-text.el (describe-char): Use *Help-2* buffer if the 1439 * descr-text.el (describe-char): Use *Help-2* buffer if the
@@ -62,7 +1498,7 @@
62 (gdb-locals-watch-map): Rename from gdb-*-*-keymap. 1498 (gdb-locals-watch-map): Rename from gdb-*-*-keymap.
63 (gdb-locals-font-lock-keywords-1) 1499 (gdb-locals-font-lock-keywords-1)
64 (gdb-locals-font-lock-keywords-2): New variables. 1500 (gdb-locals-font-lock-keywords-2): New variables.
65 (gdb-find-file-hook): fgfg. 1501 (gdb-find-file-hook): Make it work with GDB 6.4+ too.
66 (gdb-set-gud-minor-mode-existing-buffers-1) 1502 (gdb-set-gud-minor-mode-existing-buffers-1)
67 (gdb-var-list-children-1, gdb-var-list-children-handler-1) 1503 (gdb-var-list-children-1, gdb-var-list-children-handler-1)
68 (gdb-var-update-1, gdb-var-update-handler-1) 1504 (gdb-var-update-1, gdb-var-update-handler-1)
@@ -94,7 +1530,7 @@
94 1530
952005-12-06 Carsten Dominik <dominik@science.uva.nl> 15312005-12-06 Carsten Dominik <dominik@science.uva.nl>
96 1532
97 * textmodes/org.el: (org-occur-highlights): New variable. 1533 * textmodes/org.el (org-occur-highlights): New variable.
98 (org-highlight-new-match, org-remove-occur-highlights): New functions. 1534 (org-highlight-new-match, org-remove-occur-highlights): New functions.
99 (org-highlight-sparse-tree-matches): New option. 1535 (org-highlight-sparse-tree-matches): New option.
100 (org-do-occur): New function. 1536 (org-do-occur): New function.
@@ -187,7 +1623,8 @@
187 1623
188 * font-core.el (global-font-lock-mode): Use define-global-minor-mode 1624 * font-core.el (global-font-lock-mode): Use define-global-minor-mode
189 instead of easy-mmode-define-global-mode. Add `:group font-lock'. 1625 instead of easy-mmode-define-global-mode. Add `:group font-lock'.
190 (font-lock-mode): Replace `:group font-lock' with `nil nil nil'. 1626 (font-lock-mode): Replace `:group font-lock' with `nil nil nil'
1627 because there is no customization option for it.
191 1628
192 * font-lock.el (lisp-font-lock-keywords-1): 1629 * font-lock.el (lisp-font-lock-keywords-1):
193 Add define-global-minor-mode. 1630 Add define-global-minor-mode.
@@ -223,8 +1660,8 @@
223 property on their symbols (they have only `custom-loads'). 1660 property on their symbols (they have only `custom-loads').
224 1661
225 * simple.el (completion-setup-function): Put completions-common-part 1662 * simple.el (completion-setup-function): Put completions-common-part
226 face on full completion string too (i.e. completion string without 1663 face on complete completion string too (i.e. completion string
227 completions-first-difference face). 1664 without completions-first-difference face).
228 1665
229 * man.el (Man-section-regexp): Add 0-9 to support "3X11" sections. 1666 * man.el (Man-section-regexp): Add 0-9 to support "3X11" sections.
230 1667
@@ -698,7 +2135,7 @@
698 2135
6992005-11-24 Carsten Dominik <dominik@science.uva.nl> 21362005-11-24 Carsten Dominik <dominik@science.uva.nl>
700 2137
701 * textmodes/org.el: (org-export-plain-list-max-depth): Renamed from 2138 * textmodes/org.el (org-export-plain-list-max-depth): Renamed from
702 `org-export-local-list-max-depth'. Change default value to 3. 2139 `org-export-local-list-max-depth'. Change default value to 3.
703 (org-auto-renumber-ordered-lists) 2140 (org-auto-renumber-ordered-lists)
704 (org-plain-list-ordered-item-terminator): New options. 2141 (org-plain-list-ordered-item-terminator): New options.
@@ -912,7 +2349,7 @@
912 2349
9132005-11-18 Carsten Dominik <dominik@science.uva.nl> 23502005-11-18 Carsten Dominik <dominik@science.uva.nl>
914 2351
915 * textmodes/org.el: (org-table-sort-lines): New command. 2352 * textmodes/org.el (org-table-sort-lines): New command.
916 (org-tbl-menu): Add entry for `org-table-sort-lines'. 2353 (org-tbl-menu): Add entry for `org-table-sort-lines'.
917 (org-add-file): Command removed, use `org-agenda-file-to-front' 2354 (org-add-file): Command removed, use `org-agenda-file-to-front'
918 instead. 2355 instead.
@@ -2812,7 +4249,7 @@
2812 4249
28132005-10-21 Carsten Dominik <dominik@science.uva.nl> 42502005-10-21 Carsten Dominik <dominik@science.uva.nl>
2814 4251
2815 * textmodes/org.el: (org-combined-agenda-icalendar-file) 4252 * textmodes/org.el (org-combined-agenda-icalendar-file)
2816 (org-icalendar-include-todo, org-icalendar-combined-name): New options. 4253 (org-icalendar-include-todo, org-icalendar-combined-name): New options.
2817 (org-export-icalendar-this-file) 4254 (org-export-icalendar-this-file)
2818 (org-export-icalendar-all-agenda-files) 4255 (org-export-icalendar-all-agenda-files)
@@ -3494,7 +4931,7 @@
3494 4931
34952005-10-10 Carsten Dominik <dominik@science.uva.nl> 49322005-10-10 Carsten Dominik <dominik@science.uva.nl>
3496 4933
3497 * textmodes/org.el: (org-mode-map): Explicit definition of `C-c 4934 * textmodes/org.el (org-mode-map): Explicit definition of `C-c
3498 C-x' as a prefix. 4935 C-x' as a prefix.
3499 (orgtbl-mode-map): Full keymap instead of sparse, because all 4936 (orgtbl-mode-map): Full keymap instead of sparse, because all
3500 `self-insert-command' keys are redefined in this map. 4937 `self-insert-command' keys are redefined in this map.
@@ -15377,7 +16814,7 @@
15377 16814
15378 * cus-edit.el (custom-bury-buffer): Function deleted. 16815 * cus-edit.el (custom-bury-buffer): Function deleted.
15379 (custom-buffer-done-function): Option deleted. 16816 (custom-buffer-done-function): Option deleted.
15380 (custom-buffer-done-kill): New (replacement option. 16817 (custom-buffer-done-kill): New replacement option.
15381 (Custom-buffer-done): Call quit-window. 16818 (Custom-buffer-done): Call quit-window.
15382 (custom-buffer-create-internal): Update for above changes. 16819 (custom-buffer-create-internal): Update for above changes.
15383 16820
diff --git a/lisp/align.el b/lisp/align.el
index 2cbc43e38d3..122ce2f0f88 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -931,8 +931,7 @@ using a REGEXP like \"(\". All you would have to do is to mark the
931region, call `align-regexp' and type in that regular expression." 931region, call `align-regexp' and type in that regular expression."
932 (interactive 932 (interactive
933 (append 933 (append
934 (list (min (point) (mark)) 934 (list (region-beginning) (region-end))
935 (max (point) (mark)))
936 (if current-prefix-arg 935 (if current-prefix-arg
937 (list (read-string "Complex align using regexp: " 936 (list (read-string "Complex align using regexp: "
938 "\\(\\s-*\\)") 937 "\\(\\s-*\\)")
@@ -988,8 +987,7 @@ list of rules (see `align-rules-list'), it can be used to override the
988default alignment rules that would have been used to identify the text 987default alignment rules that would have been used to identify the text
989to be colored." 988to be colored."
990 (interactive 989 (interactive
991 (list (min (mark) (point)) 990 (list (region-beginning) (region-end)
992 (max (mark) (point))
993 (completing-read 991 (completing-read
994 "Title of rule to highlight: " 992 "Title of rule to highlight: "
995 (mapcar 993 (mapcar
diff --git a/lisp/button.el b/lisp/button.el
index d58e53c2895..375182dd36b 100644
--- a/lisp/button.el
+++ b/lisp/button.el
@@ -69,6 +69,7 @@
69(defvar button-buffer-map 69(defvar button-buffer-map
70 (let ((map (make-sparse-keymap))) 70 (let ((map (make-sparse-keymap)))
71 (define-key map [?\t] 'forward-button) 71 (define-key map [?\t] 'forward-button)
72 (define-key map "\e\t" 'backward-button)
72 (define-key map [backtab] 'backward-button) 73 (define-key map [backtab] 'backward-button)
73 map) 74 map)
74 "Keymap useful for buffers containing buttons. 75 "Keymap useful for buffers containing buttons.
diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el
index 590fcc9b871..40c6bfc2c86 100644
--- a/lisp/calendar/appt.el
+++ b/lisp/calendar/appt.el
@@ -1,6 +1,7 @@
1;;; appt.el --- appointment notification functions 1;;; appt.el --- appointment notification functions
2 2
3;; Copyright (C) 1989, 1990, 1994, 1998, 2004, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 1989, 1990, 1994, 1998, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Neil Mager <neilm@juliet.ll.mit.edu> 6;; Author: Neil Mager <neilm@juliet.ll.mit.edu>
6;; Maintainer: Glenn Morris <rgm@gnu.org> 7;; Maintainer: Glenn Morris <rgm@gnu.org>
@@ -235,6 +236,8 @@ The variable `appt-audible' controls the audible reminder."
235 (cond ((eq appt-display-format 'window) 236 (cond ((eq appt-display-format 'window)
236 (funcall appt-disp-window-function 237 (funcall appt-disp-window-function
237 (number-to-string mins) 238 (number-to-string mins)
239 ;; TODO - use calendar-month-abbrev-array rather
240 ;; than %b?
238 (format-time-string "%a %b %e " (current-time)) 241 (format-time-string "%a %b %e " (current-time))
239 string) 242 string)
240 (run-at-time (format "%d sec" appt-display-duration) 243 (run-at-time (format "%d sec" appt-display-duration)
diff --git a/lisp/calendar/cal-bahai.el b/lisp/calendar/cal-bahai.el
index dd06ca6b9ef..91d4d3636df 100644
--- a/lisp/calendar/cal-bahai.el
+++ b/lisp/calendar/cal-bahai.el
@@ -1,6 +1,6 @@
1;;; cal-bahai.el --- calendar functions for the Baha'i calendar. 1;;; cal-bahai.el --- calendar functions for the Baha'i calendar.
2 2
3;; Copyright (C) 2001 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5;; Author: John Wiegley <johnw@gnu.org> 5;; Author: John Wiegley <johnw@gnu.org>
6;; Keywords: calendar 6;; Keywords: calendar
diff --git a/lisp/calendar/cal-china.el b/lisp/calendar/cal-china.el
index 24d9c4f161b..a4b83b87b15 100644
--- a/lisp/calendar/cal-china.el
+++ b/lisp/calendar/cal-china.el
@@ -1,8 +1,10 @@
1;;; cal-china.el --- calendar functions for the Chinese calendar 1;;; cal-china.el --- calendar functions for the Chinese calendar
2 2
3;; Copyright (C) 1995, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org>
6;; Keywords: calendar 8;; Keywords: calendar
7;; Human-Keywords: Chinese calendar, calendar, holidays, diary 9;; Human-Keywords: Chinese calendar, calendar, holidays, diary
8 10
diff --git a/lisp/calendar/cal-coptic.el b/lisp/calendar/cal-coptic.el
index 14b3c65796f..4673053246f 100644
--- a/lisp/calendar/cal-coptic.el
+++ b/lisp/calendar/cal-coptic.el
@@ -1,8 +1,10 @@
1;;; cal-coptic.el --- calendar functions for the Coptic/Ethiopic calendars 1;;; cal-coptic.el --- calendar functions for the Coptic/Ethiopic calendars
2 2
3;; Copyright (C) 1995, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org>
6;; Keywords: calendar 8;; Keywords: calendar
7;; Human-Keywords: Coptic calendar, Ethiopic calendar, calendar, diary 9;; Human-Keywords: Coptic calendar, Ethiopic calendar, calendar, diary
8 10
diff --git a/lisp/calendar/cal-dst.el b/lisp/calendar/cal-dst.el
index 141ca2d8183..1f3859d8bf1 100644
--- a/lisp/calendar/cal-dst.el
+++ b/lisp/calendar/cal-dst.el
@@ -1,9 +1,11 @@
1;;; cal-dst.el --- calendar functions for daylight savings rules 1;;; cal-dst.el --- calendar functions for daylight savings rules
2 2
3;; Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. 3;; Copyright (C) 1993, 1994, 1995, 1996, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Paul Eggert <eggert@twinsun.com> 6;; Author: Paul Eggert <eggert@twinsun.com>
6;; Edward M. Reingold <reingold@cs.uiuc.edu> 7;; Edward M. Reingold <reingold@cs.uiuc.edu>
8;; Maintainer: Glenn Morris <rgm@gnu.org>
7;; Keywords: calendar 9;; Keywords: calendar
8;; Human-Keywords: daylight savings time, calendar, diary, holidays 10;; Human-Keywords: daylight savings time, calendar, diary, holidays
9 11
diff --git a/lisp/calendar/cal-french.el b/lisp/calendar/cal-french.el
index 7bab001a0bb..ed974d312bb 100644
--- a/lisp/calendar/cal-french.el
+++ b/lisp/calendar/cal-french.el
@@ -1,8 +1,10 @@
1;;; cal-french.el --- calendar functions for the French Revolutionary calendar 1;;; cal-french.el --- calendar functions for the French Revolutionary calendar
2 2
3;; Copyright (C) 1988, 89, 92, 94, 95, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1988, 1989, 1992, 1994, 1995, 1997, 2001, 2002, 2003,
4;; 2004, 2005 Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org>
6;; Keywords: calendar 8;; Keywords: calendar
7;; Human-Keywords: French Revolutionary calendar, calendar, diary 9;; Human-Keywords: French Revolutionary calendar, calendar, diary
8 10
diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el
index 9805a00cc7a..99823db8215 100644
--- a/lisp/calendar/cal-hebrew.el
+++ b/lisp/calendar/cal-hebrew.el
@@ -1,9 +1,11 @@
1;;; cal-hebrew.el --- calendar functions for the Hebrew calendar 1;;; cal-hebrew.el --- calendar functions for the Hebrew calendar
2 2
3;; Copyright (C) 1995, 1997, 2003 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Nachum Dershowitz <nachum@cs.uiuc.edu> 6;; Author: Nachum Dershowitz <nachum@cs.uiuc.edu>
6;; Edward M. Reingold <reingold@cs.uiuc.edu> 7;; Edward M. Reingold <reingold@cs.uiuc.edu>
8;; Maintainer: Glenn Morris <rgm@gnu.org>
7;; Keywords: calendar 9;; Keywords: calendar
8;; Human-Keywords: Hebrew calendar, calendar, diary 10;; Human-Keywords: Hebrew calendar, calendar, diary
9 11
diff --git a/lisp/calendar/cal-islam.el b/lisp/calendar/cal-islam.el
index 9cdcba6a370..52801600157 100644
--- a/lisp/calendar/cal-islam.el
+++ b/lisp/calendar/cal-islam.el
@@ -1,8 +1,10 @@
1;;; cal-islam.el --- calendar functions for the Islamic calendar 1;;; cal-islam.el --- calendar functions for the Islamic calendar
2 2
3;; Copyright (C) 1995, 1997, 2001, 2003 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org>
6;; Keywords: calendar 8;; Keywords: calendar
7;; Human-Keywords: Islamic calendar, calendar, diary 9;; Human-Keywords: Islamic calendar, calendar, diary
8 10
diff --git a/lisp/calendar/cal-iso.el b/lisp/calendar/cal-iso.el
index bee3e1ec482..41a3713d3ea 100644
--- a/lisp/calendar/cal-iso.el
+++ b/lisp/calendar/cal-iso.el
@@ -1,6 +1,7 @@
1;;; cal-iso.el --- calendar functions for the ISO calendar 1;;; cal-iso.el --- calendar functions for the ISO calendar
2 2
3;; Copyright (C) 1995, 1997, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
6;; Maintainer: Glenn Morris <rgm@gnu.org> 7;; Maintainer: Glenn Morris <rgm@gnu.org>
diff --git a/lisp/calendar/cal-julian.el b/lisp/calendar/cal-julian.el
index 48fe8725b06..068e705410a 100644
--- a/lisp/calendar/cal-julian.el
+++ b/lisp/calendar/cal-julian.el
@@ -1,8 +1,10 @@
1;;; cal-julian.el --- calendar functions for the Julian calendar 1;;; cal-julian.el --- calendar functions for the Julian calendar
2 2
3;; Copyright (C) 1995, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org>
6;; Keywords: calendar 8;; Keywords: calendar
7;; Human-Keywords: Julian calendar, Julian day number, calendar, diary 9;; Human-Keywords: Julian calendar, Julian day number, calendar, diary
8 10
diff --git a/lisp/calendar/cal-mayan.el b/lisp/calendar/cal-mayan.el
index da411c14984..ce4f42e3328 100644
--- a/lisp/calendar/cal-mayan.el
+++ b/lisp/calendar/cal-mayan.el
@@ -1,9 +1,11 @@
1;;; cal-mayan.el --- calendar functions for the Mayan calendars 1;;; cal-mayan.el --- calendar functions for the Mayan calendars
2 2
3;; Copyright (C) 1992, 1993, 1995, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1992, 1993, 1995, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Stewart M. Clamen <clamen@cs.cmu.edu> 6;; Author: Stewart M. Clamen <clamen@cs.cmu.edu>
6;; Edward M. Reingold <reingold@cs.uiuc.edu> 7;; Edward M. Reingold <reingold@cs.uiuc.edu>
8;; Maintainer: Glenn Morris <rgm@gnu.org>
7;; Keywords: calendar 9;; Keywords: calendar
8;; Human-Keywords: Mayan calendar, Maya, calendar, diary 10;; Human-Keywords: Mayan calendar, Maya, calendar, diary
9 11
diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el
index 81ec46751df..0f8e7295d32 100644
--- a/lisp/calendar/cal-menu.el
+++ b/lisp/calendar/cal-menu.el
@@ -1,6 +1,7 @@
1;;; cal-menu.el --- calendar functions for menu bar and popup menu support 1;;; cal-menu.el --- calendar functions for menu bar and popup menu support
2 2
3;; Copyright (C) 1994, 1995, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 1994, 1995, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
6;; Lara Rios <lrios@coewl.cen.uiuc.edu> 7;; Lara Rios <lrios@coewl.cen.uiuc.edu>
diff --git a/lisp/calendar/cal-move.el b/lisp/calendar/cal-move.el
index 3091822d7ff..70275017bfd 100644
--- a/lisp/calendar/cal-move.el
+++ b/lisp/calendar/cal-move.el
@@ -1,6 +1,7 @@
1;;; cal-move.el --- calendar functions for movement in the calendar 1;;; cal-move.el --- calendar functions for movement in the calendar
2 2
3;; Copyright (C) 1995, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
6;; Maintainer: Glenn Morris <rgm@gnu.org> 7;; Maintainer: Glenn Morris <rgm@gnu.org>
diff --git a/lisp/calendar/cal-persia.el b/lisp/calendar/cal-persia.el
index b92f8c29b8c..e9583a3f00d 100644
--- a/lisp/calendar/cal-persia.el
+++ b/lisp/calendar/cal-persia.el
@@ -1,8 +1,10 @@
1;;; cal-persia.el --- calendar functions for the Persian calendar 1;;; cal-persia.el --- calendar functions for the Persian calendar
2 2
3;; Copyright (C) 1996, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1996, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org>
6;; Keywords: calendar 8;; Keywords: calendar
7;; Human-Keywords: Persian calendar, calendar, diary 9;; Human-Keywords: Persian calendar, calendar, diary
8 10
diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el
index f3ec25cee9e..7b029bc93c5 100644
--- a/lisp/calendar/cal-tex.el
+++ b/lisp/calendar/cal-tex.el
@@ -1,9 +1,11 @@
1;;; cal-tex.el --- calendar functions for printing calendars with LaTeX 1;;; cal-tex.el --- calendar functions for printing calendars with LaTeX
2 2
3;; Copyright (C) 1995 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Steve Fisk <fisk@bowdoin.edu> 6;; Author: Steve Fisk <fisk@bowdoin.edu>
6;; Edward M. Reingold <reingold@cs.uiuc.edu> 7;; Edward M. Reingold <reingold@cs.uiuc.edu>
8;; Maintainer: Glenn Morris <rgm@gnu.org>
7;; Keywords: calendar 9;; Keywords: calendar
8;; Human-Keywords: Calendar, LaTeX 10;; Human-Keywords: Calendar, LaTeX
9 11
diff --git a/lisp/calendar/cal-x.el b/lisp/calendar/cal-x.el
index 903f91af57b..a512c7c1e20 100644
--- a/lisp/calendar/cal-x.el
+++ b/lisp/calendar/cal-x.el
@@ -1,6 +1,7 @@
1;;; cal-x.el --- calendar windows in dedicated frames in X 1;;; cal-x.el --- calendar windows in dedicated frames in X
2 2
3;; Copyright (C) 1994, 1995, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 1994, 1995, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Michael Kifer <kifer@cs.sunysb.edu> 6;; Author: Michael Kifer <kifer@cs.sunysb.edu>
6;; Edward M. Reingold <reingold@cs.uiuc.edu> 7;; Edward M. Reingold <reingold@cs.uiuc.edu>
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index bb36ae4bb6e..1ef8d048c88 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -1,7 +1,7 @@
1;;; calendar.el --- calendar functions 1;;; calendar.el --- calendar functions
2 2
3;; Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1997, 3;; Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1997,
4;; 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. 4;; 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org> 7;; Maintainer: Glenn Morris <rgm@gnu.org>
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 18d984d9ae9..91c396f7bf5 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -1,7 +1,7 @@
1;;; diary-lib.el --- diary functions 1;;; diary-lib.el --- diary functions
2 2
3;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1995, 2003, 2004, 2005 3;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1995, 2001, 2002, 2003,
4;; Free Software Foundation, Inc. 4;; 2004, 2005 Free Software Foundation, Inc.
5 5
6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org> 7;; Maintainer: Glenn Morris <rgm@gnu.org>
diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el
index aef07e39c8d..b18844c18d9 100644
--- a/lisp/calendar/holidays.el
+++ b/lisp/calendar/holidays.el
@@ -1,7 +1,7 @@
1;;; holidays.el --- holiday functions for the calendar package 1;;; holidays.el --- holiday functions for the calendar package
2 2
3;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1997, 2004 Free 3;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1997, 2001, 2002, 2003,
4;; Software Foundation, Inc. 4;; 2004, 2005 Free Software Foundation, Inc.
5 5
6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org> 7;; Maintainer: Glenn Morris <rgm@gnu.org>
diff --git a/lisp/calendar/lunar.el b/lisp/calendar/lunar.el
index d4d5cf23157..ed54bc88394 100644
--- a/lisp/calendar/lunar.el
+++ b/lisp/calendar/lunar.el
@@ -1,8 +1,10 @@
1;;; lunar.el --- calendar functions for phases of the moon 1;;; lunar.el --- calendar functions for phases of the moon
2 2
3;; Copyright (C) 1992, 1993, 1995, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1992, 1993, 1995, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org>
6;; Keywords: calendar 8;; Keywords: calendar
7;; Human-Keywords: moon, lunar phases, calendar, diary 9;; Human-Keywords: moon, lunar phases, calendar, diary
8 10
diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el
index 1b4ac116fe1..3e09e7b1fb6 100644
--- a/lisp/calendar/parse-time.el
+++ b/lisp/calendar/parse-time.el
@@ -1,6 +1,7 @@
1;;; parse-time.el --- parsing time strings 1;;; parse-time.el --- parsing time strings
2 2
3;; Copyright (C) 1996, 2000 by Free Software Foundation, Inc. 3;; Copyright (C) 1996, 2000, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Erik Naggum <erik@naggum.no> 6;; Author: Erik Naggum <erik@naggum.no>
6;; Keywords: util 7;; Keywords: util
diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el
index 52d12e0a18a..5b58b739dba 100644
--- a/lisp/calendar/solar.el
+++ b/lisp/calendar/solar.el
@@ -1,6 +1,7 @@
1;;; solar.el --- calendar functions for solar events 1;;; solar.el --- calendar functions for solar events
2 2
3;; Copyright (C) 1992, 1993, 1995, 1997, 2003 Free Software Foundation, Inc. 3;; Copyright (C) 1992, 1993, 1995, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
6;; Denis B. Roegel <Denis.Roegel@loria.fr> 7;; Denis B. Roegel <Denis.Roegel@loria.fr>
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index b1646a5665c..fd74e5a6251 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -1,6 +1,7 @@
1;;; time-date.el --- Date and time handling functions 1;;; time-date.el --- Date and time handling functions
2;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 2
3;; Free Software Foundation, Inc. 3;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> 6;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
6;; Masanobu Umeda <umerin@mse.kyutech.ac.jp> 7;; Masanobu Umeda <umerin@mse.kyutech.ac.jp>
diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el
index f2ee3f3a048..f46ec4eba23 100644
--- a/lisp/calendar/timeclock.el
+++ b/lisp/calendar/timeclock.el
@@ -1,6 +1,7 @@
1;;; timeclock.el --- mode for keeping track of how much you work 1;;; timeclock.el --- mode for keeping track of how much you work
2 2
3;; Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: John Wiegley <johnw@gnu.org> 6;; Author: John Wiegley <johnw@gnu.org>
6;; Created: 25 Mar 1999 7;; Created: 25 Mar 1999
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index c49733e2158..b6871a38ab9 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -1,6 +1,7 @@
1;;; todo-mode.el --- major mode for editing TODO list files 1;;; todo-mode.el --- major mode for editing TODO list files
2 2
3;; Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1997, 1999, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Oliver Seidel <os10000@seidel-space.de> 6;; Author: Oliver Seidel <os10000@seidel-space.de>
6;; [Not clear the above works, July 2000] 7;; [Not clear the above works, July 2000]
diff --git a/lisp/compare-w.el b/lisp/compare-w.el
index 3fda5f5de76..e3e7bd3945d 100644
--- a/lisp/compare-w.el
+++ b/lisp/compare-w.el
@@ -343,13 +343,13 @@ on third call it again advances points to the next difference and so on."
343 (move-overlay compare-windows-overlay1 beg1 end1 b1) 343 (move-overlay compare-windows-overlay1 beg1 end1 b1)
344 (setq compare-windows-overlay1 (make-overlay beg1 end1 b1)) 344 (setq compare-windows-overlay1 (make-overlay beg1 end1 b1))
345 (overlay-put compare-windows-overlay1 'face 'compare-windows) 345 (overlay-put compare-windows-overlay1 'face 'compare-windows)
346 (overlay-put compare-windows-overlay1 'priority 1)) 346 (overlay-put compare-windows-overlay1 'priority 1000))
347 (overlay-put compare-windows-overlay1 'window w1) 347 (overlay-put compare-windows-overlay1 'window w1)
348 (if compare-windows-overlay2 348 (if compare-windows-overlay2
349 (move-overlay compare-windows-overlay2 beg2 end2 b2) 349 (move-overlay compare-windows-overlay2 beg2 end2 b2)
350 (setq compare-windows-overlay2 (make-overlay beg2 end2 b2)) 350 (setq compare-windows-overlay2 (make-overlay beg2 end2 b2))
351 (overlay-put compare-windows-overlay2 'face 'compare-windows) 351 (overlay-put compare-windows-overlay2 'face 'compare-windows)
352 (overlay-put compare-windows-overlay2 'priority 1)) 352 (overlay-put compare-windows-overlay2 'priority 1000))
353 (overlay-put compare-windows-overlay2 'window w2) 353 (overlay-put compare-windows-overlay2 'window w2)
354 ;; Remove highlighting before next command is executed 354 ;; Remove highlighting before next command is executed
355 (add-hook 'pre-command-hook 'compare-windows-dehighlight))) 355 (add-hook 'pre-command-hook 'compare-windows-dehighlight)))
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index d4ea953bc09..eed12113568 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -1466,7 +1466,7 @@ This updates your Emacs initialization file or creates a new one."
1466 (custom-reset event)))) 1466 (custom-reset event))))
1467 (widget-insert "\n ") 1467 (widget-insert "\n ")
1468 (widget-create 'push-button 1468 (widget-create 'push-button
1469 :tag "Reset" 1469 :tag "Reset to Current"
1470 :help-echo "\ 1470 :help-echo "\
1471Reset all edited text in this buffer to reflect current values." 1471Reset all edited text in this buffer to reflect current values."
1472 :action 'Custom-reset-current) 1472 :action 'Custom-reset-current)
@@ -2155,7 +2155,11 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
2155 (setq parents (cons symbol parents))))) 2155 (setq parents (cons symbol parents)))))
2156 (and (null (get name 'custom-links)) ;No links of its own. 2156 (and (null (get name 'custom-links)) ;No links of its own.
2157 (= (length parents) 1) ;A single parent. 2157 (= (length parents) 1) ;A single parent.
2158 (let* ((links (get (car parents) 'custom-links)) 2158 (let* ((links (delq nil (mapcar (lambda (w)
2159 (unless (eq (widget-type w)
2160 'custom-group-link)
2161 w))
2162 (get (car parents) 'custom-links))))
2159 (many (> (length links) 2))) 2163 (many (> (length links) 2)))
2160 (when links 2164 (when links
2161 (insert "\nParent documentation: ") 2165 (insert "\nParent documentation: ")
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index 4b799ebfedf..7aeb33a648e 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -569,10 +569,11 @@ considered."
569 ((null completion) 569 ((null completion)
570 (message "Can't find completion for \"%s\"" pattern) 570 (message "Can't find completion for \"%s\"" pattern)
571 (ding)) 571 (ding))
572 ((not (string= pattern completion))
573 (delete-region beg end)
574 (insert completion))
575 (t 572 (t
573 (unless (string= completion pattern)
574 (delete-region beg end)
575 (insert completion)
576 (setq pattern completion))
576 (message "Making completion list...") 577 (message "Making completion list...")
577 (let ((list (all-completions pattern obarray predicate))) 578 (let ((list (all-completions pattern obarray predicate)))
578 (setq list (sort list 'string<)) 579 (setq list (sort list 'string<))
@@ -585,8 +586,10 @@ considered."
585 new)) 586 new))
586 (setq list (cdr list))) 587 (setq list (cdr list)))
587 (setq list (nreverse new)))) 588 (setq list (nreverse new))))
588 (with-output-to-temp-buffer "*Completions*" 589 (if (> (length list) 1)
589 (display-completion-list list pattern))) 590 (with-output-to-temp-buffer "*Completions*"
591 (display-completion-list list pattern))
592 (delete-windows-on "*Completions*")))
590 (message "Making completion list...%s" "done"))))))) 593 (message "Making completion list...%s" "done")))))))
591 594
592;;; arch-tag: aa7fa8a4-2e6f-4e9b-9cd9-fef06340e67e 595;;; arch-tag: aa7fa8a4-2e6f-4e9b-9cd9-fef06340e67e
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index bcfdeef4501..26d94e99e88 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -329,15 +329,6 @@ interpreted as a register number."
329 :type 'boolean 329 :type 'boolean
330 :group 'cua) 330 :group 'cua)
331 331
332(defcustom cua-use-hyper-key nil
333 "*If non-nil, bind rectangle commands to H-... instead of M-....
334If set to `also', toggle region command is also on C-return.
335Must be set prior to enabling CUA."
336 :type '(choice (const :tag "Meta key and C-return" nil)
337 (const :tag "Hyper key only" only)
338 (const :tag "Hyper key and C-return" also))
339 :group 'cua)
340
341(defcustom cua-enable-region-auto-help nil 332(defcustom cua-enable-region-auto-help nil
342 "*If non-nil, automatically show help for active region." 333 "*If non-nil, automatically show help for active region."
343 :type 'boolean 334 :type 'boolean
@@ -379,6 +370,15 @@ and after the region marked by the rectangle to search."
379 (other :tag "Enabled" t)) 370 (other :tag "Enabled" t))
380 :group 'cua) 371 :group 'cua)
381 372
373(defcustom cua-rectangle-modifier-key 'meta
374 "*Modifier key used for rectangle commands bindings.
375On non-window systems, always use the meta modifier.
376Must be set prior to enabling CUA."
377 :type '(choice (const :tag "Meta key" meta)
378 (const :tag "Hyper key" hyper )
379 (const :tag "Super key" super))
380 :group 'cua)
381
382(defcustom cua-enable-rectangle-auto-help t 382(defcustom cua-enable-rectangle-auto-help t
383 "*If non-nil, automatically show help for region, rectangle and global mark." 383 "*If non-nil, automatically show help for region, rectangle and global mark."
384 :type 'boolean 384 :type 'boolean
@@ -1180,11 +1180,13 @@ If ARG is the atom `-', scroll upward by nearly full screen."
1180 1180
1181;;; Keymaps 1181;;; Keymaps
1182 1182
1183;; Cached value of actual cua-rectangle-modifier-key
1184(defvar cua--rectangle-modifier-key 'meta)
1185
1183(defun cua--M/H-key (map key fct) 1186(defun cua--M/H-key (map key fct)
1184 ;; bind H-KEY or M-KEY to FCT in MAP 1187 ;; bind H-KEY or M-KEY to FCT in MAP
1185 (if (eq key 'space) (setq key ?\s))
1186 (unless (listp key) (setq key (list key))) 1188 (unless (listp key) (setq key (list key)))
1187 (define-key map (vector (cons (if cua-use-hyper-key 'hyper 'meta) key)) fct)) 1189 (define-key map (vector (cons cua--rectangle-modifier-key key)) fct))
1188 1190
1189(defun cua--self-insert-char-p (def) 1191(defun cua--self-insert-char-p (def)
1190 ;; Return DEF if current key sequence is self-inserting in 1192 ;; Return DEF if current key sequence is self-inserting in
@@ -1232,7 +1234,8 @@ If ARG is the atom `-', scroll upward by nearly full screen."
1232 (not cua--prefix-override-timer))) 1234 (not cua--prefix-override-timer)))
1233 (setq cua--ena-prefix-repeat-keymap 1235 (setq cua--ena-prefix-repeat-keymap
1234 (and cua--ena-region-keymap 1236 (and cua--ena-region-keymap
1235 (timerp cua--prefix-override-timer))) 1237 (or (timerp cua--prefix-override-timer)
1238 (eq cua--prefix-override-timer 'shift))))
1236 (setq cua--ena-cua-keys-keymap 1239 (setq cua--ena-cua-keys-keymap
1237 (and cua-enable-cua-keys 1240 (and cua-enable-cua-keys
1238 (not cua-inhibit-cua-keys) 1241 (not cua-inhibit-cua-keys)
@@ -1244,12 +1247,39 @@ If ARG is the atom `-', scroll upward by nearly full screen."
1244 1247
1245(defvar cua--keymaps-initalized nil) 1248(defvar cua--keymaps-initalized nil)
1246 1249
1250(defun cua--shift-control-prefix (prefix arg)
1251 ;; handle S-C-x and S-C-c by emulating the fast double prefix function.
1252 ;; Don't record this command
1253 (setq this-command last-command)
1254 ;; Restore the prefix arg
1255 (setq prefix-arg arg)
1256 (reset-this-command-lengths)
1257 ;; Activate the cua--prefix-repeat-keymap
1258 (setq cua--prefix-override-timer 'shift)
1259 ;; Push duplicate keys back on the event queue
1260 (setq unread-command-events (cons prefix (cons prefix unread-command-events))))
1261
1262(defun cua--shift-control-c-prefix (arg)
1263 (interactive "P")
1264 (cua--shift-control-prefix ?\C-c arg))
1265
1266(defun cua--shift-control-x-prefix (arg)
1267 (interactive "P")
1268 (cua--shift-control-prefix ?\C-x arg))
1269
1247(defun cua--init-keymaps () 1270(defun cua--init-keymaps ()
1248 (unless (eq cua-use-hyper-key 'only) 1271 ;; Cache actual rectangle modifier key.
1249 (define-key cua-global-keymap [(control return)] 'cua-set-rectangle-mark)) 1272 (setq cua--rectangle-modifier-key
1250 (when cua-use-hyper-key 1273 (if (and cua-rectangle-modifier-key
1251 (cua--M/H-key cua-global-keymap 'space 'cua-set-rectangle-mark) 1274 (memq window-system '(x)))
1252 (define-key cua-global-keymap [(hyper mouse-1)] 'cua-mouse-set-rectangle-mark)) 1275 cua-rectangle-modifier-key
1276 'meta))
1277 ;; C-return always toggles rectangle mark
1278 (define-key cua-global-keymap [(control return)] 'cua-set-rectangle-mark)
1279 (unless (eq cua--rectangle-modifier-key 'meta)
1280 (cua--M/H-key cua-global-keymap ?\s 'cua-set-rectangle-mark)
1281 (define-key cua-global-keymap
1282 (vector (list cua--rectangle-modifier-key 'mouse-1)) 'cua-mouse-set-rectangle-mark))
1253 1283
1254 (define-key cua-global-keymap [(shift control ?\s)] 'cua-toggle-global-mark) 1284 (define-key cua-global-keymap [(shift control ?\s)] 'cua-toggle-global-mark)
1255 1285
@@ -1287,8 +1317,9 @@ If ARG is the atom `-', scroll upward by nearly full screen."
1287 (define-key cua--prefix-repeat-keymap [(control c) right] 'cua--prefix-copy-handler) 1317 (define-key cua--prefix-repeat-keymap [(control c) right] 'cua--prefix-copy-handler)
1288 1318
1289 ;; Enable shifted fallbacks for C-x and C-c when region is active 1319 ;; Enable shifted fallbacks for C-x and C-c when region is active
1290 (define-key cua--region-keymap [(shift control x)] 'Control-X-prefix) 1320 (define-key cua--region-keymap [(shift control x)] 'cua--shift-control-x-prefix)
1291 (define-key cua--region-keymap [(shift control c)] 'mode-specific-command-prefix) 1321 (define-key cua--region-keymap [(shift control c)] 'cua--shift-control-c-prefix)
1322
1292 ;; replace current region 1323 ;; replace current region
1293 (define-key cua--region-keymap [remap self-insert-command] 'cua-replace-region) 1324 (define-key cua--region-keymap [remap self-insert-command] 'cua-replace-region)
1294 (define-key cua--region-keymap [remap self-insert-iso] 'cua-replace-region) 1325 (define-key cua--region-keymap [remap self-insert-iso] 'cua-replace-region)
@@ -1365,7 +1396,7 @@ CUA bindings, or `cua-prefix-override-inhibit-delay' to change
1365the prefix fallback behavior." 1396the prefix fallback behavior."
1366 :global t 1397 :global t
1367 :group 'cua 1398 :group 'cua
1368 :set-after '(cua-enable-modeline-indications cua-use-hyper-key) 1399 :set-after '(cua-enable-modeline-indications cua-rectangle-modifier-key)
1369 :require 'cua-base 1400 :require 'cua-base
1370 :link '(emacs-commentary-link "cua-base.el") 1401 :link '(emacs-commentary-link "cua-base.el")
1371 (setq mark-even-if-inactive t) 1402 (setq mark-even-if-inactive t)
diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el
index 0590af50249..aa82e148aff 100644
--- a/lisp/emulation/cua-rect.el
+++ b/lisp/emulation/cua-rect.el
@@ -1242,6 +1242,7 @@ The numbers are formatted according to the FORMAT string."
1242 (setq z (cdr z))) 1242 (setq z (cdr z)))
1243 (if cua--debug 1243 (if cua--debug
1244 (print (list (current-column) cc) auxbuf)) 1244 (print (list (current-column) cc) auxbuf))
1245 (just-one-space 0)
1245 (indent-to cc)))) 1246 (indent-to cc))))
1246 (if (> tr 0) 1247 (if (> tr 0)
1247 (message "Warning: Truncated %d row%s" tr (if (> tr 1) "s" ""))) 1248 (message "Warning: Truncated %d row%s" tr (if (> tr 1) "s" "")))
@@ -1358,7 +1359,9 @@ With prefix arg, indent to that column."
1358 1359
1359(defun cua-help-for-rectangle (&optional help) 1360(defun cua-help-for-rectangle (&optional help)
1360 (interactive) 1361 (interactive)
1361 (let ((M (if cua-use-hyper-key " H-" " M-"))) 1362 (let ((M (cond ((eq cua--rectangle-modifier-key 'hyper) " H-")
1363 ((eq cua--rectangle-modifier-key 'super) " s-")
1364 (t " M-"))))
1362 (message 1365 (message
1363 (concat (if help "C-?:help" "") 1366 (concat (if help "C-?:help" "")
1364 M "p:pad" M "o:open" M "c:close" M "b:blank" 1367 M "p:pad" M "o:open" M "c:close" M "b:blank"
@@ -1410,12 +1413,11 @@ With prefix arg, indent to that column."
1410 (cua--M/H-key cua--rectangle-keymap key cmd)) 1413 (cua--M/H-key cua--rectangle-keymap key cmd))
1411 1414
1412(defun cua--init-rectangles () 1415(defun cua--init-rectangles ()
1413 (unless (eq cua-use-hyper-key 'only) 1416 (define-key cua--rectangle-keymap [(control return)] 'cua-clear-rectangle-mark)
1414 (define-key cua--rectangle-keymap [(control return)] 'cua-clear-rectangle-mark) 1417 (define-key cua--region-keymap [(control return)] 'cua-toggle-rectangle-mark)
1415 (define-key cua--region-keymap [(control return)] 'cua-toggle-rectangle-mark)) 1418 (unless (eq cua--rectangle-modifier-key 'meta)
1416 (when cua-use-hyper-key 1419 (cua--rect-M/H-key ?\s 'cua-clear-rectangle-mark)
1417 (cua--rect-M/H-key 'space 'cua-clear-rectangle-mark) 1420 (cua--M/H-key cua--region-keymap ?\s 'cua-toggle-rectangle-mark))
1418 (cua--M/H-key cua--region-keymap 'space 'cua-toggle-rectangle-mark))
1419 1421
1420 (define-key cua--rectangle-keymap [remap copy-region-as-kill] 'cua-copy-rectangle) 1422 (define-key cua--rectangle-keymap [remap copy-region-as-kill] 'cua-copy-rectangle)
1421 (define-key cua--rectangle-keymap [remap kill-ring-save] 'cua-copy-rectangle) 1423 (define-key cua--rectangle-keymap [remap kill-ring-save] 'cua-copy-rectangle)
diff --git a/lisp/files.el b/lisp/files.el
index a67a6c7de3b..e3760f53fad 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3197,7 +3197,9 @@ on a DOS/Windows machine, it returns FILENAME in expanded form."
3197 ancestor)))))) 3197 ancestor))))))
3198 3198
3199(defun save-buffer (&optional args) 3199(defun save-buffer (&optional args)
3200 "Save current buffer in visited file if modified. Variations are described below. 3200 "Save current buffer in visited file if modified.
3201Variations are described below.
3202
3201By default, makes the previous version into a backup file 3203By default, makes the previous version into a backup file
3202 if previously requested or if this is the first save. 3204 if previously requested or if this is the first save.
3203Prefixed with one \\[universal-argument], marks this version 3205Prefixed with one \\[universal-argument], marks this version
diff --git a/lisp/foldout.el b/lisp/foldout.el
index 54fca4eb6f0..632a09bb05f 100644
--- a/lisp/foldout.el
+++ b/lisp/foldout.el
@@ -308,7 +308,8 @@ optional arg EXPOSURE \(interactively with prefix arg\) changes this:-
308Normally causes exited folds to be hidden, but with ARG < 0, -ARG folds are 308Normally causes exited folds to be hidden, but with ARG < 0, -ARG folds are
309exited and text is left visible." 309exited and text is left visible."
310 (interactive "p") 310 (interactive "p")
311 (let (start-marker end-marker (hide-fold t)) 311 (let ((hide-fold t) start-marker end-marker
312 beginning-of-heading end-of-subtree)
312 313
313 ;; check there are some folds to leave 314 ;; check there are some folds to leave
314 (if (null foldout-fold-list) 315 (if (null foldout-fold-list)
@@ -355,26 +356,23 @@ exited and text is left visible."
355 ;; is \n otherwise it will be hidden. If there is a newline 356 ;; is \n otherwise it will be hidden. If there is a newline
356 ;; before this one, make it visible too so we do the same as 357 ;; before this one, make it visible too so we do the same as
357 ;; outline.el and leave a blank line before the heading. 358 ;; outline.el and leave a blank line before the heading.
358 (if (zerop num-folds) 359 (when (zerop num-folds)
359 (let ((beginning-of-heading (point)) 360 (if end-marker
360 (end-of-subtree (if end-marker 361 (setq beginning-of-heading (point)
361 (progn 362 end-of-subtree (progn (forward-char -1)
362 (forward-char -1) 363 (if (memq (preceding-char)
363 (if (memq (preceding-char) 364 '(?\n ?\^M))
364 '(?\n ?\^M)) 365 (forward-char -1))
365 (forward-char -1)) 366 (point))))
366 (point)) 367 ;; hide the subtree
367 (point-max)))) 368 (when hide-fold
368 ;; hide the subtree 369 (goto-char start-marker)
369 (if hide-fold 370 (hide-subtree))
370 (outline-flag-region start-marker end-of-subtree 371
371 foldout-hide-flag)) 372 ;; make sure the next heading is exposed
372 373 (if end-marker
373 ;; make sure the next heading is exposed 374 (outline-flag-region end-of-subtree beginning-of-heading
374 (if end-marker 375 foldout-show-flag)))
375 (outline-flag-region end-of-subtree beginning-of-heading
376 foldout-show-flag))
377 ))
378 376
379 ;; zap the markers so they don't slow down editing 377 ;; zap the markers so they don't slow down editing
380 (set-marker start-marker nil) 378 (set-marker start-marker nil)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 01babcddc86..708d232e994 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,204 @@
12005-12-08 Reiner Steib <Reiner.Steib@gmx.de>
2
3 * mm-decode.el (mm-discouraged-alternatives): Fix custom type.
4 Suggest image/.* in the doc string.
5
62005-12-07 Katsumi Yamaoka <yamaoka@jpl.org>
7
8 * mm-decode.el (mm-display-external): Use nametemplate (defined in
9 RFC1524) if it is in mailcap or add a suffix according to
10 mailcap-mime-extensions when generating a temp filename; postpone
11 deleting a temp file for 2 seconds for some wrappers, shell
12 scripts, and so on, which might exit right after having started a
13 viewer command as a background job.
14
152005-12-06 Reiner Steib <Reiner.Steib@gmx.de>
16
17 * gnus-art.el (gnus-default-article-saver): Add user-defined
18 `function' to custom type.
19
202005-12-02 ARISAWA Akihiro <ari@mbf.ocn.ne.jp> (tiny change)
21
22 * mm-view.el (mm-inline-text-html-render-with-w3m): Fix misplaced
23 parens.
24
252005-11-29 Reiner Steib <Reiner.Steib@gmx.de>
26
27 * gnus-cache.el (gnus-cache-rename-group): Wrap doc strings and
28 long lines.
29 (gnus-cache-delete-group): Wrap doc strings.
30
31 * gnus-agent.el (gnus-agent-rename-group)
32 (gnus-agent-delete-group): Wrap doc strings.
33
342005-11-24 Pascal Rigaux <pixel@mandriva.com> (tiny change)
35
36 * rfc2231.el (rfc2231-parse-string): Support non-ascii chars.
37
382005-11-22 Katsumi Yamaoka <yamaoka@jpl.org>
39
40 * nnmail.el (nnmail-fancy-expiry-target): Use current-time instead
41 of current-time-string.
42
432005-11-20 Stefan Schimanski <schimmi@debian.org> (tiny change)
44
45 * nnmail.el (nnmail-fancy-expiry-target): Protect against invalid
46 date header.
47
482005-11-16 Boris Samorodov <bsam@ipt.ru> (tiny patch)
49
50 * imap.el (imap-kerberos4-open): Ignore SSL stuff.
51
522005-11-14 Kevin Greiner <kevin.greiner@compsol.cc>
53
54 * gnus-agent.el (gnus-agent-article-alist-save-format): Changed
55 internal variable to a custom variable. Changed default value
56 from compressed(2) to uncompressed(1).
57 (gnus-agent-read-agentview): Reversed revision 7.8 to restore
58 support for uncompressed agentview files. Taken together, reading
59 the agentview file should now be 6-7 times faster.
60 (gnus-agent-long-article,
61 gnus-agent-short-article, gnus-agent-score): Renamed category
62 keywords to match gnus-cus.
63 (gnus-agent-summary-fetch-series): Modified to protect against
64 gnus-agent-summary-fetch-group clearing processable flags.
65 (gnus-agent-synchronize-group-flags): Update live group buffer as
66 synchronization may occur due to the user toggling the plugged
67 status.
68 (gnus-agent-braid-nov): Now tests new nov entries
69 for duplicates which are removed. The invalid sort check then
70 triggers a rescan after the sort as sorting may have moved
71 duplicate entries such that they can be cheaply detected.
72 (gnus-agent-read-local): Trivial fix to format of
73 error message to display actual error condition.
74 (gnus-agent-save-local): Avoid saving symbols that are bound to
75 nil as they simply result in a warning message in
76 gnus-agent-read-local.
77 (gnus-agent-fetch-group-1): Clear downloadable flag when article
78 successfully downloaded.
79 (gnus-agent-regenerate-group): Use
80 gnus-agent-synchronize-group-flags to reset read status in both
81 gnus and server.
82
83 * nntp.el (nntp-end-of-line): Doc fix.
84 (nntp-authinfo-rejected): New error condition.
85 (nntp-wait-for): Use new error condition to signal authentication
86 error.
87 (nntp-retrieve-data): Rethrow new error condition to break out of
88 recursive call to nntp-send-authinfo.
89
902005-11-13 Katsumi Yamaoka <yamaoka@jpl.org>
91
92 * gnus-start.el (gnus-dribble-read-file): Use make-local-variable
93 rather than make-variable-buffer-local for file-precious-flag.
94
952005-11-13 Katsumi Yamaoka <yamaoka@jpl.org>
96
97 * gnus-start.el (gnus-dribble-read-file): Quote file-precious-flag.
98
992005-11-11 Jan Nieuwenhuizen <janneke@gnu.org>
100
101 * gnus-start.el (gnus-dribble-read-file): Set file-precious-flag,
102 as a buffer-local variable. This avoids creating truncated
103 dribble files as a result of a hang up, eg.
104
1052005-11-04 Ken Manheimer <ken.manheimer@gmail.com>
106
107 * pgg-pgp.el (pgg-pgp-encrypt-region, pgg-pgp-decrypt-region)
108 (pgg-pgp-encrypt-symmetric-region, pgg-pgp-encrypt-symmetric)
109 (pgg-pgp-encrypt, pgg-pgp-decrypt-region, pgg-pgp-decrypt)
110 (pgg-pgp-sign-region, pgg-pgp-sign): Add optional 'passphrase'
111 argument to all these routines, so the passphrase can be managed
112 externally and passed in to the system.
113 (pgg-pgp-decrypt-region, pgg-pgp-sign-region): Use new name for
114 pgg-add-passphrase-to-cache function.
115
116 * pgg-pgp5.el (pgg-pgp5-encrypt-region, pgg-pgp5-decrypt-region)
117 (pgg-pgp5-encrypt-symmetric-region, pgg-pgp5-encrypt-symmetric)
118 (pgg-pgp5-encrypt, pgg-pgp5-decrypt-region, pgg-pgp5-decrypt)
119 (pgg-pgp5-sign-region, pgg-pgp5-sign): Add optional 'passphrase'
120 argument to all these routines, so the passphrase can be managed
121 externally and passed in to the system.
122 (pgg-pgp5-sign-region): Use new name of pgg-add-passphrase-to-cache
123 function.
124
1252005-10-30 Chong Yidong <cyd@stupidchicken.com>
126
127 * imap.el (imap-open): Handle case where buffer is a buffer
128 object.
129
1302005-10-29 Ken Manheimer <ken.manheimer@gmail.com>
131
132 * pgg-gpg.el (pgg-gpg-select-matching-key): Fix: look at the right
133 part of the decoded armor to find the key-identifier.
134 (pgg-gpg-lookup-key-owner): New function to return the
135 human-readable identifier of a key owner.
136 (pgg-gpg-lookup-id-from-key-owner): Make it easy to identify the
137 key itself.
138 (pgg-gpg-decrypt-region): Prompt with the key owner (rather than
139 the key value) if we have a key and can match it against a secret
140 key. Also, added a note pointing out fact that the prompt only
141 indicates the first matching key.
142
143 * pgg.el (pgg-decrypt): Passing along 'passphrase' in call to
144 pgg-decrypt-region.
145 (pgg-pending-timers): A new hash for tracking the passphrase cache
146 timers, so that new ones supercede old ones.
147 (pgg-add-passphrase-to-cache): Rename from
148 `pgg-add-passphrase-cache' to reduce confusion (all callers
149 changed). Modified to cancel old timers when new ones are added.
150 (pgg-remove-passphrase-from-cache): Rename from
151 `pgg-remove-passphrase-cache' to reduce confusion (all callers
152 changed). Modified to cancel old timers when their keys are
153 removed from the cache.
154 (pgg-cancel-timer): In Emacs, an alias for cancel-timer; in
155 XEmacs, an indirection to delete-itimer.
156 (pgg-read-passphrase-from-cache, pgg-read-passphrase):
157 Extract pgg-read-passphrase-from-cache from pgg-read-passphrase so
158 users can only check cache without risk of prompting. Correct bug in
159 notruncate behavior.
160 (pgg-read-passphrase-from-cache, pgg-read-passphrase)
161 (pgg-add-passphrase-cache, pgg-remove-passphrase-cache):
162 Add informative docstrings.
163 (pgg-decrypt): Convey provided passphrase in subordinate call to
164 pgg-decrypt-region.
165
1662005-10-20 Ken Manheimer <ken.manheimer+emacs@gmail.com>
167
168 * pgg.el (pgg-encrypt-region, pgg-encrypt-symmetric-region)
169 (pgg-encrypt-symmetric, pgg-encrypt, pgg-decrypt-region)
170 (pgg-decrypt, pgg-sign-region, pgg-sign): Add optional
171 'passphrase' argument, so the passphrase can be managed externally
172 and then passed in to the system.
173
174 * pgg.el (pgg-read-passphrase, pgg-add-passphrase-cache)
175 (pgg-remove-passphrase-cache): Add optional 'notruncate' argument,
176 so the passphrase cache can be used reliably with identifiers
177 besides a pgp packet's key id.
178
179 * pgg-gpg.el (pgg-pgp-encrypt-region)
180 (pgg-pgp-encrypt-symmetric-region, pgg-pgp-encrypt-symmetric)
181 (pgg-pgp-encrypt, pgg-pgp-decrypt-region, pgg-pgp-decrypt)
182 (pgg-pgp-sign-region, pgg-pgp-sign): Add optional 'passphrase'
183 argument to all these routines, so the passphrase can be managed
184 externally and passed in to the system.
185
186 * pgg-gpg.el (pgg-gpg-possibly-cache-passphrase): Add optional
187 'notruncate' argument, so the passphrase cache can be used
188 reliably with identifiers besides a pgp packet's key id.
189
1902005-10-29 Sascha Wilde <swilde@sha-bang.de>
191
192 * pgg-gpg.el (pgg-gpg-encrypt-symmetric-region): New function for
193 symmetric encryption.
194 (pgg-gpg-symmetric-key-p): New function to check for an symmetric
195 encrypted session key.
196 (pgg-gpg-decrypt-region): When decrypting a symmetric encrypted
197 message ask for the passphrase in a proper way.
198
199 * pgg.el (pgg-encrypt-symmetric, pgg-encrypt-symmetric-region):
200 New user commands for symmetric encryption.
201
12005-11-30 Stefan Monnier <monnier@iro.umontreal.ca> 2022005-11-30 Stefan Monnier <monnier@iro.umontreal.ca>
2 203
3 * gnus-delay.el (gnus-delay-group): Don't autoload. 204 * gnus-delay.el (gnus-delay-group): Don't autoload.
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index 0357ddd18cb..2139c485720 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -213,6 +213,17 @@ unplugged."
213 :group 'gnus-agent 213 :group 'gnus-agent
214 :type 'boolean) 214 :type 'boolean)
215 215
216(defcustom gnus-agent-article-alist-save-format 1
217 "Indicates whether to use compression(2), verses no
218 compression(1), when writing agentview files. The compressed
219 files do save space but load times are 6-7 times higher. A
220 group must be opened then closed for the agentview to be
221 updated using the new format."
222 :version "22.1"
223 :group 'gnus-agent
224 :type '(radio (const :format "Compressed" 2)
225 (const :format "Uncompressed" 1)))
226
216;;; Internal variables 227;;; Internal variables
217 228
218(defvar gnus-agent-history-buffers nil) 229(defvar gnus-agent-history-buffers nil)
@@ -357,17 +368,17 @@ manipulated as follows:
357(gnus-agent-cat-defaccessor 368(gnus-agent-cat-defaccessor
358 gnus-agent-cat-high-score agent-high-score) 369 gnus-agent-cat-high-score agent-high-score)
359(gnus-agent-cat-defaccessor 370(gnus-agent-cat-defaccessor
360 gnus-agent-cat-length-when-long agent-length-when-long) 371 gnus-agent-cat-length-when-long agent-long-article)
361(gnus-agent-cat-defaccessor 372(gnus-agent-cat-defaccessor
362 gnus-agent-cat-length-when-short agent-length-when-short) 373 gnus-agent-cat-length-when-short agent-short-article)
363(gnus-agent-cat-defaccessor 374(gnus-agent-cat-defaccessor
364 gnus-agent-cat-low-score agent-low-score) 375 gnus-agent-cat-low-score agent-low-score)
365(gnus-agent-cat-defaccessor 376(gnus-agent-cat-defaccessor
366 gnus-agent-cat-predicate agent-predicate) 377 gnus-agent-cat-predicate agent-predicate)
367(gnus-agent-cat-defaccessor 378(gnus-agent-cat-defaccessor
368 gnus-agent-cat-score-file agent-score-file) 379 gnus-agent-cat-score-file agent-score)
369(gnus-agent-cat-defaccessor 380(gnus-agent-cat-defaccessor
370 gnus-agent-cat-enable-undownloaded-faces agent-enable-undownloaded-faces) 381 gnus-agent-cat-enable-undownloaded-faces agent-enable-undownloaded-faces)
371 382
372 383
373;; This form is equivalent to defsetf except that it calls make-symbol 384;; This form is equivalent to defsetf except that it calls make-symbol
@@ -858,9 +869,11 @@ be a select method."
858 869
859;;;###autoload 870;;;###autoload
860(defun gnus-agent-rename-group (old-group new-group) 871(defun gnus-agent-rename-group (old-group new-group)
861 "Rename fully-qualified OLD-GROUP as NEW-GROUP. Always updates the agent, even when 872 "Rename fully-qualified OLD-GROUP as NEW-GROUP.
862disabled, as the old agent files would corrupt gnus when the agent was 873Always updates the agent, even when disabled, as the old agent
863next enabled. Depends upon the caller to determine whether group renaming is supported." 874files would corrupt gnus when the agent was next enabled.
875Depends upon the caller to determine whether group renaming is
876supported."
864 (let* ((old-command-method (gnus-find-method-for-group old-group)) 877 (let* ((old-command-method (gnus-find-method-for-group old-group))
865 (old-path (directory-file-name 878 (old-path (directory-file-name
866 (let (gnus-command-method old-command-method) 879 (let (gnus-command-method old-command-method)
@@ -888,9 +901,11 @@ next enabled. Depends upon the caller to determine whether group renaming is sup
888 901
889;;;###autoload 902;;;###autoload
890(defun gnus-agent-delete-group (group) 903(defun gnus-agent-delete-group (group)
891 "Delete fully-qualified GROUP. Always updates the agent, even when 904 "Delete fully-qualified GROUP.
892disabled, as the old agent files would corrupt gnus when the agent was 905Always updates the agent, even when disabled, as the old agent
893next enabled. Depends upon the caller to determine whether group deletion is supported." 906files would corrupt gnus when the agent was next enabled.
907Depends upon the caller to determine whether group deletion is
908supported."
894 (let* ((command-method (gnus-find-method-for-group group)) 909 (let* ((command-method (gnus-find-method-for-group group))
895 (path (directory-file-name 910 (path (directory-file-name
896 (let (gnus-command-method command-method) 911 (let (gnus-command-method command-method)
@@ -1134,20 +1149,22 @@ downloadable."
1134 (when gnus-newsgroup-processable 1149 (when gnus-newsgroup-processable
1135 (setq gnus-newsgroup-downloadable 1150 (setq gnus-newsgroup-downloadable
1136 (let* ((dl gnus-newsgroup-downloadable) 1151 (let* ((dl gnus-newsgroup-downloadable)
1137 (gnus-newsgroup-downloadable 1152 (processable (sort (gnus-copy-sequence gnus-newsgroup-processable) '<))
1138 (sort (gnus-copy-sequence gnus-newsgroup-processable) '<)) 1153 (gnus-newsgroup-downloadable processable))
1139 (fetched-articles (gnus-agent-summary-fetch-group))) 1154 (gnus-agent-summary-fetch-group)
1140 ;; The preceeding call to (gnus-agent-summary-fetch-group)
1141 ;; updated gnus-newsgroup-downloadable to remove each
1142 ;; article successfully fetched.
1143 1155
1144 ;; For each article that I processed, remove its 1156 ;; For each article that I processed that is no longer
1145 ;; processable mark IF the article is no longer 1157 ;; undownloaded, remove its processable mark.
1146 ;; downloadable (i.e. it's already downloaded) 1158
1147 (dolist (article gnus-newsgroup-processable) 1159 (mapc #'gnus-summary-remove-process-mark
1148 (unless (memq article gnus-newsgroup-downloadable) 1160 (gnus-sorted-ndifference gnus-newsgroup-processable gnus-newsgroup-undownloaded))
1149 (gnus-summary-remove-process-mark article))) 1161
1150 (gnus-sorted-ndifference dl fetched-articles))))) 1162 ;; The preceeding call to (gnus-agent-summary-fetch-group)
1163 ;; updated the temporary gnus-newsgroup-downloadable to
1164 ;; remove each article successfully fetched. Now, I
1165 ;; update the real gnus-newsgroup-downloadable to only
1166 ;; include undownloaded articles.
1167 (gnus-sorted-ndifference dl (gnus-sorted-ndifference processable gnus-newsgroup-undownloaded))))))
1151 1168
1152(defun gnus-agent-summary-fetch-group (&optional all) 1169(defun gnus-agent-summary-fetch-group (&optional all)
1153 "Fetch the downloadable articles in the group. 1170 "Fetch the downloadable articles in the group.
@@ -1240,7 +1257,13 @@ This can be added to `gnus-select-article-hook' or
1240 'gnus-range-add 1257 'gnus-range-add
1241 'gnus-remove-from-range) 1258 'gnus-remove-from-range)
1242 (cdr info-marks) 1259 (cdr info-marks)
1243 range))))))))) 1260 range))))))))
1261
1262 ;;Marks can be synchronized at any time by simply toggling from
1263 ;;unplugged to plugged. If that is what is happening right now, make
1264 ;;sure that the group buffer is up to date.
1265 (when (gnus-buffer-live-p gnus-group-buffer)
1266 (gnus-group-update-group group t)))
1244 nil)) 1267 nil))
1245 1268
1246(defun gnus-agent-save-active (method) 1269(defun gnus-agent-save-active (method)
@@ -1330,7 +1353,7 @@ downloaded into the agent."
1330 (when (re-search-forward 1353 (when (re-search-forward
1331 (concat "^" (regexp-quote group) " ") nil t) 1354 (concat "^" (regexp-quote group) " ") nil t)
1332 (save-excursion 1355 (save-excursion
1333 (setq oactive-max (read (current-buffer)) ;; max 1356 (setq oactive-max (read (current-buffer)) ;; max
1334 oactive-min (read (current-buffer)))) ;; min 1357 oactive-min (read (current-buffer)))) ;; min
1335 (gnus-delete-line))) 1358 (gnus-delete-line)))
1336 (when active 1359 (when active
@@ -1824,7 +1847,7 @@ article numbers will be returned."
1824(defsubst gnus-agent-read-article-number () 1847(defsubst gnus-agent-read-article-number ()
1825 "Reads the article number at point. Returns nil when a valid article number can not be read." 1848 "Reads the article number at point. Returns nil when a valid article number can not be read."
1826 1849
1827 ;; It is unfortunite but the read function quietly overflows 1850 ;; It is unfortunate but the read function quietly overflows
1828 ;; integer. As a result, I have to use string operations to test 1851 ;; integer. As a result, I have to use string operations to test
1829 ;; for overflow BEFORE calling read. 1852 ;; for overflow BEFORE calling read.
1830 (when (looking-at "[0-9]+\t") 1853 (when (looking-at "[0-9]+\t")
@@ -1913,6 +1936,7 @@ doesn't exist, to valid the overview buffer."
1913 (goto-char p)) 1936 (goto-char p))
1914 1937
1915 (setq last (or last -134217728)) 1938 (setq last (or last -134217728))
1939 (while (catch 'problems
1916 (let (sort art) 1940 (let (sort art)
1917 (while (not (eobp)) 1941 (while (not (eobp))
1918 (setq art (gnus-agent-read-article-number)) 1942 (setq art (gnus-agent-read-article-number))
@@ -1924,12 +1948,27 @@ doesn't exist, to valid the overview buffer."
1924 ;; Art num out of order - enable sort 1948 ;; Art num out of order - enable sort
1925 (setq sort t) 1949 (setq sort t)
1926 (forward-line 1)) 1950 (forward-line 1))
1951 ((= art last)
1952 ;; Bad repeat of art number - delete this line
1953 (beginning-of-line)
1954 (delete-region (point) (progn (forward-line 1) (point))))
1927 (t 1955 (t
1928 ;; Good art num 1956 ;; Good art num
1929 (setq last art) 1957 (setq last art)
1930 (forward-line 1)))) 1958 (forward-line 1))))
1931 (when sort 1959 (when sort
1932 (sort-numeric-fields 1 (point-min) (point-max))))))) 1960 ;; something is seriously wrong as we simply shouldn't see out-of-order data.
1961 ;; First, we'll fix the sort.
1962 (sort-numeric-fields 1 (point-min) (point-max))
1963
1964 ;; but now we have to consider that we may have duplicate rows...
1965 ;; so reset to beginning of file
1966 (goto-char (point-min))
1967 (setq last -134217728)
1968
1969 ;; and throw a code that restarts this scan
1970 (throw 'problems t))
1971 nil))))))
1933 1972
1934;; Keeps the compiler from warning about the free variable in 1973;; Keeps the compiler from warning about the free variable in
1935;; gnus-agent-read-agentview. 1974;; gnus-agent-read-agentview.
@@ -1946,11 +1985,6 @@ doesn't exist, to valid the overview buffer."
1946 'gnus-agent-file-loading-cache 1985 'gnus-agent-file-loading-cache
1947 'gnus-agent-read-agentview)))) 1986 'gnus-agent-read-agentview))))
1948 1987
1949;; Save format may be either 1 or 2. Two is the new, compressed
1950;; format that is still being tested. Format 1 is uncompressed but
1951;; known to be reliable.
1952(defconst gnus-agent-article-alist-save-format 2)
1953
1954(defun gnus-agent-read-agentview (file) 1988(defun gnus-agent-read-agentview (file)
1955 "Load FILE and do a `read' there." 1989 "Load FILE and do a `read' there."
1956 (with-temp-buffer 1990 (with-temp-buffer
@@ -1964,8 +1998,6 @@ doesn't exist, to valid the overview buffer."
1964 changed-version) 1998 changed-version)
1965 1999
1966 (cond 2000 (cond
1967 ((< version 2)
1968 (error "gnus-agent-read-agentview no longer supports version %d. Stop gnus, manually evaluate gnus-agent-convert-to-compressed-agentview, then restart gnus." version))
1969 ((= version 0) 2001 ((= version 0)
1970 (let ((inhibit-quit t) 2002 (let ((inhibit-quit t)
1971 entry) 2003 entry)
@@ -1996,7 +2028,8 @@ doesn't exist, to valid the overview buffer."
1996 (setq uncomp (cons (cons article-id state) uncomp))) 2028 (setq uncomp (cons (cons article-id state) uncomp)))
1997 sequence))) 2029 sequence)))
1998 alist) 2030 alist)
1999 (setq alist (sort uncomp 'car-less-than-car))))) 2031 (setq alist (sort uncomp 'car-less-than-car)))
2032 (setq changed-version (not (= 2 gnus-agent-article-alist-save-format)))))
2000 (when changed-version 2033 (when changed-version
2001 (let ((gnus-agent-article-alist alist)) 2034 (let ((gnus-agent-article-alist alist))
2002 (gnus-agent-save-alist gnus-agent-read-agentview))) 2035 (gnus-agent-save-alist gnus-agent-read-agentview)))
@@ -2110,7 +2143,7 @@ modified) original contents, they are first saved to their own file."
2110 ;; NOTE: The '+ 0' ensure that min and max are both numerics. 2143 ;; NOTE: The '+ 0' ensure that min and max are both numerics.
2111 (set group (cons (+ 0 min) (+ 0 max)))) 2144 (set group (cons (+ 0 min) (+ 0 max))))
2112 (error 2145 (error
2113 (gnus-message 3 "Warning - invalid agent local: %s on line %d: " 2146 (gnus-message 3 "Warning - invalid agent local: %s on line %d: %s"
2114 file line (error-message-string err)))) 2147 file line (error-message-string err))))
2115 (forward-line 1) 2148 (forward-line 1)
2116 (setq line (1+ line)))) 2149 (setq line (1+ line))))
@@ -2141,13 +2174,14 @@ modified) original contents, they are first saved to their own file."
2141 ((member (symbol-name symbol) '("+dirty" "+method")) 2174 ((member (symbol-name symbol) '("+dirty" "+method"))
2142 nil) 2175 nil)
2143 (t 2176 (t
2144 (prin1 symbol)
2145 (let ((range (symbol-value symbol))) 2177 (let ((range (symbol-value symbol)))
2178 (when range
2179 (prin1 symbol)
2146 (princ " ") 2180 (princ " ")
2147 (princ (car range)) 2181 (princ (car range))
2148 (princ " ") 2182 (princ " ")
2149 (princ (cdr range)) 2183 (princ (cdr range))
2150 (princ "\n"))))) 2184 (princ "\n"))))))
2151 my-obarray)))))))) 2185 my-obarray))))))))
2152 2186
2153(defun gnus-agent-get-local (group &optional gmane method) 2187(defun gnus-agent-get-local (group &optional gmane method)
@@ -2402,7 +2436,9 @@ modified) original contents, they are first saved to their own file."
2402 (dolist (article marked-articles) 2436 (dolist (article marked-articles)
2403 (gnus-summary-set-agent-mark article t)) 2437 (gnus-summary-set-agent-mark article t))
2404 (dolist (article fetched-articles) 2438 (dolist (article fetched-articles)
2405 (if gnus-agent-mark-unread-after-downloaded 2439 (when gnus-agent-mark-unread-after-downloaded
2440 (setq gnus-newsgroup-downloadable
2441 (delq article gnus-newsgroup-downloadable))
2406 (gnus-summary-mark-article 2442 (gnus-summary-mark-article
2407 article gnus-unread-mark)) 2443 article gnus-unread-mark))
2408 (when (gnus-summary-goto-subject article nil t) 2444 (when (gnus-summary-goto-subject article nil t)
@@ -3191,7 +3227,7 @@ missing NOV entry. Run gnus-agent-regenerate-group to restore it.")))
3191 ((setq type 3227 ((setq type
3192 (cond 3228 (cond
3193 ((not (integerp fetch-date)) 3229 ((not (integerp fetch-date))
3194 'read) ;; never fetched article (may expire 3230 'read) ;; never fetched article (may expire
3195 ;; right now) 3231 ;; right now)
3196 ((not (file-exists-p 3232 ((not (file-exists-p
3197 (concat dir (number-to-string 3233 (concat dir (number-to-string
@@ -3871,8 +3907,9 @@ If REREAD is not nil, downloaded articles are marked as unread."
3871 (gnus-agent-possibly-alter-active group group-active))))) 3907 (gnus-agent-possibly-alter-active group group-active)))))
3872 3908
3873 (when (and reread gnus-agent-article-alist) 3909 (when (and reread gnus-agent-article-alist)
3874 (gnus-make-ascending-articles-unread 3910 (gnus-agent-synchronize-group-flags
3875 group 3911 group
3912 (list (list
3876 (if (listp reread) 3913 (if (listp reread)
3877 reread 3914 reread
3878 (delq nil (mapcar (function (lambda (c) 3915 (delq nil (mapcar (function (lambda (c)
@@ -3880,7 +3917,9 @@ If REREAD is not nil, downloaded articles are marked as unread."
3880 (car c)) 3917 (car c))
3881 ((cdr c) 3918 ((cdr c)
3882 (car c))))) 3919 (car c)))))
3883 gnus-agent-article-alist)))) 3920 gnus-agent-article-alist)))
3921 'del '(read)))
3922 gnus-command-method)
3884 3923
3885 (when (gnus-buffer-live-p gnus-group-buffer) 3924 (when (gnus-buffer-live-p gnus-group-buffer)
3886 (gnus-group-update-group group t))) 3925 (gnus-group-update-group group t)))
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 98e699cd80c..ef5796a6083 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -535,7 +535,8 @@ Gnus provides the following functions:
535 (function-item gnus-summary-save-in-file) 535 (function-item gnus-summary-save-in-file)
536 (function-item gnus-summary-save-body-in-file) 536 (function-item gnus-summary-save-body-in-file)
537 (function-item gnus-summary-save-in-vm) 537 (function-item gnus-summary-save-in-vm)
538 (function-item gnus-summary-write-to-file))) 538 (function-item gnus-summary-write-to-file)
539 (function)))
539 540
540(defcustom gnus-rmail-save-name 'gnus-plain-save-name 541(defcustom gnus-rmail-save-name 'gnus-plain-save-name
541 "A function generating a file name to save articles in Rmail format. 542 "A function generating a file name to save articles in Rmail format.
diff --git a/lisp/gnus/gnus-cache.el b/lisp/gnus/gnus-cache.el
index 4477e8f579e..7785fd4c7de 100644
--- a/lisp/gnus/gnus-cache.el
+++ b/lisp/gnus/gnus-cache.el
@@ -730,9 +730,11 @@ If GROUP is non-nil, also cater to `gnus-cacheable-groups' and
730 730
731;;;###autoload 731;;;###autoload
732(defun gnus-cache-rename-group (old-group new-group) 732(defun gnus-cache-rename-group (old-group new-group)
733 "Rename OLD-GROUP as NEW-GROUP. Always updates the cache, even when 733 "Rename OLD-GROUP as NEW-GROUP.
734disabled, as the old cache files would corrupt gnus when the cache was 734Always updates the cache, even when disabled, as the old cache
735next enabled. Depends upon the caller to determine whether group renaming is supported." 735files would corrupt Gnus when the cache was next enabled. It
736depends on the caller to determine whether group renaming is
737supported."
736 (let ((old-dir (gnus-cache-file-name old-group "")) 738 (let ((old-dir (gnus-cache-file-name old-group ""))
737 (new-dir (gnus-cache-file-name new-group ""))) 739 (new-dir (gnus-cache-file-name new-group "")))
738 (gnus-rename-file old-dir new-dir t)) 740 (gnus-rename-file old-dir new-dir t))
@@ -740,9 +742,12 @@ next enabled. Depends upon the caller to determine whether group renaming is sup
740 (let ((no-save gnus-cache-active-hashtb)) 742 (let ((no-save gnus-cache-active-hashtb))
741 (unless gnus-cache-active-hashtb 743 (unless gnus-cache-active-hashtb
742 (gnus-cache-read-active)) 744 (gnus-cache-read-active))
743 (let* ((old-group-hash-value (gnus-gethash old-group gnus-cache-active-hashtb)) 745 (let* ((old-group-hash-value
744 (new-group-hash-value (gnus-gethash new-group gnus-cache-active-hashtb)) 746 (gnus-gethash old-group gnus-cache-active-hashtb))
745 (delta (or old-group-hash-value new-group-hash-value))) 747 (new-group-hash-value
748 (gnus-gethash new-group gnus-cache-active-hashtb))
749 (delta
750 (or old-group-hash-value new-group-hash-value)))
746 (gnus-sethash new-group old-group-hash-value gnus-cache-active-hashtb) 751 (gnus-sethash new-group old-group-hash-value gnus-cache-active-hashtb)
747 (gnus-sethash old-group nil gnus-cache-active-hashtb) 752 (gnus-sethash old-group nil gnus-cache-active-hashtb)
748 753
@@ -752,9 +757,11 @@ next enabled. Depends upon the caller to determine whether group renaming is sup
752 757
753;;;###autoload 758;;;###autoload
754(defun gnus-cache-delete-group (group) 759(defun gnus-cache-delete-group (group)
755 "Delete GROUP. Always updates the cache, even when 760 "Delete GROUP from the cache.
756disabled, as the old cache files would corrupt gnus when the cache was 761Always updates the cache, even when disabled, as the old cache
757next enabled. Depends upon the caller to determine whether group deletion is supported." 762files would corrupt gnus when the cache was next enabled.
763Depends upon the caller to determine whether group deletion is
764supported."
758 (let ((dir (gnus-cache-file-name group ""))) 765 (let ((dir (gnus-cache-file-name group "")))
759 (gnus-delete-directory dir)) 766 (gnus-delete-directory dir))
760 767
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index 113d80bd124..d3b313c621f 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -858,6 +858,7 @@ prompt the user for the name of an NNTP server to use."
858 (set-buffer (setq gnus-dribble-buffer 858 (set-buffer (setq gnus-dribble-buffer
859 (gnus-get-buffer-create 859 (gnus-get-buffer-create
860 (file-name-nondirectory dribble-file)))) 860 (file-name-nondirectory dribble-file))))
861 (set (make-local-variable 'file-precious-flag) t)
861 (erase-buffer) 862 (erase-buffer)
862 (setq buffer-file-name dribble-file) 863 (setq buffer-file-name dribble-file)
863 (auto-save-mode t) 864 (auto-save-mode t)
diff --git a/lisp/gnus/imap.el b/lisp/gnus/imap.el
index 2be30aa6e47..967d79463f2 100644
--- a/lisp/gnus/imap.el
+++ b/lisp/gnus/imap.el
@@ -591,6 +591,13 @@ sure of changing the value of `foo'."
591 (while (and (memq (process-status process) '(open run)) 591 (while (and (memq (process-status process) '(open run))
592 (set-buffer buffer) ;; XXX "blue moon" nntp.el bug 592 (set-buffer buffer) ;; XXX "blue moon" nntp.el bug
593 (goto-char (point-min)) 593 (goto-char (point-min))
594 ;; Athena IMTEST can output SSL verify errors
595 (or (while (looking-at "^verify error:num=")
596 (forward-line))
597 t)
598 (or (while (looking-at "^TLS connection established")
599 (forward-line))
600 t)
594 ;; cyrus 1.6.x (13? < x <= 22) queries capabilities 601 ;; cyrus 1.6.x (13? < x <= 22) queries capabilities
595 (or (while (looking-at "^C:") 602 (or (while (looking-at "^C:")
596 (forward-line)) 603 (forward-line))
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 9d0bbdfeb63..108c5056541 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -335,8 +335,11 @@ for instance, text/html parts are very unwanted, and text/richtext are
335somewhat unwanted, then the value of this variable should be set 335somewhat unwanted, then the value of this variable should be set
336to: 336to:
337 337
338 (\"text/html\" \"text/richtext\")" 338 (\"text/html\" \"text/richtext\")
339 :type '(repeat string) 339
340Adding \"image/.*\" might also be useful. Spammers use it as the
341prefered part of multipart/alternative messages."
342 :type '(repeat regexp) ;; See `mm-preferred-alternative-precedence'.
340 :group 'mime-display) 343 :group 'mime-display)
341 344
342(defcustom mm-tmp-directory 345(defcustom mm-tmp-directory
@@ -761,7 +764,19 @@ external if displayed external."
761 (gnus-map-function mm-file-name-rewrite-functions 764 (gnus-map-function mm-file-name-rewrite-functions
762 (file-name-nondirectory filename)) 765 (file-name-nondirectory filename))
763 dir)) 766 dir))
764 (setq file (mm-make-temp-file (expand-file-name "mm." dir)))) 767 (setq file (mm-make-temp-file (expand-file-name "mm." dir)))
768 (let ((newname
769 ;; Use nametemplate (defined in RFC1524) if it is
770 ;; specified in mailcap.
771 (if (assoc "nametemplate" mime-info)
772 (format (assoc "nametemplate" mime-info) file)
773 ;; Add a suffix according to `mailcap-mime-extensions'.
774 (concat file (car (rassoc (mm-handle-media-type handle)
775 mailcap-mime-extensions))))))
776 (unless (string-equal file newname)
777 (when (file-exists-p file)
778 (rename-file file newname))
779 (setq file newname))))
765 (let ((coding-system-for-write mm-binary-coding-system)) 780 (let ((coding-system-for-write mm-binary-coding-system))
766 (write-region (point-min) (point-max) file nil 'nomesg)) 781 (write-region (point-min) (point-max) file nil 'nomesg))
767 (message "Viewing with %s" method) 782 (message "Viewing with %s" method)
@@ -819,6 +834,9 @@ external if displayed external."
819 (ignore-errors (kill-buffer buffer)))))) 834 (ignore-errors (kill-buffer buffer))))))
820 'inline) 835 'inline)
821 (t 836 (t
837 ;; Deleting the temp file should be postponed for some wrappers,
838 ;; shell scripts, and so on, which might exit right after having
839 ;; started a viewer command as a background job.
822 (let ((command (mm-mailcap-command 840 (let ((command (mm-mailcap-command
823 method file (mm-handle-type handle)))) 841 method file (mm-handle-type handle))))
824 (unwind-protect 842 (unwind-protect
@@ -830,24 +848,38 @@ external if displayed external."
830 shell-command-switch command) 848 shell-command-switch command)
831 (set-process-sentinel 849 (set-process-sentinel
832 (get-buffer-process buffer) 850 (get-buffer-process buffer)
833 `(lambda (process state) 851 (lexical-let ;; Don't use `let'.
834 (when (eq 'exit (process-status process)) 852 ;; Function used to remove temp file and directory.
835 ;; Don't use `ignore-errors'. 853 ((fn `(lambda nil
836 (condition-case nil 854 ;; Don't use `ignore-errors'.
837 (delete-file ,file) 855 (condition-case nil
838 (error)) 856 (delete-file ,file)
839 (condition-case nil 857 (error))
840 (delete-directory ,(file-name-directory file)) 858 (condition-case nil
841 (error)) 859 (delete-directory
842 (condition-case nil 860 ,(file-name-directory file))
843 (kill-buffer ,buffer) 861 (error))))
844 (error)) 862 ;; Form uses to kill the process buffer and
845 (condition-case nil 863 ;; remove the undisplayer.
846 ,(macroexpand (list 'mm-handle-set-undisplayer 864 (fm `(progn
847 (list 'quote handle) 865 (kill-buffer ,buffer)
848 nil)) 866 ,(macroexpand
849 (error)) 867 (list 'mm-handle-set-undisplayer
850 (message "Displaying %s...done" ,command))))) 868 (list 'quote handle)
869 nil))))
870 ;; Message to be issued when the process exits.
871 (done (format "Displaying %s...done" command))
872 ;; In particular, the timer object (which is
873 ;; a vector in Emacs but is a list in XEmacs)
874 ;; requires that it is lexically scoped.
875 (timer (run-at-time 2.0 nil 'ignore)))
876 (lambda (process state)
877 (when (eq 'exit (process-status process))
878 (if (memq timer timer-list)
879 (timer-set-function timer fn)
880 (funcall fn))
881 (ignore-errors (eval fm))
882 (message "%s" done))))))
851 (mm-handle-set-external-undisplayer 883 (mm-handle-set-external-undisplayer
852 handle (cons file buffer))) 884 handle (cons file buffer)))
853 (message "Displaying %s..." command)) 885 (message "Displaying %s..." command))
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index 033548e3bed..03c188b87a0 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -250,19 +250,19 @@
250 (point-min) (point-max) 250 (point-min) (point-max)
251 (list 'keymap w3m-minor-mode-map 251 (list 'keymap w3m-minor-mode-map
252 ;; Put the mark meaning this part was rendered by emacs-w3m. 252 ;; Put the mark meaning this part was rendered by emacs-w3m.
253 'mm-inline-text-html-with-w3m t)))) 253 'mm-inline-text-html-with-w3m t)))
254 (mm-handle-set-undisplayer 254 (mm-handle-set-undisplayer
255 handle 255 handle
256 `(lambda () 256 `(lambda ()
257 (let (buffer-read-only) 257 (let (buffer-read-only)
258 (if (functionp 'remove-specifier) 258 (if (functionp 'remove-specifier)
259 (mapcar (lambda (prop) 259 (mapcar (lambda (prop)
260 (remove-specifier 260 (remove-specifier
261 (face-property 'default prop) 261 (face-property 'default prop)
262 (current-buffer))) 262 (current-buffer)))
263 '(background background-pixmap foreground))) 263 '(background background-pixmap foreground)))
264 (delete-region ,(point-min-marker) 264 (delete-region ,(point-min-marker)
265 ,(point-max-marker)))))))) 265 ,(point-max-marker)))))))))
266 266
267(defun mm-links-remove-leading-blank () 267(defun mm-links-remove-leading-blank ()
268 ;; Delete the annoying three spaces preceding each line of links 268 ;; Delete the annoying three spaces preceding each line of links
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index ad913d441b7..1f0d1c91f49 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -1872,9 +1872,15 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
1872 (case-fold-search nil) 1872 (case-fold-search nil)
1873 (from (or (message-fetch-field "from") "")) 1873 (from (or (message-fetch-field "from") ""))
1874 (to (or (message-fetch-field "to") "")) 1874 (to (or (message-fetch-field "to") ""))
1875 (date (date-to-time 1875 (date (message-fetch-field "date"))
1876 (or (message-fetch-field "date") (current-time-string))))
1877 (target 'delete)) 1876 (target 'delete))
1877 (setq date (if date
1878 (condition-case err
1879 (date-to-time date)
1880 (error
1881 (message "%s" (error-message-string err))
1882 (current-time)))
1883 (current-time)))
1878 (dolist (regexp-target-pair (reverse nnmail-fancy-expiry-targets) target) 1884 (dolist (regexp-target-pair (reverse nnmail-fancy-expiry-targets) target)
1879 (setq header (car regexp-target-pair)) 1885 (setq header (car regexp-target-pair))
1880 (cond 1886 (cond
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index 0885737c953..ca63fa597ef 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -102,7 +102,7 @@ This command is used by the various nntp-open-via-* methods.")
102(defvoo nntp-end-of-line "\r\n" 102(defvoo nntp-end-of-line "\r\n"
103 "*String to use on the end of lines when talking to the NNTP server. 103 "*String to use on the end of lines when talking to the NNTP server.
104This is \"\\r\\n\" by default, but should be \"\\n\" when 104This is \"\\r\\n\" by default, but should be \"\\n\" when
105using and indirect connection method (nntp-open-via-*).") 105using an indirect connection method (nntp-open-via-*).")
106 106
107(defvoo nntp-via-rlogin-command "rsh" 107(defvoo nntp-via-rlogin-command "rsh"
108 "*Rlogin command used to connect to an intermediate host. 108 "*Rlogin command used to connect to an intermediate host.
@@ -259,6 +259,13 @@ Within a string, %s is replaced with the server address and %p with
259port number on server. The program should accept IMAP commands on 259port number on server. The program should accept IMAP commands on
260stdin and return responses to stdout.") 260stdin and return responses to stdout.")
261 261
262(defvar nntp-authinfo-rejected nil
263"A custom error condition used to report 'Authentication Rejected' errors.
264Condition handlers that match just this condition ensure that the nntp
265backend doesn't catch this error.")
266(put 'nntp-authinfo-rejected 'error-conditions '(error nntp-authinfo-rejected))
267(put 'nntp-authinfo-rejected 'error-message "Authorization Rejected")
268
262 269
263 270
264;;; Internal functions. 271;;; Internal functions.
@@ -313,12 +320,15 @@ be restored and the command retried."
313 (set-buffer (process-buffer process)) 320 (set-buffer (process-buffer process))
314 (goto-char (point-min)) 321 (goto-char (point-min))
315 (while (and (or (not (memq (char-after (point)) '(?2 ?3 ?4 ?5))) 322 (while (and (or (not (memq (char-after (point)) '(?2 ?3 ?4 ?5)))
316 (looking-at "480")) 323 (looking-at "48[02]"))
317 (memq (process-status process) '(open run))) 324 (memq (process-status process) '(open run)))
318 (when (looking-at "480") 325 (cond ((looking-at "480")
319 (nntp-handle-authinfo process)) 326 (nntp-handle-authinfo process))
320 (when (looking-at "^.*\n") 327 ((looking-at "482")
321 (delete-region (point) (progn (forward-line 1) (point)))) 328 (nnheader-report 'nntp (get 'nntp-authinfo-rejected 'error-message))
329 (signal 'nntp-authinfo-rejected nil))
330 ((looking-at "^.*\n")
331 (delete-region (point) (progn (forward-line 1) (point)))))
322 (nntp-accept-process-output process) 332 (nntp-accept-process-output process)
323 (goto-char (point-min))) 333 (goto-char (point-min)))
324 (prog1 334 (prog1
@@ -411,6 +421,8 @@ be restored and the command retried."
411 (wait-for 421 (wait-for
412 (nntp-wait-for process wait-for buffer decode)) 422 (nntp-wait-for process wait-for buffer decode))
413 (t t))) 423 (t t)))
424 (nntp-authinfo-rejected
425 (signal 'nntp-authinfo-rejected (cdr err)))
414 (error 426 (error
415 (nnheader-report 'nntp "Couldn't open connection to %s: %s" 427 (nnheader-report 'nntp "Couldn't open connection to %s: %s"
416 address err)) 428 address err))
diff --git a/lisp/gnus/rfc2231.el b/lisp/gnus/rfc2231.el
index f328f2dbc6a..df9a5b7bd82 100644
--- a/lisp/gnus/rfc2231.el
+++ b/lisp/gnus/rfc2231.el
@@ -127,7 +127,17 @@ The list will be on the form
127 (> c ?\177)) ;; EXTENSION: Support non-ascii chars. 127 (> c ?\177)) ;; EXTENSION: Support non-ascii chars.
128 (not (memq c stoken))) 128 (not (memq c stoken)))
129 (setq value (buffer-substring 129 (setq value (buffer-substring
130 (point) (progn (forward-sexp) (point))))) 130 (point)
131 (progn
132 (forward-sexp)
133 ;; We might not have reached at the end of
134 ;; the value because of non-ascii chars,
135 ;; so we should jump over them if any.
136 (while (and (not (eobp))
137 (> (char-after) ?\177))
138 (forward-char 1)
139 (forward-sexp))
140 (point)))))
131 (t 141 (t
132 (error "Invalid header: %s" string))) 142 (error "Invalid header: %s" string)))
133 (if number 143 (if number
diff --git a/lisp/help.el b/lisp/help.el
index 9a779f14d0c..02040007f6e 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -178,7 +178,7 @@ specifies what to do when the user exits the help buffer."
178(defalias 'help-for-help 'help-for-help-internal) 178(defalias 'help-for-help 'help-for-help-internal)
179;; It can't find this, but nobody will look. 179;; It can't find this, but nobody will look.
180(make-help-screen help-for-help-internal 180(make-help-screen help-for-help-internal
181 "a b c C e f F i I k C-k l L m p s t v w C-c C-d C-f C-n C-p C-t C-w . or ? :" 181 "a b c C e f F i I k C-k l L m p r s t v w C-c C-d C-f C-n C-p C-t C-w . or ? :"
182 "You have typed %THIS-KEY%, the help character. Type a Help option: 182 "You have typed %THIS-KEY%, the help character. Type a Help option:
183\(Use SPC or DEL to scroll through this text. Type \\<help-map>\\[help-quit] to exit the Help command.) 183\(Use SPC or DEL to scroll through this text. Type \\<help-map>\\[help-quit] to exit the Help command.)
184 184
@@ -217,6 +217,7 @@ m describe-mode. Display documentation of current minor modes,
217 and the current major mode, including their special commands. 217 and the current major mode, including their special commands.
218n view-emacs-news. Display news of recent Emacs changes. 218n view-emacs-news. Display news of recent Emacs changes.
219p finder-by-keyword. Find packages matching a given topic keyword. 219p finder-by-keyword. Find packages matching a given topic keyword.
220r info-emacs-manual. Display the Emacs manual in Info mode.
220s describe-syntax. Display contents of syntax table, plus explanations. 221s describe-syntax. Display contents of syntax table, plus explanations.
221S info-lookup-symbol. Display the definition of a specific symbol 222S info-lookup-symbol. Display the definition of a specific symbol
222 as found in the manual for the language this buffer is written in. 223 as found in the manual for the language this buffer is written in.
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 4c61be5529e..c3e2d814767 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -58,7 +58,7 @@
58;; hi-lock mode and adds a "Regexp Highlighting" entry 58;; hi-lock mode and adds a "Regexp Highlighting" entry
59;; to the edit menu. 59;; to the edit menu.
60;; 60;;
61;; (hi-lock-mode 1) 61;; (global-hi-lock-mode 1)
62;; 62;;
63;; You might also want to bind the hi-lock commands to more 63;; You might also want to bind the hi-lock commands to more
64;; finger-friendly sequences: 64;; finger-friendly sequences:
@@ -188,6 +188,17 @@ calls."
188(defvar hi-lock-file-patterns-prefix "Hi-lock" 188(defvar hi-lock-file-patterns-prefix "Hi-lock"
189 "Regexp for finding hi-lock patterns at top of file.") 189 "Regexp for finding hi-lock patterns at top of file.")
190 190
191(defvar hi-lock-archaic-interface-message-used nil
192 "True if user alerted that global-hi-lock-mode is now the global switch.
193Earlier versions of hi-lock used hi-lock-mode as the global switch,
194the message is issued if it appears that hi-lock-mode is used assuming
195that older functionality. This variable avoids multiple reminders.")
196
197(defvar hi-lock-archaic-interface-deduce nil
198 "If non-nil, sometimes assume that hi-lock-mode means global-hi-lock-mode.
199Assumption is made if hi-lock-mode used in the *scratch* buffer while
200a library is being loaded.")
201
191(make-variable-buffer-local 'hi-lock-interactive-patterns) 202(make-variable-buffer-local 'hi-lock-interactive-patterns)
192(put 'hi-lock-interactive-patterns 'permanent-local t) 203(put 'hi-lock-interactive-patterns 'permanent-local t)
193(make-variable-buffer-local 'hi-lock-regexp-history) 204(make-variable-buffer-local 'hi-lock-regexp-history)
@@ -238,13 +249,15 @@ calls."
238 249
239 250
240;;;###autoload 251;;;###autoload
241(define-minor-mode hi-lock-buffer-mode 252(define-minor-mode hi-lock-mode
242 "Toggle minor mode for interactively adding font-lock highlighting patterns. 253 "Toggle minor mode for interactively adding font-lock highlighting patterns.
243 254
244If ARG positive turn hi-lock on. Issuing a hi-lock command will also 255If ARG positive turn hi-lock on. Issuing a hi-lock command will also
245turn hi-lock on. When hi-lock is turned on, a \"Regexp Highlighting\" 256turn hi-lock on; to turn hi-lock on in all buffers use
246submenu is added to the \"Edit\" menu. The commands in the submenu, 257global-hi-lock-mode or in your .emacs file (global-hi-lock-mode 1).
247which can be called interactively, are: 258When hi-lock is turned on, a \"Regexp Highlighting\" submenu is added
259to the \"Edit\" menu. The commands in the submenu, which can be
260called interactively, are:
248 261
249\\[highlight-regexp] REGEXP FACE 262\\[highlight-regexp] REGEXP FACE
250 Highlight matches of pattern REGEXP in current buffer with FACE. 263 Highlight matches of pattern REGEXP in current buffer with FACE.
@@ -283,7 +296,24 @@ is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'."
283 :lighter " H" 296 :lighter " H"
284 :global nil 297 :global nil
285 :keymap hi-lock-map 298 :keymap hi-lock-map
286 (if hi-lock-buffer-mode 299 (when (and (equal (buffer-name) "*scratch*")
300 load-in-progress
301 (not (interactive-p))
302 (not hi-lock-archaic-interface-message-used))
303 (setq hi-lock-archaic-interface-message-used t)
304 (if hi-lock-archaic-interface-deduce
305 (global-hi-lock-mode hi-lock-mode)
306 (warn
307 "Possible archaic use of (hi-lock-mode).
308Use (global-hi-lock-mode 1) in .emacs to enable hi-lock for all buffers,
309use (hi-lock-mode 1) for individual buffers. For compatibility with Emacs
310versions before 22 use the following in your .emacs file:
311
312 (if (functionp 'global-hi-lock-mode)
313 (global-hi-lock-mode 1)
314 (hi-lock-mode 1))
315")))
316 (if hi-lock-mode
287 ;; Turned on. 317 ;; Turned on.
288 (progn 318 (progn
289 (unless font-lock-mode (font-lock-mode 1)) 319 (unless font-lock-mode (font-lock-mode 1))
@@ -294,7 +324,7 @@ is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'."
294 ;; Turned off. 324 ;; Turned off.
295 (when (or hi-lock-interactive-patterns 325 (when (or hi-lock-interactive-patterns
296 hi-lock-file-patterns) 326 hi-lock-file-patterns)
297 (when hi-lock-interactive-patterns 327 (when hi-lock-interactive-patterns
298 (font-lock-remove-keywords nil hi-lock-interactive-patterns) 328 (font-lock-remove-keywords nil hi-lock-interactive-patterns)
299 (setq hi-lock-interactive-patterns nil)) 329 (setq hi-lock-interactive-patterns nil))
300 (when hi-lock-file-patterns 330 (when hi-lock-file-patterns
@@ -306,13 +336,14 @@ is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'."
306 (remove-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook t))) 336 (remove-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook t)))
307 337
308;;;###autoload 338;;;###autoload
309(define-global-minor-mode hi-lock-mode 339(define-global-minor-mode global-hi-lock-mode
310 hi-lock-buffer-mode turn-on-hi-lock-if-enabled 340 hi-lock-mode turn-on-hi-lock-if-enabled
311 :group 'hi-lock) 341 :group 'hi-lock)
312 342
313(defun turn-on-hi-lock-if-enabled () 343(defun turn-on-hi-lock-if-enabled ()
344 (setq hi-lock-archaic-interface-message-used t)
314 (unless (memq major-mode hi-lock-exclude-modes) 345 (unless (memq major-mode hi-lock-exclude-modes)
315 (hi-lock-buffer-mode 1))) 346 (hi-lock-mode 1)))
316 347
317;;;###autoload 348;;;###autoload
318(defalias 'highlight-lines-matching-regexp 'hi-lock-line-face-buffer) 349(defalias 'highlight-lines-matching-regexp 'hi-lock-line-face-buffer)
@@ -332,7 +363,7 @@ list maintained for regexps, global history maintained for faces.
332 nil nil 'hi-lock-regexp-history)) 363 nil nil 'hi-lock-regexp-history))
333 (hi-lock-read-face-name))) 364 (hi-lock-read-face-name)))
334 (or (facep face) (setq face 'hi-yellow)) 365 (or (facep face) (setq face 'hi-yellow))
335 (unless hi-lock-buffer-mode (hi-lock-buffer-mode 1)) 366 (unless hi-lock-mode (hi-lock-mode 1))
336 (hi-lock-set-pattern 367 (hi-lock-set-pattern
337 ;; The \\(?:...\\) grouping construct ensures that a leading ^, +, * or ? 368 ;; The \\(?:...\\) grouping construct ensures that a leading ^, +, * or ?
338 ;; or a trailing $ in REGEXP will be interpreted correctly. 369 ;; or a trailing $ in REGEXP will be interpreted correctly.
@@ -357,7 +388,7 @@ list maintained for regexps, global history maintained for faces.
357 nil nil 'hi-lock-regexp-history)) 388 nil nil 'hi-lock-regexp-history))
358 (hi-lock-read-face-name))) 389 (hi-lock-read-face-name)))
359 (or (facep face) (setq face 'hi-yellow)) 390 (or (facep face) (setq face 'hi-yellow))
360 (unless hi-lock-buffer-mode (hi-lock-buffer-mode 1)) 391 (unless hi-lock-mode (hi-lock-mode 1))
361 (hi-lock-set-pattern regexp face)) 392 (hi-lock-set-pattern regexp face))
362 393
363;;;###autoload 394;;;###autoload
@@ -377,7 +408,7 @@ lower-case letters made case insensitive."
377 nil nil 'hi-lock-regexp-history))) 408 nil nil 'hi-lock-regexp-history)))
378 (hi-lock-read-face-name))) 409 (hi-lock-read-face-name)))
379 (or (facep face) (setq face 'hi-yellow)) 410 (or (facep face) (setq face 'hi-yellow))
380 (unless hi-lock-buffer-mode (hi-lock-buffer-mode 1)) 411 (unless hi-lock-mode (hi-lock-mode 1))
381 (hi-lock-set-pattern regexp face)) 412 (hi-lock-set-pattern regexp face))
382 413
383;;;###autoload 414;;;###autoload
@@ -535,7 +566,7 @@ not suitable."
535 (setq all-patterns (append (read (current-buffer)) all-patterns)) 566 (setq all-patterns (append (read (current-buffer)) all-patterns))
536 (error (message "Invalid pattern list expression at %d" 567 (error (message "Invalid pattern list expression at %d"
537 (line-number-at-pos))))))) 568 (line-number-at-pos)))))))
538 (when hi-lock-buffer-mode (hi-lock-set-file-patterns all-patterns)) 569 (when hi-lock-mode (hi-lock-set-file-patterns all-patterns))
539 (if (interactive-p) 570 (if (interactive-p)
540 (message "Hi-lock added %d patterns." (length all-patterns)))))) 571 (message "Hi-lock added %d patterns." (length all-patterns))))))
541 572
@@ -544,7 +575,7 @@ not suitable."
544 (if font-lock-mode 575 (if font-lock-mode
545 (progn (font-lock-add-keywords nil hi-lock-file-patterns) 576 (progn (font-lock-add-keywords nil hi-lock-file-patterns)
546 (font-lock-add-keywords nil hi-lock-interactive-patterns)) 577 (font-lock-add-keywords nil hi-lock-interactive-patterns))
547 (hi-lock-buffer-mode -1))) 578 (hi-lock-mode -1)))
548 579
549(provide 'hi-lock) 580(provide 'hi-lock)
550 581
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index 4e8f8f61221..2de72547887 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -1021,10 +1021,12 @@ currently used by buffers."
1021 (ibuffer-awhen (with-current-buffer buf 1021 (ibuffer-awhen (with-current-buffer buf
1022 (or buffer-file-name 1022 (or buffer-file-name
1023 (and (boundp 'dired-directory) 1023 (and (boundp 'dired-directory)
1024 (if (stringp dired-directory) 1024 (let ((dired-dir
1025 dired-directory 1025 (if (stringp dired-directory)
1026 (car dired-directory)) 1026 dired-directory
1027 (expand-file-name dired-directory)))) 1027 (car dired-directory))))
1028 (and dired-dir
1029 (expand-file-name dired-dir))))))
1028 (string-match qualifier it))) 1030 (string-match qualifier it)))
1029 1031
1030;;;###autoload (autoload 'ibuffer-filter-by-size-gt "ibuf-ext") 1032;;;###autoload (autoload 'ibuffer-filter-by-size-gt "ibuf-ext")
diff --git a/lisp/ido.el b/lisp/ido.el
index e6dcea5fd21..9fe063bade6 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -24,45 +24,6 @@
24;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 24;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25;; Boston, MA 02110-1301, USA. 25;; Boston, MA 02110-1301, USA.
26 26
27;;; Acknowledgements
28
29;; Infinite amounts of gratitude goes to Stephen Eglen <stephen@cns.ed.ac.uk>
30;; who wrote iswitch-buffer mode - from which I ripped off 99% of the code
31;; for ido-switch-buffer and found the inspiration for ido-find-file.
32;; The ido package would never have existed without his work.
33
34;; Also thanks to Klaus Berndl, Rohit Namjoshi, Robert Fenk, Alex
35;; Schroeder, Bill Benedetto, Stephen Eglen, and many others for bug
36;; fixes and improvements.
37
38;;; History
39
40;; Since I discovered Stephen Eglen's excellent iswitchb package, I just
41;; couldn't live without it, but once being addicted to switching buffers
42;; with a minimum of keystrokes, I soon found that opening files in the
43;; old-fashioned way was just too slow - so I decided to write a package
44;; which could open files with the same speed and ease as iswitchb could
45;; switch buffers.
46
47;; I originally wrote a separate ifindf.el package based on a copy of
48;; iswitchb.el, which did for opening files what iswitchb did for
49;; switching buffers. Along the way, I corrected a few errors in
50;; ifindf which could have found its way back into iswitchb, but since
51;; most of the functionality of the two package was practically
52;; identical, I decided that the proper thing to do was to merge my
53;; ifindf package back into iswitchb.
54;;
55;; This is basically what ido (interactively do) is all about; but I
56;; found it ackward to merge my changes into the "iswitchb-" namespace,
57;; so I invented a common "ido-" namespace for the merged packages.
58;;
59;; This version is based on ido.el version 1.57 released on
60;; gnu.emacs.sources adapted for emacs 22.1 to use command remapping
61;; and optionally hooking the read-buffer and read-file-name functions.
62;;
63;; Prefix matching was added by Klaus Berndl <klaus.berndl@sdm.de> based on
64;; an idea of Yuji Minejima <ggb01164@nifty.ne.jp> and his mcomplete-package.
65
66 27
67;;; Commentary: 28;;; Commentary:
68 29
@@ -94,10 +55,10 @@
94;; most recent, when I use ido-switch-buffer, I first of all get 55;; most recent, when I use ido-switch-buffer, I first of all get
95;; presented with the list of all the buffers 56;; presented with the list of all the buffers
96;; 57;;
97;; Buffer: {123456,123} 58;; Buffer: {123456 | 123}
98;; 59;;
99;; If I then press 2: 60;; If I then press 2:
100;; Buffer: 2[3]{123456,123} 61;; Buffer: 2[3]{123456 | 123}
101;; 62;;
102;; The list in {...} are the matching buffers, most recent first 63;; The list in {...} are the matching buffers, most recent first
103;; (buffers visible in the current frame are put at the end of the 64;; (buffers visible in the current frame are put at the end of the
@@ -110,7 +71,7 @@
110;; pressing TAB. In this case, I will get "3" added to my input. 71;; pressing TAB. In this case, I will get "3" added to my input.
111 72
112;; So, I press TAB: 73;; So, I press TAB:
113;; Buffer: 23{123456,123} 74;; Buffer: 23{123456 | 123}
114;; 75;;
115;; At this point, I still have two matching buffers. 76;; At this point, I still have two matching buffers.
116;; If I want the first buffer in the list, I simply press RET. If I 77;; If I want the first buffer in the list, I simply press RET. If I
@@ -118,13 +79,16 @@
118;; top of the list and then RET to select it. 79;; top of the list and then RET to select it.
119;; 80;;
120;; However, if I type 4, I only have one match left: 81;; However, if I type 4, I only have one match left:
121;; Buffer: 234[123456] [Matched] 82;; Buffer: 234[123456]
83;;
84;; Since there is only one matching buffer left, it is given in [] and
85;; it is shown in the `ido-only-match' face (ForestGreen). I can now
86;; press TAB or RET to go to that buffer.
122;; 87;;
123;; Since there is only one matching buffer left, it is given in [] and we 88;; If I want to create a new buffer named "234", I press C-j instead of
124;; see the text [Matched] afterwards. I can now press TAB or RET to go 89;; TAB or RET.
125;; to that buffer.
126;; 90;;
127;; If however, I now type "a": 91;; If instead, I type "a":
128;; Buffer: 234a [No match] 92;; Buffer: 234a [No match]
129;; There are no matching buffers. If I press RET or TAB, I can be 93;; There are no matching buffers. If I press RET or TAB, I can be
130;; prompted to create a new buffer called "234a". 94;; prompted to create a new buffer called "234a".
@@ -318,6 +282,45 @@
318;; can be used by other packages to read a buffer name, a file name, 282;; can be used by other packages to read a buffer name, a file name,
319;; or a directory name in the `ido' way. 283;; or a directory name in the `ido' way.
320 284
285;;; Acknowledgements
286
287;; Infinite amounts of gratitude goes to Stephen Eglen <stephen@cns.ed.ac.uk>
288;; who wrote iswitch-buffer mode - from which I ripped off 99% of the code
289;; for ido-switch-buffer and found the inspiration for ido-find-file.
290;; The ido package would never have existed without his work.
291
292;; Also thanks to Klaus Berndl, Rohit Namjoshi, Robert Fenk, Alex
293;; Schroeder, Bill Benedetto, Stephen Eglen, and many others for bug
294;; fixes and improvements.
295
296;;; History
297
298;; Since I discovered Stephen Eglen's excellent iswitchb package, I just
299;; couldn't live without it, but once being addicted to switching buffers
300;; with a minimum of keystrokes, I soon found that opening files in the
301;; old-fashioned way was just too slow - so I decided to write a package
302;; which could open files with the same speed and ease as iswitchb could
303;; switch buffers.
304
305;; I originally wrote a separate ifindf.el package based on a copy of
306;; iswitchb.el, which did for opening files what iswitchb did for
307;; switching buffers. Along the way, I corrected a few errors in
308;; ifindf which could have found its way back into iswitchb, but since
309;; most of the functionality of the two package was practically
310;; identical, I decided that the proper thing to do was to merge my
311;; ifindf package back into iswitchb.
312;;
313;; This is basically what ido (interactively do) is all about; but I
314;; found it ackward to merge my changes into the "iswitchb-" namespace,
315;; so I invented a common "ido-" namespace for the merged packages.
316;;
317;; This version is based on ido.el version 1.57 released on
318;; gnu.emacs.sources adapted for emacs 22.1 to use command remapping
319;; and optionally hooking the read-buffer and read-file-name functions.
320;;
321;; Prefix matching was added by Klaus Berndl <klaus.berndl@sdm.de> based on
322;; an idea of Yuji Minejima <ggb01164@nifty.ne.jp> and his mcomplete-package.
323
321 324
322;;; Code: 325;;; Code:
323 326
diff --git a/lisp/info.el b/lisp/info.el
index 2853a0f94ee..94bf36222f0 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -3071,6 +3071,7 @@ if point is in a menu item description, follow that menu item."
3071 (define-key Info-mode-map " " 'Info-scroll-up) 3071 (define-key Info-mode-map " " 'Info-scroll-up)
3072 (define-key Info-mode-map "\C-m" 'Info-follow-nearest-node) 3072 (define-key Info-mode-map "\C-m" 'Info-follow-nearest-node)
3073 (define-key Info-mode-map "\t" 'Info-next-reference) 3073 (define-key Info-mode-map "\t" 'Info-next-reference)
3074 (define-key Info-mode-map "\e\t" 'Info-prev-reference)
3074 (define-key Info-mode-map [(shift tab)] 'Info-prev-reference) 3075 (define-key Info-mode-map [(shift tab)] 'Info-prev-reference)
3075 (define-key Info-mode-map [backtab] 'Info-prev-reference) 3076 (define-key Info-mode-map [backtab] 'Info-prev-reference)
3076 (define-key Info-mode-map "1" 'Info-nth-menu-item) 3077 (define-key Info-mode-map "1" 'Info-nth-menu-item)
diff --git a/lisp/international/ucs-tables.el b/lisp/international/ucs-tables.el
index 8d0760563c5..a8ca220466a 100644
--- a/lisp/international/ucs-tables.el
+++ b/lisp/international/ucs-tables.el
@@ -2499,8 +2499,8 @@ See also command `unify-8859-on-encoding-mode' and the user option
2499;; normal-mode and minibuffer-setup-hook. 2499;; normal-mode and minibuffer-setup-hook.
2500(defun ucs-set-table-for-input (&optional buffer) 2500(defun ucs-set-table-for-input (&optional buffer)
2501 "Set up an appropriate `translation-table-for-input' for BUFFER. 2501 "Set up an appropriate `translation-table-for-input' for BUFFER.
2502BUFFER defaults to the current buffer. 2502BUFFER defaults to the current buffer. This function is
2503This function is automatically called directly at the end of `get-buffer-create'." 2503automatically called directly at the end of `get-buffer-create'."
2504 (when (and unify-8859-on-encoding-mode 2504 (when (and unify-8859-on-encoding-mode
2505 (not unify-8859-on-decoding-mode) 2505 (not unify-8859-on-decoding-mode)
2506 (char-table-p translation-table-for-input)) 2506 (char-table-p translation-table-for-input))
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 5ccf2bf92ba..99c637e5664 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1809,6 +1809,8 @@ Isearch mode."
1809 ((eq char ?|) (isearch-fallback t nil t))) 1809 ((eq char ?|) (isearch-fallback t nil t)))
1810 1810
1811 ;; Append the char to the search string, update the message and re-search. 1811 ;; Append the char to the search string, update the message and re-search.
1812 (if (char-table-p translation-table-for-input)
1813 (setq char (or (aref translation-table-for-input char) char)))
1812 (isearch-process-search-string 1814 (isearch-process-search-string
1813 (char-to-string char) 1815 (char-to-string char)
1814 (if (>= char ?\200) 1816 (if (>= char ?\200)
@@ -2235,17 +2237,15 @@ since they have special meaning in a regexp."
2235(defvar isearch-overlay nil) 2237(defvar isearch-overlay nil)
2236 2238
2237(defun isearch-highlight (beg end) 2239(defun isearch-highlight (beg end)
2238 (unless (null search-highlight) 2240 (if search-highlight
2239 (cond (isearch-overlay 2241 (if isearch-overlay
2240 ;; Overlay already exists, just move it. 2242 ;; Overlay already exists, just move it.
2241 (move-overlay isearch-overlay beg end (current-buffer))) 2243 (move-overlay isearch-overlay beg end (current-buffer))
2242 2244 ;; Overlay doesn't exist, create it.
2243 (t 2245 (setq isearch-overlay (make-overlay beg end))
2244 ;; Overlay doesn't exist, create it. 2246 ;; 1001 is higher than lazy's 1000 and ediff's 100+
2245 (setq isearch-overlay (make-overlay beg end)) 2247 (overlay-put isearch-overlay 'priority 1001)
2246 (overlay-put isearch-overlay 'face isearch) 2248 (overlay-put isearch-overlay 'face isearch))))
2247 (overlay-put isearch-overlay 'priority 1) ;higher than lazy overlays
2248 ))))
2249 2249
2250(defun isearch-dehighlight () 2250(defun isearch-dehighlight ()
2251 (when isearch-overlay 2251 (when isearch-overlay
@@ -2409,8 +2409,10 @@ Attempt to do the search exactly the way the pending isearch would."
2409 ;; non-zero-length match 2409 ;; non-zero-length match
2410 (let ((ov (make-overlay mb me))) 2410 (let ((ov (make-overlay mb me)))
2411 (push ov isearch-lazy-highlight-overlays) 2411 (push ov isearch-lazy-highlight-overlays)
2412 ;; 1000 is higher than ediff's 100+,
2413 ;; but lower than isearch main overlay's 1001
2414 (overlay-put ov 'priority 1000)
2412 (overlay-put ov 'face lazy-highlight-face) 2415 (overlay-put ov 'face lazy-highlight-face)
2413 (overlay-put ov 'priority 0) ;lower than main overlay
2414 (overlay-put ov 'window (selected-window)))) 2416 (overlay-put ov 'window (selected-window))))
2415 (if isearch-forward 2417 (if isearch-forward
2416 (setq isearch-lazy-highlight-end (point)) 2418 (setq isearch-lazy-highlight-end (point))
diff --git a/lisp/locate.el b/lisp/locate.el
index 5b61ed522e9..5934a572d4d 100644
--- a/lisp/locate.el
+++ b/lisp/locate.el
@@ -229,7 +229,8 @@ With prefix arg, prompt for the locate command to run."
229 (save-window-excursion 229 (save-window-excursion
230 (set-buffer (get-buffer-create locate-buffer-name)) 230 (set-buffer (get-buffer-create locate-buffer-name))
231 (locate-mode) 231 (locate-mode)
232 (let ((inhibit-read-only t)) 232 (let ((inhibit-read-only t)
233 (buffer-undo-list t))
233 (erase-buffer) 234 (erase-buffer)
234 235
235 (setq locate-current-filter filter) 236 (setq locate-current-filter filter)
diff --git a/lisp/mail/mail-extr.el b/lisp/mail/mail-extr.el
index da5ec4bfda1..0f5aa1e18f7 100644
--- a/lisp/mail/mail-extr.el
+++ b/lisp/mail/mail-extr.el
@@ -699,9 +699,10 @@ Unless NO-REPLACE is true, at each of the positions in LIST-SYMBOL
699;;;###autoload 699;;;###autoload
700(defun mail-extract-address-components (address &optional all) 700(defun mail-extract-address-components (address &optional all)
701 "Given an RFC-822 address ADDRESS, extract full name and canonical address. 701 "Given an RFC-822 address ADDRESS, extract full name and canonical address.
702Returns a list of the form (FULL-NAME CANONICAL-ADDRESS). 702Returns a list of the form (FULL-NAME CANONICAL-ADDRESS). If no
703If no name can be extracted, FULL-NAME will be nil. Also see 703name can be extracted, FULL-NAME will be nil. Also see
704`mail-extr-ignore-single-names' and `mail-extr-ignore-realname-equals-mailbox-name'. 704`mail-extr-ignore-single-names' and
705`mail-extr-ignore-realname-equals-mailbox-name'.
705 706
706If the optional argument ALL is non-nil, then ADDRESS can contain zero 707If the optional argument ALL is non-nil, then ADDRESS can contain zero
707or more recipients, separated by commas, and we return a list of 708or more recipients, separated by commas, and we return a list of
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 0decf2813aa..b45467386ba 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -3155,13 +3155,18 @@ If N is negative, go backwards instead."
3155 search-regexp found) 3155 search-regexp found)
3156 (if (string-match "\\`[ \t]+" subject) 3156 (if (string-match "\\`[ \t]+" subject)
3157 (setq subject (substring subject (match-end 0)))) 3157 (setq subject (substring subject (match-end 0))))
3158 (if (string-match "Re:[ \t]*" subject) 3158 (if (string-match "\\`\\(Re:[ \t]*\\)+" subject)
3159 (setq subject (substring subject (match-end 0)))) 3159 (setq subject (substring subject (match-end 0))))
3160 (if (string-match "[ \t]+\\'" subject) 3160 (if (string-match "[ \t]+\\'" subject)
3161 (setq subject (substring subject 0 (match-beginning 0)))) 3161 (setq subject (substring subject 0 (match-beginning 0))))
3162 (setq search-regexp (concat "^Subject: *\\(Re:[ \t]*\\)?" 3162 ;; If Subject is long, mailers will break it into several lines at
3163 (regexp-quote subject) 3163 ;; arbitrary places, so replace whitespace with a regexp that will
3164 "[ \t]*\n")) 3164 ;; match any sequence of spaces, TABs, and newlines.
3165 (setq subject (regexp-quote subject))
3166 (setq subject
3167 (replace-regexp-in-string "[ \t\n]+" "[ \t\n]+" subject t t))
3168 (setq search-regexp (concat "^Subject: *\\(Re:[ \t]*\\)*"
3169 subject "[ \t]*\n"))
3165 (save-excursion 3170 (save-excursion
3166 (save-restriction 3171 (save-restriction
3167 (widen) 3172 (widen)
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 4a4d2172c8b..40e678aa130 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -596,7 +596,10 @@ actually occur.")
596(define-derived-mode mail-mode text-mode "Mail" 596(define-derived-mode mail-mode text-mode "Mail"
597 "Major mode for editing mail to be sent. 597 "Major mode for editing mail to be sent.
598Like Text Mode but with these additional commands: 598Like Text Mode but with these additional commands:
599\\[mail-send] mail-send (send the message) \\[mail-send-and-exit] mail-send-and-exit 599
600\\[mail-send] mail-send (send the message)
601\\[mail-send-and-exit] mail-send-and-exit (send the message and exit)
602
600Here are commands that move to a header field (and create it if there isn't): 603Here are commands that move to a header field (and create it if there isn't):
601 \\[mail-to] move to To: \\[mail-subject] move to Subject: 604 \\[mail-to] move to To: \\[mail-subject] move to Subject:
602 \\[mail-cc] move to CC: \\[mail-bcc] move to BCC: 605 \\[mail-cc] move to CC: \\[mail-bcc] move to BCC:
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 175e32becdf..0eb956981ce 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -605,6 +605,7 @@ This is relative to `smtpmail-queue-dir'.")
605 605
606 ;; clear the trace buffer of old output 606 ;; clear the trace buffer of old output
607 (with-current-buffer process-buffer 607 (with-current-buffer process-buffer
608 (setq buffer-undo-list t)
608 (erase-buffer)) 609 (erase-buffer))
609 610
610 ;; open the connection to the server 611 ;; open the connection to the server
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 64dad08988c..56745d82cc4 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -481,7 +481,7 @@ A large number or nil slows down menu responsiveness."
481 :enable (and (not buffer-read-only) 481 :enable (and (not buffer-read-only)
482 (not (eq t buffer-undo-list)) 482 (not (eq t buffer-undo-list))
483 (if (eq last-command 'undo) 483 (if (eq last-command 'undo)
484 pending-undo-list 484 (listp pending-undo-list)
485 (consp buffer-undo-list))) 485 (consp buffer-undo-list)))
486 :help "Undo last operation")) 486 :help "Undo last operation"))
487 487
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index e88a64f3dc7..dafa37c6b3d 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,12 @@
12005-12-09 Bill Wohler <wohler@newt.com>
2
3 * mh-customize.el (mh-path): Move here from mh-init.el.
4 (mh-variant): Mention that mh-path can be customized.
5 (mh-invisible-header-fields-internal): Add X-ContentStamp,
6 X-MAIL-INFO, and X-UNTD- from NetZero.
7
8 * mh-init.el (mh-path): Move defcustom to mh-customize.el.
9
12005-12-04 Bill Wohler <wohler@newt.com> 102005-12-04 Bill Wohler <wohler@newt.com>
2 11
3 * mh-customize.el (mh-sortm-args): Sync docstrings with manual. 12 * mh-customize.el (mh-sortm-args): Sync docstrings with manual.
diff --git a/lisp/mh-e/mh-customize.el b/lisp/mh-e/mh-customize.el
index 2b834c5913e..49aceae3b61 100644
--- a/lisp/mh-e/mh-customize.el
+++ b/lisp/mh-e/mh-customize.el
@@ -260,15 +260,21 @@ mailutils."
260(eval-when (compile) 260(eval-when (compile)
261 (setq mh-variant 'none)) 261 (setq mh-variant 'none))
262 262
263(defcustom mh-path nil
264 "*Additional list of directories to search for MH.
265See `mh-variant'."
266 :group 'mh-e
267 :type '(repeat (directory)))
268
263(defcustom mh-variant 'autodetect 269(defcustom mh-variant 'autodetect
264 "*Specifies the variant used by MH-E. 270 "*Specifies the variant used by MH-E.
265 271
266The default setting of this option is `Auto-detect' which means that MH-E will 272The default setting of this option is `Auto-detect' which means that MH-E will
267automatically choose the first of nmh, MH, or GNU mailutils that it finds in 273automatically choose the first of nmh, MH, or GNU mailutils that it finds in
268the directories listed in `mh-path', `mh-sys-path', and `exec-path'. If, for 274the directories listed in `mh-path' (which you can customize), `mh-sys-path',
269example, you have both nmh and mailutils installed and `mh-variant-in-use' was 275and `exec-path'. If, for example, you have both nmh and mailutils installed
270initialized to nmh but you want to use mailutils, then you can set this option 276and `mh-variant-in-use' was initialized to nmh but you want to use mailutils,
271to `mailutils'. 277then you can set this option to `mailutils'.
272 278
273When this variable is changed, MH-E resets `mh-progs', `mh-lib', 279When this variable is changed, MH-E resets `mh-progs', `mh-lib',
274`mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use' 280`mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use'
@@ -1421,6 +1427,7 @@ of citations entirely, choose \"None\"."
1421 "X-Bogosity:" ; bogofilter 1427 "X-Bogosity:" ; bogofilter
1422 "X-Bugzilla-*" ; Bugzilla 1428 "X-Bugzilla-*" ; Bugzilla
1423 "X-Complaints-To:" 1429 "X-Complaints-To:"
1430 "X-ContentStamp:" ; NetZero
1424 "X-Cron-Env:" 1431 "X-Cron-Env:"
1425 "X-DMCA" 1432 "X-DMCA"
1426 "X-Delivered" 1433 "X-Delivered"
@@ -1453,6 +1460,7 @@ of citations entirely, choose \"None\"."
1453 "X-Listprocessor-" ; ListProc(tm) by CREN 1460 "X-Listprocessor-" ; ListProc(tm) by CREN
1454 "X-Listserver:" ; Unknown mailing list managers 1461 "X-Listserver:" ; Unknown mailing list managers
1455 "X-Loop:" ; Unknown mailing list managers 1462 "X-Loop:" ; Unknown mailing list managers
1463 "X-MAIL-INFO:" ; NetZero
1456 "X-MHE-Checksum" ; Checksum added during index search 1464 "X-MHE-Checksum" ; Checksum added during index search
1457 "X-MIME-Autoconverted:" ; sendmail 1465 "X-MIME-Autoconverted:" ; sendmail
1458 "X-MIMETrack:" 1466 "X-MIMETrack:"
@@ -1506,6 +1514,7 @@ of citations entirely, choose \"None\"."
1506 "X-Trace:" 1514 "X-Trace:"
1507 "X-UID" 1515 "X-UID"
1508 "X-UIDL:" 1516 "X-UIDL:"
1517 "X-UNTD-" ; NetZero
1509 "X-USANET-" ; usa.net 1518 "X-USANET-" ; usa.net
1510 "X-UserInfo1:" 1519 "X-UserInfo1:"
1511 "X-Virus-Scanned" ; amavisd-new 1520 "X-Virus-Scanned" ; amavisd-new
diff --git a/lisp/mh-e/mh-init.el b/lisp/mh-e/mh-init.el
index 3ef478fd55f..79f779810e2 100644
--- a/lisp/mh-e/mh-init.el
+++ b/lisp/mh-e/mh-init.el
@@ -73,6 +73,31 @@ This directory contains, among other things, the mhl program.")
73;;;###autoload 73;;;###autoload
74(put 'mh-lib-progs 'risky-local-variable t) 74(put 'mh-lib-progs 'risky-local-variable t)
75 75
76(defvar mh-variants nil
77 "List describing known MH variants.
78Created by the function `mh-variants'")
79
80;;;###mh-autoload
81(defun mh-variants ()
82 "Return a list of installed variants of MH on the system.
83This function looks for MH in `mh-sys-path', `mh-path' and
84`exec-path'. The format of the list of variants that is returned is described
85by the variable `mh-variants'."
86 (if mh-variants
87 mh-variants
88 (let ((list-unique))
89 ;; Make a unique list of directories, keeping the given order.
90 ;; We don't want the same MH variant to be listed multiple times.
91 (loop for dir in (append mh-path mh-sys-path exec-path) do
92 (setq dir (file-chase-links (directory-file-name dir)))
93 (add-to-list 'list-unique dir))
94 (loop for dir in (nreverse list-unique) do
95 (when (and dir (file-directory-p dir) (file-readable-p dir))
96 (let ((variant (mh-variant-info dir)))
97 (if variant
98 (add-to-list 'mh-variants variant)))))
99 mh-variants)))
100
76(defvar mh-variant-in-use nil 101(defvar mh-variant-in-use nil
77 "The MH variant currently in use; a string with variant and version number. 102 "The MH variant currently in use; a string with variant and version number.
78This differs from `mh-variant' when the latter is set to `autodetect'.") 103This differs from `mh-variant' when the latter is set to `autodetect'.")
@@ -171,17 +196,6 @@ The list `exec-path' is searched in addition to this list.
171There's no need for users to modify this list. Instead add extra 196There's no need for users to modify this list. Instead add extra
172directories to the customizable variable `mh-path'.") 197directories to the customizable variable `mh-path'.")
173 198
174(defcustom mh-path nil
175 "*List of directories to search for variants of the MH variant.
176The directories will be searched for `mhparam' in addition to directories
177listed in `mh-sys-path' and `exec-path'."
178 :group 'mh-e
179 :type '(repeat (directory)))
180
181(defvar mh-variants nil
182 "List describing known MH variants.
183Created by the function `mh-variants'")
184
185(defun mh-variant-mh-info (dir) 199(defun mh-variant-mh-info (dir)
186 "Return info for MH variant in DIR assuming a temporary buffer is setup." 200 "Return info for MH variant in DIR assuming a temporary buffer is setup."
187 ;; MH does not have the -version option. 201 ;; MH does not have the -version option.
@@ -281,27 +295,6 @@ This assumes that a temporary buffer is setup."
281 ((mh-variant-nmh-info dir)) 295 ((mh-variant-nmh-info dir))
282 ((mh-variant-mu-mh-info dir)))))) 296 ((mh-variant-mu-mh-info dir))))))
283 297
284;;;###mh-autoload
285(defun mh-variants ()
286 "Return a list of installed variants of MH on the system.
287This function looks for MH in `mh-sys-path', `mh-path' and
288`exec-path'. The format of the list of variants that is returned is described
289by the variable `mh-variants'."
290 (if mh-variants
291 mh-variants
292 (let ((list-unique))
293 ;; Make a unique list of directories, keeping the given order.
294 ;; We don't want the same MH variant to be listed multiple times.
295 (loop for dir in (append mh-path mh-sys-path exec-path) do
296 (setq dir (file-chase-links (directory-file-name dir)))
297 (add-to-list 'list-unique dir))
298 (loop for dir in (nreverse list-unique) do
299 (when (and dir (file-directory-p dir) (file-readable-p dir))
300 (let ((variant (mh-variant-info dir)))
301 (if variant
302 (add-to-list 'mh-variants variant)))))
303 mh-variants)))
304
305 298
306 299
307(defvar mh-image-load-path-called-flag nil) 300(defvar mh-image-load-path-called-flag nil)
diff --git a/lisp/pcvs.el b/lisp/pcvs.el
index 1e9f1bce7ce..0f0ff76ed0c 100644
--- a/lisp/pcvs.el
+++ b/lisp/pcvs.el
@@ -775,6 +775,7 @@ clear what alternative to use.
775For interactive use, use `" (symbol-name fun) "' instead.") 775For interactive use, use `" (symbol-name fun) "' instead.")
776 ,interact 776 ,interact
777 ,@body) 777 ,@body)
778 (put ',fun-1 'definition-name ',fun)
778 (defun ,fun () 779 (defun ,fun ()
779 ,(concat line1 "\nWrapper function that switches to a *cvs* buffer 780 ,(concat line1 "\nWrapper function that switches to a *cvs* buffer
780before calling the real function `" (symbol-name fun-1) "'.\n") 781before calling the real function `" (symbol-name fun-1) "'.\n")
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index f6ef6f1e810..aa0fd0c1378 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -436,8 +436,7 @@ ZERO are not used, but are required by the caller."
436If the GUD BUFFER is not running a supported debugger, then turn 436If the GUD BUFFER is not running a supported debugger, then turn
437off the specialized speedbar mode. BUFFER is not used, but are 437off the specialized speedbar mode. BUFFER is not used, but are
438required by the caller." 438required by the caller."
439 (when (and (boundp 'gud-comint-buffer) 439 (when (and gud-comint-buffer
440 gud-comint-buffer
441 ;; gud-comint-buffer might be killed 440 ;; gud-comint-buffer might be killed
442 (buffer-name gud-comint-buffer)) 441 (buffer-name gud-comint-buffer))
443 (let* ((minor-mode (with-current-buffer buffer gud-minor-mode)) 442 (let* ((minor-mode (with-current-buffer buffer gud-minor-mode))
@@ -661,6 +660,11 @@ The directory containing FILE becomes the initial working directory
661and source-file directory for your debugger." 660and source-file directory for your debugger."
662 (interactive (list (gud-query-cmdline 'gdb))) 661 (interactive (list (gud-query-cmdline 'gdb)))
663 662
663 (if (and gud-comint-buffer
664 (buffer-name gud-comint-buffer)
665 (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)))
666 (error "Multiple debugging is only supported with \"gdb --fullname\""))
667
664 (gud-common-init command-line nil 'gud-gdb-marker-filter) 668 (gud-common-init command-line nil 'gud-gdb-marker-filter)
665 (set (make-local-variable 'gud-minor-mode) 'gdb) 669 (set (make-local-variable 'gud-minor-mode) 'gdb)
666 670
@@ -3217,10 +3221,50 @@ Treats actions as defuns."
3217;;; tooltips for GUD 3221;;; tooltips for GUD
3218 3222
3219;;; Customizable settings 3223;;; Customizable settings
3224
3225;;;###autoload
3226(define-minor-mode gud-tooltip-mode
3227 "Toggle the display of GUD tooltips."
3228 :global t
3229 :group 'gud
3230 :group 'tooltip
3231 (require 'tooltip)
3232 (if gud-tooltip-mode
3233 (progn
3234 (add-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode)
3235 (add-hook 'pre-command-hook 'tooltip-hide)
3236 (add-hook 'tooltip-hook 'gud-tooltip-tips)
3237 (define-key global-map [mouse-movement] 'gud-tooltip-mouse-motion))
3238 (unless tooltip-mode (remove-hook 'pre-command-hook 'tooltip-hide)
3239 (remove-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode)
3240 (remove-hook 'tooltip-hook 'gud-tooltip-tips)
3241 (define-key global-map [mouse-movement] 'ignore)))
3242 (gud-tooltip-activate-mouse-motions-if-enabled)
3243 (if (and
3244 gud-comint-buffer
3245 (buffer-name gud-comint-buffer); gud-comint-buffer might be killed
3246 (with-current-buffer gud-comint-buffer
3247 (memq gud-minor-mode '(gdbmi gdba))))
3248 (if gud-tooltip-mode
3249 (progn
3250 (dolist (buffer (buffer-list))
3251 (unless (eq buffer gud-comint-buffer)
3252 (with-current-buffer buffer
3253 (when (and (memq gud-minor-mode '(gdbmi gdba))
3254 (not (string-match "\\`\\*.+\\*\\'"
3255 (buffer-name))))
3256 (make-local-variable 'gdb-define-alist)
3257 (gdb-create-define-alist)
3258 (add-hook 'after-save-hook
3259 'gdb-create-define-alist nil t))))))
3260 (kill-local-variable 'gdb-define-alist)
3261 (remove-hook 'after-save-hook 'gdb-create-define-alist t))))
3262
3220(defcustom gud-tooltip-modes '(gud-mode c-mode c++-mode fortran-mode) 3263(defcustom gud-tooltip-modes '(gud-mode c-mode c++-mode fortran-mode)
3221 "List of modes for which to enable GUD tips." 3264 "List of modes for which to enable GUD tooltips."
3222 :type 'sexp 3265 :type 'sexp
3223 :tag "GUD modes" 3266 :tag "GUD modes"
3267 :group 'gud
3224 :group 'tooltip) 3268 :group 'tooltip)
3225 3269
3226(defcustom gud-tooltip-display 3270(defcustom gud-tooltip-display
@@ -3232,12 +3276,13 @@ Forms in the list are combined with AND. The default is to display
3232only tooltips in the buffer containing the overlay arrow." 3276only tooltips in the buffer containing the overlay arrow."
3233 :type 'sexp 3277 :type 'sexp
3234 :tag "GUD buffers predicate" 3278 :tag "GUD buffers predicate"
3279 :group 'gud
3235 :group 'tooltip) 3280 :group 'tooltip)
3236 3281
3237(defcustom gud-tooltip-echo-area nil 3282(defcustom gud-tooltip-echo-area nil
3238 "Use the echo area instead of frames for GUD tooltips." 3283 "Use the echo area instead of frames for GUD tooltips."
3239 :type 'boolean 3284 :type 'boolean
3240 :tag "Use echo area" 3285 :group 'gud
3241 :group 'tooltip) 3286 :group 'tooltip)
3242 3287
3243(define-obsolete-variable-alias 'tooltip-gud-modes 3288(define-obsolete-variable-alias 'tooltip-gud-modes
@@ -3311,43 +3356,6 @@ This event can be examined by forms in GUD-TOOLTIP-DISPLAY.")
3311(define-obsolete-function-alias 'tooltip-gud-toggle-dereference 3356(define-obsolete-function-alias 'tooltip-gud-toggle-dereference
3312 'toggle-gud-tooltip-dereference "22.1") 3357 'toggle-gud-tooltip-dereference "22.1")
3313 3358
3314;;;###autoload
3315(define-minor-mode gud-tooltip-mode
3316 "Toggle the display of GUD tooltips."
3317 :global t
3318 :group 'gud
3319 (require 'tooltip)
3320 (if gud-tooltip-mode
3321 (progn
3322 (add-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode)
3323 (add-hook 'pre-command-hook 'tooltip-hide)
3324 (add-hook 'tooltip-hook 'gud-tooltip-tips)
3325 (define-key global-map [mouse-movement] 'gud-tooltip-mouse-motion))
3326 (unless tooltip-mode (remove-hook 'pre-command-hook 'tooltip-hide)
3327 (remove-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode)
3328 (remove-hook 'tooltip-hook 'gud-tooltip-tips)
3329 (define-key global-map [mouse-movement] 'ignore)))
3330 (gud-tooltip-activate-mouse-motions-if-enabled)
3331 (if (and
3332 gud-comint-buffer
3333 (buffer-name gud-comint-buffer); gud-comint-buffer might be kille
3334 (with-current-buffer gud-comint-buffer
3335 (memq gud-minor-mode '(gdbmi gdba))))
3336 (if gud-tooltip-mode
3337 (progn
3338 (dolist (buffer (buffer-list))
3339 (unless (eq buffer gud-comint-buffer)
3340 (with-current-buffer buffer
3341 (when (and (memq gud-minor-mode '(gdbmi gdba))
3342 (not (string-match "\\`\\*.+\\*\\'"
3343 (buffer-name))))
3344 (make-local-variable 'gdb-define-alist)
3345 (gdb-create-define-alist)
3346 (add-hook 'after-save-hook
3347 'gdb-create-define-alist nil t))))))
3348 (kill-local-variable 'gdb-define-alist)
3349 (remove-hook 'after-save-hook 'gdb-create-define-alist t))))
3350
3351; This will only display data that comes in one chunk. 3359; This will only display data that comes in one chunk.
3352; Larger arrays (say 400 elements) are displayed in 3360; Larger arrays (say 400 elements) are displayed in
3353; the tooltip incompletely and spill over into the gud buffer. 3361; the tooltip incompletely and spill over into the gud buffer.
@@ -3384,9 +3392,8 @@ This function must return nil if it doesn't handle EVENT."
3384 (let (process) 3392 (let (process)
3385 (when (and (eventp event) 3393 (when (and (eventp event)
3386 gud-tooltip-mode 3394 gud-tooltip-mode
3387 (boundp 'gud-comint-buffer)
3388 gud-comint-buffer 3395 gud-comint-buffer
3389 (buffer-name gud-comint-buffer); gud-comint-buffer might be killed 3396 (buffer-name gud-comint-buffer); might be killed
3390 (setq process (get-buffer-process gud-comint-buffer)) 3397 (setq process (get-buffer-process gud-comint-buffer))
3391 (posn-point (event-end event)) 3398 (posn-point (event-end event))
3392 (or (and (eq gud-minor-mode 'gdba) (not gdb-active-process)) 3399 (or (and (eq gud-minor-mode 'gdba) (not gdb-active-process))
diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el
index 0cda438fa6a..56dac972472 100644
--- a/lisp/progmodes/octave-mod.el
+++ b/lisp/progmodes/octave-mod.el
@@ -1311,7 +1311,8 @@ Maybe expand abbrevs and blink matching block open keywords.
1311Reindent the line of `octave-auto-indent' is non-nil." 1311Reindent the line of `octave-auto-indent' is non-nil."
1312 (interactive) 1312 (interactive)
1313 (setq last-command-char ? ) 1313 (setq last-command-char ? )
1314 (if (not (octave-not-in-string-or-comment-p)) 1314 (if (and octave-auto-indent
1315 (not (octave-not-in-string-or-comment-p)))
1315 (progn 1316 (progn
1316 (indent-according-to-mode) 1317 (indent-according-to-mode)
1317 (self-insert-command 1)) 1318 (self-insert-command 1))
diff --git a/lisp/recentf.el b/lisp/recentf.el
index 287ab3014cb..d92bc92f6ee 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -46,9 +46,9 @@
46(defvar recentf-list nil 46(defvar recentf-list nil
47 "List of recently opened files.") 47 "List of recently opened files.")
48 48
49(defvar recentf-data-cache nil 49(defsubst recentf-enabled-p ()
50 "Cache of data used to build the recentf menu. 50 "Return non-nil if recentf mode is currently enabled."
51The menu is rebuilt when this data has changed.") 51 (memq 'recentf-save-list kill-emacs-hook))
52 52
53;;; Customization 53;;; Customization
54;; 54;;
@@ -111,10 +111,13 @@ remote access."
111(defun recentf-menu-customization-changed (variable value) 111(defun recentf-menu-customization-changed (variable value)
112 "Function called when the recentf menu customization has changed. 112 "Function called when the recentf menu customization has changed.
113Set VARIABLE with VALUE, and force a rebuild of the recentf menu." 113Set VARIABLE with VALUE, and force a rebuild of the recentf menu."
114 (when (featurep 'recentf) 114 (if (and (featurep 'recentf) (recentf-enabled-p))
115 ;; Unavailable until recentf has been loaded. 115 (progn
116 (recentf-clear-data)) 116 ;; Unavailable until recentf has been loaded.
117 (set-default variable value)) 117 (recentf-hide-menu)
118 (set-default variable value)
119 (recentf-show-menu))
120 (set-default variable value)))
118 121
119(defcustom recentf-menu-title "Open Recent" 122(defcustom recentf-menu-title "Open Recent"
120 "*Name of the recentf menu." 123 "*Name of the recentf menu."
@@ -142,14 +145,12 @@ If nil add it at end of menu (see also `easy-menu-add-item')."
142 "*Function to invoke with a filename item of the recentf menu. 145 "*Function to invoke with a filename item of the recentf menu.
143The default is to call `find-file' to edit the selected file." 146The default is to call `find-file' to edit the selected file."
144 :group 'recentf 147 :group 'recentf
145 :type 'function 148 :type 'function)
146 :set 'recentf-menu-customization-changed)
147 149
148(defcustom recentf-max-menu-items 10 150(defcustom recentf-max-menu-items 10
149 "*Maximum number of items in the recentf menu." 151 "*Maximum number of items in the recentf menu."
150 :group 'recentf 152 :group 'recentf
151 :type 'integer 153 :type 'integer)
152 :set 'recentf-menu-customization-changed)
153 154
154(defcustom recentf-menu-filter nil 155(defcustom recentf-menu-filter nil
155 "*Function used to filter files displayed in the recentf menu. 156 "*Function used to filter files displayed in the recentf menu.
@@ -182,7 +183,7 @@ A nil value means no filter. The following functions are predefined:
182- `recentf-arrange-by-dir' 183- `recentf-arrange-by-dir'
183 Show a sub-menu for each directory. 184 Show a sub-menu for each directory.
184- `recentf-filter-changer' 185- `recentf-filter-changer'
185 Manage a ring of filters. 186 Manage a menu of filters.
186 187
187The filter function is called with one argument, the list of menu 188The filter function is called with one argument, the list of menu
188elements used to build the menu and must return a new list of menu 189elements used to build the menu and must return a new list of menu
@@ -203,21 +204,18 @@ elements (see `recentf-make-menu-element' for menu element form)."
203 (function-item recentf-arrange-by-mode) 204 (function-item recentf-arrange-by-mode)
204 (function-item recentf-arrange-by-dir) 205 (function-item recentf-arrange-by-dir)
205 (function-item recentf-filter-changer) 206 (function-item recentf-filter-changer)
206 function) 207 function))
207 :set 'recentf-menu-customization-changed)
208 208
209(defcustom recentf-menu-open-all-flag nil 209(defcustom recentf-menu-open-all-flag nil
210 "*Non-nil means to show an \"All...\" item in the menu. 210 "*Non-nil means to show an \"All...\" item in the menu.
211This item will replace the \"More...\" item." 211This item will replace the \"More...\" item."
212 :group 'recentf 212 :group 'recentf
213 :type 'boolean 213 :type 'boolean)
214 :set 'recentf-menu-customization-changed)
215 214
216(defcustom recentf-menu-append-commands-flag t 215(defcustom recentf-menu-append-commands-flag t
217 "*Non-nil means to append command items to the menu." 216 "*Non-nil means to append command items to the menu."
218 :group 'recentf 217 :group 'recentf
219 :type 'boolean 218 :type 'boolean)
220 :set 'recentf-menu-customization-changed)
221 219
222(define-obsolete-variable-alias 'recentf-menu-append-commands-p 220(define-obsolete-variable-alias 'recentf-menu-append-commands-p
223 'recentf-menu-append-commands-flag 221 'recentf-menu-append-commands-flag
@@ -331,7 +329,7 @@ specifies a maximum number of elements to insert. By default insert
331the full list." 329the full list."
332 (let ((value (symbol-value variable))) 330 (let ((value (symbol-value variable)))
333 (if (atom value) 331 (if (atom value)
334 (insert (format "\n(setq %S %S)\n" variable value)) 332 (insert (format "\n(setq %S '%S)\n" variable value))
335 (when (and (integerp limit) (> limit 0)) 333 (when (and (integerp limit) (> limit 0))
336 (setq value (recentf-trunc-list value limit))) 334 (setq value (recentf-trunc-list value limit)))
337 (insert (format "\n(setq %S\n '(" variable)) 335 (insert (format "\n(setq %S\n '(" variable))
@@ -576,35 +574,40 @@ menu-elements (no sub-menu)."
576;; Count the number of assigned menu shortcuts. 574;; Count the number of assigned menu shortcuts.
577(defvar recentf-menu-shortcuts) 575(defvar recentf-menu-shortcuts)
578 576
579(defun recentf-make-menu-items () 577(defun recentf-make-menu-items (&optional menu)
580 "Make menu items from the recent list." 578 "Make menu items from the recent list.
579This is a menu filter function which ignores the MENU argument."
581 (setq recentf-menu-filter-commands nil) 580 (setq recentf-menu-filter-commands nil)
582 (let* ((recentf-menu-shortcuts 0) 581 (let* ((recentf-menu-shortcuts 0)
583 (file-items 582 (file-items
584 (mapcar 'recentf-make-menu-item 583 (condition-case err
585 (recentf-apply-menu-filter 584 (mapcar 'recentf-make-menu-item
586 recentf-menu-filter 585 (recentf-apply-menu-filter
587 (recentf-menu-elements recentf-max-menu-items))))) 586 recentf-menu-filter
588 (append (or file-items (list ["No files" t 587 (recentf-menu-elements recentf-max-menu-items)))
589 :help "No recent file to open" 588 (error
590 :active nil])) 589 (message "recentf update menu failed: %s"
591 (if recentf-menu-open-all-flag 590 (error-message-string err))))))
592 (list ["All..." recentf-open-files 591 (append
593 :help "Open recent files through a dialog" 592 (or file-items
594 :active t]) 593 '(["No files" t
595 (and (< recentf-max-menu-items (length recentf-list)) 594 :help "No recent file to open"
596 (list ["More..." recentf-open-more-files 595 :active nil]))
597 :help "Open files not in the menu through a dialog" 596 (if recentf-menu-open-all-flag
598 :active t]))) 597 '(["All..." recentf-open-files
599 (and recentf-menu-filter-commands 598 :help "Open recent files through a dialog"
600 (cons "---" 599 :active t])
601 recentf-menu-filter-commands)) 600 (and (< recentf-max-menu-items (length recentf-list))
602 (and recentf-menu-append-commands-flag 601 '(["More..." recentf-open-more-files
603 (cons "---" 602 :help "Open files not in the menu through a dialog"
604 recentf-menu-items-for-commands))))) 603 :active t])))
604 (and recentf-menu-filter-commands '("---"))
605 recentf-menu-filter-commands
606 (and recentf-menu-items-for-commands '("---"))
607 recentf-menu-items-for-commands)))
605 608
606(defun recentf-menu-value-shortcut (name) 609(defun recentf-menu-value-shortcut (name)
607 "Return a shorcut digit for file NAME. 610 "Return a shortcut digit for file NAME.
608Return nil if file NAME is not one of the ten more recent." 611Return nil if file NAME is not one of the ten more recent."
609 (let ((i 0) k) 612 (let ((i 0) k)
610 (while (and (not k) (< i 10)) 613 (while (and (not k) (< i 10))
@@ -639,12 +642,17 @@ Return nil if file NAME is not one of the ten more recent."
639 "Return the keymap of the global menu bar." 642 "Return the keymap of the global menu bar."
640 (lookup-key global-map [menu-bar])) 643 (lookup-key global-map [menu-bar]))
641 644
642(defun recentf-clear-data () 645(defun recentf-show-menu ()
643 "Clear data used to build the recentf menu. 646 "Show the menu of recently opened files."
644This forces a rebuild of the menu." 647 (easy-menu-add-item
645 (easy-menu-remove-item (recentf-menu-bar) 648 (recentf-menu-bar) recentf-menu-path
646 recentf-menu-path recentf-menu-title) 649 (list recentf-menu-title :filter 'recentf-make-menu-items)
647 (setq recentf-data-cache nil)) 650 recentf-menu-before))
651
652(defun recentf-hide-menu ()
653 "Hide the menu of recently opened files."
654 (easy-menu-remove-item (recentf-menu-bar) recentf-menu-path
655 recentf-menu-title))
648 656
649;;; Predefined menu filters 657;;; Predefined menu filters
650;; 658;;
@@ -750,19 +758,24 @@ Filenames are relative to the `default-directory'."
750;; 758;;
751(defcustom recentf-arrange-rules 759(defcustom recentf-arrange-rules
752 '( 760 '(
753 ("Elisp files (%d)" ".\\.el$") 761 ("Elisp files (%d)" ".\\.el\\'")
754 ("Java files (%d)" ".\\.java$") 762 ("Java files (%d)" ".\\.java\\'")
755 ("C/C++ files (%d)" "c\\(pp\\)?$") 763 ("C/C++ files (%d)" "c\\(pp\\)?\\'")
756 ) 764 )
757 "*List of rules used by `recentf-arrange-by-rule' to build sub-menus. 765 "*List of rules used by `recentf-arrange-by-rule' to build sub-menus.
758A rule is a pair (SUB-MENU-TITLE . MATCHER). SUB-MENU-TITLE is the 766A rule is a pair (SUB-MENU-TITLE . MATCHER). SUB-MENU-TITLE is the
759displayed title of the sub-menu where a '%d' `format' pattern is 767displayed title of the sub-menu where a '%d' `format' pattern is
760replaced by the number of items in the sub-menu. MATCHER is a regexp 768replaced by the number of items in the sub-menu. MATCHER is a regexp
761or a list of regexps. Items matching one of the regular expressions in 769or a list of regexps. Items matching one of the regular expressions in
762MATCHER are added to the corresponding sub-menu." 770MATCHER are added to the corresponding sub-menu.
771SUB-MENU-TITLE can be a function. It is passed every items that
772matched the corresponding MATCHER, and it must return a
773pair (SUB-MENU-TITLE . ITEM). SUB-MENU-TITLE is a computed sub-menu
774title that can be another function. ITEM is the received item which
775may have been modified to match another rule."
763 :group 'recentf-filters 776 :group 'recentf-filters
764 :type '(repeat (cons string (repeat regexp))) 777 :type '(repeat (cons (choice string function)
765 :set 'recentf-menu-customization-changed) 778 (repeat regexp))))
766 779
767(defcustom recentf-arrange-by-rule-others "Other files (%d)" 780(defcustom recentf-arrange-by-rule-others "Other files (%d)"
768 "*Title of the `recentf-arrange-by-rule' sub-menu. 781 "*Title of the `recentf-arrange-by-rule' sub-menu.
@@ -772,8 +785,7 @@ displayed in the main recent files menu. A '%d' `format' pattern in
772the title is replaced by the number of items in the sub-menu." 785the title is replaced by the number of items in the sub-menu."
773 :group 'recentf-filters 786 :group 'recentf-filters
774 :type '(choice (const :tag "Main menu" nil) 787 :type '(choice (const :tag "Main menu" nil)
775 (string :tag "Title")) 788 (string :tag "Title")))
776 :set 'recentf-menu-customization-changed)
777 789
778(defcustom recentf-arrange-by-rules-min-items 0 790(defcustom recentf-arrange-by-rules-min-items 0
779 "*Minimum number of items in a `recentf-arrange-by-rule' sub-menu. 791 "*Minimum number of items in a `recentf-arrange-by-rule' sub-menu.
@@ -782,8 +794,7 @@ corresponding sub-menu items are displayed in the main recent files
782menu or in the `recentf-arrange-by-rule-others' sub-menu if 794menu or in the `recentf-arrange-by-rule-others' sub-menu if
783defined." 795defined."
784 :group 'recentf-filters 796 :group 'recentf-filters
785 :type 'number 797 :type 'number)
786 :set 'recentf-menu-customization-changed)
787 798
788(defcustom recentf-arrange-by-rule-subfilter nil 799(defcustom recentf-arrange-by-rule-subfilter nil
789 "*Function called by a rule based filter to filter sub-menu elements. 800 "*Function called by a rule based filter to filter sub-menu elements.
@@ -796,81 +807,82 @@ You can't use another rule based filter here."
796 recentf-arrange-by-mode 807 recentf-arrange-by-mode
797 recentf-arrange-by-dir)) 808 recentf-arrange-by-dir))
798 (error "Recursive use of a rule based filter")) 809 (error "Recursive use of a rule based filter"))
799 (recentf-menu-customization-changed variable value))) 810 (set-default variable value)))
800 811
801(defun recentf-match-rule-p (matcher filename) 812(defun recentf-match-rule (file)
802 "Return non-nil if the rule specified by MATCHER match FILENAME. 813 "Return the rule that match FILE."
803See `recentf-arrange-rules' for details on MATCHER." 814 (let ((rules recentf-arrange-rules)
804 (if (stringp matcher) 815 match found)
805 (string-match matcher filename) 816 (while (and (not found) rules)
806 (while (and (consp matcher) 817 (setq match (cdar rules))
807 (not (string-match (car matcher) filename))) 818 (when (stringp match)
808 (setq matcher (cdr matcher))) 819 (setq match (list match)))
809 matcher)) 820 (while (and match (not (string-match (car match) file)))
821 (setq match (cdr match)))
822 (if match
823 (setq found (cons (caar rules) file))
824 (setq rules (cdr rules))))
825 found))
810 826
811(defun recentf-arrange-by-rule (l) 827(defun recentf-arrange-by-rule (l)
812 "Filter the list of menu-elements L. 828 "Filter the list of menu-elements L.
813Arrange them in sub-menus following rules in `recentf-arrange-rules'." 829Arrange them in sub-menus following rules in `recentf-arrange-rules'."
814 (if (not recentf-arrange-rules) 830 (when recentf-arrange-rules
815 l 831 (let (menus others menu file min count)
816 (let* ((strip (assq t recentf-arrange-rules))
817 (rules (remq strip recentf-arrange-rules))
818 (menus (mapcar #'(lambda (r) (list (car r))) rules))
819 others l1 l2 menu file min count)
820 ;; Put menu items into sub-menus as defined by rules. 832 ;; Put menu items into sub-menus as defined by rules.
821 (dolist (elt l) 833 (dolist (elt l)
822 (setq l1 menus ;; List of sub-menus 834 (setq file (recentf-menu-element-value elt)
823 l2 rules ;; List of corresponding matchers. 835 menu (recentf-match-rule file))
824 file (recentf-menu-element-value elt) 836 (while (functionp (car menu))
825 menu nil) 837 (setq menu (funcall (car menu) (cdr menu))))
826 ;; Apply the strip suffix rule. 838 (if (not (stringp (car menu)))
827 (while (recentf-match-rule-p (cdr strip) file) 839 (push elt others)
828 (setq file (substring file 0 (match-beginning 0)))) 840 (setq menu (or (assoc (car menu) menus)
829 ;; Search which sub-menu to put the menu item into. 841 (car (push (list (car menu)) menus))))
830 (while (and (not menu) l2) 842 (recentf-set-menu-element-value
831 (when (recentf-match-rule-p (cdar l2) file) 843 menu (cons elt (recentf-menu-element-value menu)))))
832 (setq menu (car l1)) 844 ;; Finalize each sub-menu:
833 (recentf-set-menu-element-value
834 menu (cons elt (recentf-menu-element-value menu))))
835 (setq l1 (cdr l1)
836 l2 (cdr l2)))
837 ;; Put unmatched menu items in the `others' bin.
838 (or menu (push elt others)))
839 ;; Finalize the sub-menus. That is, for each one:
840 ;; - truncate it depending on the value of 845 ;; - truncate it depending on the value of
841 ;; `recentf-arrange-by-rules-min-items', 846 ;; `recentf-arrange-by-rules-min-items',
842 ;; - replace %d by the number of menu items, 847 ;; - replace %d by the number of menu items,
843 ;; - apply `recentf-arrange-by-rule-subfilter' to menu items. 848 ;; - apply `recentf-arrange-by-rule-subfilter' to menu items.
844 (setq min (if (natnump recentf-arrange-by-rules-min-items) 849 (setq min (if (natnump recentf-arrange-by-rules-min-items)
845 recentf-arrange-by-rules-min-items 0) 850 recentf-arrange-by-rules-min-items 0)
846 l2 nil) 851 l nil)
847 (dolist (menu menus) 852 (dolist (elt menus)
848 (when (setq l1 (recentf-menu-element-value menu)) 853 (setq menu (recentf-menu-element-value elt)
849 (setq count (length l1)) 854 count (length menu))
850 (if (< count min) 855 (if (< count min)
851 (setq others (nconc l1 others)) 856 (setq others (nconc menu others))
852 (recentf-set-menu-element-item 857 (recentf-set-menu-element-item
853 menu (format (recentf-menu-element-item menu) count)) 858 elt (format (recentf-menu-element-item elt) count))
854 (recentf-set-menu-element-value 859 (recentf-set-menu-element-value
855 menu (recentf-apply-menu-filter 860 elt (recentf-apply-menu-filter
856 recentf-arrange-by-rule-subfilter (nreverse l1))) 861 recentf-arrange-by-rule-subfilter (nreverse menu)))
857 (push menu l2)))) 862 (push elt l)))
858 ;; Add the menu items remaining in the `others' bin. 863 ;; Add the menu items remaining in the `others' bin.
859 (if (and (stringp recentf-arrange-by-rule-others) others) 864 (when (setq others (nreverse others))
860 (nreverse 865 (setq l (nconc
861 (cons 866 l
862 (recentf-make-menu-element 867 ;; Put items in an sub menu.
863 (format recentf-arrange-by-rule-others (length others)) 868 (if (stringp recentf-arrange-by-rule-others)
864 (recentf-apply-menu-filter 869 (list
865 recentf-arrange-by-rule-subfilter (nreverse others))) 870 (recentf-make-menu-element
866 l2)) 871 (format recentf-arrange-by-rule-others
867 (nconc 872 (length others))
868 (nreverse l2) 873 (recentf-apply-menu-filter
869 (recentf-apply-menu-filter 874 recentf-arrange-by-rule-subfilter others)))
870 recentf-arrange-by-rule-subfilter (nreverse others))))))) 875 ;; Append items to the main menu.
876 (recentf-apply-menu-filter
877 recentf-arrange-by-rule-subfilter others)))))))
878 l)
871 879
872;;; Predefined rule based menu filters 880;;; Predefined rule based menu filters
873;; 881;;
882(defun recentf-indirect-mode-rule (file)
883 "Apply a second level `auto-mode-alist' regexp to FILE."
884 (recentf-match-rule (substring file 0 (match-beginning 0))))
885
874(defun recentf-build-mode-rules () 886(defun recentf-build-mode-rules ()
875 "Convert `auto-mode-alist' to menu filter rules. 887 "Convert `auto-mode-alist' to menu filter rules.
876Rules obey `recentf-arrange-rules' format." 888Rules obey `recentf-arrange-rules' format."
@@ -886,7 +898,7 @@ Rules obey `recentf-arrange-rules' format."
886 ;; ignored by the menu filter. So in some corner cases a 898 ;; ignored by the menu filter. So in some corner cases a
887 ;; wrong mode could be guessed. 899 ;; wrong mode could be guessed.
888 ((and (consp mode) (cadr mode)) 900 ((and (consp mode) (cadr mode))
889 (setq rule-name t)) 901 (setq rule-name 'recentf-indirect-mode-rule))
890 ((and mode (symbolp mode)) 902 ((and mode (symbolp mode))
891 (setq rule-name (symbol-name mode)) 903 (setq rule-name (symbol-name mode))
892 (if (string-match "\\(.*\\)-mode$" rule-name) 904 (if (string-match "\\(.*\\)-mode$" rule-name)
@@ -906,21 +918,6 @@ Rules obey `recentf-arrange-rules' format."
906 (recentf-arrange-by-rule-others "others (%d)")) 918 (recentf-arrange-by-rule-others "others (%d)"))
907 (recentf-arrange-by-rule l))) 919 (recentf-arrange-by-rule l)))
908 920
909(defun recentf-build-dir-rules (l)
910 "Convert directories in menu-elements L to menu filter rules.
911Rules obey `recentf-arrange-rules' format."
912 (let (dirs)
913 (mapcar #'(lambda (e)
914 (let ((dir (file-name-directory
915 (recentf-menu-element-value e))))
916 (or (recentf-string-member dir dirs)
917 (push dir dirs))))
918 l)
919 (mapcar #'(lambda (d)
920 (cons (concat d " (%d)")
921 (concat "\\`" d)))
922 (nreverse (sort dirs 'recentf-string-lessp)))))
923
924(defun recentf-file-name-nondir (l) 921(defun recentf-file-name-nondir (l)
925 "Filter the list of menu-elements L to show filenames sans directory. 922 "Filter the list of menu-elements L to show filenames sans directory.
926This simplified version of `recentf-show-basenames' does not handle 923This simplified version of `recentf-show-basenames' does not handle
@@ -932,23 +929,27 @@ duplicates. It is used by `recentf-arrange-by-dir' as its
932 (recentf-menu-element-value e))) 929 (recentf-menu-element-value e)))
933 l)) 930 l))
934 931
932(defun recentf-dir-rule (file)
933 "Return as a sub-menu, the directory FILE belongs to."
934 (cons (file-name-directory file) file))
935
935(defun recentf-arrange-by-dir (l) 936(defun recentf-arrange-by-dir (l)
936 "Split the list of menu-elements L into sub-menus by directory." 937 "Split the list of menu-elements L into sub-menus by directory."
937 (let ((recentf-arrange-rules (recentf-build-dir-rules l)) 938 (let ((recentf-arrange-rules '((recentf-dir-rule . ".*")))
938 (recentf-arrange-by-rule-subfilter 'recentf-file-name-nondir) 939 (recentf-arrange-by-rule-subfilter 'recentf-file-name-nondir)
939 recentf-arrange-by-rule-others) 940 recentf-arrange-by-rule-others)
940 (nreverse (recentf-arrange-by-rule l)))) 941 (recentf-arrange-by-rule l)))
941 942
942;;; Ring of menu filters 943;;; Menu of menu filters
943;; 944;;
944(defvar recentf-filter-changer-state nil 945(defvar recentf-filter-changer-current nil
945 "Used by `recentf-filter-changer' to hold its state.") 946 "Current filter used by `recentf-filter-changer'.")
946 947
947(defcustom recentf-filter-changer-alist 948(defcustom recentf-filter-changer-alist
948 '( 949 '(
949 (recentf-arrange-by-mode . "*Files by Mode*") 950 (recentf-arrange-by-mode . "Grouped by Mode")
950 (recentf-arrange-by-dir . "*Files by Directory*") 951 (recentf-arrange-by-dir . "Grouped by Directory")
951 (recentf-arrange-by-rule . "*Files by User Rule*") 952 (recentf-arrange-by-rule . "Grouped by Custom Rules")
952 ) 953 )
953 "*List of filters managed by `recentf-filter-changer'. 954 "*List of filters managed by `recentf-filter-changer'.
954Each filter is defined by a pair (FUNCTION . LABEL), where FUNCTION is 955Each filter is defined by a pair (FUNCTION . LABEL), where FUNCTION is
@@ -957,50 +958,38 @@ that filter."
957 :group 'recentf-filters 958 :group 'recentf-filters
958 :type '(repeat (cons function string)) 959 :type '(repeat (cons function string))
959 :set (lambda (variable value) 960 :set (lambda (variable value)
960 (setq recentf-filter-changer-state nil) 961 (setq recentf-filter-changer-current nil)
961 (recentf-menu-customization-changed variable value))) 962 (set-default variable value)))
962
963(defun recentf-filter-changer-goto-next ()
964 "Go to the next filter available.
965See `recentf-filter-changer'."
966 (setq recentf-filter-changer-state (cdr recentf-filter-changer-state))
967 (recentf-clear-data))
968 963
969(defsubst recentf-filter-changer-get-current () 964(defun recentf-filter-changer-select (filter)
970 "Get the current filter available. 965 "Select FILTER as the current menu filter.
971See `recentf-filter-changer'." 966See `recentf-filter-changer'."
972 (unless recentf-filter-changer-state 967 (setq recentf-filter-changer-current filter))
973 (setq recentf-filter-changer-state recentf-filter-changer-alist))
974 (car recentf-filter-changer-state))
975
976(defsubst recentf-filter-changer-get-next ()
977 "Get the next filter available.
978See `recentf-filter-changer'."
979 ;; At this point the current filter is the first element of
980 ;; `recentf-filter-changer-state'.
981 (car (or (cdr recentf-filter-changer-state)
982 ;; There is no next element in
983 ;; `recentf-filter-changer-state', so loop back to the
984 ;; first element of `recentf-filter-changer-alist'.
985 recentf-filter-changer-alist)))
986 968
987(defun recentf-filter-changer (l) 969(defun recentf-filter-changer (l)
988 "Manage a ring of menu filters. 970 "Manage a sub-menu of menu filters.
989`recentf-filter-changer-alist' defines the filters in the ring. 971`recentf-filter-changer-alist' defines the filters in the menu.
990Filtering of L is delegated to the current filter in the ring. A 972Filtering of L is delegated to the selected filter in the menu."
991filter menu item is displayed allowing to dynamically activate the 973 (unless recentf-filter-changer-current
992next filter in the ring. If the filter ring is empty, L is left 974 (setq recentf-filter-changer-current
993unchanged." 975 (caar recentf-filter-changer-alist)))
994 (let ((filter (recentf-filter-changer-get-current))) 976 (if (not recentf-filter-changer-current)
995 (when filter 977 l
996 (setq l (recentf-apply-menu-filter (car filter) l) 978 (setq recentf-menu-filter-commands
997 filter (recentf-filter-changer-get-next)) 979 (list
998 (when filter 980 `("Show files"
999 (setq recentf-menu-filter-commands 981 ,@(mapcar
1000 (list (vector (cdr filter) 982 #'(lambda (f)
1001 '(recentf-filter-changer-goto-next) 983 `[,(cdr f)
1002 t))))) 984 (setq recentf-filter-changer-current ',(car f))
1003 l)) 985 ;;:active t
986 :style radio ;;radio Don't work with GTK :-(
987 :selected (eq recentf-filter-changer-current
988 ',(car f))
989 ;;:help ,(cdr f)
990 ])
991 recentf-filter-changer-alist))))
992 (recentf-apply-menu-filter recentf-filter-changer-current l)))
1004 993
1005;;; Hooks 994;;; Hooks
1006;; 995;;
@@ -1017,35 +1006,14 @@ That is, remove a non kept file from the recent list."
1017 (and buffer-file-name 1006 (and buffer-file-name
1018 (recentf-remove-if-non-kept buffer-file-name))) 1007 (recentf-remove-if-non-kept buffer-file-name)))
1019 1008
1020(defun recentf-update-menu ()
1021 "Update the recentf menu from the current recent list."
1022 (let ((cache (cons default-directory recentf-list)))
1023 ;; Does nothing, if nothing has changed.
1024 (unless (equal recentf-data-cache cache)
1025 (setq recentf-data-cache cache)
1026 (condition-case err
1027 (easy-menu-add-item
1028 (recentf-menu-bar) recentf-menu-path
1029 (easy-menu-create-menu recentf-menu-title
1030 (recentf-make-menu-items))
1031 recentf-menu-before)
1032 (error
1033 (message "recentf update menu failed: %s"
1034 (error-message-string err)))))))
1035
1036(defconst recentf-used-hooks 1009(defconst recentf-used-hooks
1037 '( 1010 '(
1038 (find-file-hook recentf-track-opened-file) 1011 (find-file-hook recentf-track-opened-file)
1039 (write-file-functions recentf-track-opened-file) 1012 (write-file-functions recentf-track-opened-file)
1040 (kill-buffer-hook recentf-track-closed-file) 1013 (kill-buffer-hook recentf-track-closed-file)
1041 (menu-bar-update-hook recentf-update-menu)
1042 (kill-emacs-hook recentf-save-list) 1014 (kill-emacs-hook recentf-save-list)
1043 ) 1015 )
1044 "Hooks used by recentf.") 1016 "Hooks used by recentf.")
1045
1046(defsubst recentf-enabled-p ()
1047 "Return non-nil if recentf mode is currently enabled."
1048 (memq 'recentf-update-menu menu-bar-update-hook))
1049 1017
1050;;; Commands 1018;;; Commands
1051;; 1019;;
@@ -1126,8 +1094,7 @@ IGNORE arguments."
1126 (setq recentf-list (delq e recentf-list) 1094 (setq recentf-list (delq e recentf-list)
1127 i (1+ i))) 1095 i (1+ i)))
1128 (kill-buffer (current-buffer)) 1096 (kill-buffer (current-buffer))
1129 (message "%S file(s) removed from the list" i) 1097 (message "%S file(s) removed from the list" i))
1130 (recentf-clear-data))
1131 (message "No file selected"))) 1098 (message "No file selected")))
1132 1099
1133(defun recentf-edit-list () 1100(defun recentf-edit-list ()
@@ -1292,7 +1259,7 @@ Write data into the file specified by `recentf-save-file'."
1292 (set-buffer-file-coding-system recentf-save-file-coding-system) 1259 (set-buffer-file-coding-system recentf-save-file-coding-system)
1293 (insert (format recentf-save-file-header (current-time-string))) 1260 (insert (format recentf-save-file-header (current-time-string)))
1294 (recentf-dump-variable 'recentf-list recentf-max-saved-items) 1261 (recentf-dump-variable 'recentf-list recentf-max-saved-items)
1295 (recentf-dump-variable 'recentf-filter-changer-state) 1262 (recentf-dump-variable 'recentf-filter-changer-current)
1296 (insert "\n \n;;; Local Variables:\n" 1263 (insert "\n \n;;; Local Variables:\n"
1297 (format ";;; coding: %s\n" recentf-save-file-coding-system) 1264 (format ";;; coding: %s\n" recentf-save-file-coding-system)
1298 ";;; End:\n") 1265 ";;; End:\n")
@@ -1354,10 +1321,12 @@ that were operated on recently.
1354 :keymap recentf-mode-map 1321 :keymap recentf-mode-map
1355 (unless (and recentf-mode (recentf-enabled-p)) 1322 (unless (and recentf-mode (recentf-enabled-p))
1356 (if recentf-mode 1323 (if recentf-mode
1357 (recentf-load-list) 1324 (progn
1325 (recentf-load-list)
1326 (recentf-show-menu))
1327 (recentf-hide-menu)
1358 (recentf-save-list)) 1328 (recentf-save-list))
1359 (recentf-auto-cleanup) 1329 (recentf-auto-cleanup)
1360 (recentf-clear-data)
1361 (let ((hook-setup (if recentf-mode 'add-hook 'remove-hook))) 1330 (let ((hook-setup (if recentf-mode 'add-hook 'remove-hook)))
1362 (dolist (hook recentf-used-hooks) 1331 (dolist (hook recentf-used-hooks)
1363 (apply hook-setup hook))) 1332 (apply hook-setup hook)))
diff --git a/lisp/replace.el b/lisp/replace.el
index fbfa1be09c2..8229eda85a4 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1710,7 +1710,7 @@ make, or the user didn't cancel the call."
1710 (if replace-overlay 1710 (if replace-overlay
1711 (move-overlay replace-overlay match-beg match-end (current-buffer)) 1711 (move-overlay replace-overlay match-beg match-end (current-buffer))
1712 (setq replace-overlay (make-overlay match-beg match-end)) 1712 (setq replace-overlay (make-overlay match-beg match-end))
1713 (overlay-put replace-overlay 'priority 1) ;higher than lazy overlays 1713 (overlay-put replace-overlay 'priority 1001) ;higher than lazy overlays
1714 (overlay-put replace-overlay 'face 'query-replace))) 1714 (overlay-put replace-overlay 'face 'query-replace)))
1715 (if query-replace-lazy-highlight 1715 (if query-replace-lazy-highlight
1716 (let ((isearch-string string) 1716 (let ((isearch-string string)
diff --git a/lisp/simple.el b/lisp/simple.el
index 580b5fef38c..2b0645b5a6d 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2745,6 +2745,8 @@ and KILLP is t if a prefix arg was specified."
2745Case is ignored if `case-fold-search' is non-nil in the current buffer. 2745Case is ignored if `case-fold-search' is non-nil in the current buffer.
2746Goes backward if ARG is negative; error if CHAR not found." 2746Goes backward if ARG is negative; error if CHAR not found."
2747 (interactive "p\ncZap to char: ") 2747 (interactive "p\ncZap to char: ")
2748 (if (char-table-p translation-table-for-input)
2749 (setq char (or (aref translation-table-for-input char) char)))
2748 (kill-region (point) (progn 2750 (kill-region (point) (progn
2749 (search-forward (char-to-string char) nil nil arg) 2751 (search-forward (char-to-string char) nil nil arg)
2750; (goto-char (if (> arg 0) (1- (point)) (1+ (point)))) 2752; (goto-char (if (> arg 0) (1- (point)) (1+ (point))))
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index 66a633d6f36..c4ccc9588ed 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -76,10 +76,12 @@
76(require 'menu-bar) 76(require 'menu-bar)
77(require 'fontset) 77(require 'fontset)
78(require 'dnd) 78(require 'dnd)
79(eval-when-compile (require 'url))
79 80
80(defvar mac-charset-info-alist) 81(defvar mac-charset-info-alist)
81(defvar mac-services-selection) 82(defvar mac-services-selection)
82(defvar mac-system-script-code) 83(defvar mac-system-script-code)
84(defvar mac-apple-event-map)
83(defvar x-invocation-args) 85(defvar x-invocation-args)
84 86
85(defvar x-command-line-resources nil) 87(defvar x-command-line-resources nil)
@@ -1148,7 +1150,7 @@ correspoinding TextEncodingBase value."
1148 1150
1149(define-key special-event-map [language-change] 'mac-handle-language-change) 1151(define-key special-event-map [language-change] 'mac-handle-language-change)
1150 1152
1151;;;; Selections and Services menu 1153;;;; Selections
1152 1154
1153;; Setup to use the Mac clipboard. 1155;; Setup to use the Mac clipboard.
1154(set-selection-coding-system mac-system-coding-system) 1156(set-selection-coding-system mac-system-coding-system)
@@ -1386,6 +1388,157 @@ in `selection-converter-alist', which see."
1386 (public.file-url . mac-select-convert-to-file-url) 1388 (public.file-url . mac-select-convert-to-file-url)
1387 ) 1389 )
1388 selection-converter-alist)) 1390 selection-converter-alist))
1391
1392;;;; Apple events, HICommand events, and Services menu
1393
1394;;; Event classes
1395(put 'core-event 'mac-apple-event-class "aevt") ; kCoreEventClass
1396(put 'internet-event 'mac-apple-event-class "GURL") ; kAEInternetEventClass
1397
1398;;; Event IDs
1399;; kCoreEventClass
1400(put 'open-application 'mac-apple-event-id "oapp") ; kAEOpenApplication
1401(put 'reopen-application 'mac-apple-event-id "rapp") ; kAEReopenApplication
1402(put 'open-documents 'mac-apple-event-id "odoc") ; kAEOpenDocuments
1403(put 'print-documents 'mac-apple-event-id "pdoc") ; kAEPrintDocuments
1404(put 'open-contents 'mac-apple-event-id "ocon") ; kAEOpenContents
1405(put 'quit-application 'mac-apple-event-id "quit") ; kAEQuitApplication
1406(put 'application-died 'mac-apple-event-id "obit") ; kAEApplicationDied
1407(put 'show-preferences 'mac-apple-event-id "pref") ; kAEShowPreferences
1408(put 'autosave-now 'mac-apple-event-id "asav") ; kAEAutosaveNow
1409;; kAEInternetEventClass
1410(put 'get-url 'mac-apple-event-id "GURL") ; kAEGetURL
1411;; Converted HICommand events
1412(put 'about 'mac-apple-event-id "abou") ; kHICommandAbout
1413
1414(defmacro mac-event-spec (event)
1415 `(nth 1 ,event))
1416
1417(defmacro mac-event-ae (event)
1418 `(nth 2 ,event))
1419
1420(defun mac-ae-parameter (ae &optional keyword type)
1421 (or keyword (setq keyword "----")) ;; Direct object.
1422 (if (not (and (consp ae) (equal (car ae) "aevt")))
1423 (error "Not an Apple event: %S" ae)
1424 (let ((type-data (cdr (assoc keyword (cdr ae))))
1425 data)
1426 (when (and type type-data)
1427 (setq data (mac-coerce-ae-data (car type-data) (cdr type-data) type))
1428 (setq type-data (if data (cons type data) nil)))
1429 type-data)))
1430
1431(defun mac-ae-list (ae &optional keyword type)
1432 (or keyword (setq keyword "----")) ;; Direct object.
1433 (let ((desc (mac-ae-parameter ae keyword)))
1434 (cond ((null desc)
1435 nil)
1436 ((not (equal (car desc) "list"))
1437 (error "Parameter for \"%s\" is not a list" keyword))
1438 (t
1439 (if (null type)
1440 (cdr desc)
1441 (mapcar
1442 (lambda (type-data)
1443 (mac-coerce-ae-data (car type-data) (cdr type-data) type))
1444 (cdr desc)))))))
1445
1446(defun mac-bytes-to-integer (bytes &optional from to)
1447 (or from (setq from 0))
1448 (or to (setq to (length bytes)))
1449 (let* ((len (- to from))
1450 (extended-sign-len (- (1+ (ceiling (log most-positive-fixnum 2)))
1451 (* 8 len)))
1452 (result 0))
1453 (dotimes (i len)
1454 (setq result (logior (lsh result 8)
1455 (aref bytes (+ from (if (eq (byteorder) ?B) i
1456 (- len i 1)))))))
1457 (if (> extended-sign-len 0)
1458 (ash (lsh result extended-sign-len) (- extended-sign-len))
1459 result)))
1460
1461(defun mac-ae-selection-range (ae)
1462;; #pragma options align=mac68k
1463;; typedef struct SelectionRange {
1464;; short unused1; // 0 (not used)
1465;; short lineNum; // line to select (<0 to specify range)
1466;; long startRange; // start of selection range (if line < 0)
1467;; long endRange; // end of selection range (if line < 0)
1468;; long unused2; // 0 (not used)
1469;; long theDate; // modification date/time
1470;; } SelectionRange;
1471;; #pragma options align=reset
1472 (let ((range-bytes (cdr (mac-ae-parameter ae "kpos" "TEXT"))))
1473 (and range-bytes
1474 (list (mac-bytes-to-integer range-bytes 2 4)
1475 (mac-bytes-to-integer range-bytes 4 8)
1476 (mac-bytes-to-integer range-bytes 8 12)
1477 (mac-bytes-to-integer range-bytes 16 20)))))
1478
1479;; On Mac OS X 10.4 and later, the `open-document' event contains an
1480;; optional parameter keyAESearchText from the Spotlight search.
1481(defun mac-ae-text-for-search (ae)
1482 (let ((utf8-text (cdr (mac-ae-parameter ae "stxt" "utf8"))))
1483 (and utf8-text
1484 (decode-coding-string utf8-text 'utf-8))))
1485
1486(defun mac-ae-open-documents (event)
1487 (interactive "e")
1488 (let ((ae (mac-event-ae event)))
1489 (dolist (file-name (mac-ae-list ae nil 'undecoded-file-name))
1490 (if file-name
1491 (dnd-open-local-file (concat "file:" file-name) nil)))
1492 (let ((selection-range (mac-ae-selection-range ae))
1493 (search-text (mac-ae-text-for-search ae)))
1494 (cond (selection-range
1495 (let ((line (car selection-range))
1496 (start (cadr selection-range))
1497 (end (nth 2 selection-range)))
1498 (if (> line 0)
1499 (goto-line line)
1500 (if (and (> start 0) (> end 0))
1501 (progn (set-mark start)
1502 (goto-char end))))))
1503 ((stringp search-text)
1504 (re-search-forward
1505 (mapconcat 'regexp-quote (split-string search-text) "\\|")
1506 nil t)))))
1507 (raise-frame))
1508
1509(defun mac-ae-text (ae)
1510 (or (cdr (mac-ae-parameter ae nil "TEXT"))
1511 (error "No text in Apple event.")))
1512
1513(defun mac-ae-get-url (event)
1514 (interactive "e")
1515 (let* ((ae (mac-event-ae event))
1516 (parsed-url (url-generic-parse-url (mac-ae-text ae))))
1517 (if (string= (url-type parsed-url) "mailto")
1518 (url-mailto parsed-url)
1519 (error "Unsupported URL scheme: %s" (url-type parsed-url)))))
1520
1521(setq mac-apple-event-map (make-sparse-keymap))
1522
1523;; Received when Emacs is launched without associated documents.
1524;; Accept it as an Apple event, but no Emacs event is generated so as
1525;; not to erase the splash screen.
1526(define-key mac-apple-event-map [core-event open-application] 0)
1527
1528;; Received when a dock or application icon is clicked and Emacs is
1529;; already running. Simply ignored. Another idea is to make a new
1530;; frame if all frames are invisible.
1531(define-key mac-apple-event-map [core-event reopen-application] 'ignore)
1532
1533(define-key mac-apple-event-map [core-event open-documents]
1534 'mac-ae-open-documents)
1535(define-key mac-apple-event-map [core-event show-preferences] 'customize)
1536(define-key mac-apple-event-map [core-event quit-application]
1537 'save-buffers-kill-emacs)
1538
1539(define-key mac-apple-event-map [internet-event get-url] 'mac-ae-get-url)
1540
1541(define-key mac-apple-event-map [hicommand about] 'display-splash-screen)
1389 1542
1390(defun mac-services-open-file () 1543(defun mac-services-open-file ()
1391 (interactive) 1544 (interactive)
@@ -1420,21 +1573,35 @@ in `selection-converter-alist', which see."
1420 (substitute-command-keys 1573 (substitute-command-keys
1421 "The text from the Services menu can be accessed with \\[yank]"))))) 1574 "The text from the Services menu can be accessed with \\[yank]")))))
1422 1575
1423(defvar mac-application-menu-map (make-sparse-keymap)) 1576(define-key mac-apple-event-map [services paste] 'mac-services-insert-text)
1424(define-key mac-application-menu-map [quit] 'save-buffers-kill-emacs) 1577(define-key mac-apple-event-map [services perform open-file]
1425(define-key mac-application-menu-map [services perform open-file]
1426 'mac-services-open-file) 1578 'mac-services-open-file)
1427(define-key mac-application-menu-map [services perform open-selection] 1579(define-key mac-apple-event-map [services perform open-selection]
1428 'mac-services-open-selection) 1580 'mac-services-open-selection)
1429(define-key mac-application-menu-map [services perform mail-selection] 1581(define-key mac-apple-event-map [services perform mail-selection]
1430 'mac-services-mail-selection) 1582 'mac-services-mail-selection)
1431(define-key mac-application-menu-map [services perform mail-to] 1583(define-key mac-apple-event-map [services perform mail-to]
1432 'mac-services-mail-to) 1584 'mac-services-mail-to)
1433(define-key mac-application-menu-map [services paste] 1585
1434 'mac-services-insert-text) 1586(defun mac-dispatch-apple-event (event)
1435(define-key mac-application-menu-map [preferences] 'customize) 1587 (interactive "e")
1436(define-key mac-application-menu-map [about] 'display-splash-screen) 1588 (let* ((binding (lookup-key mac-apple-event-map (mac-event-spec event)))
1437(global-set-key [menu-bar application] mac-application-menu-map) 1589 (service-message
1590 (and (keymapp binding)
1591 (cdr (mac-ae-parameter (mac-event-ae event) "svmg")))))
1592 (when service-message
1593 (setq service-message
1594 (intern (decode-coding-string service-message 'utf-8)))
1595 (setq binding (lookup-key binding (vector service-message))))
1596 (call-interactively binding)))
1597
1598(global-set-key [mac-apple-event] 'mac-dispatch-apple-event)
1599
1600;; Processing of Apple events are deferred at the startup time. For
1601;; example, files dropped onto the Emacs application icon can only be
1602;; processed when the initial frame has been created: this is where
1603;; the files should be opened.
1604(add-hook 'after-init-hook 'mac-process-deferred-apple-events)
1438 1605
1439;;; Do the actual Windows setup here; the above code just defines 1606;;; Do the actual Windows setup here; the above code just defines
1440;;; functions and variables that we use now. 1607;;; functions and variables that we use now.
@@ -1855,31 +2022,12 @@ Switch to a buffer editing the last file dropped."
1855 (y (cdr coords))) 2022 (y (cdr coords)))
1856 (if (and (> x 0) (> y 0)) 2023 (if (and (> x 0) (> y 0))
1857 (set-frame-selected-window nil window)) 2024 (set-frame-selected-window nil window))
1858 (mapcar (lambda (file-name) 2025 (dolist (file-name (nth 2 event))
1859 (if (listp file-name) 2026 (dnd-handle-one-url window 'private
1860 (let ((line (car file-name)) 2027 (concat "file:" file-name))))
1861 (start (car (cdr file-name)))
1862 (end (car (cdr (cdr file-name)))))
1863 (if (> line 0)
1864 (goto-line line)
1865 (if (and (> start 0) (> end 0))
1866 (progn (set-mark start)
1867 (goto-char end)))))
1868 (dnd-handle-one-url window 'private
1869 (concat "file:" file-name))))
1870 (car (cdr (cdr event)))))
1871 (raise-frame)) 2028 (raise-frame))
1872 2029
1873(global-set-key [drag-n-drop] 'mac-drag-n-drop) 2030(global-set-key [drag-n-drop] 'mac-drag-n-drop)
1874
1875;; By checking whether the variable mac-ready-for-drag-n-drop has been
1876;; defined, the event loop in macterm.c can be informed that it can
1877;; now receive Finder drag and drop events. Files dropped onto the
1878;; Emacs application icon can only be processed when the initial frame
1879;; has been created: this is where the files should be opened.
1880(add-hook 'after-init-hook
1881 '(lambda ()
1882 (defvar mac-ready-for-drag-n-drop t)))
1883 2031
1884;;;; Non-toolkit Scroll bars 2032;;;; Non-toolkit Scroll bars
1885 2033
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 99bcc621765..9e81c224855 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2307,11 +2307,13 @@ otherwise it is displayed normally.
2307 2307
2308The variable `ispell-highlight-face' selects the face to use for highlighting." 2308The variable `ispell-highlight-face' selects the face to use for highlighting."
2309 (if highlight 2309 (if highlight
2310 (progn 2310 (if ispell-overlay
2311 (move-overlay ispell-overlay start end (current-buffer))
2311 (setq ispell-overlay (make-overlay start end)) 2312 (setq ispell-overlay (make-overlay start end))
2312 (overlay-put ispell-overlay 'priority 1) ;higher than lazy overlays 2313 (overlay-put ispell-overlay 'priority 1001) ;higher than lazy overlays
2313 (overlay-put ispell-overlay 'face ispell-highlight-face)) 2314 (overlay-put ispell-overlay 'face ispell-highlight-face))
2314 (delete-overlay ispell-overlay)) 2315 (if ispell-overlay
2316 (delete-overlay ispell-overlay)))
2315 (if (and ispell-lazy-highlight (boundp 'lazy-highlight-cleanup)) 2317 (if (and ispell-lazy-highlight (boundp 'lazy-highlight-cleanup))
2316 (if highlight 2318 (if highlight
2317 (let ((isearch-string 2319 (let ((isearch-string
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el
index 6d2db55654d..47d6464da19 100644
--- a/lisp/textmodes/org.el
+++ b/lisp/textmodes/org.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <dominik at science dot uva dot nl> 5;; Author: Carsten Dominik <dominik at science dot uva dot nl>
6;; Keywords: outlines, hypermedia, calendar 6;; Keywords: outlines, hypermedia, calendar
7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ 7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
8;; Version: 3.22 8;; Version: 3.23
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -82,6 +82,10 @@
82;; 82;;
83;; Changes: 83;; Changes:
84;; ------- 84;; -------
85;; Version 3.23
86;; - M-RET makes new items as well as new headings.
87;; - Various small bug fixes
88;;
85;; Version 3.22 89;; Version 3.22
86;; - CamelCase words link to other locations in the same file. 90;; - CamelCase words link to other locations in the same file.
87;; - File links accept search options, to link to specific locations. 91;; - File links accept search options, to link to specific locations.
@@ -253,7 +257,7 @@
253 257
254;;; Customization variables 258;;; Customization variables
255 259
256(defvar org-version "3.22" 260(defvar org-version "3.23"
257 "The version number of the file org.el.") 261 "The version number of the file org.el.")
258(defun org-version () 262(defun org-version ()
259 (interactive) 263 (interactive)
@@ -2530,22 +2534,39 @@ or nil."
2530(defvar org-ignore-region nil 2534(defvar org-ignore-region nil
2531 "To temporarily disable the active region.") 2535 "To temporarily disable the active region.")
2532 2536
2533(defun org-insert-heading () 2537(defun org-insert-heading (&optional force-heading)
2534 "Insert a new heading with same depth at point." 2538 "Insert a new heading or item with same depth at point.
2535 (interactive) 2539If ARG is non-nil"
2536 (let* ((head (save-excursion 2540 (interactive "P")
2537 (condition-case nil 2541 (when (or force-heading (not (org-insert-item)))
2538 (org-back-to-heading) 2542 (let* ((head (save-excursion
2539 (error (outline-next-heading))) 2543 (condition-case nil
2540 (prog1 (match-string 0) 2544 (org-back-to-heading)
2541 (funcall outline-level))))) 2545 (error (outline-next-heading)))
2546 (prog1 (match-string 0)
2547 (funcall outline-level)))))
2548 (unless (bolp) (newline))
2549 (insert head)
2550 (unless (eolp)
2551 (save-excursion (newline-and-indent)))
2552 (unless (equal (char-before) ?\ )
2553 (insert " "))
2554 (run-hooks 'org-insert-heading-hook))))
2555
2556(defun org-insert-item ()
2557 "Insert a new item at the current level.
2558Return t when tings worked, nil when we are not in an item."
2559 (when (save-excursion
2560 (condition-case nil
2561 (progn
2562 (org-beginning-of-item)
2563 (org-at-item-p)
2564 t)
2565 (error nil)))
2542 (unless (bolp) (newline)) 2566 (unless (bolp) (newline))
2543 (insert head) 2567 (insert (match-string 0))
2544 (unless (eolp) 2568 (org-maybe-renumber-ordered-list)
2545 (save-excursion (newline-and-indent))) 2569 t))
2546 (unless (equal (char-before) ?\ )
2547 (insert " "))
2548 (run-hooks 'org-insert-heading-hook)))
2549 2570
2550(defun org-insert-todo-heading (arg) 2571(defun org-insert-todo-heading (arg)
2551 "Insert a new heading with the same level and TODO state as current heading. 2572 "Insert a new heading with the same level and TODO state as current heading.
@@ -3034,8 +3055,9 @@ with something like \"1.\" or \"2)\"."
3034 (beginning-of-line 0) 3055 (beginning-of-line 0)
3035 (if (looking-at "[ \t]*$") (throw 'next t)) 3056 (if (looking-at "[ \t]*$") (throw 'next t))
3036 (skip-chars-forward " \t") (setq ind1 (current-column)) 3057 (skip-chars-forward " \t") (setq ind1 (current-column))
3037 (if (and (<= ind1 ind) 3058 (if (or (< ind1 ind)
3038 (not (org-at-item-p))) 3059 (and (= ind1 ind)
3060 (not (org-at-item-p))))
3039 (throw 'exit t))))) 3061 (throw 'exit t)))))
3040 ;; Walk forward and replace these numbers 3062 ;; Walk forward and replace these numbers
3041 (catch 'exit 3063 (catch 'exit
@@ -3055,7 +3077,7 @@ with something like \"1.\" or \"2)\"."
3055 (insert (format "%d" (setq n (1+ n))))))) 3077 (insert (format "%d" (setq n (1+ n)))))))
3056 (goto-line line) 3078 (goto-line line)
3057 (move-to-column col))) 3079 (move-to-column col)))
3058 3080
3059(defvar org-last-indent-begin-marker (make-marker)) 3081(defvar org-last-indent-begin-marker (make-marker))
3060(defvar org-last-indent-end-marker (make-marker)) 3082(defvar org-last-indent-end-marker (make-marker))
3061 3083
@@ -3422,9 +3444,10 @@ that the match should indeed be shown."
3422 (save-match-data (funcall callback))) 3444 (save-match-data (funcall callback)))
3423 (setq cnt (1+ cnt)) 3445 (setq cnt (1+ cnt))
3424 (org-highlight-new-match (match-beginning 0) (match-end 0)) 3446 (org-highlight-new-match (match-beginning 0) (match-end 0))
3425 (add-hook 'before-change-functions 'org-remove-occur-highlights
3426 nil 'local)
3427 (org-show-hierarchy-above)))) 3447 (org-show-hierarchy-above))))
3448 (make-local-hook 'before-change-functions) ; needed for XEmacs
3449 (add-hook 'before-change-functions 'org-remove-occur-highlights
3450 nil 'local)
3428 (run-hooks 'org-occur-hook) 3451 (run-hooks 'org-occur-hook)
3429 (if (interactive-p) 3452 (if (interactive-p)
3430 (message "%d match(es) for regexp %s" cnt regexp)) 3453 (message "%d match(es) for regexp %s" cnt regexp))
@@ -4036,7 +4059,9 @@ The following commands are available:
4036 (use-local-map org-agenda-mode-map) 4059 (use-local-map org-agenda-mode-map)
4037 (easy-menu-add org-agenda-menu) 4060 (easy-menu-add org-agenda-menu)
4038 (if org-startup-truncated (setq truncate-lines t)) 4061 (if org-startup-truncated (setq truncate-lines t))
4062 (make-local-hook 'post-command-hook) ; Needed for XEmacs
4039 (add-hook 'post-command-hook 'org-agenda-post-command-hook nil 'local) 4063 (add-hook 'post-command-hook 'org-agenda-post-command-hook nil 'local)
4064 (make-local-hook 'pre-command-hook) ; Needed for XEmacs
4040 (add-hook 'pre-command-hook 'org-unhighlight nil 'local) 4065 (add-hook 'pre-command-hook 'org-unhighlight nil 'local)
4041 (setq org-agenda-follow-mode nil) 4066 (setq org-agenda-follow-mode nil)
4042 (easy-menu-change 4067 (easy-menu-change
@@ -4049,7 +4074,7 @@ The following commands are available:
4049 (org-agenda-set-mode-name) 4074 (org-agenda-set-mode-name)
4050 (apply 4075 (apply
4051 (if (fboundp 'run-mode-hooks) 'run-mode-hooks 'run-hooks) 4076 (if (fboundp 'run-mode-hooks) 'run-mode-hooks 'run-hooks)
4052 org-agenda-mode-hook)) 4077 (list 'org-agenda-mode-hook)))
4053 4078
4054(define-key org-agenda-mode-map "\C-i" 'org-agenda-goto) 4079(define-key org-agenda-mode-map "\C-i" 'org-agenda-goto)
4055(define-key org-agenda-mode-map "\C-m" 'org-agenda-switch-to) 4080(define-key org-agenda-mode-map "\C-m" 'org-agenda-switch-to)
@@ -4903,8 +4928,8 @@ function from a program - use `org-agenda-get-day-entries' instead."
4903 (let (tbl) 4928 (let (tbl)
4904 (save-excursion 4929 (save-excursion
4905 (goto-char (point-min)) 4930 (goto-char (point-min))
4906 (while (re-search-forward "^#\\+CATEGORY:[ \t]*\\(.*\\)" nil t) 4931 (while (re-search-forward "\\(^\\|\r\\)#\\+CATEGORY:[ \t]*\\(.*\\)" nil t)
4907 (push (cons (point) (org-trim (match-string 1))) tbl))) 4932 (push (cons (point) (org-trim (match-string 2))) tbl)))
4908 tbl)) 4933 tbl))
4909 (defun org-get-category (&optional pos) 4934 (defun org-get-category (&optional pos)
4910 "Get the category applying to position POS." 4935 "Get the category applying to position POS."
@@ -10899,7 +10924,7 @@ See the individual commands for more information."
10899 (cond 10924 (cond
10900 ((org-at-table-p) 10925 ((org-at-table-p)
10901 (org-table-wrap-region arg)) 10926 (org-table-wrap-region arg))
10902 (t (org-insert-heading)))) 10927 (t (org-insert-heading arg))))
10903 10928
10904;;; Menu entries 10929;;; Menu entries
10905 10930
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index 50715cf800c..451ca389013 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -30,6 +30,35 @@
30(defvar comint-prompt-regexp) 30(defvar comint-prompt-regexp)
31 31
32;;; Customizable settings 32;;; Customizable settings
33;;; Switching tooltips on/off
34
35;; We don't set track-mouse globally because this is a big redisplay
36;; problem in buffers having a pre-command-hook or such installed,
37;; which does a set-buffer, like the summary buffer of Gnus. Calling
38;; set-buffer prevents redisplay optimizations, so every mouse motion
39;; would be accompanied by a full redisplay.
40
41(define-minor-mode tooltip-mode
42 "Toggle Tooltip display.
43With ARG, turn tooltip mode on if and only if ARG is positive."
44 :global t
45 :init-value (not (or noninteractive
46 emacs-basic-display
47 (not (display-graphic-p))
48 (not (fboundp 'x-show-tip))))
49 :initialize 'custom-initialize-safe-default
50 :group 'tooltip
51 (unless (or (null tooltip-mode) (fboundp 'x-show-tip))
52 (error "Sorry, tooltips are not yet available on this system"))
53 (if tooltip-mode
54 (progn
55 (add-hook 'pre-command-hook 'tooltip-hide)
56 (add-hook 'tooltip-hook 'tooltip-help-tips))
57 (unless (and (boundp 'gud-tooltip-mode) gud-tooltip-mode)
58 (remove-hook 'pre-command-hook 'tooltip-hide))
59 (remove-hook 'tooltip-hook 'tooltip-help-tips))
60 (setq show-help-function
61 (if tooltip-mode 'tooltip-show-help nil)))
33 62
34(defgroup tooltip nil 63(defgroup tooltip nil
35 "Customization group for the `tooltip' package." 64 "Customization group for the `tooltip' package."
@@ -145,36 +174,6 @@ This might return nil if the event did not occur over a buffer."
145 (let ((window (posn-window (event-end event)))) 174 (let ((window (posn-window (event-end event))))
146 (and window (window-buffer window)))) 175 (and window (window-buffer window))))
147 176
148;;; Switching tooltips on/off
149
150;; We don't set track-mouse globally because this is a big redisplay
151;; problem in buffers having a pre-command-hook or such installed,
152;; which does a set-buffer, like the summary buffer of Gnus. Calling
153;; set-buffer prevents redisplay optimizations, so every mouse motion
154;; would be accompanied by a full redisplay.
155
156(define-minor-mode tooltip-mode
157 "Toggle Tooltip display.
158With ARG, turn tooltip mode on if and only if ARG is positive."
159 :global t
160 :init-value (not (or noninteractive
161 emacs-basic-display
162 (not (display-graphic-p))
163 (not (fboundp 'x-show-tip))))
164 :initialize 'custom-initialize-safe-default
165 :group 'tooltip
166 (unless (or (null tooltip-mode) (fboundp 'x-show-tip))
167 (error "Sorry, tooltips are not yet available on this system"))
168 (if tooltip-mode
169 (progn
170 (add-hook 'pre-command-hook 'tooltip-hide)
171 (add-hook 'tooltip-hook 'tooltip-help-tips))
172 (unless (and (boundp 'gud-tooltip-mode) gud-tooltip-mode)
173 (remove-hook 'pre-command-hook 'tooltip-hide))
174 (remove-hook 'tooltip-hook 'tooltip-help-tips))
175 (setq show-help-function
176 (if tooltip-mode 'tooltip-show-help nil)))
177
178 177
179;;; Timeout for tooltip display 178;;; Timeout for tooltip display
180 179
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 0df0b7365db..b6dc9470d2c 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -852,6 +852,7 @@ button end points."
852(defvar widget-keymap 852(defvar widget-keymap
853 (let ((map (make-sparse-keymap))) 853 (let ((map (make-sparse-keymap)))
854 (define-key map "\t" 'widget-forward) 854 (define-key map "\t" 'widget-forward)
855 (define-key map "\e\t" 'widget-backward)
855 (define-key map [(shift tab)] 'widget-backward) 856 (define-key map [(shift tab)] 'widget-backward)
856 (define-key map [backtab] 'widget-backward) 857 (define-key map [backtab] 'widget-backward)
857 (define-key map [down-mouse-2] 'widget-button-click) 858 (define-key map [down-mouse-2] 'widget-button-click)
diff --git a/lisp/window.el b/lisp/window.el
index cd4b22f3e7e..6cb553c3799 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -228,75 +228,201 @@ If WINDOW is nil or omitted, it defaults to the currently selected window."
228 (or (= (nth 2 edges) (nth 2 (window-edges (previous-window)))) 228 (or (= (nth 2 edges) (nth 2 (window-edges (previous-window))))
229 (= (nth 0 edges) (nth 0 (window-edges (next-window)))))))) 229 (= (nth 0 edges) (nth 0 (window-edges (next-window))))))))
230 230
231 231
232(defun balance-windows () 232;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
233 "Make all visible windows the same height (approximately)." 233;;; `balance-windows' subroutines using `window-tree'
234
235;;; Translate from internal window tree format
236
237(defun bw-get-tree (&optional window-or-frame)
238 "Get a window split tree in our format.
239
240WINDOW-OR-FRAME must be nil, a frame, or a window. If it is nil,
241then the whole window split tree for `selected-frame' is returned.
242If it is a frame, then this is used instead. If it is a window,
243then the smallest tree containing that window is returned."
244 (when window-or-frame
245 (unless (or (framep window-or-frame)
246 (windowp window-or-frame))
247 (error "Not a frame or window: %s" window-or-frame)))
248 (let ((subtree (bw-find-tree-sub window-or-frame)))
249 (if (integerp subtree)
250 nil
251 (bw-get-tree-1 subtree))))
252
253(defun bw-get-tree-1 (split)
254 (if (windowp split)
255 split
256 (let ((dir (car split))
257 (edges (car (cdr split)))
258 (childs (cdr (cdr split))))
259 (list
260 (cons 'dir (if dir 'ver 'hor))
261 (cons 'b (nth 3 edges))
262 (cons 'r (nth 2 edges))
263 (cons 't (nth 1 edges))
264 (cons 'l (nth 0 edges))
265 (cons 'childs (mapcar #'bw-get-tree-1 childs))))))
266
267(defun bw-find-tree-sub (window-or-frame &optional get-parent)
268 (let* ((window (when (windowp window-or-frame) window-or-frame))
269 (frame (when (windowp window) (window-frame window)))
270 (wt (car (window-tree frame))))
271 (when (< 1 (length (window-list frame 0)))
272 (if window
273 (bw-find-tree-sub-1 wt window get-parent)
274 wt))))
275
276(defun bw-find-tree-sub-1 (tree win &optional get-parent)
277 (unless (windowp win) (error "Not a window: %s" win))
278 (if (memq win tree)
279 (if get-parent
280 get-parent
281 tree)
282 (let ((childs (cdr (cdr tree)))
283 child
284 subtree)
285 (while (and childs (not subtree))
286 (setq child (car childs))
287 (setq childs (cdr childs))
288 (when (and child (listp child))
289 (setq subtree (bw-find-tree-sub-1 child win get-parent))))
290 (if (integerp subtree)
291 (progn
292 (if (= 1 subtree)
293 tree
294 (1- subtree)))
295 subtree
296 ))))
297
298;;; Window or object edges
299
300(defun bw-l(obj)
301 "Left edge of OBJ."
302 (if (windowp obj) (nth 0 (window-edges obj)) (cdr (assq 'l obj))))
303(defun bw-t(obj)
304 "Top edge of OBJ."
305 (if (windowp obj) (nth 1 (window-edges obj)) (cdr (assq 't obj))))
306(defun bw-r(obj)
307 "Right edge of OBJ."
308 (if (windowp obj) (nth 2 (window-edges obj)) (cdr (assq 'r obj))))
309(defun bw-b(obj)
310 "Bottom edge of OBJ."
311 (if (windowp obj) (nth 3 (window-edges obj)) (cdr (assq 'b obj))))
312
313;;; Split directions
314
315(defun bw-dir(obj)
316 "Return window split tree direction if OBJ.
317If OBJ is a window return 'both. If it is a window split tree
318then return its direction."
319 (if (symbolp obj)
320 obj
321 (if (windowp obj)
322 'both
323 (let ((dir (cdr (assq 'dir obj))))
324 (unless (memq dir '(hor ver both))
325 (error "Can't find dir in %s" obj))
326 dir))))
327
328(defun bw-eqdir(obj1 obj2)
329 "Return t if window split tree directions are equal.
330OBJ1 and OBJ2 should be either windows or window split trees in
331our format. The directions returned by `bw-dir' are compared and
332t is returned if they are `eq' or one of them is 'both."
333 (let ((dir1 (bw-dir obj1))
334 (dir2 (bw-dir obj2)))
335 (or (eq dir1 dir2)
336 (eq dir1 'both)
337 (eq dir2 'both))))
338
339;;; Building split tree
340
341(defun bw-refresh-edges(obj)
342 "Refresh the edge information of OBJ and return OBJ."
343 (unless (windowp obj)
344 (let ((childs (cdr (assq 'childs obj)))
345 (ol 1000)
346 (ot 1000)
347 (or -1)
348 (ob -1))
349 (dolist (o childs)
350 (when (> ol (bw-l o)) (setq ol (bw-l o)))
351 (when (> ot (bw-t o)) (setq ot (bw-t o)))
352 (when (< or (bw-r o)) (setq or (bw-r o)))
353 (when (< ob (bw-b o)) (setq ob (bw-b o))))
354 (setq obj (delq 'l obj))
355 (setq obj (delq 't obj))
356 (setq obj (delq 'r obj))
357 (setq obj (delq 'b obj))
358 (add-to-list 'obj (cons 'l ol))
359 (add-to-list 'obj (cons 't ot))
360 (add-to-list 'obj (cons 'r or))
361 (add-to-list 'obj (cons 'b ob))
362 ))
363 obj)
364
365;;; Balance windows
366
367(defun balance-windows(&optional window-or-frame)
368 "Make windows the same heights or widths in window split subtrees.
369
370When called non-interactively WINDOW-OR-FRAME may be either a
371window or a frame. It then balances the windows on the implied
372frame. If the parameter is a window only the corresponding window
373subtree is balanced."
234 (interactive) 374 (interactive)
235 (let ((count -1) levels newsizes level-size 375 (let (
236 ;; Don't count the lines that are above the uppermost windows. 376 (wt (bw-get-tree window-or-frame))
237 ;; (These are the menu bar lines, if any.) 377 (w)
238 (mbl (nth 1 (window-edges (frame-first-window (selected-frame))))) 378 (h)
239 (last-window (previous-window (frame-first-window (selected-frame)))) 379 (tried-sizes)
240 ;; Don't count the lines that are past the lowest main window. 380 (last-sizes)
241 total) 381 (windows (window-list nil 0))
242 ;; Bottom edge of last window determines what size we have to work with. 382 (counter 0))
243 (setq total 383 (when wt
244 (+ (window-height last-window) 384 (while (not (member last-sizes tried-sizes))
245 (nth 1 (window-edges last-window)))) 385 (when last-sizes (setq tried-sizes (cons last-sizes tried-sizes)))
246 386 (setq last-sizes (mapcar (lambda(w)
247 ;; Find all the different vpos's at which windows start, 387 (window-edges w))
248 ;; then count them. But ignore levels that differ by only 1. 388 windows))
249 (let (tops (prev-top -2)) 389 (when (eq 'hor (bw-dir wt))
250 (walk-windows (function (lambda (w) 390 (setq w (- (bw-r wt) (bw-l wt))))
251 (setq tops (cons (nth 1 (window-edges w)) 391 (when (eq 'ver (bw-dir wt))
252 tops)))) 392 (setq h (- (bw-b wt) (bw-t wt))))
253 'nomini) 393 (bw-balance-sub wt w h)))))
254 (setq tops (sort tops '<)) 394
255 (while tops 395(defun bw-adjust-window(window delta horizontal)
256 (if (> (car tops) (1+ prev-top)) 396 "Wrapper around `adjust-window-trailing-edge' with error checking.
257 (setq prev-top (car tops) 397Arguments WINDOW, DELTA and HORIZONTAL are passed on to that function."
258 count (1+ count))) 398 (condition-case err
259 (setq levels (cons (cons (car tops) count) levels)) 399 (adjust-window-trailing-edge window delta horizontal)
260 (setq tops (cdr tops))) 400 (error
261 (setq count (1+ count))) 401 ;;(message "adjust: %s" (error-message-string err))
262 ;; Subdivide the frame into desired number of vertical levels. 402 )))
263 (setq level-size (/ (- total mbl) count)) 403
264 (save-selected-window 404(defun bw-balance-sub(wt w h)
265 ;; Set up NEWSIZES to map windows to their desired sizes. 405 (setq wt (bw-refresh-edges wt))
266 ;; If a window ends at the bottom level, don't include 406 (unless w (setq w (- (bw-r wt) (bw-l wt))))
267 ;; it in NEWSIZES. Those windows get the right sizes 407 (unless h (setq h (- (bw-b wt) (bw-t wt))))
268 ;; by adjusting the ones above them. 408 (if (windowp wt)
269 (walk-windows (function 409 (progn
270 (lambda (w) 410 (when w
271 (let ((newtop (cdr (assq (nth 1 (window-edges w)) 411 (let ((dw (- w (- (bw-r wt) (bw-l wt)))))
272 levels))) 412 (when (/= 0 dw)
273 (newbot (cdr (assq (+ (window-height w) 413 (bw-adjust-window wt dw t))))
274 (nth 1 (window-edges w))) 414 (when h
275 levels)))) 415 (let ((dh (- h (- (bw-b wt) (bw-t wt)))))
276 (if newbot 416 (when (/= 0 dh)
277 (setq newsizes 417 (bw-adjust-window wt dh nil)))))
278 (cons (cons w (* level-size (- newbot newtop))) 418 (let* ((childs (cdr (assq 'childs wt)))
279 newsizes)))))) 419 (lastchild (car (last childs)))
280 'nomini) 420 (cw (when w (/ w (if (bw-eqdir 'hor wt) (length childs) 1))))
281 ;; Make walk-windows start with the topmost window. 421 (ch (when h (/ h (if (bw-eqdir 'ver wt) (length childs) 1)))))
282 (select-window (previous-window (frame-first-window (selected-frame)))) 422 (dolist (c childs)
283 (let (done (count 0)) 423 (bw-balance-sub c cw ch)))))
284 ;; Give each window its precomputed size, or at least try. 424
285 ;; Keep trying until they all get the intended sizes, 425;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
286 ;; but not more than 3 times (to prevent infinite loop).
287 (while (and (not done) (< count 3))
288 (setq done t)
289 (setq count (1+ count))
290 (walk-windows (function (lambda (w)
291 (select-window w)
292 (let ((newsize (cdr (assq w newsizes))))
293 (when newsize
294 (enlarge-window (- newsize
295 (window-height))
296 nil)
297 (unless (= (window-height) newsize)
298 (setq done nil))))))
299 'nomini))))))
300 426
301;; I think this should be the default; I think people will prefer it--rms. 427;; I think this should be the default; I think people will prefer it--rms.
302(defcustom split-window-keep-point t 428(defcustom split-window-keep-point t