aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMiles Bader2004-10-27 05:42:04 +0000
committerMiles Bader2004-10-27 05:42:04 +0000
commite0da2cddda8d2244be17fe33fd3130af8c8041c8 (patch)
tree4f29220860cddf776e784932fde024d8ca03c802 /lisp
parent69c48766bbee2af7643b8995213120216b26a73e (diff)
parente65837df545fcf0791b3c8db27186e605cf89538 (diff)
downloademacs-e0da2cddda8d2244be17fe33fd3130af8c8041c8.tar.gz
emacs-e0da2cddda8d2244be17fe33fd3130af8c8041c8.zip
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-65
Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-634 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-639 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-640 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-641 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-59 - miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-60 Update from CVS
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog195
-rw-r--r--lisp/calc/calc-incom.el3
-rw-r--r--lisp/calc/calc-misc.el6
-rw-r--r--lisp/calc/calc-rewr.el6
-rw-r--r--lisp/calc/calc.el37
-rw-r--r--lisp/calendar/icalendar.el87
-rw-r--r--lisp/files.el220
-rw-r--r--lisp/find-file.el30
-rw-r--r--lisp/gnus/ChangeLog10
-rw-r--r--lisp/gnus/gnus-start.el5
-rw-r--r--lisp/gnus/html2text.el18
-rw-r--r--lisp/help.el18
-rw-r--r--lisp/ibuf-ext.el98
-rw-r--r--lisp/ibuffer.el4
-rw-r--r--lisp/imenu.el51
-rw-r--r--lisp/indent.el8
-rw-r--r--lisp/info.el3
-rw-r--r--lisp/man.el11
-rw-r--r--lisp/menu-bar.el10
-rw-r--r--lisp/mouse-sel.el1
-rw-r--r--lisp/net/password.el56
-rw-r--r--lisp/net/tramp-vc.el3
-rw-r--r--lisp/net/tramp.el15
-rw-r--r--lisp/pcomplete.el6
-rw-r--r--lisp/progmodes/asm-mode.el4
-rw-r--r--lisp/progmodes/flymake.el5
-rw-r--r--lisp/progmodes/gdb-ui.el66
-rw-r--r--lisp/simple.el33
-rw-r--r--lisp/subr.el55
-rw-r--r--lisp/textmodes/sgml-mode.el20
-rw-r--r--lisp/textmodes/tex-mode.el6
-rw-r--r--lisp/vc.el2
-rw-r--r--lisp/woman.el2
33 files changed, 687 insertions, 407 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 556f9ad2a94..260dfb22af5 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,13 +1,166 @@
12004-10-26 Daniel Pfeiffer <occitan@esperanto.org>
2
3 * files.el (auto-mode-alist): Add pod, js, xbm and xpm and group
4 trivial variants to shorten the list.
5 (xml-based-modes): New var.
6 (set-auto-mode): Give interpreter-mode-alist or <?xml or <!DOCTYPE
7 declaration higher priority than auto-mode-alist.
8
9 * find-file.el (cc-other-file-alist): Bring it in line with
10 cc-mode's auto-mode-alist entries and use \' instead of $.
11
12 * textmodes/sgml-mode.el (sgml-mode): Fix imenu-generic-expression
13 and add "Id" and "Name" submenus to it.
14
15 * imenu.el (imenu--generic-function): Skip matches in comments.
16
172004-10-26 Jay Belanger <belanger@truman.edu>
18
19 * calc/calc.el (calc,full-calc, calc-quit, calc-keypad)
20 (full-calc-keypad, calc-trail-display): Use an extra argument
21 instead of `interactive-p'.
22
23 * calc/calc-misc.el (calc-other-window): Use an extra argument
24 instead of `interactive-p'.
25
26 * calc/calc-rewr.el (calc-match): Use an extra argument instead of
27 `interactive-p'.
28
292004-10-26 Kim F. Storm <storm@cua.dk>
30
31 * help.el (describe-key): Describe both down-event and up-event
32 for a mouse click.
33
342004-10-26 Richard M. Stallman <rms@gnu.org>
35
36 * woman.el (woman): Don't call interactive-p.
37
38 * pcomplete.el (pcomplete): Instead of interactive-p,
39 use an arg set non-nil by the interactive spec.
40
41 * menu-bar.el (menu-bar-make-toggle): Instead of interactive-p,
42 use an arg set non-nil by the interactive spec.
43
44 * man.el (Man-cleanup-manpage): Instead of interactive-p,
45 use an arg set non-nil by the interactive spec.
46
472004-10-26 Pavel Kobiakov <pk_at_work@yahoo.com>
48
49 * progmodes/flymake.el (flymake-split-string): Use
50 `flymake-split-string-remove-empty-edges' in any case.
51
522004-10-26 Masatake YAMATO <jet@gyve.org>
53
54 * progmodes/flymake.el (flymake-err-line-patterns):
55 Use `compilation-error-regexp-alist-alist' instead of
56 `compilation-error-regexp-alist'.
57
582004-10-25 Jay Belanger <belanger@truman.edu>
59
60 * calc/calc-incom.el (calc-digit-dots): Inhibit read-only before
61 erasing minibuffer.
62
632004-10-25 Simon Josefsson <jas@extundo.com>
64
65 * subr.el (read-passwd): Move to net/password.el.
66
67 * net/password.el (read-passwd): Add. Autoload it.
68
692004-10-25 Kai Grossjohann <kai.grossjohann@gmx.net>
70
71 * mouse-sel.el (mouse-sel-mode): Specify custom group.
72
73 * simple.el (process-file): Fix logic.
74
752004-10-24 Luc Teirlinck <teirllm@auburn.edu>
76
77 * indent.el (set-left-margin, set-right-margin): Delete redundant code.
78 (increase-right-margin): Remove erroneous call to `interactive-p'.
79
802004-10-24 Kim F. Storm <storm@cua.dk>
81
82 * help.el (describe-mode): Fix 2004-10-13 change.
83 Copy pure "Auto Fill" string so it can be propertized later
84 without causing a read-only error.
85
862004-10-24 Luc Teirlinck <teirllm@auburn.edu>
87
88 * info.el (Info-find-emacs-command-nodes): Adapt to Texinfo-4.7
89 style indexes.
90
912004-10-24 Kai Grossjohann <kai.grossjohann@gmx.net>
92
93 * simple.el (process-file): Accept nil for INFILE. Reported by
94 Luc Teirlinck.
95
962004-10-24 Masatake YAMATO <jet@gyve.org>
97
98 * progmodes/gdb-ui.el (gdb-assembler-font-lock-keywords):
99 Handle periods and underscores in a function name.
100 Remove the address fontification.
101
1022004-10-24 Masatake YAMATO <jet@gyve.org>
103
104 * progmodes/asm-mode.el (asm-font-lock-keywords):
105 Use font-lock-variable-name-face for registers.
106
1072004-10-24 Nick Roberts <nickrob@snap.net.nz>
108
109 * progmodes/gdb-ui.el (gdb-get-create-buffer): Allow modes to run
110 kill-all-local-variables.
111 (gdb-breakpoints-mode, gdb-frames-mode, gdb-threads-mode)
112 (gdb-registers-mode, gdb-locals-mode, gdb-assembler-mode):
113 Use kill-all-local-variables and provide mode-hooks.
114 (gdb-assembler-font-lock-keywords): New font lock keywords definition.
115 (gdb-assembler-mode): Use 'gdb-assembler-font-lock-keywords'.
116 Suggested by Masatake YAMATO <jet@gyve.org>.
117
1182004-10-23 Kai Grossjohann <kai.grossjohann@gmx.net>
119
120 * simple.el (process-file): New function, similar to call-process
121 but supports file handlers.
122 * vc.el (vc-do-command): Use it, instead of call-process.
123 * net/tramp-vc.el (vc-do-command): Do not advise it if
124 process-file is fboundp.
125 * net/tramp.el (tramp-file-name-handler-alist): Add entry for
126 process-file.
127 (tramp-handle-process-file): New function.
128 (tramp-file-name-for-operation): Support process-file.
129
1302004-10-23 Ulf Jasper <ulf.jasper@web.de>
131
132 * calendar/icalendar.el (icalendar--weekday-array): New constant.
133 (icalendar-weekdayabbrev-table)
134 (icalendar-monthnumber-table): Delete.
135 (icalendar--get-month-number): Use calendar-month-name-array.
136 (icalendar--get-weekday-number): New function.
137 (icalendar--get-weekday-abbrev) Use calendar-day-name-array.
138 (icalendar-export-region): Handle multi-line entries.
139 (icalendar--convert-ical-to-diary): Use calendar-day-name-array.
140
1412004-10-23 John Paul Wallington <jpw@gnu.org>
142
143 * ibuffer.el (ibuffer-find-file): Remove `interactive-p' call;
144 `wildcards' set to t in interactive spec.
145
146 * ibuf-ext.el (ibuffer-jump-to-buffer): Read buffer name in
147 interactive spec rather than use `interactive-p'.
148 (ibuffer-kill-line): Set arg `interactive-p' in interactive spec
149 rather than use function `interactive-p'.
150
12004-10-21 Jay Belanger <belanger@truman.edu> 1512004-10-21 Jay Belanger <belanger@truman.edu>
2 152
3 * calc/calc-aent.el (calc-alg-ent-map, calc-alg-ent-esc-map): 153 * calc/calc-aent.el (calc-alg-ent-map, calc-alg-ent-esc-map):
4 Declared these variables with defvar. 154 Declare these variables with defvar.
5 155
6 * calc/calc-aent.el (calc-do-alg-entry): Since `calc-alg-ent-map' 156 * calc/calc-aent.el (calc-do-alg-entry): Since `calc-alg-ent-map'
7 is bound, only check to see if it is bound. 157 is bound, only check to see if it is bound.
8 158
92004-10-21 Stefan Monnier <monnier@iro.umontreal.ca> 1592004-10-21 Stefan Monnier <monnier@iro.umontreal.ca>
10 160
161 * textmodes/tex-mode.el (tex-compilation-parse-errors):
162 Don't output messages.
163
11 * calc/calc-help.el (calc-describe-bindings): Fix last change. 164 * calc/calc-help.el (calc-describe-bindings): Fix last change.
12 165
132004-10-21 John Paul Wallington <jpw@gnu.org> 1662004-10-21 John Paul Wallington <jpw@gnu.org>
@@ -245,6 +398,13 @@
245 398
246 * net/password.el: Add. 399 * net/password.el: Add.
247 400
4012004-10-14 Masatake YAMATO <jet@gyve.org>
402
403 * progmodes/gud.el (gdb-script-beginning-of-defun): New function.
404 (gdb-script-end-of-defun): New function.
405 (gdb-script-mode): Use `gdb-script-beginning-of-defun' and
406 `gdb-script-end-of-defun' as *-of-defun-function.
407
2482004-10-13 Daniel Pfeiffer <occitan@esperanto.org> 4082004-10-13 Daniel Pfeiffer <occitan@esperanto.org>
249 409
250 * button.el (button-activate): Allow a marker to display as an action. 410 * button.el (button-activate): Allow a marker to display as an action.
@@ -254,13 +414,6 @@
254 * help.el (describe-mode): Use it to make minor mode list into 414 * help.el (describe-mode): Use it to make minor mode list into
255 hyperlinks. 415 hyperlinks.
256 416
2572004-10-14 Masatake YAMATO <jet@gyve.org>
258
259 * progmodes/gud.el (gdb-script-beginning-of-defun): New function.
260 (gdb-script-end-of-defun): New function.
261 (gdb-script-mode): Use `gdb-script-beginning-of-defun' and
262 `gdb-script-end-of-defun' as *-of-defun-function.
263
2642004-10-13 Stefan Monnier <monnier@iro.umontreal.ca> 4172004-10-13 Stefan Monnier <monnier@iro.umontreal.ca>
265 418
266 * vc.el (vc-annotate-display-select): Fix typo. 419 * vc.el (vc-annotate-display-select): Fix typo.
@@ -564,15 +717,6 @@
564 * diff-mode.el (diff-file-header-re): Tighten up regexp a tiny bit. 717 * diff-mode.el (diff-file-header-re): Tighten up regexp a tiny bit.
565 (diff-fixup-modifs): Catch unified-diff file-headers. 718 (diff-fixup-modifs): Catch unified-diff file-headers.
566 719
5672004-09-28 Stefan Monnier <monnier@iro.umontreal.ca>
568
569 * dired.el (dired-view-command-alist): Use more efficient regexps.
570 Remove dubious arguments.
571 (dired-align-file): New function.
572 (dired-insert-directory): Use it.
573 (dired-move-to-end-of-filename): Make the " -> " search more specific.
574 (dired-buffers-for-dir): Remove unused var `pattern'.
575
5762004-09-29 Kim F. Storm <storm@cua.dk> 7202004-09-29 Kim F. Storm <storm@cua.dk>
577 721
578 * progmodes/gdb-ui.el (breakpoint): Define as fringe bitmap. 722 * progmodes/gdb-ui.el (breakpoint): Define as fringe bitmap.
@@ -582,6 +726,15 @@
582 * fringe.el (fringe-bitmap-p): New macro. 726 * fringe.el (fringe-bitmap-p): New macro.
583 (fringe-bitmaps): Add standard fringe bitmaps on load. 727 (fringe-bitmaps): Add standard fringe bitmaps on load.
584 728
7292004-09-28 Stefan Monnier <monnier@iro.umontreal.ca>
730
731 * dired.el (dired-view-command-alist): Use more efficient regexps.
732 Remove dubious arguments.
733 (dired-align-file): New function.
734 (dired-insert-directory): Use it.
735 (dired-move-to-end-of-filename): Make the " -> " search more specific.
736 (dired-buffers-for-dir): Remove unused var `pattern'.
737
5852004-09-28 Matthew Mundell <matt@mundell.ukfsn.org> (tiny change) 7382004-09-28 Matthew Mundell <matt@mundell.ukfsn.org> (tiny change)
586 739
587 * calendar/diary-lib.el (list-diary-entries): Save diary buffer 740 * calendar/diary-lib.el (list-diary-entries): Save diary buffer
@@ -720,7 +873,7 @@
720 873
721 * calc/calc-graph.el (calc-graph-add-curve): Moved the call to 874 * calc/calc-graph.el (calc-graph-add-curve): Moved the call to
722 `calc-graph-set-styles' so the gnuplot buffer will appear in a 875 `calc-graph-set-styles' so the gnuplot buffer will appear in a
723 separate window. 876 separate window.
724 877
7252004-09-21 Luc Teirlinck <teirllm@auburn.edu> 8782004-09-21 Luc Teirlinck <teirllm@auburn.edu>
726 879
@@ -737,7 +890,7 @@
737 fixed. 890 fixed.
738 891
7392004-09-21 Jay Belanger <belanger@truman.edu> 8922004-09-21 Jay Belanger <belanger@truman.edu>
740 893
741 * calc/calc.el (calc-mode-var-list): Removed unnecessary quotes. 894 * calc/calc.el (calc-mode-var-list): Removed unnecessary quotes.
742 895
7432004-09-20 Luc Teirlinck <teirllm@auburn.edu> 8962004-09-20 Luc Teirlinck <teirllm@auburn.edu>
@@ -828,8 +981,8 @@
8282004-09-17 Jay Belanger <belanger@truman.edu> 9812004-09-17 Jay Belanger <belanger@truman.edu>
829 982
830 * calc/calc.el (calc-mode-var-list): Fixed the value of 983 * calc/calc.el (calc-mode-var-list): Fixed the value of
831 `calc-matrix-brackets'. 984 `calc-matrix-brackets'.
832 985
8332004-09-17 Romain Francoise <romain@orebokech.com> 9862004-09-17 Romain Francoise <romain@orebokech.com>
834 987
835 * ibuf-ext.el (define-ibuffer-filter filename): 988 * ibuf-ext.el (define-ibuffer-filter filename):
diff --git a/lisp/calc/calc-incom.el b/lisp/calc/calc-incom.el
index b8bb7ab4f9a..7dc7f08b4bd 100644
--- a/lisp/calc/calc-incom.el
+++ b/lisp/calc/calc-incom.el
@@ -183,7 +183,8 @@
183 (if calc-prev-prev-char 183 (if calc-prev-prev-char
184 (calcDigit-nondigit) 184 (calcDigit-nondigit)
185 (setq calc-digit-value nil) 185 (setq calc-digit-value nil)
186 (erase-buffer) 186 (let ((inhibit-read-only t))
187 (erase-buffer))
187 (exit-minibuffer))) 188 (exit-minibuffer)))
188 ;; just ignore extra decimal point, anticipating ".." 189 ;; just ignore extra decimal point, anticipating ".."
189 (delete-backward-char 1))) 190 (delete-backward-char 1)))
diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el
index c01d37e6848..159b1ee3178 100644
--- a/lisp/calc/calc-misc.el
+++ b/lisp/calc/calc-misc.el
@@ -130,9 +130,9 @@ Calc user interface as before (either M-# C or M-# K; initially M-# C)."
130 "Now using full screen for Calc" 130 "Now using full screen for Calc"
131 "Now using partial screen for Calc")))) 131 "Now using partial screen for Calc"))))
132 132
133(defun calc-other-window () 133(defun calc-other-window (&optional interactive)
134 "Invoke the Calculator in another window." 134 "Invoke the Calculator in another window."
135 (interactive) 135 (interactive "p")
136 (if (memq major-mode '(calc-mode calc-trail-mode)) 136 (if (memq major-mode '(calc-mode calc-trail-mode))
137 (progn 137 (progn
138 (other-window 1) 138 (other-window 1)
@@ -141,7 +141,7 @@ Calc user interface as before (either M-# C or M-# K; initially M-# C)."
141 (if (get-buffer-window "*Calculator*") 141 (if (get-buffer-window "*Calculator*")
142 (calc-quit) 142 (calc-quit)
143 (let ((win (selected-window))) 143 (let ((win (selected-window)))
144 (calc nil win (interactive-p)))))) 144 (calc nil win interactive)))))
145 145
146(defun another-calc () 146(defun another-calc ()
147 "Create another, independent Calculator buffer." 147 "Create another, independent Calculator buffer."
diff --git a/lisp/calc/calc-rewr.el b/lisp/calc/calc-rewr.el
index 51cffb753fc..47b48bd88d8 100644
--- a/lisp/calc/calc-rewr.el
+++ b/lisp/calc/calc-rewr.el
@@ -143,15 +143,15 @@
143 (calc-pop-push-record-list n "rwrt" (list expr))) 143 (calc-pop-push-record-list n "rwrt" (list expr)))
144 (calc-handle-whys))) 144 (calc-handle-whys)))
145 145
146(defun calc-match (pat) 146(defun calc-match (pat &optional interactive)
147 (interactive "sPattern: \n") 147 (interactive "sPattern: \np")
148 (calc-slow-wrapper 148 (calc-slow-wrapper
149 (let (n expr) 149 (let (n expr)
150 (if (or (null pat) (equal pat "") (equal pat "$")) 150 (if (or (null pat) (equal pat "") (equal pat "$"))
151 (setq expr (calc-top-n 2) 151 (setq expr (calc-top-n 2)
152 pat (calc-top-n 1) 152 pat (calc-top-n 1)
153 n 2) 153 n 2)
154 (if (interactive-p) (setq calc-previous-alg-entry pat)) 154 (if interactive (setq calc-previous-alg-entry pat))
155 (setq pat (if (stringp pat) (math-read-expr pat) pat)) 155 (setq pat (if (stringp pat) (math-read-expr pat) pat))
156 (if (eq (car-safe pat) 'error) 156 (if (eq (car-safe pat) 'error)
157 (error "Bad format in expression: %s" (nth 1 pat))) 157 (error "Bad format in expression: %s" (nth 1 pat)))
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index c1669f78f08..4ace5fb6780 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -1142,7 +1142,7 @@ commands given here will actually operate on the *Calculator* stack."
1142;;;###autoload 1142;;;###autoload
1143(defun calc (&optional arg full-display interactive) 1143(defun calc (&optional arg full-display interactive)
1144 "The Emacs Calculator. Full documentation is listed under \"calc-mode\"." 1144 "The Emacs Calculator. Full documentation is listed under \"calc-mode\"."
1145 (interactive "P") 1145 (interactive "P\ni\np")
1146 (if arg 1146 (if arg
1147 (unless (eq arg 0) 1147 (unless (eq arg 0)
1148 (calc-extensions) 1148 (calc-extensions)
@@ -1188,17 +1188,16 @@ commands given here will actually operate on the *Calculator* stack."
1188 (window-point full-display) 1188 (window-point full-display)
1189 (select-window full-display)) 1189 (select-window full-display))
1190 (calc-check-defines) 1190 (calc-check-defines)
1191 (when (and calc-said-hello 1191 (when (and calc-said-hello interactive)
1192 (or (interactive-p) interactive))
1193 (sit-for 2) 1192 (sit-for 2)
1194 (message "")) 1193 (message ""))
1195 (setq calc-said-hello t))))) 1194 (setq calc-said-hello t)))))
1196 1195
1197;;;###autoload 1196;;;###autoload
1198(defun full-calc () 1197(defun full-calc (&optional interactive)
1199 "Invoke the Calculator and give it a full-sized window." 1198 "Invoke the Calculator and give it a full-sized window."
1200 (interactive) 1199 (interactive "p")
1201 (calc nil t (interactive-p))) 1200 (calc nil t interactive))
1202 1201
1203(defun calc-same-interface (arg) 1202(defun calc-same-interface (arg)
1204 "Invoke the Calculator using the most recent interface (calc or calc-keypad)." 1203 "Invoke the Calculator using the most recent interface (calc or calc-keypad)."
@@ -1215,8 +1214,8 @@ commands given here will actually operate on the *Calculator* stack."
1215 (calc arg calc-full-mode t)))))) 1214 (calc arg calc-full-mode t))))))
1216 1215
1217 1216
1218(defun calc-quit (&optional non-fatal) 1217(defun calc-quit (&optional non-fatal interactive)
1219 (interactive) 1218 (interactive "i\np")
1220 (and calc-standalone-flag (not non-fatal) 1219 (and calc-standalone-flag (not non-fatal)
1221 (save-buffers-kill-emacs nil)) 1220 (save-buffers-kill-emacs nil))
1222 (if (and (equal (buffer-name) "*Gnuplot Trail*") 1221 (if (and (equal (buffer-name) "*Gnuplot Trail*")
@@ -1226,7 +1225,7 @@ commands given here will actually operate on the *Calculator* stack."
1226 (calc-edit-cancel) 1225 (calc-edit-cancel)
1227 (if (eq major-mode 'MacEdit-mode) 1226 (if (eq major-mode 'MacEdit-mode)
1228 (MacEdit-cancel-edit) 1227 (MacEdit-cancel-edit)
1229 (if (and (interactive-p) 1228 (if (and interactive
1230 calc-embedded-info 1229 calc-embedded-info
1231 (eq (current-buffer) (aref calc-embedded-info 0))) 1230 (eq (current-buffer) (aref calc-embedded-info 0)))
1232 (calc-embedded nil) 1231 (calc-embedded nil)
@@ -1266,22 +1265,22 @@ or a list containing a character position and an error message in string form."
1266 (calc-do-calc-eval str separator args)) 1265 (calc-do-calc-eval str separator args))
1267 1266
1268;;;###autoload 1267;;;###autoload
1269(defun calc-keypad () 1268(defun calc-keypad (&optional interactive)
1270 "Invoke the Calculator in \"visual keypad\" mode. 1269 "Invoke the Calculator in \"visual keypad\" mode.
1271This is most useful in the X window system. 1270This is most useful in the X window system.
1272In this mode, click on the Calc \"buttons\" using the left mouse button. 1271In this mode, click on the Calc \"buttons\" using the left mouse button.
1273Or, position the cursor manually and do M-x calc-keypad-press." 1272Or, position the cursor manually and do M-x calc-keypad-press."
1274 (interactive) 1273 (interactive "p")
1275 (calc-extensions) 1274 (calc-extensions)
1276 (calc-do-keypad calc-full-mode (interactive-p))) 1275 (calc-do-keypad calc-full-mode interactive))
1277 1276
1278;;;###autoload 1277;;;###autoload
1279(defun full-calc-keypad () 1278(defun full-calc-keypad (&optional interactive)
1280 "Invoke the Calculator in full-screen \"visual keypad\" mode. 1279 "Invoke the Calculator in full-screen \"visual keypad\" mode.
1281See calc-keypad for details." 1280See calc-keypad for details."
1282 (interactive) 1281 (interactive "p")
1283 (calc-extensions) 1282 (calc-extensions)
1284 (calc-do-keypad t (interactive-p))) 1283 (calc-do-keypad t interactive))
1285 1284
1286 1285
1287(defvar calc-aborted-prefix nil) 1286(defvar calc-aborted-prefix nil)
@@ -1802,8 +1801,8 @@ If mouse is pressed in Calc window, push cut buffer contents onto the stack."
1802 val) 1801 val)
1803 1802
1804 1803
1805(defun calc-trail-display (flag &optional no-refresh) 1804(defun calc-trail-display (flag &optional no-refresh interactive)
1806 (interactive "P") 1805 (interactive "P\ni\np")
1807 (let ((win (get-buffer-window (calc-trail-buffer)))) 1806 (let ((win (get-buffer-window (calc-trail-buffer))))
1808 (if (setq calc-display-trail 1807 (if (setq calc-display-trail
1809 (not (if flag (memq flag '(nil 0)) win))) 1808 (not (if flag (memq flag '(nil 0)) win)))
@@ -1817,7 +1816,7 @@ If mouse is pressed in Calc window, push cut buffer contents onto the stack."
1817 (setq overlay-arrow-string calc-trail-overlay 1816 (setq overlay-arrow-string calc-trail-overlay
1818 overlay-arrow-position calc-trail-pointer) 1817 overlay-arrow-position calc-trail-pointer)
1819 (or no-refresh 1818 (or no-refresh
1820 (if (interactive-p) 1819 (if interactive
1821 (calc-do-refresh) 1820 (calc-do-refresh)
1822 (calc-refresh)))))) 1821 (calc-refresh))))))
1823 (if win 1822 (if win
@@ -1825,7 +1824,7 @@ If mouse is pressed in Calc window, push cut buffer contents onto the stack."
1825 (delete-window win) 1824 (delete-window win)
1826 (calc-wrapper 1825 (calc-wrapper
1827 (or no-refresh 1826 (or no-refresh
1828 (if (interactive-p) 1827 (if interactive
1829 (calc-do-refresh) 1828 (calc-do-refresh)
1830 (calc-refresh)))))))) 1829 (calc-refresh))))))))
1831 calc-trail-buffer) 1830 calc-trail-buffer)
diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el
index 9e5f2b93c22..5f581e1d74a 100644
--- a/lisp/calendar/icalendar.el
+++ b/lisp/calendar/icalendar.el
@@ -39,6 +39,8 @@
39;; Added icalendar-export-region. 39;; Added icalendar-export-region.
40;; The import and export commands do not clear their target file, 40;; The import and export commands do not clear their target file,
41;; but append their results to the target file. 41;; but append their results to the target file.
42;; I18n-problems fixed -- use calendar-(month|day)-name-array.
43;; Fixed problems with export of multi-line diary entries.
42 44
43;; 0.06: Bugfixes regarding icalendar-import-format-*. 45;; 0.06: Bugfixes regarding icalendar-import-format-*.
44;; Fix in icalendar-convert-diary-to-ical -- thanks to Philipp 46;; Fix in icalendar-convert-diary-to-ical -- thanks to Philipp
@@ -167,31 +169,7 @@ longer than they are."
167;; NO USER SERVICABLE PARTS BELOW THIS LINE 169;; NO USER SERVICABLE PARTS BELOW THIS LINE
168;; ====================================================================== 170;; ======================================================================
169 171
170(defconst icalendar-weekdayabbrev-table 172(defconst icalendar--weekday-array ["SU" "MO" "TU" "WE" "TH" "FR" "SA"])
171 '(("mon\\(day\\)?" . "MO")
172 ("tue\\(sday\\)?" . "TU")
173 ("wed\\(nesday\\)?" . "WE")
174 ("thu\\(rsday\\)?" . "TH")
175 ("fri\\(day\\)?" . "FR")
176 ("sat\\(urday\\)?" . "SA")
177 ("sun\\(day\\)?" . "SU"))
178 "Translation table for weekdays.")
179
180(defconst icalendar-monthnumber-table
181 '(("^jan\\(uar\\)?y?$" . 1)
182 ("^feb\\(ruar\\)?y?$" . 2)
183 ("^mar\\(ch\\)?\\|märz$" . 3)
184 ("^apr\\(il\\)?$" . 4)
185 ("^ma[iy]$" . 5)
186 ("^jun[ie]?$" . 6)
187 ("^jul[iy]?$" . 7)
188 ("^aug\\(ust\\)?$" . 8)
189 ("^sep\\(tember\\)?$" . 9)
190 ("^o[ck]t\\(ober\\)?$" . 10)
191 ("^nov\\(ember\\)?$" . 11)
192 ("^de[cz]\\(ember\\)?$" . 12))
193 "Regular expressions for month names.
194Currently this matches only German and English.")
195 173
196(defvar icalendar-debug nil ".") 174(defvar icalendar-debug nil ".")
197 175
@@ -511,18 +489,47 @@ Note that this silently ignores seconds."
511 489
512(defun icalendar--get-month-number (monthname) 490(defun icalendar--get-month-number (monthname)
513 "Return the month number for the given MONTHNAME." 491 "Return the month number for the given MONTHNAME."
514 (save-match-data 492 (catch 'found
515 (let ((case-fold-search t)) 493 (let ((num 1)
516 (assoc-default monthname icalendar-monthnumber-table 494 (m (downcase monthname)))
517 'string-match)))) 495 (mapc (lambda (month)
496 (let ((mm (downcase month)))
497 (if (or (string-equal mm m)
498 (string-equal (substring mm 0 3) m))
499 (throw 'found num))
500 (setq num (1+ num))))
501 calendar-month-name-array))
502 ;; Error:
503 -1))
504
505(defun icalendar--get-weekday-number (abbrevweekday)
506 "Return the number for the ABBREVWEEKDAY."
507 (catch 'found
508 (let ((num 0)
509 (aw (downcase abbrevweekday)))
510 (mapc (lambda (day)
511 (let ((d (downcase day)))
512 (if (string-equal d aw)
513 (throw 'found num))
514 (setq num (1+ num))))
515 icalendar--weekday-array))
516 ;; Error:
517 -1))
518 518
519(defun icalendar--get-weekday-abbrev (weekday) 519(defun icalendar--get-weekday-abbrev (weekday)
520 "Return the abbreviated WEEKDAY." 520 "Return the abbreviated WEEKDAY."
521 ;;FIXME: ISO-like(?). 521 (catch 'found
522 (save-match-data 522 (let ((num 0)
523 (let ((case-fold-search t)) 523 (w (downcase weekday)))
524 (assoc-default weekday icalendar-weekdayabbrev-table 524 (mapc (lambda (day)
525 'string-match)))) 525 (let ((d (downcase day)))
526 (if (or (string-equal d w)
527 (string-equal (substring d 0 3) w))
528 (throw 'found (aref icalendar--weekday-array num)))
529 (setq num (1+ num))))
530 calendar-day-name-array))
531 ;; Error:
532 "??"))
526 533
527(defun icalendar--datestring-to-isodate (datestring &optional day-shift) 534(defun icalendar--datestring-to-isodate (datestring &optional day-shift)
528 "Convert diary-style DATESTRING to iso-style date. 535 "Convert diary-style DATESTRING to iso-style date.
@@ -648,7 +655,7 @@ FExport diary data into iCalendar file: ")
648 (save-excursion 655 (save-excursion
649 (goto-char min) 656 (goto-char min)
650 (while (re-search-forward 657 (while (re-search-forward
651 "^\\([^ \t\n].*\\)\\(\n[ \t].*\\)*" max t) 658 "^\\([^ \t\n].*\\)\\(\\(\n[ \t].*\\)*\\)" max t)
652 (setq entry-main (match-string 1)) 659 (setq entry-main (match-string 1))
653 (if (match-beginning 2) 660 (if (match-beginning 2)
654 (setq entry-rest (match-string 2)) 661 (setq entry-rest (match-string 2))
@@ -1171,13 +1178,13 @@ written into the buffer ` *icalendar-errors*'."
1171 ;; weekly and not all-day 1178 ;; weekly and not all-day
1172 (let* ((byday (cadr (assoc 'BYDAY rrule-props))) 1179 (let* ((byday (cadr (assoc 'BYDAY rrule-props)))
1173 (weekday 1180 (weekday
1174 (cdr (rassoc 1181 (icalendar--get-weekday-number byday)))
1175 byday
1176 icalendar-weekdayabbrev-table))))
1177 (icalendar--dmsg "weekly not-all-day") 1182 (icalendar--dmsg "weekly not-all-day")
1178 (if weekday 1183 (if (> weekday -1)
1179 (setq diary-string 1184 (setq diary-string
1180 (format "%s %s%s%s" weekday 1185 (format "%s %s%s%s"
1186 (aref calendar-day-name-array
1187 weekday)
1181 start-t (if end-t "-" "") 1188 start-t (if end-t "-" "")
1182 (or end-t ""))) 1189 (or end-t "")))
1183 ;; FIXME!!!! 1190 ;; FIXME!!!!
diff --git a/lisp/files.el b/lisp/files.el
index aaed1395275..c9fb3514b57 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1646,40 +1646,33 @@ in that case, this function acts as if `enable-local-variables' were t."
1646 (lambda (elt) 1646 (lambda (elt)
1647 (cons (purecopy (car elt)) (cdr elt))) 1647 (cons (purecopy (car elt)) (cdr elt)))
1648 '(("\\.te?xt\\'" . text-mode) 1648 '(("\\.te?xt\\'" . text-mode)
1649 ("\\.tex\\'" . tex-mode) 1649 ("\\.[tT]e[xX]\\'" . tex-mode)
1650 ("\\.ins\\'" . tex-mode) ;Installation files for TeX packages. 1650 ("\\.ins\\'" . tex-mode) ;Installation files for TeX packages.
1651 ("\\.ltx\\'" . latex-mode) 1651 ("\\.ltx\\'" . latex-mode)
1652 ("\\.dtx\\'" . doctex-mode) 1652 ("\\.dtx\\'" . doctex-mode)
1653 ("\\.el\\'" . emacs-lisp-mode) 1653 ("\\.el\\'" . emacs-lisp-mode)
1654 ("\\.\\(scm\\|stk\\|ss\\|sch\\)\\'" . scheme-mode) 1654 ("\\.\\(scm\\|stk\\|ss\\|sch\\)\\'" . scheme-mode)
1655 ("\\.l\\'" . lisp-mode) 1655 ("\\.l\\'" . lisp-mode)
1656 ("\\.lisp\\'" . lisp-mode) 1656 ("\\.li?sp\\'" . lisp-mode)
1657 ("\\.f\\'" . fortran-mode) 1657 ("\\.[fF]\\'" . fortran-mode)
1658 ("\\.F\\'" . fortran-mode)
1659 ("\\.for\\'" . fortran-mode) 1658 ("\\.for\\'" . fortran-mode)
1660 ("\\.p\\'" . pascal-mode) 1659 ("\\.p\\'" . pascal-mode)
1661 ("\\.pas\\'" . pascal-mode) 1660 ("\\.pas\\'" . pascal-mode)
1662 ("\\.ad[abs]\\'" . ada-mode) 1661 ("\\.ad[abs]\\'" . ada-mode)
1663 ("\\.ad[bs].dg\\'" . ada-mode) 1662 ("\\.ad[bs].dg\\'" . ada-mode)
1664 ("\\.\\([pP]\\([Llm]\\|erl\\)\\|al\\)\\'" . perl-mode) 1663 ("\\.\\([pP]\\([Llm]\\|erl\\|od\\)\\|al\\)\\'" . perl-mode)
1665 ("\\.s?html?\\'" . html-mode) 1664 ("\\.s?html?\\'" . html-mode)
1666 ("\\.mk\\'" . makefile-mode) 1665 ("\\.mk\\'" . makefile-mode)
1667 ("\\(M\\|m\\|GNUm\\)akefile\\'" . makefile-mode) 1666 ("\\([Mm]\\|GNUm\\)akep*file\\'" . makefile-mode)
1668 ("\\.am\\'" . makefile-mode) ;For Automake. 1667 ("\\.am\\'" . makefile-mode) ;For Automake.
1669 ;; Less common extensions come here 1668 ;; Less common extensions come here
1670 ;; so more common ones above are found faster. 1669 ;; so more common ones above are found faster.
1671 ("\\.texinfo\\'" . texinfo-mode) 1670 ("\\.texinfo\\'" . texinfo-mode)
1672 ("\\.te?xi\\'" . texinfo-mode) 1671 ("\\.te?xi\\'" . texinfo-mode)
1673 ("\\.s\\'" . asm-mode) 1672 ("\\.[sS]\\'" . asm-mode)
1674 ("\\.S\\'" . asm-mode)
1675 ("\\.asm\\'" . asm-mode) 1673 ("\\.asm\\'" . asm-mode)
1676 ("ChangeLog\\'" . change-log-mode) 1674 ("[cC]hange\\.?[lL]og?\\'" . change-log-mode)
1677 ("change\\.log\\'" . change-log-mode) 1675 ("[cC]hange[lL]og\\.[0-9]+\\'" . change-log-mode)
1678 ("changelo\\'" . change-log-mode)
1679 ("ChangeLog\\.[0-9]+\\'" . change-log-mode)
1680 ;; for MSDOS and MS-Windows (which are case-insensitive)
1681 ("changelog\\'" . change-log-mode)
1682 ("changelog\\.[0-9]+\\'" . change-log-mode)
1683 ("\\$CHANGE_LOG\\$\\.TXT" . change-log-mode) 1676 ("\\$CHANGE_LOG\\$\\.TXT" . change-log-mode)
1684 ("\\.scm\\.[0-9]*\\'" . scheme-mode) 1677 ("\\.scm\\.[0-9]*\\'" . scheme-mode)
1685 ("\\.[ck]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode) 1678 ("\\.[ck]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode)
@@ -1688,36 +1681,27 @@ in that case, this function acts as if `enable-local-variables' were t."
1688 ("\\(/\\|\\`\\)\\.\\(bash_logout\\|shrc\\|[kz]shrc\\|bashrc\\|t?cshrc\\|esrc\\)\\'" . sh-mode) 1681 ("\\(/\\|\\`\\)\\.\\(bash_logout\\|shrc\\|[kz]shrc\\|bashrc\\|t?cshrc\\|esrc\\)\\'" . sh-mode)
1689 ("\\(/\\|\\`\\)\\.\\([kz]shenv\\|xinitrc\\|startxrc\\|xsession\\)\\'" . sh-mode) 1682 ("\\(/\\|\\`\\)\\.\\([kz]shenv\\|xinitrc\\|startxrc\\|xsession\\)\\'" . sh-mode)
1690 ("\\.m?spec\\'" . sh-mode) 1683 ("\\.m?spec\\'" . sh-mode)
1691 ("\\.mm\\'" . nroff-mode) 1684 ("\\.m[mes]\\'" . nroff-mode)
1692 ("\\.me\\'" . nroff-mode)
1693 ("\\.ms\\'" . nroff-mode)
1694 ("\\.man\\'" . nroff-mode) 1685 ("\\.man\\'" . nroff-mode)
1695 ("\\.TeX\\'" . tex-mode)
1696 ("\\.sty\\'" . latex-mode) 1686 ("\\.sty\\'" . latex-mode)
1697 ("\\.cls\\'" . latex-mode) ;LaTeX 2e class 1687 ("\\.cl[so]\\'" . latex-mode) ;LaTeX 2e class option
1698 ("\\.clo\\'" . latex-mode) ;LaTeX 2e class option
1699 ("\\.bbl\\'" . latex-mode) 1688 ("\\.bbl\\'" . latex-mode)
1700 ("\\.bib\\'" . bibtex-mode) 1689 ("\\.bib\\'" . bibtex-mode)
1701 ("\\.sql\\'" . sql-mode) 1690 ("\\.sql\\'" . sql-mode)
1702 ("\\.m4\\'" . m4-mode) 1691 ("\\.m[4c]\\'" . m4-mode)
1703 ("\\.mc\\'" . m4-mode) 1692 ("\\.m[fp]\\'" . metapost-mode)
1704 ("\\.mf\\'" . metafont-mode)
1705 ("\\.mp\\'" . metapost-mode)
1706 ("\\.vhdl?\\'" . vhdl-mode) 1693 ("\\.vhdl?\\'" . vhdl-mode)
1707 ("\\.article\\'" . text-mode) 1694 ("\\.article\\'" . text-mode)
1708 ("\\.letter\\'" . text-mode) 1695 ("\\.letter\\'" . text-mode)
1709 ("\\.tcl\\'" . tcl-mode) 1696 ("\\.i?tcl\\'" . tcl-mode)
1710 ("\\.exp\\'" . tcl-mode) 1697 ("\\.exp\\'" . tcl-mode)
1711 ("\\.itcl\\'" . tcl-mode)
1712 ("\\.itk\\'" . tcl-mode) 1698 ("\\.itk\\'" . tcl-mode)
1713 ("\\.icn\\'" . icon-mode) 1699 ("\\.icn\\'" . icon-mode)
1714 ("\\.sim\\'" . simula-mode) 1700 ("\\.sim\\'" . simula-mode)
1715 ("\\.mss\\'" . scribe-mode) 1701 ("\\.mss\\'" . scribe-mode)
1716 ("\\.f90\\'" . f90-mode) 1702 ("\\.f9[05]\\'" . f90-mode)
1717 ("\\.f95\\'" . f90-mode)
1718 ("\\.indent\\.pro\\'" . fundamental-mode) ; to avoid idlwave-mode 1703 ("\\.indent\\.pro\\'" . fundamental-mode) ; to avoid idlwave-mode
1719 ("\\.pro\\'" . idlwave-mode) 1704 ("\\.pro\\'" . idlwave-mode)
1720 ("\\.lsp\\'" . lisp-mode)
1721 ("\\.prolog\\'" . prolog-mode) 1705 ("\\.prolog\\'" . prolog-mode)
1722 ("\\.tar\\'" . tar-mode) 1706 ("\\.tar\\'" . tar-mode)
1723 ("\\.\\(arc\\|zip\\|lzh\\|zoo\\|ear\\|jar\\|war\\)\\'" . archive-mode) 1707 ("\\.\\(arc\\|zip\\|lzh\\|zoo\\|ear\\|jar\\|war\\)\\'" . archive-mode)
@@ -1733,10 +1717,11 @@ in that case, this function acts as if `enable-local-variables' were t."
1733 ("\\`/tmp/fol/" . text-mode) 1717 ("\\`/tmp/fol/" . text-mode)
1734 ("\\.oak\\'" . scheme-mode) 1718 ("\\.oak\\'" . scheme-mode)
1735 ("\\.sgml?\\'" . sgml-mode) 1719 ("\\.sgml?\\'" . sgml-mode)
1736 ("\\.xml\\'" . sgml-mode) 1720 ("\\.x[ms]l\\'" . xml-mode)
1737 ("\\.xsl\\'" . sgml-mode)
1738 ("\\.dtd\\'" . sgml-mode) 1721 ("\\.dtd\\'" . sgml-mode)
1739 ("\\.ds\\(ss\\)?l\\'" . dsssl-mode) 1722 ("\\.ds\\(ss\\)?l\\'" . dsssl-mode)
1723 ("\\.js\\'" . java-mode) ; javascript-mode would be better
1724 ("\\.x[bp]m\\'" . c-mode)
1740 ;; .emacs or .gnus or .viper following a directory delimiter in 1725 ;; .emacs or .gnus or .viper following a directory delimiter in
1741 ;; Unix, MSDOG or VMS syntax. 1726 ;; Unix, MSDOG or VMS syntax.
1742 ("[]>:/\\]\\..*\\(emacs\\|gnus\\|viper\\)\\'" . emacs-lisp-mode) 1727 ("[]>:/\\]\\..*\\(emacs\\|gnus\\|viper\\)\\'" . emacs-lisp-mode)
@@ -1760,7 +1745,7 @@ in that case, this function acts as if `enable-local-variables' were t."
1760 ;; or .#<file>.<rev>-<rev> or VC's <file>.~<rev>~. 1745 ;; or .#<file>.<rev>-<rev> or VC's <file>.~<rev>~.
1761 ;; Using mode nil rather than `ignore' would let the search continue 1746 ;; Using mode nil rather than `ignore' would let the search continue
1762 ;; through this list (with the shortened name) rather than start over. 1747 ;; through this list (with the shortened name) rather than start over.
1763 ("\\.~?[0-9]+\\.[0-9][-.0-9]*~?\\'" ignore t) 1748 ("\\.~?[0-9]+\\.[0-9][-.0-9]*~?\\'" nil t)
1764 ;; The following should come after the ChangeLog pattern 1749 ;; The following should come after the ChangeLog pattern
1765 ;; for the sake of ChangeLog.1, etc. 1750 ;; for the sake of ChangeLog.1, etc.
1766 ;; and after the .scm.[0-9] and CVS' <file>.<rev> patterns too. 1751 ;; and after the .scm.[0-9] and CVS' <file>.<rev> patterns too.
@@ -1849,12 +1834,20 @@ be interpreted by the interpreter matched by the second group of the
1849regular expression. The mode is then determined as the mode associated 1834regular expression. The mode is then determined as the mode associated
1850with that interpreter in `interpreter-mode-alist'.") 1835with that interpreter in `interpreter-mode-alist'.")
1851 1836
1837(defvar xml-based-modes '(html-mode)
1838 "Modes that override an XML declaration.
1839When `set-auto-mode' sees an <?xml or <!DOCTYPE declaration, that
1840buffer will be in some XML mode. If `auto-mode-alist' associates
1841the file with one of the modes in this list, that mode will be
1842used. Else `xml-mode' or `sgml-mode' is used.")
1843
1852(defun set-auto-mode (&optional just-from-file-name) 1844(defun set-auto-mode (&optional just-from-file-name)
1853 "Select major mode appropriate for current buffer. 1845 "Select major mode appropriate for current buffer.
1854This checks for a -*- mode tag in the buffer's text, 1846This checks for a -*- mode tag in the buffer's text, checks the
1855compares the filename against the entries in `auto-mode-alist', 1847interpreter that runs this file against `interpreter-mode-alist',
1856or checks the interpreter that runs this file against 1848looks for an <?xml or <!DOCTYPE declaration (see
1857`interpreter-mode-alist'. 1849`xml-based-modes'), or compares the filename against the entries
1850in `auto-mode-alist'.
1858 1851
1859It does not check for the `mode:' local variable in the 1852It does not check for the `mode:' local variable in the
1860Local Variables section of the file; for that, use `hack-local-variables'. 1853Local Variables section of the file; for that, use `hack-local-variables'.
@@ -1866,87 +1859,84 @@ If the optional argument JUST-FROM-FILE-NAME is non-nil,
1866then we do not set anything but the major mode, 1859then we do not set anything but the major mode,
1867and we don't even do that unless it would come from the file name." 1860and we don't even do that unless it would come from the file name."
1868 ;; Look for -*-MODENAME-*- or -*- ... mode: MODENAME; ... -*- 1861 ;; Look for -*-MODENAME-*- or -*- ... mode: MODENAME; ... -*-
1869 (let (end done modes) 1862 (let (end done mode modes xml)
1870 (save-excursion
1871 (goto-char (point-min))
1872 (skip-chars-forward " \t\n")
1873 (and enable-local-variables
1874 (setq end (set-auto-mode-1))
1875 (if (save-excursion (search-forward ":" end t))
1876 ;; Find all specifications for the `mode:' variable
1877 ;; and execute them left to right.
1878 (while (let ((case-fold-search t))
1879 (or (and (looking-at "mode:")
1880 (goto-char (match-end 0)))
1881 (re-search-forward "[ \t;]mode:" end t)))
1882 (skip-chars-forward " \t")
1883 (let ((beg (point)))
1884 (if (search-forward ";" end t)
1885 (forward-char -1)
1886 (goto-char end))
1887 (skip-chars-backward " \t")
1888 (push (intern (concat (downcase (buffer-substring beg (point))) "-mode"))
1889 modes)))
1890 ;; Simple -*-MODE-*- case.
1891 (push (intern (concat (downcase (buffer-substring (point) end))
1892 "-mode"))
1893 modes))))
1894 ;; If we found modes to use, invoke them now,
1895 ;; outside the save-excursion.
1896 (unless just-from-file-name 1863 (unless just-from-file-name
1897 (dolist (mode (nreverse modes)) 1864 ;; Find a -*- mode tag
1898 (if (not (functionp mode)) 1865 (save-excursion
1899 (message "Ignoring unknown mode `%s'" mode) 1866 (goto-char (point-min))
1900 (setq done t) 1867 (skip-chars-forward " \t\n")
1901 (funcall mode)))) 1868 ;; While we're at this point, check xml for later.
1902 ;; If we didn't find a mode from a -*- line, try using the file name. 1869 (setq xml (looking-at "<\\?xml \\|<!DOCTYPE"))
1870 (and enable-local-variables
1871 (setq end (set-auto-mode-1))
1872 (if (save-excursion (search-forward ":" end t))
1873 ;; Find all specifications for the `mode:' variable
1874 ;; and execute them left to right.
1875 (while (let ((case-fold-search t))
1876 (or (and (looking-at "mode:")
1877 (goto-char (match-end 0)))
1878 (re-search-forward "[ \t;]mode:" end t)))
1879 (skip-chars-forward " \t")
1880 (let ((beg (point)))
1881 (if (search-forward ";" end t)
1882 (forward-char -1)
1883 (goto-char end))
1884 (skip-chars-backward " \t")
1885 (push (intern (concat (downcase (buffer-substring beg (point))) "-mode"))
1886 modes)))
1887 ;; Simple -*-MODE-*- case.
1888 (push (intern (concat (downcase (buffer-substring (point) end))
1889 "-mode"))
1890 modes))))
1891 ;; If we found modes to use, invoke them now, outside the save-excursion.
1892 (if modes
1893 (dolist (mode (nreverse modes))
1894 (if (not (functionp mode))
1895 (message "Ignoring unknown mode `%s'" mode)
1896 (setq done t)
1897 (funcall mode)))
1898 ;; If we didn't, look for an interpreter specified in the first line.
1899 ;; As a special case, allow for things like "#!/bin/env perl", which
1900 ;; finds the interpreter anywhere in $PATH.
1901 (setq mode (save-excursion
1902 (goto-char (point-min))
1903 (if (looking-at auto-mode-interpreter-regexp)
1904 (match-string 2)
1905 ""))
1906 ;; Map interpreter name to a mode, signalling we're done at the
1907 ;; same time.
1908 done (assoc (file-name-nondirectory mode)
1909 interpreter-mode-alist))
1910 ;; If we found an interpreter mode to use, invoke it now.
1911 (if done (funcall (cdr done)))))
1903 (if (and (not done) buffer-file-name) 1912 (if (and (not done) buffer-file-name)
1904 (let ((name buffer-file-name) 1913 (let ((name buffer-file-name))
1905 (keep-going t))
1906 ;; Remove backup-suffixes from file name. 1914 ;; Remove backup-suffixes from file name.
1907 (setq name (file-name-sans-versions name)) 1915 (setq name (file-name-sans-versions name))
1908 (while keep-going 1916 (while (not done)
1909 (setq keep-going nil) 1917 ;; Find first matching alist entry.
1910 (let ((alist auto-mode-alist) 1918 (let ((case-fold-search
1911 (mode nil)) 1919 (memq system-type '(vax-vms windows-nt cygwin))))
1912 ;; Find first matching alist entry. 1920 (if (and (setq mode (assoc-default name auto-mode-alist
1913 (let ((case-fold-search 1921 'string-match))
1914 (memq system-type '(vax-vms windows-nt cygwin)))) 1922 (consp mode)
1915 (while (and (not mode) alist) 1923 (cadr mode))
1916 (if (string-match (car (car alist)) name) 1924 (setq mode (car mode)
1917 (if (and (consp (cdr (car alist))) 1925 name (substring name 0 (match-beginning 0)))
1918 (nth 2 (car alist))) 1926 (setq done t)))
1919 (setq mode (car (cdr (car alist))) 1927 (if mode
1920 name (substring name 0 (match-beginning 0)) 1928 ;; When JUST-FROM-FILE-NAME is set, we are working on behalf
1921 keep-going t) 1929 ;; of set-visited-file-name. In that case, if the major mode
1922 (setq mode (cdr (car alist)) 1930 ;; specified is the same one we already have, don't actually
1923 keep-going nil))) 1931 ;; reset it. We don't want to lose minor modes such as Font
1924 (setq alist (cdr alist)))) 1932 ;; Lock.
1925 (if mode 1933 (unless (and just-from-file-name (eq mode major-mode))
1926 ;; When JUST-FROM-FILE-NAME is set, 1934 (if (if xml (memq mode xml-based-modes) t)
1927 ;; we are working on behalf of set-visited-file-name. 1935 (funcall mode)
1928 ;; In that case, if the major mode specified is the 1936 (xml-mode)))))))
1929 ;; same one we already have, don't actually reset it. 1937 (and (not done)
1930 ;; We don't want to lose minor modes such as Font Lock. 1938 xml
1931 (unless (and just-from-file-name (eq mode major-mode)) 1939 (xml-mode))))
1932 (funcall mode))
1933 ;; If we can't deduce a mode from the file name,
1934 ;; look for an interpreter specified in the first line.
1935 ;; As a special case, allow for things like "#!/bin/env perl",
1936 ;; which finds the interpreter anywhere in $PATH.
1937 (let ((interpreter
1938 (save-excursion
1939 (goto-char (point-min))
1940 (if (looking-at auto-mode-interpreter-regexp)
1941 (match-string 2)
1942 "")))
1943 elt)
1944 ;; Map interpreter name to a mode.
1945 (setq elt (assoc (file-name-nondirectory interpreter)
1946 interpreter-mode-alist))
1947 (unless just-from-file-name
1948 (if elt
1949 (funcall (cdr elt))))))))))))
1950 1940
1951 1941
1952(defun set-auto-mode-1 () 1942(defun set-auto-mode-1 ()
@@ -2157,7 +2147,7 @@ is specified, returning t if it is specified."
2157 (error "Local variables entry is missing the suffix"))) 2147 (error "Local variables entry is missing the suffix")))
2158 (forward-line 1)) 2148 (forward-line 1))
2159 (goto-char (point-min)) 2149 (goto-char (point-min))
2160 2150
2161 (while (not (eobp)) 2151 (while (not (eobp))
2162 ;; Find the variable name; strip whitespace. 2152 ;; Find the variable name; strip whitespace.
2163 (skip-chars-forward " \t") 2153 (skip-chars-forward " \t")
diff --git a/lisp/find-file.el b/lisp/find-file.el
index 4805d08400b..d85d2ab0f51 100644
--- a/lisp/find-file.el
+++ b/lisp/find-file.el
@@ -57,7 +57,7 @@
57;; format above can be changed to include a function to be called when the 57;; format above can be changed to include a function to be called when the
58;; current file matches the regexp: 58;; current file matches the regexp:
59;; 59;;
60;; '(("\\.cc$" cc-function) 60;; '(("\\.cc$" cc--function)
61;; ("\\.hh$" hh-function)) 61;; ("\\.hh$" hh-function))
62;; 62;;
63;; These functions must return a list consisting of the possible names of the 63;; These functions must return a list consisting of the possible names of the
@@ -239,22 +239,26 @@ the preceding slash. The star represents all the subdirectories except
239 :group 'ff) 239 :group 'ff)
240 240
241(defcustom cc-other-file-alist 241(defcustom cc-other-file-alist
242 '( 242 '(("\\.cc\\'" (".hh" ".h"))
243 ("\\.cc$" (".hh" ".h")) 243 ("\\.hh\\'" (".cc" ".C"))
244 ("\\.hh$" (".cc" ".C"))
245 244
246 ("\\.c$" (".h")) 245 ("\\.c\\'" (".h"))
247 ("\\.h$" (".c" ".cc" ".C" ".CC" ".cxx" ".cpp")) 246 ("\\.h\\'" (".c" ".cc" ".C" ".CC" ".cxx" ".cpp"))
248 247
249 ("\\.C$" (".H" ".hh" ".h")) 248 ("\\.C\\'" (".H" ".hh" ".h"))
250 ("\\.H$" (".C" ".CC")) 249 ("\\.H\\'" (".C" ".CC"))
251 250
252 ("\\.CC$" (".HH" ".H" ".hh" ".h")) 251 ("\\.CC\\'" (".HH" ".H" ".hh" ".h"))
253 ("\\.HH$" (".CC")) 252 ("\\.HH\\'" (".CC"))
254 253
255 ("\\.cxx$" (".hh" ".h")) 254 ("\\.c\\+\\+\\'" (".h++" ".hh" ".h"))
256 ("\\.cpp$" (".hh" ".h")) 255 ("\\.h\\+\\+\\'" (".c++"))
257 ) 256
257 ("\\.cpp\\'" (".hpp" ".hh" ".h"))
258 ("\\.hpp\\'" (".cpp"))
259
260 ("\\.cxx\\'" (".hxx" ".hh" ".h"))
261 ("\\.hxx\\'" (".cxx")))
258 "*Alist of extensions to find given the current file's extension. 262 "*Alist of extensions to find given the current file's extension.
259 263
260This list should contain the most used extensions before the others, 264This list should contain the most used extensions before the others,
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 2a4b0a80398..02d8fe24007 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,13 @@
12004-10-25 Reiner Steib <Reiner.Steib@gmx.de>
2
3 * html2text.el (html2text-buffer-head): Removed. Use `goto-char'
4 instead.
5
62004-10-24 Kevin Greiner <kevin.greiner@compsol.cc>
7
8 * gnus-start.el (gnus-convert-old-newsrc): Fixed numeric
9 comparison on string.
10
12004-10-21 Katsumi Yamaoka <yamaoka@jpl.org> 112004-10-21 Katsumi Yamaoka <yamaoka@jpl.org>
2 12
3 * mm-view.el (mm-display-inline-fontify): Inhibit font-lock when 13 * mm-view.el (mm-display-inline-fontify): Inhibit font-lock when
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index dda03b864b1..ecce9f00b37 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -2227,7 +2227,8 @@ If FORCE is non-nil, the .newsrc file is read."
2227(defun gnus-convert-old-newsrc () 2227(defun gnus-convert-old-newsrc ()
2228 "Convert old newsrc formats into the current format, if needed." 2228 "Convert old newsrc formats into the current format, if needed."
2229 (let ((fcv (and gnus-newsrc-file-version 2229 (let ((fcv (and gnus-newsrc-file-version
2230 (gnus-continuum-version gnus-newsrc-file-version)))) 2230 (gnus-continuum-version gnus-newsrc-file-version)))
2231 (gcv (gnus-continuum-version)))
2231 (when fcv 2232 (when fcv
2232 ;; A newsrc file was loaded. 2233 ;; A newsrc file was loaded.
2233 (let (prompt-displayed 2234 (let (prompt-displayed
@@ -2261,7 +2262,7 @@ If FORCE is non-nil, the .newsrc file is read."
2261 ;; Perform converters to bring older version up to date. 2262 ;; Perform converters to bring older version up to date.
2262 (when (and converters (< fcv (caar converters))) 2263 (when (and converters (< fcv (caar converters)))
2263 (while (and converters (< fcv (caar converters)) 2264 (while (and converters (< fcv (caar converters))
2264 (<= (caar converters) gnus-version)) 2265 (<= (caar converters) gcv))
2265 (let* ((converter-spec (pop converters)) 2266 (let* ((converter-spec (pop converters))
2266 (convert-to (nth 1 converter-spec)) 2267 (convert-to (nth 1 converter-spec))
2267 (load-from (nth 2 converter-spec)) 2268 (load-from (nth 2 converter-spec))
diff --git a/lisp/gnus/html2text.el b/lisp/gnus/html2text.el
index 6f1ef3b0289..31d1869c695 100644
--- a/lisp/gnus/html2text.el
+++ b/lisp/gnus/html2text.el
@@ -116,12 +116,6 @@ formatting, and then moved afterward.")
116;; <Utility functions> 116;; <Utility functions>
117;; 117;;
118 118
119(defun html2text-buffer-head ()
120 (if (string= mode-name "Article")
121 (beginning-of-buffer)
122 (beginning-of-buffer)
123 )
124 )
125 119
126(defun html2text-replace-string (from-string to-string p1 p2) 120(defun html2text-replace-string (from-string to-string p1 p2)
127 (goto-char p1) 121 (goto-char p1)
@@ -432,11 +426,11 @@ formatting, and then moved afterward.")
432 "This _tries_ to fix up the paragraphs - this is done in quite a ad-hook 426 "This _tries_ to fix up the paragraphs - this is done in quite a ad-hook
433fashion, quite close to pure guess-work. It does work in some cases though." 427fashion, quite close to pure guess-work. It does work in some cases though."
434 (interactive) 428 (interactive)
435 (html2text-buffer-head) 429 (goto-char (point-min))
436 (replace-regexp "^<br>$" "") 430 (replace-regexp "^<br>$" "")
437 ;; Removing lonely <br> on a single line, if they are left intact we 431 ;; Removing lonely <br> on a single line, if they are left intact we
438 ;; dont have any paragraphs at all. 432 ;; dont have any paragraphs at all.
439 (html2text-buffer-head) 433 (goto-char (point-min))
440 (while (not (eobp)) 434 (while (not (eobp))
441 (let ((p1 (point))) 435 (let ((p1 (point)))
442 (forward-paragraph 1) 436 (forward-paragraph 1)
@@ -462,7 +456,7 @@ fashion, quite close to pure guess-work. It does work in some cases though."
462See the documentation for that variable." 456See the documentation for that variable."
463 (interactive) 457 (interactive)
464 (dolist (tag tag-list) 458 (dolist (tag tag-list)
465 (html2text-buffer-head) 459 (goto-char (point-min))
466 (while (re-search-forward (format "\\(</?%s[^>]*>\\)" tag) (point-max) t) 460 (while (re-search-forward (format "\\(</?%s[^>]*>\\)" tag) (point-max) t)
467 (delete-region (match-beginning 0) (match-end 0))))) 461 (delete-region (match-beginning 0) (match-end 0)))))
468 462
@@ -472,7 +466,7 @@ See the documentation for that variable."
472 (dolist (tag-and-function html2text-format-tag-list) 466 (dolist (tag-and-function html2text-format-tag-list)
473 (let ((tag (car tag-and-function)) 467 (let ((tag (car tag-and-function))
474 (function (cdr tag-and-function))) 468 (function (cdr tag-and-function)))
475 (html2text-buffer-head) 469 (goto-char (point-min))
476 (while (re-search-forward (format "\\(<%s\\( [^>]*\\)?>\\)" tag) 470 (while (re-search-forward (format "\\(<%s\\( [^>]*\\)?>\\)" tag)
477 (point-max) t) 471 (point-max) t)
478 (let ((p1) 472 (let ((p1)
@@ -497,7 +491,7 @@ See the documentation for that variable."
497 "See the variable \"html2text-replace-list\" for documentation" 491 "See the variable \"html2text-replace-list\" for documentation"
498 (interactive) 492 (interactive)
499 (dolist (e html2text-replace-list) 493 (dolist (e html2text-replace-list)
500 (html2text-buffer-head) 494 (goto-char (point-min))
501 (let ((old-string (car e)) 495 (let ((old-string (car e))
502 (new-string (cdr e))) 496 (new-string (cdr e)))
503 (html2text-replace-string old-string new-string (point-min) (point-max)) 497 (html2text-replace-string old-string new-string (point-min) (point-max))
@@ -511,7 +505,7 @@ See the documentation for that variable."
511 (dolist (tag-and-function html2text-format-single-element-list) 505 (dolist (tag-and-function html2text-format-single-element-list)
512 (let ((tag (car tag-and-function)) 506 (let ((tag (car tag-and-function))
513 (function (cdr tag-and-function))) 507 (function (cdr tag-and-function)))
514 (html2text-buffer-head) 508 (goto-char (point-min))
515 (while (re-search-forward (format "\\(<%s\\( [^>]*\\)?>\\)" tag) 509 (while (re-search-forward (format "\\(<%s\\( [^>]*\\)?>\\)" tag)
516 (point-max) t) 510 (point-max) t)
517 (let ((p1) 511 (let ((p1)
diff --git a/lisp/help.el b/lisp/help.el
index 5a2867bdc18..ee35d007639 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -573,14 +573,14 @@ the last key hit are used."
573 (if (symbolp defn) defn (prin1-to-string defn))))))))) 573 (if (symbolp defn) defn (prin1-to-string defn)))))))))
574 574
575 575
576(defun describe-key (key &optional untranslated) 576(defun describe-key (key &optional untranslated up-event)
577 "Display documentation of the function invoked by KEY. 577 "Display documentation of the function invoked by KEY.
578KEY should be a key sequence--when calling from a program, 578KEY should be a key sequence--when calling from a program,
579pass a string or a vector. 579pass a string or a vector.
580If non-nil UNTRANSLATED is a vector of the untranslated events. 580If non-nil UNTRANSLATED is a vector of the untranslated events.
581It can also be a number in which case the untranslated events from 581It can also be a number in which case the untranslated events from
582the last key hit are used." 582the last key hit are used."
583 (interactive "kDescribe key: \np") 583 (interactive "kDescribe key: \np\nU")
584 (if (numberp untranslated) 584 (if (numberp untranslated)
585 (setq untranslated (this-single-command-raw-keys))) 585 (setq untranslated (this-single-command-raw-keys)))
586 (save-excursion 586 (save-excursion
@@ -608,6 +608,17 @@ the last key hit are used."
608 (prin1 defn) 608 (prin1 defn)
609 (princ "\n which is ") 609 (princ "\n which is ")
610 (describe-function-1 defn) 610 (describe-function-1 defn)
611 (when up-event
612 (let ((defn (or (string-key-binding up-event) (key-binding up-event))))
613 (unless (or (null defn) (integerp defn) (equal defn 'undefined))
614 (princ "\n\n-------------- up event ---------------\n\n")
615 (princ (key-description up-event))
616 (if (windowp window)
617 (princ " at that spot"))
618 (princ " runs the command ")
619 (prin1 defn)
620 (princ "\n which is ")
621 (describe-function-1 defn))))
611 (print-help-return-message))))))) 622 (print-help-return-message)))))))
612 623
613 624
@@ -651,7 +662,8 @@ whose documentation describes the minor mode."
651 (push (list pretty-minor-mode mode indicator) 662 (push (list pretty-minor-mode mode indicator)
652 minor-modes)))) 663 minor-modes))))
653 (if auto-fill-function 664 (if auto-fill-function
654 (push '("Auto Fill" auto-fill-mode " Fill") 665 ;; copy pure string so we can add face property to it below.
666 (push (list (copy-sequence "Auto Fill") 'auto-fill-mode " Fill")
655 minor-modes)) 667 minor-modes))
656 (setq minor-modes 668 (setq minor-modes
657 (sort minor-modes 669 (sort minor-modes
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index 5d24964362a..bed4330d0c2 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -645,16 +645,16 @@ The group will be added to `ibuffer-filter-group-kill-ring'."
645 (ibuffer-update nil t)) 645 (ibuffer-update nil t))
646 646
647;;;###autoload 647;;;###autoload
648(defun ibuffer-kill-line (&optional arg) 648(defun ibuffer-kill-line (&optional arg interactive-p)
649 "Kill the filter group at point. 649 "Kill the filter group at point.
650See also `ibuffer-kill-filter-group'." 650See also `ibuffer-kill-filter-group'."
651 (interactive "P") 651 (interactive "P\np")
652 (ibuffer-aif (save-excursion 652 (ibuffer-aif (save-excursion
653 (ibuffer-forward-line 0) 653 (ibuffer-forward-line 0)
654 (get-text-property (point) 'ibuffer-filter-group-name)) 654 (get-text-property (point) 'ibuffer-filter-group-name))
655 (progn 655 (progn
656 (ibuffer-kill-filter-group it)) 656 (ibuffer-kill-filter-group it))
657 (funcall (if (interactive-p) #'call-interactively #'funcall) 657 (funcall (if interactive-p #'call-interactively #'funcall)
658 #'kill-line arg))) 658 #'kill-line arg)))
659 659
660(defun ibuffer-insert-filter-group-before (newgroup group) 660(defun ibuffer-insert-filter-group-before (newgroup group)
@@ -1237,53 +1237,51 @@ hidden group filter, open it.
1237If `ibuffer-jump-offer-only-visible-buffers' is non-nil, only offer 1237If `ibuffer-jump-offer-only-visible-buffers' is non-nil, only offer
1238visible buffers in the completion list. Calling the command with 1238visible buffers in the completion list. Calling the command with
1239a prefix argument reverses the meaning of that variable." 1239a prefix argument reverses the meaning of that variable."
1240 (interactive (list nil)) 1240 (interactive (list
1241 (let ((only-visible ibuffer-jump-offer-only-visible-buffers)) 1241 (let ((only-visible ibuffer-jump-offer-only-visible-buffers))
1242 (when current-prefix-arg 1242 (when current-prefix-arg
1243 (setq only-visible (not only-visible))) 1243 (setq only-visible (not only-visible)))
1244 (if only-visible 1244 (if only-visible
1245 (let ((table (mapcar #'(lambda (x) 1245 (let ((table (mapcar #'(lambda (x)
1246 (buffer-name (car x))) 1246 (buffer-name (car x)))
1247 (ibuffer-current-state-list)))) 1247 (ibuffer-current-state-list))))
1248 (when (null table) 1248 (when (null table)
1249 (error "No buffers!")) 1249 (error "No buffers!"))
1250 (when (interactive-p) 1250 (completing-read "Jump to buffer: "
1251 (setq name (completing-read "Jump to buffer: " 1251 table nil t))
1252 table nil t)))) 1252 (read-buffer "Jump to buffer: " nil t)))))
1253 (when (interactive-p) 1253 (when (not (string= "" name))
1254 (setq name (read-buffer "Jump to buffer: " nil t)))) 1254 (let (buf-point)
1255 (when (not (string= "" name)) 1255 ;; Blindly search for our buffer: it is very likely that it is
1256 (let (buf-point) 1256 ;; not in a hidden filter group.
1257 ;; Blindly search for our buffer: it is very likely that it is 1257 (ibuffer-map-lines #'(lambda (buf marks)
1258 ;; not in a hidden filter group. 1258 (when (string= (buffer-name buf) name)
1259 (ibuffer-map-lines #'(lambda (buf marks) 1259 (setq buf-point (point))
1260 (when (string= (buffer-name buf) name) 1260 nil))
1261 (setq buf-point (point)) 1261 t nil)
1262 nil)) 1262 (when (and
1263 t nil) 1263 (null buf-point)
1264 (when (and 1264 (not (null ibuffer-hidden-filter-groups)))
1265 (null buf-point) 1265 ;; We did not find our buffer. It must be in a hidden filter
1266 (not (null ibuffer-hidden-filter-groups))) 1266 ;; group, so go through all hidden filter groups to find it.
1267 ;; We did not find our buffer. It must be in a hidden filter 1267 (catch 'found
1268 ;; group, so go through all hidden filter groups to find it. 1268 (dolist (group ibuffer-hidden-filter-groups)
1269 (catch 'found 1269 (ibuffer-jump-to-filter-group group)
1270 (dolist (group ibuffer-hidden-filter-groups) 1270 (ibuffer-toggle-filter-group)
1271 (ibuffer-jump-to-filter-group group) 1271 (ibuffer-map-lines #'(lambda (buf marks)
1272 (ibuffer-toggle-filter-group) 1272 (when (string= (buffer-name buf) name)
1273 (ibuffer-map-lines #'(lambda (buf marks) 1273 (setq buf-point (point))
1274 (when (string= (buffer-name buf) name) 1274 nil))
1275 (setq buf-point (point)) 1275 t group)
1276 nil)) 1276 (if buf-point
1277 t group) 1277 (throw 'found nil)
1278 (if buf-point 1278 (ibuffer-toggle-filter-group)))))
1279 (throw 'found nil) 1279 (if (null buf-point)
1280 (ibuffer-toggle-filter-group))))) 1280 ;; Still not found even though we expanded all hidden filter
1281 (if (null buf-point) 1281 ;; groups: that must be because it's hidden by predicate:
1282 ;; Still not found even though we expanded all hidden filter 1282 ;; we won't bother trying to display it.
1283 ;; groups: that must be because it's hidden by predicate: 1283 (error "No buffer with name %s" name)
1284 ;; we won't bother trying to display it. 1284 (goto-char buf-point)))))
1285 (error "No buffer with name %s" name)
1286 (goto-char buf-point))))))
1287 1285
1288;;;###autoload 1286;;;###autoload
1289(defun ibuffer-diff-with-file () 1287(defun ibuffer-diff-with-file ()
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 12f29bdac63..30c97a383d3 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -873,8 +873,8 @@ width and the longest string in LIST."
873 default-directory) 873 default-directory)
874 default-directory)))) 874 default-directory))))
875 (list (read-file-name "Find file: " default-directory) 875 (list (read-file-name "Find file: " default-directory)
876 current-prefix-arg))) 876 t)))
877 (find-file file (or wildcards (interactive-p)))) 877 (find-file file wildcards))
878 878
879(defun ibuffer-mouse-visit-buffer (event) 879(defun ibuffer-mouse-visit-buffer (event)
880 "Visit the buffer chosen with the mouse." 880 "Visit the buffer chosen with the mouse."
diff --git a/lisp/imenu.el b/lisp/imenu.el
index 6859c0c74c7..924746f3bd1 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -62,6 +62,8 @@
62 62
63;;; Code: 63;;; Code:
64 64
65(require 'newcomment)
66
65(eval-when-compile (require 'cl)) 67(eval-when-compile (require 'cl))
66 68
67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 69;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -796,32 +798,37 @@ depending on PATTERNS."
796 (regexp (nth 1 pat)) 798 (regexp (nth 1 pat))
797 (index (nth 2 pat)) 799 (index (nth 2 pat))
798 (function (nth 3 pat)) 800 (function (nth 3 pat))
799 (rest (nthcdr 4 pat))) 801 (rest (nthcdr 4 pat))
802 cs)
800 ;; Go backwards for convenience of adding items in order. 803 ;; Go backwards for convenience of adding items in order.
801 (goto-char (point-max)) 804 (goto-char (point-max))
802 (while (re-search-backward regexp nil t) 805 (while (re-search-backward regexp nil t)
803 (imenu-progress-message prev-pos nil t) 806 (goto-char (match-end index))
804 (setq beg (match-beginning index)) 807 (setq beg (match-beginning index))
805 ;; Add this sort of submenu only when we've found an 808 (if (setq cs (save-match-data (comment-beginning)))
806 ;; item for it, avoiding empty, duff menus. 809 (goto-char cs) ; skip this one, it's in a comment
807 (unless (assoc menu-title index-alist) 810 (goto-char beg)
808 (push (list menu-title) index-alist)) 811 (imenu-progress-message prev-pos nil t)
809 (if imenu-use-markers 812 ;; Add this sort of submenu only when we've found an
810 (setq beg (copy-marker beg))) 813 ;; item for it, avoiding empty, duff menus.
811 (let ((item 814 (unless (assoc menu-title index-alist)
812 (if function 815 (push (list menu-title) index-alist))
813 (nconc (list (match-string-no-properties index) 816 (if imenu-use-markers
814 beg function) 817 (setq beg (copy-marker beg)))
815 rest) 818 (let ((item
816 (cons (match-string-no-properties index) 819 (if function
817 beg))) 820 (nconc (list (match-string-no-properties index)
818 ;; This is the desired submenu, 821 beg function)
819 ;; starting with its title (or nil). 822 rest)
820 (menu (assoc menu-title index-alist))) 823 (cons (match-string-no-properties index)
821 ;; Insert the item unless it is already present. 824 beg)))
822 (unless (member item (cdr menu)) 825 ;; This is the desired submenu,
823 (setcdr menu 826 ;; starting with its title (or nil).
824 (cons item (cdr menu)))))))) 827 (menu (assoc menu-title index-alist)))
828 ;; Insert the item unless it is already present.
829 (unless (member item (cdr menu))
830 (setcdr menu
831 (cons item (cdr menu)))))))))
825 (set-syntax-table old-table))) 832 (set-syntax-table old-table)))
826 (imenu-progress-message prev-pos 100 t) 833 (imenu-progress-message prev-pos 100 t)
827 ;; Sort each submenu by position. 834 ;; Sort each submenu by position.
diff --git a/lisp/indent.el b/lisp/indent.el
index e1a9cae4819..9713268f03b 100644
--- a/lisp/indent.el
+++ b/lisp/indent.el
@@ -205,7 +205,6 @@ If `auto-fill-mode' is active, re-fill the region to fit the new margin.
205Interactively, WIDTH is the prefix argument, if specified. 205Interactively, WIDTH is the prefix argument, if specified.
206Without prefix argument, the command prompts for WIDTH." 206Without prefix argument, the command prompts for WIDTH."
207 (interactive "r\nNSet left margin to column: ") 207 (interactive "r\nNSet left margin to column: ")
208 (if (interactive-p) (setq width (prefix-numeric-value width)))
209 (save-excursion 208 (save-excursion
210 ;; If inside indentation, start from BOL. 209 ;; If inside indentation, start from BOL.
211 (goto-char from) 210 (goto-char from)
@@ -229,7 +228,6 @@ If `auto-fill-mode' is active, re-fill the region to fit the new margin.
229Interactively, WIDTH is the prefix argument, if specified. 228Interactively, WIDTH is the prefix argument, if specified.
230Without prefix argument, the command prompts for WIDTH." 229Without prefix argument, the command prompts for WIDTH."
231 (interactive "r\nNSet right margin to width: ") 230 (interactive "r\nNSet right margin to width: ")
232 (if (interactive-p) (setq width (prefix-numeric-value width)))
233 (save-excursion 231 (save-excursion
234 (goto-char from) 232 (goto-char from)
235 (skip-chars-backward " \t") 233 (skip-chars-backward " \t")
@@ -289,12 +287,10 @@ to change the margin by, in characters. A negative argument decreases
289the right margin width. 287the right margin width.
290If `auto-fill-mode' is active, re-fill the region to fit the new margin." 288If `auto-fill-mode' is active, re-fill the region to fit the new margin."
291 (interactive "r\nP") 289 (interactive "r\nP")
292 (if (interactive-p) 290 (setq inc (if inc (prefix-numeric-value inc) standard-indent))
293 (setq inc (if inc (prefix-numeric-value current-prefix-arg)
294 standard-indent)))
295 (save-excursion 291 (save-excursion
296 (alter-text-property from to 'right-margin 292 (alter-text-property from to 'right-margin
297 (lambda (v) (+ inc (or v 0)))) 293 (lambda (v) (+ inc (or v 0))))
298 (if auto-fill-function 294 (if auto-fill-function
299 (fill-region from to nil t t)))) 295 (fill-region from to nil t t))))
300 296
diff --git a/lisp/info.el b/lisp/info.el
index 17905c6d738..4fc7b5c9cf7 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -3248,7 +3248,8 @@ The locations are of the format used in `Info-history', i.e.
3248\(FILENAME NODENAME BUFFERPOS\)." 3248\(FILENAME NODENAME BUFFERPOS\)."
3249 (let ((where '()) 3249 (let ((where '())
3250 (cmd-desc (concat "^\\* +" (regexp-quote (symbol-name command)) 3250 (cmd-desc (concat "^\\* +" (regexp-quote (symbol-name command))
3251 "\\( <[0-9]+>\\)?:\\s *\\(.*\\)\\.$")) 3251 "\\( <[0-9]+>\\)?:\\s *\\(.*\\)\\."
3252 "\\([ \t]*(line[ \t]*[0-9]*)\\)?$"))
3252 (info-file "emacs")) ;default 3253 (info-file "emacs")) ;default
3253 ;; Determine which info file this command is documented in. 3254 ;; Determine which info file this command is documented in.
3254 (if (get command 'info-file) 3255 (if (get command 'info-file)
diff --git a/lisp/man.el b/lisp/man.el
index cbfae21e44b..afd183fa720 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -893,12 +893,15 @@ header file(#include <foo.h>) and files in FILES"
893 'Man-target-string (match-string target-pos) 893 'Man-target-string (match-string target-pos)
894 ))))) 894 )))))
895 895
896(defun Man-cleanup-manpage () 896(defun Man-cleanup-manpage (&optional interactive)
897 "Remove overstriking and underlining from the current buffer." 897 "Remove overstriking and underlining from the current buffer.
898 (interactive) 898Normally skip any jobs that should have been done by the sed script,
899but when called interactively, do those jobs even if the sed
900script would have done them."
901 (interactive "p")
899 (message "Please wait: cleaning up the %s man page..." 902 (message "Please wait: cleaning up the %s man page..."
900 Man-arguments) 903 Man-arguments)
901 (if (or (interactive-p) (not Man-sed-script)) 904 (if (or interactive (not Man-sed-script))
902 (progn 905 (progn
903 (goto-char (point-min)) 906 (goto-char (point-min))
904 (while (search-forward "_\b" nil t) (backward-delete-char 2)) 907 (while (search-forward "_\b" nil t) (backward-delete-char 2))
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 17deeff4619..22840896c17 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -596,10 +596,12 @@ PROPS are additional properties."
596 596
597(defmacro menu-bar-make-toggle (name variable doc message help &rest body) 597(defmacro menu-bar-make-toggle (name variable doc message help &rest body)
598 `(progn 598 `(progn
599 (defun ,name () 599 (defun ,name (&optional interactively)
600 ,(concat "Toggle whether to " (downcase (substring help 0 1)) 600 ,(concat "Toggle whether to " (downcase (substring help 0 1))
601 (substring help 1) ".") 601 (substring help 1) ".\
602 (interactive) 602In an interactive call, record this option as a candidate for saving
603by \"Save Options\" in Custom buffers.")
604 (interactive "p")
603 (if ,(if body `(progn . ,body) 605 (if ,(if body `(progn . ,body)
604 `(progn 606 `(progn
605 (custom-load-symbol ',variable) 607 (custom-load-symbol ',variable)
@@ -612,7 +614,7 @@ PROPS are additional properties."
612 ;; a variable is set interactively, as the purpose is to mark it as 614 ;; a variable is set interactively, as the purpose is to mark it as
613 ;; a candidate for "Save Options", and we do not want to save options 615 ;; a candidate for "Save Options", and we do not want to save options
614 ;; the user have already set explicitly in his init file. 616 ;; the user have already set explicitly in his init file.
615 (if (interactive-p) (customize-mark-as-set ',variable))) 617 (if interactively (customize-mark-as-set ',variable)))
616 '(menu-item ,doc ,name 618 '(menu-item ,doc ,name
617 :help ,help 619 :help ,help
618 :button (:toggle . (and (default-boundp ',variable) 620 :button (:toggle . (and (default-boundp ',variable)
diff --git a/lisp/mouse-sel.el b/lisp/mouse-sel.el
index f9b90fbfc6a..b6f4558f280 100644
--- a/lisp/mouse-sel.el
+++ b/lisp/mouse-sel.el
@@ -240,6 +240,7 @@ to the kill ring. Pressing mouse-1 or mouse-3 kills it.
240& mouse-3, but operate on the X secondary selection rather than the 240& mouse-3, but operate on the X secondary selection rather than the
241primary selection and region." 241primary selection and region."
242 :global t 242 :global t
243 :group 'mouse-sel
243 (if mouse-sel-mode 244 (if mouse-sel-mode
244 (progn 245 (progn
245 (add-hook 'x-lost-selection-hooks 'mouse-sel-lost-selection-hook) 246 (add-hook 'x-lost-selection-hooks 'mouse-sel-lost-selection-hook)
diff --git a/lisp/net/password.el b/lisp/net/password.el
index e8be612ecca..da009ed9ea0 100644
--- a/lisp/net/password.el
+++ b/lisp/net/password.el
@@ -122,6 +122,62 @@ seconds."
122 key)) 122 key))
123 nil) 123 nil)
124 124
125;;;###autoload
126(defun read-passwd (prompt &optional confirm default)
127 "Read a password, prompting with PROMPT, and return it.
128If optional CONFIRM is non-nil, read the password twice to make sure.
129Optional DEFAULT is a default password to use instead of empty input.
130
131This function echoes `.' for each character that the user types.
132The user ends with RET, LFD, or ESC. DEL or C-h rubs out. C-u kills line.
133C-g quits; if `inhibit-quit' was non-nil around this function,
134then it returns nil if the user types C-g.
135
136Once the caller uses the password, it can erase the password
137by doing (clear-string STRING)."
138 (with-local-quit
139 (if confirm
140 (let (success)
141 (while (not success)
142 (let ((first (read-passwd prompt nil default))
143 (second (read-passwd "Confirm password: " nil default)))
144 (if (equal first second)
145 (progn
146 (and (arrayp second) (clear-string second))
147 (setq success first))
148 (and (arrayp first) (clear-string first))
149 (and (arrayp second) (clear-string second))
150 (message "Password not repeated accurately; please start over")
151 (sit-for 1))))
152 success)
153 (let ((pass nil)
154 (c 0)
155 (echo-keystrokes 0)
156 (cursor-in-echo-area t))
157 (while (progn (message "%s%s"
158 prompt
159 (make-string (length pass) ?.))
160 (setq c (read-char-exclusive nil t))
161 (and (/= c ?\r) (/= c ?\n) (/= c ?\e)))
162 (clear-this-command-keys)
163 (if (= c ?\C-u)
164 (progn
165 (and (arrayp pass) (clear-string pass))
166 (setq pass ""))
167 (if (and (/= c ?\b) (/= c ?\177))
168 (let* ((new-char (char-to-string c))
169 (new-pass (concat pass new-char)))
170 (and (arrayp pass) (clear-string pass))
171 (clear-string new-char)
172 (setq c ?\0)
173 (setq pass new-pass))
174 (if (> (length pass) 0)
175 (let ((new-pass (substring pass 0 -1)))
176 (and (arrayp pass) (clear-string pass))
177 (setq pass new-pass))))))
178 (message nil)
179 (or pass default "")))))
180
125(provide 'password) 181(provide 'password)
126 182
127;;; arch-tag: ab160494-16c8-4c68-a4a1-73eebf6686e5 183;;; arch-tag: ab160494-16c8-4c68-a4a1-73eebf6686e5
diff --git a/lisp/net/tramp-vc.el b/lisp/net/tramp-vc.el
index e720deb8f07..3cc54eda650 100644
--- a/lisp/net/tramp-vc.el
+++ b/lisp/net/tramp-vc.el
@@ -217,6 +217,7 @@ Since TRAMP doesn't do async commands yet, this function doesn't, either."
217;; Daniel Pittman <daniel@danann.net> 217;; Daniel Pittman <daniel@danann.net>
218;;-(if (fboundp 'vc-call-backend) 218;;-(if (fboundp 'vc-call-backend)
219;;- () ;; This is the new VC for which we don't have an appropriate advice yet 219;;- () ;; This is the new VC for which we don't have an appropriate advice yet
220(unless (fboundp 'process-file)
220(if (fboundp 'vc-call-backend) 221(if (fboundp 'vc-call-backend)
221 (defadvice vc-do-command 222 (defadvice vc-do-command
222 (around tramp-advice-vc-do-command 223 (around tramp-advice-vc-do-command
@@ -242,7 +243,7 @@ Since TRAMP doesn't do async commands yet, this function doesn't, either."
242 (setq ad-return-value 243 (setq ad-return-value
243 (apply 'tramp-vc-do-command buffer okstatus command 244 (apply 'tramp-vc-do-command buffer okstatus command
244 (or file (buffer-file-name)) last flags)) 245 (or file (buffer-file-name)) last flags))
245 ad-do-it)))) 246 ad-do-it)))))
246;;-) 247;;-)
247 248
248 249
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 582ae8ee207..5a71a50c5db 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1770,6 +1770,7 @@ on the FILENAME argument, even if VISIT was a string.")
1770 (delete-file . tramp-handle-delete-file) 1770 (delete-file . tramp-handle-delete-file)
1771 (directory-file-name . tramp-handle-directory-file-name) 1771 (directory-file-name . tramp-handle-directory-file-name)
1772 (shell-command . tramp-handle-shell-command) 1772 (shell-command . tramp-handle-shell-command)
1773 (process-file . tramp-handle-process-file)
1773 (insert-directory . tramp-handle-insert-directory) 1774 (insert-directory . tramp-handle-insert-directory)
1774 (expand-file-name . tramp-handle-expand-file-name) 1775 (expand-file-name . tramp-handle-expand-file-name)
1775 (file-local-copy . tramp-handle-file-local-copy) 1776 (file-local-copy . tramp-handle-file-local-copy)
@@ -3469,6 +3470,18 @@ This will break if COMMAND prints a newline, followed by the value of
3469 (tramp-run-real-handler 'shell-command 3470 (tramp-run-real-handler 'shell-command
3470 (list command output-buffer error-buffer)))) 3471 (list command output-buffer error-buffer))))
3471 3472
3473(defun tramp-handle-process-file (program &optional infile buffer display &rest args)
3474 "Like `process-file' for Tramp files."
3475 (when infile (error "Implementation does not handle input from file"))
3476 (when (and (numberp buffer) (zerop buffer))
3477 (error "Implementation does not handle immediate return"))
3478 (when (consp buffer) (error "Implementation does not handle error files"))
3479 (shell-command
3480 (mapconcat 'tramp-shell-quote-argument
3481 (cons program args)
3482 " ")
3483 buffer))
3484
3472;; File Editing. 3485;; File Editing.
3473 3486
3474(defsubst tramp-make-temp-file () 3487(defsubst tramp-make-temp-file ()
@@ -3960,6 +3973,8 @@ ARGS are the arguments OPERATION has been called with."
3960 ; COMMAND 3973 ; COMMAND
3961 ((member operation 3974 ((member operation
3962 (list 'dired-call-process 'shell-command 3975 (list 'dired-call-process 'shell-command
3976 ; Post Emacs 21.3 only
3977 'process-file
3963 ; XEmacs only 3978 ; XEmacs only
3964 'dired-print-file 'dired-shell-call-process)) 3979 'dired-print-file 'dired-shell-call-process))
3965 default-directory) 3980 default-directory)
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index 1260867f7c6..5dff6d954f8 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -347,12 +347,12 @@ modified to be an empty string, or the desired separation string."
347;;; User Functions: 347;;; User Functions:
348 348
349;;;###autoload 349;;;###autoload
350(defun pcomplete () 350(defun pcomplete (&optional interactively)
351 "Support extensible programmable completion. 351 "Support extensible programmable completion.
352To use this function, just bind the TAB key to it, or add it to your 352To use this function, just bind the TAB key to it, or add it to your
353completion functions list (it should occur fairly early in the list)." 353completion functions list (it should occur fairly early in the list)."
354 (interactive) 354 (interactive "p")
355 (if (and (interactive-p) 355 (if (and interactively
356 pcomplete-cycle-completions 356 pcomplete-cycle-completions
357 pcomplete-current-completions 357 pcomplete-current-completions
358 (memq last-command '(pcomplete 358 (memq last-command '(pcomplete
diff --git a/lisp/progmodes/asm-mode.el b/lisp/progmodes/asm-mode.el
index 76d12aa6f6e..17cb7c78316 100644
--- a/lisp/progmodes/asm-mode.el
+++ b/lisp/progmodes/asm-mode.el
@@ -90,7 +90,9 @@
90 2 font-lock-keyword-face) 90 2 font-lock-keyword-face)
91 ;; directive started from ".". 91 ;; directive started from ".".
92 ("^\\(\\.\\(\\sw\\|\\s_\\)+\\)\\>[^:]?" 92 ("^\\(\\.\\(\\sw\\|\\s_\\)+\\)\\>[^:]?"
93 1 font-lock-keyword-face)) 93 1 font-lock-keyword-face)
94 ;; %register
95 ("%\\sw+" . font-lock-variable-name-face))
94 "Additional expressions to highlight in Assembler mode.") 96 "Additional expressions to highlight in Assembler mode.")
95 97
96;;;###autoload 98;;;###autoload
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 2cd62eeecee..3ccea967bc5 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -94,7 +94,7 @@
94(defun flymake-split-string(str pattern) 94(defun flymake-split-string(str pattern)
95 (cond 95 (cond
96 ((equal flymake-emacs 'xemacs) (flymake-split-string-remove-empty-edges str pattern)) 96 ((equal flymake-emacs 'xemacs) (flymake-split-string-remove-empty-edges str pattern))
97 (t (split-string str pattern)) 97 (t (flymake-split-string-remove-empty-edges str pattern))
98 ) 98 )
99) 99)
100 100
@@ -1243,7 +1243,8 @@ Whenether a buffer for master-file-name exists, use it as a source instead of re
1243 (" *\\(\\[javac\\]\\)? *\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)" 1243 (" *\\(\\[javac\\]\\)? *\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)"
1244 2 4 nil 5) 1244 2 4 nil 5)
1245 ) 1245 )
1246 compilation-error-regexp-alist) 1246 ;; compilation-error-regexp-alist)
1247 (mapcar (lambda (x) (cdr x)) compilation-error-regexp-alist-alist))
1247 "patterns for matching error/warning lines, (regexp file-idx line-idx err-text-idx)" 1248 "patterns for matching error/warning lines, (regexp file-idx line-idx err-text-idx)"
1248) 1249)
1249;(defcustom flymake-err-line-patterns 1250;(defcustom flymake-err-line-patterns
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index d8f2cf34867..64f8808c7f1 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -177,7 +177,7 @@ detailed description of this mode.
177 177
178 (setq comint-input-sender 'gdb-send) 178 (setq comint-input-sender 'gdb-send)
179 ;; 179 ;;
180 ;; (re-)initialise 180 ;; (re-)initialize
181 (setq gdb-current-address "main") 181 (setq gdb-current-address "main")
182 (setq gdb-previous-address nil) 182 (setq gdb-previous-address nil)
183 (setq gdb-previous-frame nil) 183 (setq gdb-previous-frame nil)
@@ -482,14 +482,14 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'."
482 (name (funcall (gdb-rules-name-maker rules))) 482 (name (funcall (gdb-rules-name-maker rules)))
483 (new (get-buffer-create name))) 483 (new (get-buffer-create name)))
484 (with-current-buffer new 484 (with-current-buffer new
485 ;; FIXME: This should be set after calling the function, since the 485 (let ((trigger))
486 ;; function should run kill-all-local-variables. 486 (if (cdr (cdr rules))
487 (set (make-local-variable 'gdb-buffer-type) key) 487 (setq trigger (funcall (car (cdr (cdr rules))))))
488 (if (cdr (cdr rules)) 488 (set (make-local-variable 'gdb-buffer-type) key)
489 (funcall (car (cdr (cdr rules))))) 489 (set (make-local-variable 'gud-minor-mode)
490 (set (make-local-variable 'gud-minor-mode) 490 (with-current-buffer gud-comint-buffer gud-minor-mode))
491 (with-current-buffer gud-comint-buffer gud-minor-mode)) 491 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
492 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) 492 (if trigger (funcall trigger)))
493 new)))) 493 new))))
494 494
495(defun gdb-rules-name-maker (rules) (car (cdr rules))) 495(defun gdb-rules-name-maker (rules) (car (cdr rules)))
@@ -1190,13 +1190,15 @@ static char *magick[] = {
1190 "Major mode for gdb breakpoints. 1190 "Major mode for gdb breakpoints.
1191 1191
1192\\{gdb-breakpoints-mode-map}" 1192\\{gdb-breakpoints-mode-map}"
1193 (kill-all-local-variables)
1193 (setq major-mode 'gdb-breakpoints-mode) 1194 (setq major-mode 'gdb-breakpoints-mode)
1194 (setq mode-name "Breakpoints") 1195 (setq mode-name "Breakpoints")
1195 (use-local-map gdb-breakpoints-mode-map) 1196 (use-local-map gdb-breakpoints-mode-map)
1196 (setq buffer-read-only t) 1197 (setq buffer-read-only t)
1198 (run-mode-hooks 'gdb-breakpoints-mode-hook)
1197 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) 1199 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
1198 (gdb-invalidate-breakpoints) 1200 'gdb-invalidate-breakpoints
1199 (gdbmi-invalidate-breakpoints))) 1201 'gdbmi-invalidate-breakpoints))
1200 1202
1201(defun gdb-toggle-breakpoint () 1203(defun gdb-toggle-breakpoint ()
1202 "Enable/disable the breakpoint at current line." 1204 "Enable/disable the breakpoint at current line."
@@ -1317,14 +1319,16 @@ static char *magick[] = {
1317 "Major mode for gdb frames. 1319 "Major mode for gdb frames.
1318 1320
1319\\{gdb-frames-mode-map}" 1321\\{gdb-frames-mode-map}"
1322 (kill-all-local-variables)
1320 (setq major-mode 'gdb-frames-mode) 1323 (setq major-mode 'gdb-frames-mode)
1321 (setq mode-name "Frames") 1324 (setq mode-name "Frames")
1322 (setq buffer-read-only t) 1325 (setq buffer-read-only t)
1323 (use-local-map gdb-frames-mode-map) 1326 (use-local-map gdb-frames-mode-map)
1324 (font-lock-mode -1) 1327 (font-lock-mode -1)
1328 (run-mode-hooks 'gdb-frames-mode-hook)
1325 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) 1329 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
1326 (gdb-invalidate-frames) 1330 'gdb-invalidate-frames
1327 (gdbmi-invalidate-frames))) 1331 'gdbmi-invalidate-frames))
1328 1332
1329(defun gdb-get-frame-number () 1333(defun gdb-get-frame-number ()
1330 (save-excursion 1334 (save-excursion
@@ -1396,11 +1400,13 @@ static char *magick[] = {
1396 "Major mode for gdb frames. 1400 "Major mode for gdb frames.
1397 1401
1398\\{gdb-threads-mode-map}" 1402\\{gdb-threads-mode-map}"
1403 (kill-all-local-variables)
1399 (setq major-mode 'gdb-threads-mode) 1404 (setq major-mode 'gdb-threads-mode)
1400 (setq mode-name "Threads") 1405 (setq mode-name "Threads")
1401 (setq buffer-read-only t) 1406 (setq buffer-read-only t)
1402 (use-local-map gdb-threads-mode-map) 1407 (use-local-map gdb-threads-mode-map)
1403 (gdb-invalidate-threads)) 1408 (run-mode-hooks 'gdb-threads-mode-hook)
1409 'gdb-invalidate-threads)
1404 1410
1405(defun gdb-get-thread-number () 1411(defun gdb-get-thread-number ()
1406 (save-excursion 1412 (save-excursion
@@ -1444,11 +1450,13 @@ static char *magick[] = {
1444 "Major mode for gdb registers. 1450 "Major mode for gdb registers.
1445 1451
1446\\{gdb-registers-mode-map}" 1452\\{gdb-registers-mode-map}"
1453 (kill-all-local-variables)
1447 (setq major-mode 'gdb-registers-mode) 1454 (setq major-mode 'gdb-registers-mode)
1448 (setq mode-name "Registers") 1455 (setq mode-name "Registers")
1449 (setq buffer-read-only t) 1456 (setq buffer-read-only t)
1450 (use-local-map gdb-registers-mode-map) 1457 (use-local-map gdb-registers-mode-map)
1451 (gdb-invalidate-registers)) 1458 (run-mode-hooks 'gdb-registers-mode-hook)
1459 'gdb-invalidate-registers)
1452 1460
1453(defun gdb-registers-buffer-name () 1461(defun gdb-registers-buffer-name ()
1454 (with-current-buffer gud-comint-buffer 1462 (with-current-buffer gud-comint-buffer
@@ -1518,13 +1526,15 @@ static char *magick[] = {
1518 "Major mode for gdb locals. 1526 "Major mode for gdb locals.
1519 1527
1520\\{gdb-locals-mode-map}" 1528\\{gdb-locals-mode-map}"
1529 (kill-all-local-variables)
1521 (setq major-mode 'gdb-locals-mode) 1530 (setq major-mode 'gdb-locals-mode)
1522 (setq mode-name (concat "Locals:" gdb-current-frame)) 1531 (setq mode-name (concat "Locals:" gdb-current-frame))
1523 (setq buffer-read-only t) 1532 (setq buffer-read-only t)
1524 (use-local-map gdb-locals-mode-map) 1533 (use-local-map gdb-locals-mode-map)
1534 (run-mode-hooks 'gdb-locals-mode-hook)
1525 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) 1535 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
1526 (gdb-invalidate-locals) 1536 'gdb-invalidate-locals
1527 (gdbmi-invalidate-locals))) 1537 'gdbmi-invalidate-locals))
1528 1538
1529(defun gdb-locals-buffer-name () 1539(defun gdb-locals-buffer-name ()
1530 (with-current-buffer gud-comint-buffer 1540 (with-current-buffer gud-comint-buffer
@@ -1939,10 +1949,26 @@ BUFFER nil or omitted means use the current buffer."
1939 (suppress-keymap map) 1949 (suppress-keymap map)
1940 map)) 1950 map))
1941 1951
1952(defvar gdb-assembler-font-lock-keywords
1953 '(;; <__function.name+n>
1954 ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>"
1955 (1 font-lock-function-name-face))
1956 ;; 0xNNNNNNNN <__function.name+n>: opcode
1957 ("^0x[0-9a-f]+ \\(<\\(\\(\\sw\\|[_.]\\)+\\)\\+[0-9]+>\\)?:[ \t]+\\(\\sw+\\)"
1958 (4 font-lock-keyword-face))
1959 ;; %register(at least i386)
1960 ("%\\sw+" . font-lock-variable-name-face)
1961 ("^\\(Dump of assembler code for function\\) \\(.+\\):"
1962 (1 font-lock-comment-face)
1963 (2 font-lock-function-name-face))
1964 ("^\\(End of assembler dump\\.\\)" . font-lock-comment-face))
1965 "Font lock keywords used in `gdb-assembler-mode'.")
1966
1942(defun gdb-assembler-mode () 1967(defun gdb-assembler-mode ()
1943 "Major mode for viewing code assembler. 1968 "Major mode for viewing code assembler.
1944 1969
1945\\{gdb-assembler-mode-map}" 1970\\{gdb-assembler-mode-map}"
1971 (kill-all-local-variables)
1946 (setq major-mode 'gdb-assembler-mode) 1972 (setq major-mode 'gdb-assembler-mode)
1947 (setq mode-name "Machine") 1973 (setq mode-name "Machine")
1948 (setq gdb-overlay-arrow-position nil) 1974 (setq gdb-overlay-arrow-position nil)
@@ -1951,7 +1977,11 @@ BUFFER nil or omitted means use the current buffer."
1951 (setq fringes-outside-margins t) 1977 (setq fringes-outside-margins t)
1952 (setq buffer-read-only t) 1978 (setq buffer-read-only t)
1953 (use-local-map gdb-assembler-mode-map) 1979 (use-local-map gdb-assembler-mode-map)
1954 (gdb-invalidate-assembler)) 1980 (gdb-invalidate-assembler)
1981 (set (make-local-variable 'font-lock-defaults)
1982 '(gdb-assembler-font-lock-keywords))
1983 (run-mode-hooks 'gdb-assembler-mode-hook)
1984 'gdb-invalidate-assembler)
1955 1985
1956(defun gdb-assembler-buffer-name () 1986(defun gdb-assembler-buffer-name ()
1957 (with-current-buffer gud-comint-buffer 1987 (with-current-buffer gud-comint-buffer
diff --git a/lisp/simple.el b/lisp/simple.el
index 1e6e49012e1..6420ebffd54 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1879,6 +1879,39 @@ specifies the value of ERROR-BUFFER."
1879 (with-current-buffer 1879 (with-current-buffer
1880 standard-output 1880 standard-output
1881 (call-process shell-file-name nil t nil shell-command-switch command)))) 1881 (call-process shell-file-name nil t nil shell-command-switch command))))
1882
1883(defun process-file (program &optional infile buffer display &rest args)
1884 "Process files synchronously in a separate process.
1885Similar to `call-process', but may invoke a file handler based on
1886`default-directory'. The current working directory of the
1887subprocess is `default-directory'.
1888
1889File names in INFILE and BUFFER are handled normally, but file
1890names in ARGS should be relative to `default-directory', as they
1891are passed to the process verbatim. \(This is a difference to
1892`call-process' which does not support file handlers for INFILE
1893and BUFFER.\)
1894
1895Some file handlers might not support all variants, for example
1896they might behave as if DISPLAY was nil, regardless of the actual
1897value passed."
1898 (let ((fh (find-file-name-handler default-directory 'process-file))
1899 lc stderr-file)
1900 (unwind-protect
1901 (if fh (apply fh 'process-file program infile buffer display args)
1902 (when infile (setq lc (file-local-copy infile)))
1903 (setq stderr-file (when (and (consp buffer) (stringp (cadr buffer)))
1904 (make-temp-file "emacs")))
1905 (prog1
1906 (apply 'call-process program
1907 (or lc infile)
1908 (if stderr-file (list (car buffer) stderr-file) buffer)
1909 display args)
1910 (when stderr-file (copy-file stderr-file (cadr buffer)))))
1911 (when stderr-file (delete-file stderr-file))
1912 (when lc (delete-file lc)))))
1913
1914
1882 1915
1883(defvar universal-argument-map 1916(defvar universal-argument-map
1884 (let ((map (make-sparse-keymap))) 1917 (let ((map (make-sparse-keymap)))
diff --git a/lisp/subr.el b/lisp/subr.el
index 5e162ef5c83..7d666f4c157 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1211,61 +1211,6 @@ any other non-digit terminates the character code and is then used as input."))
1211 (setq first nil)) 1211 (setq first nil))
1212 code)) 1212 code))
1213 1213
1214(defun read-passwd (prompt &optional confirm default)
1215 "Read a password, prompting with PROMPT, and return it.
1216If optional CONFIRM is non-nil, read the password twice to make sure.
1217Optional DEFAULT is a default password to use instead of empty input.
1218
1219This function echoes `.' for each character that the user types.
1220The user ends with RET, LFD, or ESC. DEL or C-h rubs out. C-u kills line.
1221C-g quits; if `inhibit-quit' was non-nil around this function,
1222then it returns nil if the user types C-g.
1223
1224Once the caller uses the password, it can erase the password
1225by doing (clear-string STRING)."
1226 (with-local-quit
1227 (if confirm
1228 (let (success)
1229 (while (not success)
1230 (let ((first (read-passwd prompt nil default))
1231 (second (read-passwd "Confirm password: " nil default)))
1232 (if (equal first second)
1233 (progn
1234 (and (arrayp second) (clear-string second))
1235 (setq success first))
1236 (and (arrayp first) (clear-string first))
1237 (and (arrayp second) (clear-string second))
1238 (message "Password not repeated accurately; please start over")
1239 (sit-for 1))))
1240 success)
1241 (let ((pass nil)
1242 (c 0)
1243 (echo-keystrokes 0)
1244 (cursor-in-echo-area t))
1245 (while (progn (message "%s%s"
1246 prompt
1247 (make-string (length pass) ?.))
1248 (setq c (read-char-exclusive nil t))
1249 (and (/= c ?\r) (/= c ?\n) (/= c ?\e)))
1250 (clear-this-command-keys)
1251 (if (= c ?\C-u)
1252 (progn
1253 (and (arrayp pass) (clear-string pass))
1254 (setq pass ""))
1255 (if (and (/= c ?\b) (/= c ?\177))
1256 (let* ((new-char (char-to-string c))
1257 (new-pass (concat pass new-char)))
1258 (and (arrayp pass) (clear-string pass))
1259 (clear-string new-char)
1260 (setq c ?\0)
1261 (setq pass new-pass))
1262 (if (> (length pass) 0)
1263 (let ((new-pass (substring pass 0 -1)))
1264 (and (arrayp pass) (clear-string pass))
1265 (setq pass new-pass))))))
1266 (message nil)
1267 (or pass default "")))))
1268
1269;; This should be used by `call-interactively' for `n' specs. 1214;; This should be used by `call-interactively' for `n' specs.
1270(defun read-number (prompt &optional default) 1215(defun read-number (prompt &optional default)
1271 (let ((n nil)) 1216 (let ((n nil))
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 584056bf30b..28f3d7c3b27 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -451,10 +451,22 @@ Do \\[describe-key] on the following bindings to discover what they do.
451 ;; recognized. 451 ;; recognized.
452 (set (make-local-variable 'comment-start-skip) "\\(?:<!\\)?--[ \t]*") 452 (set (make-local-variable 'comment-start-skip) "\\(?:<!\\)?--[ \t]*")
453 (set (make-local-variable 'comment-end-skip) "[ \t]*--\\([ \t\n]*>\\)?") 453 (set (make-local-variable 'comment-end-skip) "[ \t]*--\\([ \t\n]*>\\)?")
454 ;; This definition probably is not useful in derived modes. 454 ;; This definition has an HTML leaning but probably fits well for other modes.
455 (set (make-local-variable 'imenu-generic-expression) 455 (setq imenu-generic-expression
456 (concat "<!\\(element\\|entity\\)[ \t\n]+%?[ \t\n]*\\(" 456 `((nil
457 sgml-name-re "\\)"))) 457 ,(concat "<!\\(element\\|entity\\)[ \t\n]+%?[ \t\n]*\\("
458 sgml-name-re "\\)")
459 2)
460 ("Id"
461 ,(concat "<[^>]+[ \t\n]+[Ii][Dd]=\\(['\"]"
462 (if sgml-xml-mode "" "?")
463 "\\)\\(" sgml-name-re "\\)\\1")
464 2)
465 ("Name"
466 ,(concat "<[^>]+[ \t\n]+[Nn][Aa][Mm][Ee]=\\(['\"]"
467 (if sgml-xml-mode "" "?")
468 "\\)\\(" sgml-name-re "\\)\\1")
469 2))))
458 470
459;; Some programs (such as Glade 2) generate XML which has 471;; Some programs (such as Glade 2) generate XML which has
460;; -*- mode: xml -*-. 472;; -*- mode: xml -*-.
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index a7ca14d1294..06ae4db1d8a 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -468,6 +468,10 @@ An alternative value is \" . \", if you use a font with a narrow period."
468 ;; (arg "\\(?:{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)\\|\\\\[a-z*]+\\)")) 468 ;; (arg "\\(?:{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)\\|\\\\[a-z*]+\\)"))
469 (arg "{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)")) 469 (arg "{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)"))
470 (list 470 (list
471 ;; font-lock-syntactic-keywords causes the \ of \end{verbatim} to be
472 ;; highlighted as tex-verbatim-face. Let's undo that.
473 ;; This is ugly and brittle :-( --Stef
474 '("^\\(\\\\\\)end" (1 (get-text-property (match-end 1) 'face) t))
471 ;; display $$ math $$ 475 ;; display $$ math $$
472 ;; We only mark the match between $$ and $$ because the $$ delimiters 476 ;; We only mark the match between $$ and $$ because the $$ delimiters
473 ;; themselves have already been marked (along with $..$) by syntactic 477 ;; themselves have already been marked (along with $..$) by syntactic
@@ -619,6 +623,8 @@ An alternative value is \" . \", if you use a font with a narrow period."
619 ;; 2 - font-lock considers the preceding \n as being part of the 623 ;; 2 - font-lock considers the preceding \n as being part of the
620 ;; preceding line, so things gets screwed every time the previous 624 ;; preceding line, so things gets screwed every time the previous
621 ;; line is re-font-locked on its own. 625 ;; line is re-font-locked on its own.
626 ;; There's a hack in tex-font-lock-keywords-1 to remove the verbatim
627 ;; face from the \ but C-M-f still jumps to the wrong spot :-( --Stef
622 (,(concat "^\\(\\\\\\)end *{" verbs "}\\(.?\\)") (1 "|") (3 "<")) 628 (,(concat "^\\(\\\\\\)end *{" verbs "}\\(.?\\)") (1 "|") (3 "<"))
623 ;; ("^\\(\\\\\\)begin *{comment}" 1 "< b") 629 ;; ("^\\(\\\\\\)begin *{comment}" 1 "< b")
624 ;; ("^\\\\end *{comment}.*\\(\n\\)" 1 "> b") 630 ;; ("^\\\\end *{comment}.*\\(\n\\)" 1 "> b")
diff --git a/lisp/vc.el b/lisp/vc.el
index a0d3d1cd4be..15d0258e85d 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -953,7 +953,7 @@ that is inserted into the command line before the filename."
953 (vc-exec-after 953 (vc-exec-after
954 `(unless (active-minibuffer-window) 954 `(unless (active-minibuffer-window)
955 (message "Running %s in the background... done" ',command)))) 955 (message "Running %s in the background... done" ',command))))
956 (setq status (apply 'call-process command nil t nil squeezed)) 956 (setq status (apply 'process-file command nil t nil squeezed))
957 (when (or (not (integerp status)) (and okstatus (< okstatus status))) 957 (when (or (not (integerp status)) (and okstatus (< okstatus status)))
958 (pop-to-buffer (current-buffer)) 958 (pop-to-buffer (current-buffer))
959 (goto-char (point-min)) 959 (goto-char (point-min))
diff --git a/lisp/woman.el b/lisp/woman.el
index cea1c61bcc4..610590a2972 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -1132,7 +1132,7 @@ Used non-interactively, arguments are optional: if given then TOPIC
1132should be a topic string and non-nil RE-CACHE forces re-caching." 1132should be a topic string and non-nil RE-CACHE forces re-caching."
1133 (interactive (list nil current-prefix-arg)) 1133 (interactive (list nil current-prefix-arg))
1134 ;; The following test is for non-interactive calls via gnudoit etc. 1134 ;; The following test is for non-interactive calls via gnudoit etc.
1135 (if (or (interactive-p) (not (stringp topic)) (string-match "\\S " topic)) 1135 (if (or (not (stringp topic)) (string-match "\\S " topic))
1136 (let ((file-name (woman-file-name topic re-cache))) 1136 (let ((file-name (woman-file-name topic re-cache)))
1137 (if file-name 1137 (if file-name
1138 (woman-find-file file-name) 1138 (woman-find-file file-name)