aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMiles Bader2004-11-12 02:53:04 +0000
committerMiles Bader2004-11-12 02:53:04 +0000
commit8b7e837d9c3266e775142a4865845b3d2a8b60aa (patch)
treed1468612ab319b665728b9ebf94dbc0c0d4c20fc /lisp
parentd1a3e560ff62e047d9fa8e8b3b1bc1e56e104c26 (diff)
parente22c7647c7ff33c846132f3d2877ac436b8b47e6 (diff)
downloademacs-8b7e837d9c3266e775142a4865845b3d2a8b60aa.tar.gz
emacs-8b7e837d9c3266e775142a4865845b3d2a8b60aa.zip
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-70
Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-669 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-678 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-679 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-680 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-688 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-690 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-691 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-69 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-70 - miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-71 Update from CVS
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog451
-rw-r--r--lisp/ChangeLog.101
-rw-r--r--lisp/ChangeLog.721
-rw-r--r--lisp/Makefile.in5
-rw-r--r--lisp/align.el8
-rw-r--r--lisp/calc/calc-aent.el475
-rw-r--r--lisp/calc/calc-comb.el68
-rw-r--r--lisp/calc/calc-ext.el114
-rw-r--r--lisp/calc/calc-forms.el6
-rw-r--r--lisp/calc/calc-lang.el40
-rw-r--r--lisp/calc/calc-poly.el2
-rw-r--r--lisp/calc/calc-rewr.el40
-rw-r--r--lisp/calc/calc-vec.el104
-rw-r--r--lisp/calc/calc.el201
-rw-r--r--lisp/calc/calcalg2.el12
-rw-r--r--lisp/calendar/diary-lib.el37
-rw-r--r--lisp/cvs-status.el32
-rw-r--r--lisp/descr-text.el5
-rw-r--r--lisp/desktop.el24
-rw-r--r--lisp/dired.el10
-rw-r--r--lisp/ebuff-menu.el21
-rw-r--r--lisp/emacs-lisp/bytecomp.el58
-rw-r--r--lisp/emacs-lisp/easymenu.el108
-rw-r--r--lisp/emacs-lisp/edebug.el6
-rw-r--r--lisp/emacs-lisp/elp.el1
-rw-r--r--lisp/eshell/esh-mode.el11
-rw-r--r--lisp/files.el78
-rw-r--r--lisp/filesets.el10
-rw-r--r--lisp/font-lock.el12
-rw-r--r--lisp/gnus/ChangeLog20
-rw-r--r--lisp/gnus/gnus-art.el98
-rw-r--r--lisp/gnus/gnus-msg.el12
-rw-r--r--lisp/gnus/pgg-def.el3
-rw-r--r--lisp/gnus/spam.el3
-rw-r--r--lisp/help-fns.el7
-rw-r--r--lisp/imenu.el4
-rw-r--r--lisp/info-look.el64
-rw-r--r--lisp/info.el52
-rw-r--r--lisp/international/iso-cvt.el121
-rw-r--r--lisp/international/mule-cmds.el197
-rw-r--r--lisp/international/mule.el2
-rw-r--r--lisp/macros.el9
-rw-r--r--lisp/mail/supercite.el24
-rw-r--r--lisp/menu-bar.el56
-rw-r--r--lisp/mouse.el3
-rw-r--r--lisp/mwheel.el8
-rw-r--r--lisp/net/browse-url.el24
-rw-r--r--lisp/net/tramp.el10
-rw-r--r--lisp/outline.el5
-rw-r--r--lisp/paren.el4
-rw-r--r--lisp/pcvs.el21
-rw-r--r--lisp/printing.el29
-rw-r--r--lisp/progmodes/ada-xref.el2
-rw-r--r--lisp/progmodes/compile.el13
-rw-r--r--lisp/progmodes/cperl-mode.el2
-rw-r--r--lisp/progmodes/f90.el8
-rw-r--r--lisp/progmodes/gdb-ui.el17
-rw-r--r--lisp/progmodes/idlw-shell.el31
-rw-r--r--lisp/recentf.el2
-rw-r--r--lisp/simple.el201
-rw-r--r--lisp/subr.el18
-rw-r--r--lisp/tempo.el6
-rw-r--r--lisp/textmodes/conf-mode.el531
-rw-r--r--lisp/textmodes/flyspell.el6
-rw-r--r--lisp/textmodes/ispell.el5
-rw-r--r--lisp/textmodes/sgml-mode.el117
-rw-r--r--lisp/textmodes/table.el3
-rw-r--r--lisp/tooltip.el10
-rw-r--r--lisp/url/ChangeLog5
-rw-r--r--lisp/url/url-mailto.el2
70 files changed, 2594 insertions, 1122 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3b3579e3908..d1826a7fade 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,437 @@
12004-11-12 Nick Roberts <nickrob@snap.net.nz>
2
3 * tooltip.el (require): Explain why CL is needed.
4
52004-11-11 Vinicius Jose Latorre <viniciusjl@ig.com.br>
6
7 * printing.el: Insert :version into defgroup (printing). All reference
8 to Files option in menubar were changed to File.
9 (pr-version): New version number (6.8.2).
10 (pr-get-symbol): Call easy-menu-intern.
11 (pr-region-active-p): Now is a fun (it was defsubst). To avoid
12 compilation gripes.
13
142004-11-11 Stefan Monnier <monnier@iro.umontreal.ca>
15
16 * international/iso-cvt.el (iso-cvt-define-menu): Fix typo.
17
18 * tooltip.el: Require CL.
19
20 * emacs-lisp/bytecomp.el: Use push.
21 (byte-compile-file-form-defalias): Rename from byte-compile-defalias.
22 (defalias): Remove the `byte-compile' property and add
23 a `byte-hunk-handler'.
24
252004-11-11 Juri Linkov <juri@jurta.org>
26
27 * info.el (Info-search): Save match data for isearch.
28 Skip Tag Table node.
29
30 * descr-text.el (describe-char): Replace syntax-after with code
31 from its previous version.
32
33 * files.el (magic-mode-alist): Use optimization for SGML mode too.
34 (set-auto-mode): Doc fix. Remove unused variable `xml'.
35
36 * international/mule.el (sgml-html-meta-auto-coding-function):
37 Remove > after <html to allow HTML attributes.
38
392004-11-11 Jay Belanger <belanger@truman.edu>
40
41 * calc/calc-comb.el (math-prime-factors-finished): Declare it as
42 a variable.
43 (calcFunc-dfac): Replace unbound max by n.
44 (math-stirling-local-cache): New variable.
45 (math-stirling-number, math-stirling-1, math-stirling-2):
46 Replace the variable `cache' by the declared variable
47 math-stirling-local-cache.
48 (var-RandSeed): Declare it as a variable.
49 (math-init-random-base, math-random-digit): Don't check to see if
50 var-RandSeed is bound.
51 (math-random-cache, math-gaussian-cache, calc-verbose-nextprime):
52 Declare them instead of just setting them.
53 (math-init-random-base): Made i a local variable.
54 (math-random-digit): Made math-random-last a local variable.
55 (math-prime-test-cache): Move declaration to before it is used.
56 (math-prime-test-cache-k, math-prime-test-cache-q)
57 (math-prime-test-cache-nm1, math-prime-factors-finished):
58 Declare them as variables.
59
602004-11-11 Jay Belanger <belanger@truman.edu>
61
62 * calc/calc-ext.el (math-defcache): Use defvar for the new
63 variables it creates.
64
652004-11-11 Lars Hansen <larsh@math.ku.dk>
66
67 * desktop.el (desktop-buffer-mode-handlers, desktop-after-read-hook)
68 (desktop-clear-preserve-buffers-regexp, desktop-file-name-format)
69 (desktop-globals-to-clear, desktop-no-desktop-file-hook, desktop-path)
70 (desktop-save): Add :version.
71
722004-11-11 Stefan Monnier <monnier@iro.umontreal.ca>
73
74 * printing.el (pr-get-symbol): Don't downcase.
75
762004-11-10 Jay Belanger <belanger@truman.edu>
77
78 * calc/calc-aent.el (calc-do-quick-calc): Use kill-new to append
79 string to kill-ring.
80
81 * calc/calc-aent.el (calc-alg-exp, math-toks)
82 (math-exp-pos,math-exp-old-pos, math-exp-token)
83 (math-exp-keep-spaces, math-exp-str): New variables.
84 (calc-do-alg-entry, calcAlg-equals, calcAlg-edit)
85 (calcAlg-enter): Use declared variable calc-alg-exp.
86 (math-build-parse-table, math-find-user-token): Use declared
87 variable math-toks.
88 (math-read-exprs, math-read-token, calc-check-user-syntax)
89 (calc-match-user-syntax, match-factor-after, math-read-factor):
90 Use declared variables math-exp-pos math-exp-old-pos.
91 (math-read-exprs, math-read-token, math-read-expr-level)
92 (calc-check-user-syntax, calc-match-user-syntax)
93 (match-factor-after, math-read-factor): Use declared variable
94 math-exp-token.
95 (math-read-exprs, math-read-expr-list, math-read-token)
96 (math-read-factor): Use declared variable math-exp-keep-spaces.
97 (math-read-exprs, math-read-token): Use declared variable
98 math-exp-str.
99 (calc-match-user-syntax): Made m a local variable.
100
101 * calc/calc-ext.el (math-read-expr): Use declared variables
102 math-exp-pos, math-exp-old-pos, math-exp-str, math-exp-token,
103 math-exp-keep-spaces.
104
105 * calc/calc-forms.el (math-read-angle-bracket): Use declared
106 variables math-exp-pos, math-exp-str.
107
108 * calc/calc-lang.el (math-parse-tex-sum): Use declared variable
109 math-exp-old-pos.
110 (math-parse-fortran-vector, math-parse-fortran-vector-end)
111 (math-parse-eqn-prime): Use declared variable math-exp-token.
112
113 * calc/calc-vec.el (math-read-brackets, math-check-for-commas):
114 Use declared variable math-exp-pos.
115 (math-check-for-commas): Use declared variable math-exp-str.
116 (math-read-brackets): Use declared variables math-exp-old-pos,
117 math-exp-keep-spaces.
118 (math-read-brackets, math-read-vector, math-read-matrix):
119 Use declared variable math-exp-token.
120
1212004-11-10 Stefan Monnier <monnier@iro.umontreal.ca>
122
123 * files.el (magic-mode-alist): Reduce backtracking in the HTML regexp.
124
125 * textmodes/sgml-mode.el (sgml-tag-text-p): New fun.
126 (sgml-parse-tag-backward): Use it to skip spurious < or >.
127
1282004-11-10 Thien-Thi Nguyen <ttn@gnu.org>
129
130 * ebuff-menu.el: Doc fixes throughout.
131 (electric-buffer-menu-mode-hook): New defvar.
132
1332004-11-10 Nick Roberts <nickrob@snap.net.nz>
134
135 * tooltip.el: Don't require cl, comint, gud, gdb-ui for
136 compilation. The resulting compiler warnings appear to be harmless.
137
1382004-11-10 Daniel Pfeiffer <occitan@esperanto.org>
139
140 * textmodes/conf-mode.el: New file.
141
142 * files.el (auto-mode-alist, magic-mode-alist): Use it.
143
1442004-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
145
146 * international/iso-cvt.el (iso-cvt-define-menu): Clean up namespace.
147
1482004-11-09 Jay Belanger <belanger@truman.edu>
149
150 * calc/calc-ext.el (calc-init-extensions): Remove old code.
151
152 * calc/calc-ext.el (math-expr-data, math-mt-many, math-mt-func)
153 (calc-z-prefix-buf, calc-z-prefix-msgs): New variables.
154 (calc-z-prefix-help, calc-user-function-list): Use declared
155 variables calc-z-prefix-buf, calc-z-prefix-msgs.
156 (math-map-tree, math-map-tree-rec): Use declared variables
157 math-mt-many, math-mt-func.
158 (math-read-expression, math-read-string): Use declared variable
159 math-expr-data.
160
161 * calc/calc-ext.el (math-normalize-nonstandard): Use declared
162 variable math-normalize-a.
163
164 * calc/calc.el (math-normalize-a): New variable.
165 (math-normalize): Use declared variable math-normalize-a.
166
167 * calc/calc-poly.el (math-expand-form): Use declared variable
168 math-mt-many.
169
170 * calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
171 Use declared variable math-mt-many.
172 (math-rewrite): Use declared variable math-mt-func.
173
174 * calc/calc-vec.el (math-read-brackets, math-read-vector)
175 (math-read-matrix): Use declared variable math-expr-data.
176
177 * calc/calc-lang.el (math-parse-fortran-vector)
178 (math-parse-fortran-vector-end, math-parse-tex-sum)
179 (math-parse-eqn-matrix, math-parse-eqn-prime)
180 (math-read-math-subscr): Use declared variable math-expr-data.
181
182 * calc/calc-aent.el (math-read-exprs, math-read-expr-list)
183 (math-read-expr-level, math-read-token, calc-check-user-syntax)
184 (calc-match-user-syntax, math-read-if, math-factor-after)
185 (math-read-factor): Use declared variable math-expr-data.
186
1872004-11-09 Glenn Morris <gmorris@ast.cam.ac.uk>
188
189 * calendar/diary-lib.el (diary-from-outlook)
190 (diary-from-outlook-gnus, diary-from-outlook-rmail): Do not use
191 interactive-p; but rather new optional argument NOCONFIRM.
192
1932004-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
194
195 * emacs-lisp/easymenu.el (easy-menu-intern): Revert to no-downcasing.
196 (easy-menu-name-match): Revert correspondingly.
197
1982004-11-09 Richard M. Stallman <rms@gnu.org>
199
200 * emacs-lisp/bytecomp.el (byte-compile-defalias):
201 Turn off warnings for the new function even if definition not constant.
202 If the definition isn't a quoted symbol, record (FUNCTION . t).
203 (byte-compile-function-environment): Now allow (FUNCTION . t) as elt.
204 (byte-compile-callargs-warn): Handle (FUNCTION . t).
205 (display-call-tree, byte-compile-arglist-warn):
206 Handle t returned by byte-compile-fdefinition.
207
2082004-11-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
209
210 * Makefile.in (maintainer-clean): Depend on distclean.
211
212 * help-fns.el (help-C-file-name): File name must be in build-files
213 to be returned.
214
2152004-11-09 Jay Belanger <belanger@truman.edu>
216
217 * calc/calc.el (calc-mode-hook, calc-trail-mode-hook)
218 (calc-start-hook, calc-end-hook, calc-load-hook): New variables.
219
220 * calc/calc.el (calc, calc-trail-display, calc-mode):
221 Remove obsolete sections.
222
223 * calc/calc.el (calc-x-paste-text): Remove.
224
225 * calc/calc-ext.el (calc-init-extensions): Bind calc-yank to
226 mouse-2.
227
2282004-11-09 Nick Roberts <nickrob@snap.net.nz>
229
230 * progmodes/gdb-ui.el (gdb-current-stack-level): New variable.
231 (gdb-info-frames-custom, gdb-frame-handler): Use it to find
232 current frame (in case of recursive calls).
233 (gdb-show-changed-values): Add :version keyword.
234
2352004-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
236
237 * international/mule-cmds.el: Change coding-system to utf-8.
238 (select-safe-coding-system-interactively):
239 New function extracted from select-safe-coding-system.
240 (select-safe-coding-system): Use it.
241
2422004-11-08 Richard M. Stallman <rms@gnu.org>
243
244 * subr.el (syntax-after): Doc fix.
245
246 * paren.el (show-paren-function): Change calls to syntax-after
247 for new way of returning the value.
248
249 * menu-bar.el (menu-bar-file-menu): Make this the real name
250 and menu-bar-files-menu the alias. Use the former.
251 (global-map): Use `file', not `files', as the symbol.
252
253 * info.el (Info-revert-find-node): Don't use beginning-of-buffer.
254
255 * filesets.el (filesets-spawn-external-viewer, filesets-run-cmd):
256 Don't use beginning-of-buffer.
257 (filesets-cmd-show-result): Use with-no-warnings.
258
2592004-11-08 Juri Linkov <juri@jurta.org>
260
261 * progmodes/compile.el (compile): Don't overwrite last command in
262 minibuffer history with default command if they are not equal.
263
2642004-11-08 Jay Belanger <belanger@truman.edu>
265
266 * calc/calcalg2.el (math-do-integral-methods): Try linear then
267 non-linear substitutions.
268
2692004-11-08 Jay Belanger <belanger@truman.edu>
270
271 * calc/calcalg2.el (math-linear-subst-tried): New variable.
272 (math-do-integral): Set `math-linear-subst-tried' to nil.
273 (math-do-integral-methods): Use `math-linear-subst-tried' to
274 determine what type of substitution to try.
275 (math-integ-try-linear-substituion):
276 Set `math-linear-subst-tried' to t.
277
2782004-11-08 Kim F. Storm <storm@cua.dk>
279
280 * Makefile.in (bootstrap-clean): New target for 'make bootstrap'.
281
2822004-11-07 Juri Linkov <juri@jurta.org>
283
284 * info-look.el (info-lookup): Allow reusing in the current buffer
285 not only *info* buffer, but all (even renamed) Info buffers
286 by checking for major-mode instead of *info* buffer name.
287 (c-mode, autoconf-mode, emacs-lisp-mode, scheme-mode)
288 (octave-mode, maxima-mode) <doc-spec>:
289 Allow long dashes generated by Texinfo 4.7 before definitions.
290 (texinfo-mode) <doc-spec>: Add space to suffix to find command
291 definitions with argument separated by space.
292
2932004-11-06 Richard M. Stallman <rms@gnu.org>
294
295 * simple.el (next-error group, face): Move before first use.
296 (next-error-highlight, next-error-highlight-no-select): Likewise.
297
298 * simple.el (line-move-invisible-p): Rename from line-move-invisible.
299 (line-move): New args NOERROR and TO-END.
300 Return t if if succeed in moving specified number of lines.
301 (move-end-of-line): New function.
302
303 * simple.el (beginning-of-buffer-other-window): Use with-no-warnings.
304 (end-of-buffer-other-window): Likewise.
305
306 * simple.el (line-move-ignore-invisible): Default to t.
307
308 * subr.el (syntax-after): Return the syntax letter, not the raw code.
309
310 * emacs-lisp/elp.el (elp-results): Delete wasteful beginning-of-buffer.
311
312 * international/iso-cvt.el (iso-cvt-define-menu):
313 Rename menu-bar-files-menu to menu-bar-file-menu.
314
315 * net/browse-url.el (browse-url-gnome-moz-program)
316 (browse-url-gnome-moz-arguments): Move up before first use.
317
318 * net/tramp.el (tramp group): Add :version.
319
320 * progmodes/ada-xref.el (ada-gdb-application):
321 Use goto-char instead of beginning-of-buffer.
322
323 * progmodes/cperl-mode.el (cperl-info-on-command):
324 Use goto-char instead of beginning-of-buffer.
325
326 * progmodes/idlw-shell.el (idlwave-shell-examine-map):
327 Move up before first use.
328 (idlwave-shell-temp-pro-file): Likewise.
329 (idlwave-shell-temp-rinfo-save-file): Likewise.
330 (idlwave-shell-temp-file): Minor doc fix.
331
332 * textmodes/flyspell.el (flyspell-external-point-words):
333 Use goto-char instead of beginning-of-buffer.
334
3352004-11-06 Kai Grossjohann <kai.grossjohann@gmx.net>
336
337 * net/tramp.el (tramp-coding-commands): Additionally try "uudecode -o
338 /dev/stdout" before trying "uudecode -o -". Suggested by Han Boetes.
339 (tramp-uudecode): Mention `uudecode -o /dev/stdout'.
340
3412004-11-06 David Ponce <david@dponce.com>
342
343 * recentf.el (recentf-menu-path): Use menu item name.
344
3452004-11-06 Eli Zaretskii <eliz@gnu.org>
346
347 * progmodes/gdb-ui.el: Don't call define-fringe-bitmap if the
348 display doesn't support images.
349
3502004-11-06 Andreas Schwab <schwab@suse.de>
351
352 * tempo.el (tempo-match-finder): Doc fix.
353
354 * emacs-lisp/easymenu.el (easy-menu-get-map): Fix last change.
355
3562004-11-06 Stefan Monnier <monnier@iro.umontreal.ca>
357
358 * emacs-lisp/easymenu.el (easy-menu-get-map-look-for-name): Remove.
359 (easy-menu-lookup-name): New fun to replace it.
360 (easy-menu-get-map): Use it to obey menu item names (rather than just
361 keys) when looking up `path'.
362 (easy-menu-always-true-p): Rename from easy-menu-always-true.
363 (easy-menu-convert-item-1): Adjust to new name.
364
3652004-11-06 Peter Heslin <pj@heslin.eclipse.co.uk> (tiny change)
366
367 * outline.el (hide-body): Don't hide lines at the top of the file
368 that precede the first header line.
369
3702004-11-06 Paul Pogonyshev <pogonyshev@gmx.net>
371
372 * align.el (align-areas): Delete whitespace before reindenting, so
373 that tabs are never placed after spaces.
374
3752004-11-06 Alan Shutko <ats@acm.org>
376
377 * macros.el (insert-kbd-macro): Do completions based on macros,
378 rather than all commands.
379
3802004-11-06 David Hansen <david.hansen@gmx.net> (tiny change)
381
382 * tempo.el (tempo-match-finder): Use [:word:] instead of "^\\b",
383 to solve a bug whereby tags with 'b' don't match.
384
3852004-11-05 Juri Linkov <juri@jurta.org>
386
387 * info.el (Info-search): Don't search in node header lines
388 and file headers.
389
390 * emacs-lisp/edebug.el (edebug-next-token-class): Allow all
391 symbol-constituent characters after dot, not only digits.
392
3932004-11-04 Daniel Pfeiffer <occitan@esperanto.org>
394
395 * files.el (set-auto-mode): Don't get error after setting -*-mode-*-.
396
3972004-11-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
398
399 * dired.el (dired-read-dir-and-switches): Call read-directory-name
400 if a dialog will be used, read-file-name otherwise.
401
4022004-11-04 Richard M. Stallman <rms@gnu.org>
403
404 * textmodes/table.el (table group): Add :version.
405
406 * textmodes/ispell.el (ispell-word):
407 Don't alter args; set them only thru `interactive' spec.
408
409 * textmodes/flyspell.el (flyspell-word):
410 Don't alter FOLLOWING; set it only thru `interactive' spec.
411
412 * progmodes/f90.el (f90-end-of-block): Don't use interactive-p.
413
414 * net/browse-url.el (browse-url-maybe-new-window):
415 Use called-interactively-p.
416
417 * mail/supercite.el (sc-cite-region):
418 Don't use interactive-p. Add arg INTERACTIVE.
419 (sc-version): Don't use interactive-p. Rename arg to MESSAGE.
420
421 * international/mule-cmds.el (set-input-method, toggle-input-method):
422 Don't use interactive-p. Add arg INTERACTIVE.
423
424 * eshell/esh-mode.el (eshell-show-maximum-output):
425 Don't use interactive-p.
426 (eshell-truncate-buffer): Just message, no error, if buffer is short.
427
428 * mouse.el (mouse-show-mark): Get positions to delete from mark
429 and point, not from mouse-drag-overlay.
430
431 * imenu.el (imenu-eager-completion-buffer): Add :version.
432
433 * filesets.el (filesets group): Add :version.
434
12004-11-03 Daniel Pfeiffer <occitan@esperanto.org> 4352004-11-03 Daniel Pfeiffer <occitan@esperanto.org>
2 436
3 * files.el (xml-based-modes): Delete var. 437 * files.el (xml-based-modes): Delete var.
@@ -28,6 +462,12 @@
28 462
292004-11-02 Richard M. Stallman <rms@gnu.org> 4632004-11-02 Richard M. Stallman <rms@gnu.org>
30 464
465 * cus-edit.el (customize-group-other-window):
466 Select the window that displays the custom buffer.
467 (custom-buffer-create-other-window): Likewise.
468
469 * comint.el (comint-insert-input): Fix previous change.
470
31 * emacs-lisp/elp.el (elp-instrument-function): 471 * emacs-lisp/elp.el (elp-instrument-function):
32 Use called-interactively-p. 472 Use called-interactively-p.
33 473
@@ -74,8 +514,7 @@
74 (icalendar-convert-diary-to-ical) 514 (icalendar-convert-diary-to-ical)
75 (icalendar-extract-ical-from-buffer): Use only two args for 515 (icalendar-extract-ical-from-buffer): Use only two args for
76 make-obsolete (XEmacs compatibility). 516 make-obsolete (XEmacs compatibility).
77 (icalendar-export-file, icalendar-import-file): Blank at end of 517 (icalendar-export-file, icalendar-import-file): Blank at end of prompt.
78 prompt.
79 (icalendar-export-region): Doc fix. 518 (icalendar-export-region): Doc fix.
80 If error, return non-nil and write errors to a buffer. 519 If error, return non-nil and write errors to a buffer.
81 Use correct weekday for weekly recurring events. 520 Use correct weekday for weekly recurring events.
@@ -115,16 +554,16 @@
115 554
1162004-11-02 Pavel Kobiakov <pk_at_work@yahoo.com> 5552004-11-02 Pavel Kobiakov <pk_at_work@yahoo.com>
117 556
118 * progmodes/flymake.el (flymake-err-line-patterns): Use 557 * progmodes/flymake.el (flymake-err-line-patterns):
119 `flymake-reformat-err-line-patterns-from-compile-el' to convert 558 Use `flymake-reformat-err-line-patterns-from-compile-el' to convert
120 `compilation-error-regexp-alist-alist' to internal Flymake format. 559 `compilation-error-regexp-alist-alist' to internal Flymake format.
121 560
122 * progmodes/flymake.el: eliminated byte-compiler warnings. 561 * progmodes/flymake.el: eliminated byte-compiler warnings.
123 562
1242004-11-01 Jay Belanger <belanger@truman.edu> 5632004-11-01 Jay Belanger <belanger@truman.edu>
125 564
126 * calc/calc-frac.el (calc-over-notation): Replaced 565 * calc/calc-frac.el (calc-over-notation): Replace `completing-read'
127 `completing-read' with `interactive "s"'. 566 with `interactive "s"'.
128 567
1292004-11-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 5682004-11-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
130 569
diff --git a/lisp/ChangeLog.10 b/lisp/ChangeLog.10
index 486f0f38964..a702e56fdf3 100644
--- a/lisp/ChangeLog.10
+++ b/lisp/ChangeLog.10
@@ -4150,6 +4150,7 @@
4150 (desktop-path): New customizable variable. List of directories in 4150 (desktop-path): New customizable variable. List of directories in
4151 which to lookup the desktop file. Replaces hardcoded list. 4151 which to lookup the desktop file. Replaces hardcoded list.
4152 (desktop-globals-to-clear): New variable replaces hardcoded list. 4152 (desktop-globals-to-clear): New variable replaces hardcoded list.
4153 (desktop-globals-to-save): Variable made customizable.
4153 (desktop-clear-preserve-buffers-regexp): New customizable variable. 4154 (desktop-clear-preserve-buffers-regexp): New customizable variable.
4154 (desktop-after-read-hook): New hook run after a desktop is read. 4155 (desktop-after-read-hook): New hook run after a desktop is read.
4155 (desktop-no-desktop-file-hook): New hook when no desktop file found. 4156 (desktop-no-desktop-file-hook): New hook when no desktop file found.
diff --git a/lisp/ChangeLog.7 b/lisp/ChangeLog.7
index 85dfaeaf35f..f89cb7b0d47 100644
--- a/lisp/ChangeLog.7
+++ b/lisp/ChangeLog.7
@@ -23104,8 +23104,8 @@
23104 * message.el (message-mode): Delete abbrev mode initialization. 23104 * message.el (message-mode): Delete abbrev mode initialization.
23105 (message-mode-hook): Move it here, instead, so the user can 23105 (message-mode-hook): Move it here, instead, so the user can
23106 override it. 23106 override it.
23107 (message-y-or-n-p, message-talkative-question, 23107 (message-y-or-n-p, message-talkative-question)
23108 message-flatten-list, message-flatten-list-1): Move utility 23108 (message-flatten-list, message-flatten-list-1): Move utility
23109 functions up so macro is defined before first invocation. 23109 functions up so macro is defined before first invocation.
23110 23110
23111 * f90.el (f90-auto-fill-mode): Function deleted, all references 23111 * f90.el (f90-auto-fill-mode): Function deleted, all references
@@ -23115,24 +23115,23 @@
23115 23115
231161996-08-13 Torbjorn Einarsson <etxeina@etxdn.ericsson.se> 231161996-08-13 Torbjorn Einarsson <etxeina@etxdn.ericsson.se>
23117 23117
23118 * f90.el: (f90-do-auto-fill): Fixed bug which made program hang for 23118 * f90.el: (f90-do-auto-fill): Fix bug which made program hang for
23119 space in fill-column. 23119 space in fill-column.
23120 (f90-font-lock-keywords-1): Now we have common font-lock 23120 (f90-font-lock-keywords-1): Now we have common font-lock
23121 exps for Emacs and XEmacs 23121 exps for Emacs and XEmacs
23122 (f90-font-lock-keywords-2): Changed reg-exp for line number. A 23122 (f90-font-lock-keywords-2): Change reg-exp for line number.
23123 number must be followed by a letter to be highlighted. Fixed 23123 A number must be followed by a letter to be highlighted.
23124 highlighting of declarations with trailing comments. 23124 Fix highlighting of declarations with trailing comments.
23125 (f90-match-end): Fixed bug due to new message syntax. 23125 (f90-match-end): Fix bug due to new message syntax.
23126 (f90-mode): Fixed setup of variable font-lock-defaults. 23126 (f90-mode): Fix setup of variable font-lock-defaults.
23127 (f90-looking-at-program-block-start): Small error in detecting of 23127 (f90-looking-at-program-block-start): Small error in detecting of
23128 function start. Made the detection of subroutine start more flexible. 23128 function start. Made the detection of subroutine start more flexible.
23129 (f90-mode-map): Much nicer menu with sections and added submenus 23129 (f90-mode-map): Much nicer menu with sections and added submenus
23130 for highlighting and keyword case change. 23130 for highlighting and keyword case change.
23131 Also added 'menu-enable' properties for region-based commands. 23131 Also added 'menu-enable' properties for region-based commands.
23132 (f90-imenu-generic-expression): Fixed expression to find 23132 (f90-imenu-generic-expression): Fix expression to find
23133 procedures, modules and types. 23133 procedures, modules and types.
23134 (f90-add-imenu-menu): New function for adding imenu menu to the 23134 (f90-add-imenu-menu): New function for adding imenu menu to the menubar.
23135 menubar.
23136 23135
231371996-08-13 Richard Stallman <rms@psilocin.gnu.ai.mit.edu> 231361996-08-13 Richard Stallman <rms@psilocin.gnu.ai.mit.edu>
23138 23137
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index d43f47871c2..8a4659fcc1c 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -309,9 +309,12 @@ bootstrap-prepare:
309 fi \ 309 fi \
310 fi 310 fi
311 311
312maintainer-clean: 312maintainer-clean: distclean
313 cd $(lisp); rm -f *.elc */*.elc $(AUTOGENEL) 313 cd $(lisp); rm -f *.elc */*.elc $(AUTOGENEL)
314 314
315bootstrap-clean:
316 cd $(lisp); rm -f *.elc */*.elc
317
315# Generate/update files for the bootstrap process. 318# Generate/update files for the bootstrap process.
316 319
317bootstrap: update-subdirs autoloads compile 320bootstrap: update-subdirs autoloads compile
diff --git a/lisp/align.el b/lisp/align.el
index bae09d749db..5e739c8f7c0 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -1212,6 +1212,14 @@ have been aligned. No changes will be made to the buffer."
1212 (cond ((< gocol 0) t) ; don't do anything 1212 (cond ((< gocol 0) t) ; don't do anything
1213 ((= cur gocol) t) ; don't need to 1213 ((= cur gocol) t) ; don't need to
1214 ((< cur gocol) ; just add space 1214 ((< cur gocol) ; just add space
1215 ;; FIXME: It is stated above that "...the
1216 ;; whitespace to be modified was already
1217 ;; deleted by `align-region', all we have
1218 ;; to do here is indent." However, this
1219 ;; doesn't seem to be true, so we first
1220 ;; delete the whitespace to avoid tabs
1221 ;; after spaces.
1222 (delete-horizontal-space t)
1215 (indent-to gocol)) 1223 (indent-to gocol))
1216 (t 1224 (t
1217 ;; This code works around an oddity in the 1225 ;; This code works around an oddity in the
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el
index 2db722ccb2d..182b3b0635c 100644
--- a/lisp/calc/calc-aent.el
+++ b/lisp/calc/calc-aent.el
@@ -101,10 +101,7 @@
101 (message "Result: %s" buf))) 101 (message "Result: %s" buf)))
102 (if (eq last-command-char 10) 102 (if (eq last-command-char 10)
103 (insert shortbuf) 103 (insert shortbuf)
104 (setq kill-ring (cons shortbuf kill-ring)) 104 (kill-new shortbuf)))))
105 (when (> (length kill-ring) kill-ring-max)
106 (setcdr (nthcdr (1- kill-ring-max) kill-ring) nil))
107 (setq kill-ring-yank-pointer kill-ring)))))
108 105
109(defun calc-do-calc-eval (str separator args) 106(defun calc-do-calc-eval (str separator args)
110 (calc-check-defines) 107 (calc-check-defines)
@@ -301,10 +298,12 @@
301(defvar calc-alg-ent-esc-map nil 298(defvar calc-alg-ent-esc-map nil
302 "The keymap used for escapes in algebraic entry.") 299 "The keymap used for escapes in algebraic entry.")
303 300
301(defvar calc-alg-exp)
302
304(defun calc-do-alg-entry (&optional initial prompt no-normalize) 303(defun calc-do-alg-entry (&optional initial prompt no-normalize)
305 (let* ((calc-buffer (current-buffer)) 304 (let* ((calc-buffer (current-buffer))
306 (blink-paren-function 'calcAlg-blink-matching-open) 305 (blink-paren-function 'calcAlg-blink-matching-open)
307 (alg-exp 'error)) 306 (calc-alg-exp 'error))
308 (unless calc-alg-ent-map 307 (unless calc-alg-ent-map
309 (setq calc-alg-ent-map (copy-keymap minibuffer-local-map)) 308 (setq calc-alg-ent-map (copy-keymap minibuffer-local-map))
310 (define-key calc-alg-ent-map "'" 'calcAlg-previous) 309 (define-key calc-alg-ent-map "'" 'calcAlg-previous)
@@ -328,13 +327,13 @@
328 (let ((buf (read-from-minibuffer (or prompt "Algebraic: ") 327 (let ((buf (read-from-minibuffer (or prompt "Algebraic: ")
329 (or initial "") 328 (or initial "")
330 calc-alg-ent-map nil))) 329 calc-alg-ent-map nil)))
331 (when (eq alg-exp 'error) 330 (when (eq calc-alg-exp 'error)
332 (when (eq (car-safe (setq alg-exp (math-read-exprs buf))) 'error) 331 (when (eq (car-safe (setq calc-alg-exp (math-read-exprs buf))) 'error)
333 (setq alg-exp nil))) 332 (setq calc-alg-exp nil)))
334 (setq calc-aborted-prefix "alg'") 333 (setq calc-aborted-prefix "alg'")
335 (or no-normalize 334 (or no-normalize
336 (and alg-exp (setq alg-exp (mapcar 'calc-normalize alg-exp)))) 335 (and calc-alg-exp (setq calc-alg-exp (mapcar 'calc-normalize calc-alg-exp))))
337 alg-exp))) 336 calc-alg-exp)))
338 337
339(defun calcAlg-plus-minus () 338(defun calcAlg-plus-minus ()
340 (interactive) 339 (interactive)
@@ -364,8 +363,8 @@
364 (interactive) 363 (interactive)
365 (unwind-protect 364 (unwind-protect
366 (calcAlg-enter) 365 (calcAlg-enter)
367 (if (consp alg-exp) 366 (if (consp calc-alg-exp)
368 (progn (setq prefix-arg (length alg-exp)) 367 (progn (setq prefix-arg (length calc-alg-exp))
369 (calc-unread-command ?=))))) 368 (calc-unread-command ?=)))))
370 369
371(defun calcAlg-escape () 370(defun calcAlg-escape ()
@@ -383,8 +382,8 @@
383 (calc-minibuffer-contains 382 (calc-minibuffer-contains
384 "\\`\\([^\"]*\"[^\"]*\"\\)*[^\"]*\"[^\"]*\\'")) 383 "\\`\\([^\"]*\"[^\"]*\"\\)*[^\"]*\"[^\"]*\\'"))
385 (insert "`") 384 (insert "`")
386 (setq alg-exp (minibuffer-contents)) 385 (setq calc-alg-exp (minibuffer-contents))
387 (and (> (length alg-exp) 0) (setq calc-previous-alg-entry alg-exp)) 386 (and (> (length calc-alg-exp) 0) (setq calc-previous-alg-entry calc-alg-exp))
388 (exit-minibuffer))) 387 (exit-minibuffer)))
389 388
390(defun calcAlg-enter () 389(defun calcAlg-enter ()
@@ -402,7 +401,7 @@
402 (calc-temp-minibuffer-message 401 (calc-temp-minibuffer-message
403 (concat " [" (or (nth 2 exp) "Error") "]")) 402 (concat " [" (or (nth 2 exp) "Error") "]"))
404 (calc-clear-unread-commands)) 403 (calc-clear-unread-commands))
405 (setq alg-exp (if (calc-minibuffer-contains "\\` *\\[ *\\'") 404 (setq calc-alg-exp (if (calc-minibuffer-contains "\\` *\\[ *\\'")
406 '((incomplete vec)) 405 '((incomplete vec))
407 exp)) 406 exp))
408 (and (> (length str) 0) (setq calc-previous-alg-entry str)) 407 (and (> (length str) 0) (setq calc-previous-alg-entry str))
@@ -460,30 +459,39 @@
460 459
461;;; Algebraic expression parsing. [Public] 460;;; Algebraic expression parsing. [Public]
462 461
463(defun math-read-exprs (exp-str) 462;;; The next few variables are local to math-read-exprs (and math-read-expr)
464 (let ((exp-pos 0) 463;;; but are set in functions they call.
465 (exp-old-pos 0) 464
466 (exp-keep-spaces nil) 465(defvar math-exp-pos)
467 exp-token exp-data) 466(defvar math-exp-str)
467(defvar math-exp-old-pos)
468(defvar math-exp-token)
469(defvar math-exp-keep-spaces)
470
471(defun math-read-exprs (math-exp-str)
472 (let ((math-exp-pos 0)
473 (math-exp-old-pos 0)
474 (math-exp-keep-spaces nil)
475 math-exp-token math-expr-data)
468 (if calc-language-input-filter 476 (if calc-language-input-filter
469 (setq exp-str (funcall calc-language-input-filter exp-str))) 477 (setq math-exp-str (funcall calc-language-input-filter math-exp-str)))
470 (while (setq exp-token (string-match "\\.\\.\\([^.]\\|.[^.]\\)" exp-str)) 478 (while (setq math-exp-token (string-match "\\.\\.\\([^.]\\|.[^.]\\)" math-exp-str))
471 (setq exp-str (concat (substring exp-str 0 exp-token) "\\dots" 479 (setq math-exp-str (concat (substring math-exp-str 0 math-exp-token) "\\dots"
472 (substring exp-str (+ exp-token 2))))) 480 (substring math-exp-str (+ math-exp-token 2)))))
473 (math-build-parse-table) 481 (math-build-parse-table)
474 (math-read-token) 482 (math-read-token)
475 (let ((val (catch 'syntax (math-read-expr-list)))) 483 (let ((val (catch 'syntax (math-read-expr-list))))
476 (if (stringp val) 484 (if (stringp val)
477 (list 'error exp-old-pos val) 485 (list 'error math-exp-old-pos val)
478 (if (equal exp-token 'end) 486 (if (equal math-exp-token 'end)
479 val 487 val
480 (list 'error exp-old-pos "Syntax error")))))) 488 (list 'error math-exp-old-pos "Syntax error"))))))
481 489
482(defun math-read-expr-list () 490(defun math-read-expr-list ()
483 (let* ((exp-keep-spaces nil) 491 (let* ((math-exp-keep-spaces nil)
484 (val (list (math-read-expr-level 0))) 492 (val (list (math-read-expr-level 0)))
485 (last val)) 493 (last val))
486 (while (equal exp-data ",") 494 (while (equal math-expr-data ",")
487 (math-read-token) 495 (math-read-token)
488 (let ((rest (list (math-read-expr-level 0)))) 496 (let ((rest (list (math-read-expr-level 0))))
489 (setcdr last rest) 497 (setcdr last rest)
@@ -496,20 +504,23 @@
496(defvar calc-user-tokens nil) 504(defvar calc-user-tokens nil)
497(defvar calc-user-token-chars nil) 505(defvar calc-user-token-chars nil)
498 506
507(defvar math-toks nil
508 "Tokens to pass between math-build-parse-table and math-find-user-tokens.")
509
499(defun math-build-parse-table () 510(defun math-build-parse-table ()
500 (let ((mtab (cdr (assq nil calc-user-parse-tables))) 511 (let ((mtab (cdr (assq nil calc-user-parse-tables)))
501 (ltab (cdr (assq calc-language calc-user-parse-tables)))) 512 (ltab (cdr (assq calc-language calc-user-parse-tables))))
502 (or (and (eq mtab calc-last-main-parse-table) 513 (or (and (eq mtab calc-last-main-parse-table)
503 (eq ltab calc-last-lang-parse-table)) 514 (eq ltab calc-last-lang-parse-table))
504 (let ((p (append mtab ltab)) 515 (let ((p (append mtab ltab))
505 (toks nil)) 516 (math-toks nil))
506 (setq calc-user-parse-table p) 517 (setq calc-user-parse-table p)
507 (setq calc-user-token-chars nil) 518 (setq calc-user-token-chars nil)
508 (while p 519 (while p
509 (math-find-user-tokens (car (car p))) 520 (math-find-user-tokens (car (car p)))
510 (setq p (cdr p))) 521 (setq p (cdr p)))
511 (setq calc-user-tokens (mapconcat 'identity 522 (setq calc-user-tokens (mapconcat 'identity
512 (sort (mapcar 'car toks) 523 (sort (mapcar 'car math-toks)
513 (function (lambda (x y) 524 (function (lambda (x y)
514 (> (length x) 525 (> (length x)
515 (length y))))) 526 (length y)))))
@@ -517,7 +528,7 @@
517 calc-last-main-parse-table mtab 528 calc-last-main-parse-table mtab
518 calc-last-lang-parse-table ltab))))) 529 calc-last-lang-parse-table ltab)))))
519 530
520(defun math-find-user-tokens (p) ; uses "toks" 531(defun math-find-user-tokens (p)
521 (while p 532 (while p
522 (cond ((and (stringp (car p)) 533 (cond ((and (stringp (car p))
523 (or (> (length (car p)) 1) (equal (car p) "$") 534 (or (> (length (car p)) 1) (equal (car p) "$")
@@ -528,9 +539,9 @@
528 (setq s (concat "\\<" s))) 539 (setq s (concat "\\<" s)))
529 (if (string-match "[a-zA-Z0-9]\\'" s) 540 (if (string-match "[a-zA-Z0-9]\\'" s)
530 (setq s (concat s "\\>"))) 541 (setq s (concat s "\\>")))
531 (or (assoc s toks) 542 (or (assoc s math-toks)
532 (progn 543 (progn
533 (setq toks (cons (list s) toks)) 544 (setq math-toks (cons (list s) math-toks))
534 (or (memq (aref (car p) 0) calc-user-token-chars) 545 (or (memq (aref (car p) 0) calc-user-token-chars)
535 (setq calc-user-token-chars 546 (setq calc-user-token-chars
536 (cons (aref (car p) 0) 547 (cons (aref (car p) 0)
@@ -542,161 +553,168 @@
542 (setq p (cdr p)))) 553 (setq p (cdr p))))
543 554
544(defun math-read-token () 555(defun math-read-token ()
545 (if (>= exp-pos (length exp-str)) 556 (if (>= math-exp-pos (length math-exp-str))
546 (setq exp-old-pos exp-pos 557 (setq math-exp-old-pos math-exp-pos
547 exp-token 'end 558 math-exp-token 'end
548 exp-data "\000") 559 math-expr-data "\000")
549 (let ((ch (aref exp-str exp-pos))) 560 (let ((ch (aref math-exp-str math-exp-pos)))
550 (setq exp-old-pos exp-pos) 561 (setq math-exp-old-pos math-exp-pos)
551 (cond ((memq ch '(32 10 9)) 562 (cond ((memq ch '(32 10 9))
552 (setq exp-pos (1+ exp-pos)) 563 (setq math-exp-pos (1+ math-exp-pos))
553 (if exp-keep-spaces 564 (if math-exp-keep-spaces
554 (setq exp-token 'space 565 (setq math-exp-token 'space
555 exp-data " ") 566 math-expr-data " ")
556 (math-read-token))) 567 (math-read-token)))
557 ((and (memq ch calc-user-token-chars) 568 ((and (memq ch calc-user-token-chars)
558 (let ((case-fold-search nil)) 569 (let ((case-fold-search nil))
559 (eq (string-match calc-user-tokens exp-str exp-pos) 570 (eq (string-match calc-user-tokens math-exp-str math-exp-pos)
560 exp-pos))) 571 math-exp-pos)))
561 (setq exp-token 'punc 572 (setq math-exp-token 'punc
562 exp-data (math-match-substring exp-str 0) 573 math-expr-data (math-match-substring math-exp-str 0)
563 exp-pos (match-end 0))) 574 math-exp-pos (match-end 0)))
564 ((or (and (>= ch ?a) (<= ch ?z)) 575 ((or (and (>= ch ?a) (<= ch ?z))
565 (and (>= ch ?A) (<= ch ?Z))) 576 (and (>= ch ?A) (<= ch ?Z)))
566 (string-match (if (memq calc-language '(c fortran pascal maple)) 577 (string-match (if (memq calc-language '(c fortran pascal maple))
567 "[a-zA-Z0-9_#]*" 578 "[a-zA-Z0-9_#]*"
568 "[a-zA-Z0-9'#]*") 579 "[a-zA-Z0-9'#]*")
569 exp-str exp-pos) 580 math-exp-str math-exp-pos)
570 (setq exp-token 'symbol 581 (setq math-exp-token 'symbol
571 exp-pos (match-end 0) 582 math-exp-pos (match-end 0)
572 exp-data (math-restore-dashes 583 math-expr-data (math-restore-dashes
573 (math-match-substring exp-str 0))) 584 (math-match-substring math-exp-str 0)))
574 (if (eq calc-language 'eqn) 585 (if (eq calc-language 'eqn)
575 (let ((code (assoc exp-data math-eqn-ignore-words))) 586 (let ((code (assoc math-expr-data math-eqn-ignore-words)))
576 (cond ((null code)) 587 (cond ((null code))
577 ((null (cdr code)) 588 ((null (cdr code))
578 (math-read-token)) 589 (math-read-token))
579 ((consp (nth 1 code)) 590 ((consp (nth 1 code))
580 (math-read-token) 591 (math-read-token)
581 (if (assoc exp-data (cdr code)) 592 (if (assoc math-expr-data (cdr code))
582 (setq exp-data (format "%s %s" 593 (setq math-expr-data (format "%s %s"
583 (car code) exp-data)))) 594 (car code) math-expr-data))))
584 ((eq (nth 1 code) 'punc) 595 ((eq (nth 1 code) 'punc)
585 (setq exp-token 'punc 596 (setq math-exp-token 'punc
586 exp-data (nth 2 code))) 597 math-expr-data (nth 2 code)))
587 (t 598 (t
588 (math-read-token) 599 (math-read-token)
589 (math-read-token)))))) 600 (math-read-token))))))
590 ((or (and (>= ch ?0) (<= ch ?9)) 601 ((or (and (>= ch ?0) (<= ch ?9))
591 (and (eq ch '?\.) 602 (and (eq ch '?\.)
592 (eq (string-match "\\.[0-9]" exp-str exp-pos) exp-pos)) 603 (eq (string-match "\\.[0-9]" math-exp-str math-exp-pos)
604 math-exp-pos))
593 (and (eq ch '?_) 605 (and (eq ch '?_)
594 (eq (string-match "_\\.?[0-9]" exp-str exp-pos) exp-pos) 606 (eq (string-match "_\\.?[0-9]" math-exp-str math-exp-pos)
595 (or (eq exp-pos 0) 607 math-exp-pos)
608 (or (eq math-exp-pos 0)
596 (and (memq calc-language '(nil flat big unform 609 (and (memq calc-language '(nil flat big unform
597 tex eqn)) 610 tex eqn))
598 (eq (string-match "[^])}\"a-zA-Z0-9'$]_" 611 (eq (string-match "[^])}\"a-zA-Z0-9'$]_"
599 exp-str (1- exp-pos)) 612 math-exp-str (1- math-exp-pos))
600 (1- exp-pos)))))) 613 (1- math-exp-pos))))))
601 (or (and (eq calc-language 'c) 614 (or (and (eq calc-language 'c)
602 (string-match "0[xX][0-9a-fA-F]+" exp-str exp-pos)) 615 (string-match "0[xX][0-9a-fA-F]+" math-exp-str math-exp-pos))
603 (string-match "_?\\([0-9]+.?0*@ *\\)?\\([0-9]+.?0*' *\\)?\\(0*\\([2-9]\\|1[0-4]\\)\\(#\\|\\^\\^\\)[0-9a-dA-D.]+[eE][-+_]?[0-9]+\\|0*\\([2-9]\\|[0-2][0-9]\\|3[0-6]\\)\\(#\\|\\^\\^\\)[0-9a-zA-Z:.]+\\|[0-9]+:[0-9:]+\\|[0-9.]+\\([eE][-+_]?[0-9]+\\)?\"?\\)?" exp-str exp-pos)) 616 (string-match "_?\\([0-9]+.?0*@ *\\)?\\([0-9]+.?0*' *\\)?\\(0*\\([2-9]\\|1[0-4]\\)\\(#\\|\\^\\^\\)[0-9a-dA-D.]+[eE][-+_]?[0-9]+\\|0*\\([2-9]\\|[0-2][0-9]\\|3[0-6]\\)\\(#\\|\\^\\^\\)[0-9a-zA-Z:.]+\\|[0-9]+:[0-9:]+\\|[0-9.]+\\([eE][-+_]?[0-9]+\\)?\"?\\)?"
604 (setq exp-token 'number 617 math-exp-str math-exp-pos))
605 exp-data (math-match-substring exp-str 0) 618 (setq math-exp-token 'number
606 exp-pos (match-end 0))) 619 math-expr-data (math-match-substring math-exp-str 0)
620 math-exp-pos (match-end 0)))
607 ((eq ch ?\$) 621 ((eq ch ?\$)
608 (if (and (eq calc-language 'pascal) 622 (if (and (eq calc-language 'pascal)
609 (eq (string-match 623 (eq (string-match
610 "\\(\\$[0-9a-fA-F]+\\)\\($\\|[^0-9a-zA-Z]\\)" 624 "\\(\\$[0-9a-fA-F]+\\)\\($\\|[^0-9a-zA-Z]\\)"
611 exp-str exp-pos) 625 math-exp-str math-exp-pos)
612 exp-pos)) 626 math-exp-pos))
613 (setq exp-token 'number 627 (setq math-exp-token 'number
614 exp-data (math-match-substring exp-str 1) 628 math-expr-data (math-match-substring math-exp-str 1)
615 exp-pos (match-end 1)) 629 math-exp-pos (match-end 1))
616 (if (eq (string-match "\\$\\([1-9][0-9]*\\)" exp-str exp-pos) 630 (if (eq (string-match "\\$\\([1-9][0-9]*\\)" math-exp-str math-exp-pos)
617 exp-pos) 631 math-exp-pos)
618 (setq exp-data (- (string-to-int (math-match-substring 632 (setq math-expr-data (- (string-to-int (math-match-substring
619 exp-str 1)))) 633 math-exp-str 1))))
620 (string-match "\\$+" exp-str exp-pos) 634 (string-match "\\$+" math-exp-str math-exp-pos)
621 (setq exp-data (- (match-end 0) (match-beginning 0)))) 635 (setq math-expr-data (- (match-end 0) (match-beginning 0))))
622 (setq exp-token 'dollar 636 (setq math-exp-token 'dollar
623 exp-pos (match-end 0)))) 637 math-exp-pos (match-end 0))))
624 ((eq ch ?\#) 638 ((eq ch ?\#)
625 (if (eq (string-match "#\\([1-9][0-9]*\\)" exp-str exp-pos) 639 (if (eq (string-match "#\\([1-9][0-9]*\\)" math-exp-str math-exp-pos)
626 exp-pos) 640 math-exp-pos)
627 (setq exp-data (string-to-int 641 (setq math-expr-data (string-to-int
628 (math-match-substring exp-str 1)) 642 (math-match-substring math-exp-str 1))
629 exp-pos (match-end 0)) 643 math-exp-pos (match-end 0))
630 (setq exp-data 1 644 (setq math-expr-data 1
631 exp-pos (1+ exp-pos))) 645 math-exp-pos (1+ math-exp-pos)))
632 (setq exp-token 'hash)) 646 (setq math-exp-token 'hash))
633 ((eq (string-match "~=\\|<=\\|>=\\|<>\\|/=\\|\\+/-\\|\\\\dots\\|\\\\ldots\\|\\*\\*\\|<<\\|>>\\|==\\|!=\\|&&&\\||||\\|!!!\\|&&\\|||\\|!!\\|:=\\|::\\|=>" 647 ((eq (string-match "~=\\|<=\\|>=\\|<>\\|/=\\|\\+/-\\|\\\\dots\\|\\\\ldots\\|\\*\\*\\|<<\\|>>\\|==\\|!=\\|&&&\\||||\\|!!!\\|&&\\|||\\|!!\\|:=\\|::\\|=>"
634 exp-str exp-pos) 648 math-exp-str math-exp-pos)
635 exp-pos) 649 math-exp-pos)
636 (setq exp-token 'punc 650 (setq math-exp-token 'punc
637 exp-data (math-match-substring exp-str 0) 651 math-expr-data (math-match-substring math-exp-str 0)
638 exp-pos (match-end 0))) 652 math-exp-pos (match-end 0)))
639 ((and (eq ch ?\") 653 ((and (eq ch ?\")
640 (string-match "\\(\"\\([^\"\\]\\|\\\\.\\)*\\)\\(\"\\|\\'\\)" exp-str exp-pos)) 654 (string-match "\\(\"\\([^\"\\]\\|\\\\.\\)*\\)\\(\"\\|\\'\\)"
655 math-exp-str math-exp-pos))
641 (if (eq calc-language 'eqn) 656 (if (eq calc-language 'eqn)
642 (progn 657 (progn
643 (setq exp-str (copy-sequence exp-str)) 658 (setq math-exp-str (copy-sequence math-exp-str))
644 (aset exp-str (match-beginning 1) ?\{) 659 (aset math-exp-str (match-beginning 1) ?\{)
645 (if (< (match-end 1) (length exp-str)) 660 (if (< (match-end 1) (length math-exp-str))
646 (aset exp-str (match-end 1) ?\})) 661 (aset math-exp-str (match-end 1) ?\}))
647 (math-read-token)) 662 (math-read-token))
648 (setq exp-token 'string 663 (setq math-exp-token 'string
649 exp-data (math-match-substring exp-str 1) 664 math-expr-data (math-match-substring math-exp-str 1)
650 exp-pos (match-end 0)))) 665 math-exp-pos (match-end 0))))
651 ((and (= ch ?\\) (eq calc-language 'tex) 666 ((and (= ch ?\\) (eq calc-language 'tex)
652 (< exp-pos (1- (length exp-str)))) 667 (< math-exp-pos (1- (length math-exp-str))))
653 (or (string-match "\\\\hbox *{\\([a-zA-Z0-9]+\\)}" exp-str exp-pos) 668 (or (string-match "\\\\hbox *{\\([a-zA-Z0-9]+\\)}"
654 (string-match "\\(\\\\\\([a-zA-Z]+\\|[^a-zA-Z]\\)\\)" exp-str exp-pos)) 669 math-exp-str math-exp-pos)
655 (setq exp-token 'symbol 670 (string-match "\\(\\\\\\([a-zA-Z]+\\|[^a-zA-Z]\\)\\)"
656 exp-pos (match-end 0) 671 math-exp-str math-exp-pos))
657 exp-data (math-restore-dashes 672 (setq math-exp-token 'symbol
658 (math-match-substring exp-str 1))) 673 math-exp-pos (match-end 0)
659 (let ((code (assoc exp-data math-tex-ignore-words))) 674 math-expr-data (math-restore-dashes
675 (math-match-substring math-exp-str 1)))
676 (let ((code (assoc math-expr-data math-tex-ignore-words)))
660 (cond ((null code)) 677 (cond ((null code))
661 ((null (cdr code)) 678 ((null (cdr code))
662 (math-read-token)) 679 (math-read-token))
663 ((eq (nth 1 code) 'punc) 680 ((eq (nth 1 code) 'punc)
664 (setq exp-token 'punc 681 (setq math-exp-token 'punc
665 exp-data (nth 2 code))) 682 math-expr-data (nth 2 code)))
666 ((and (eq (nth 1 code) 'mat) 683 ((and (eq (nth 1 code) 'mat)
667 (string-match " *{" exp-str exp-pos)) 684 (string-match " *{" math-exp-str math-exp-pos))
668 (setq exp-pos (match-end 0) 685 (setq math-exp-pos (match-end 0)
669 exp-token 'punc 686 math-exp-token 'punc
670 exp-data "[") 687 math-expr-data "[")
671 (let ((right (string-match "}" exp-str exp-pos))) 688 (let ((right (string-match "}" math-exp-str math-exp-pos)))
672 (and right 689 (and right
673 (setq exp-str (copy-sequence exp-str)) 690 (setq math-exp-str (copy-sequence math-exp-str))
674 (aset exp-str right ?\]))))))) 691 (aset math-exp-str right ?\])))))))
675 ((and (= ch ?\.) (eq calc-language 'fortran) 692 ((and (= ch ?\.) (eq calc-language 'fortran)
676 (eq (string-match "\\.[a-zA-Z][a-zA-Z][a-zA-Z]?\\." 693 (eq (string-match "\\.[a-zA-Z][a-zA-Z][a-zA-Z]?\\."
677 exp-str exp-pos) exp-pos)) 694 math-exp-str math-exp-pos) math-exp-pos))
678 (setq exp-token 'punc 695 (setq math-exp-token 'punc
679 exp-data (upcase (math-match-substring exp-str 0)) 696 math-expr-data (upcase (math-match-substring math-exp-str 0))
680 exp-pos (match-end 0))) 697 math-exp-pos (match-end 0)))
681 ((and (eq calc-language 'math) 698 ((and (eq calc-language 'math)
682 (eq (string-match "\\[\\[\\|->\\|:>" exp-str exp-pos) 699 (eq (string-match "\\[\\[\\|->\\|:>" math-exp-str math-exp-pos)
683 exp-pos)) 700 math-exp-pos))
684 (setq exp-token 'punc 701 (setq math-exp-token 'punc
685 exp-data (math-match-substring exp-str 0) 702 math-expr-data (math-match-substring math-exp-str 0)
686 exp-pos (match-end 0))) 703 math-exp-pos (match-end 0)))
687 ((and (eq calc-language 'eqn) 704 ((and (eq calc-language 'eqn)
688 (eq (string-match "->\\|<-\\|+-\\|\\\\dots\\|~\\|\\^" 705 (eq (string-match "->\\|<-\\|+-\\|\\\\dots\\|~\\|\\^"
689 exp-str exp-pos) 706 math-exp-str math-exp-pos)
690 exp-pos)) 707 math-exp-pos))
691 (setq exp-token 'punc 708 (setq math-exp-token 'punc
692 exp-data (math-match-substring exp-str 0) 709 math-expr-data (math-match-substring math-exp-str 0)
693 exp-pos (match-end 0)) 710 math-exp-pos (match-end 0))
694 (and (eq (string-match "\\\\dots\\." exp-str exp-pos) exp-pos) 711 (and (eq (string-match "\\\\dots\\." math-exp-str math-exp-pos)
695 (setq exp-pos (match-end 0))) 712 math-exp-pos)
696 (if (memq (aref exp-data 0) '(?~ ?^)) 713 (setq math-exp-pos (match-end 0)))
714 (if (memq (aref math-expr-data 0) '(?~ ?^))
697 (math-read-token))) 715 (math-read-token)))
698 ((eq (string-match "%%.*$" exp-str exp-pos) exp-pos) 716 ((eq (string-match "%%.*$" math-exp-str math-exp-pos) math-exp-pos)
699 (setq exp-pos (match-end 0)) 717 (setq math-exp-pos (match-end 0))
700 (math-read-token)) 718 (math-read-token))
701 (t 719 (t
702 (if (and (eq ch ?\{) (memq calc-language '(tex eqn))) 720 (if (and (eq ch ?\{) (memq calc-language '(tex eqn)))
@@ -705,9 +723,9 @@
705 (setq ch ?\))) 723 (setq ch ?\)))
706 (if (and (eq ch ?\&) (eq calc-language 'tex)) 724 (if (and (eq ch ?\&) (eq calc-language 'tex))
707 (setq ch ?\,)) 725 (setq ch ?\,))
708 (setq exp-token 'punc 726 (setq math-exp-token 'punc
709 exp-data (char-to-string ch) 727 math-expr-data (char-to-string ch)
710 exp-pos (1+ exp-pos))))))) 728 math-exp-pos (1+ math-exp-pos)))))))
711 729
712 730
713(defun math-read-expr-level (exp-prec &optional exp-term) 731(defun math-read-expr-level (exp-prec &optional exp-term)
@@ -716,10 +734,10 @@
716 (setq op (calc-check-user-syntax x exp-prec)) 734 (setq op (calc-check-user-syntax x exp-prec))
717 (setq x op 735 (setq x op
718 op '("2x" ident 999999 -1))) 736 op '("2x" ident 999999 -1)))
719 (and (setq op (assoc exp-data math-expr-opers)) 737 (and (setq op (assoc math-expr-data math-expr-opers))
720 (/= (nth 2 op) -1) 738 (/= (nth 2 op) -1)
721 (or (and (setq op2 (assoc 739 (or (and (setq op2 (assoc
722 exp-data 740 math-expr-data
723 (cdr (memq op math-expr-opers)))) 741 (cdr (memq op math-expr-opers))))
724 (eq (= (nth 3 op) -1) 742 (eq (= (nth 3 op) -1)
725 (/= (nth 3 op2) -1)) 743 (/= (nth 3 op2) -1))
@@ -728,27 +746,27 @@
728 (setq op op2)) 746 (setq op op2))
729 t)) 747 t))
730 (and (or (eq (nth 2 op) -1) 748 (and (or (eq (nth 2 op) -1)
731 (memq exp-token '(symbol number dollar hash)) 749 (memq math-exp-token '(symbol number dollar hash))
732 (equal exp-data "(") 750 (equal math-expr-data "(")
733 (and (equal exp-data "[") 751 (and (equal math-expr-data "[")
734 (not (eq calc-language 'math)) 752 (not (eq calc-language 'math))
735 (not (and exp-keep-spaces 753 (not (and math-exp-keep-spaces
736 (eq (car-safe x) 'vec))))) 754 (eq (car-safe x) 'vec)))))
737 (or (not (setq op (assoc exp-data math-expr-opers))) 755 (or (not (setq op (assoc math-expr-data math-expr-opers)))
738 (/= (nth 2 op) -1)) 756 (/= (nth 2 op) -1))
739 (or (not calc-user-parse-table) 757 (or (not calc-user-parse-table)
740 (not (eq exp-token 'symbol)) 758 (not (eq math-exp-token 'symbol))
741 (let ((p calc-user-parse-table)) 759 (let ((p calc-user-parse-table))
742 (while (and p 760 (while (and p
743 (or (not (integerp 761 (or (not (integerp
744 (car (car (car p))))) 762 (car (car (car p)))))
745 (not (equal 763 (not (equal
746 (nth 1 (car (car p))) 764 (nth 1 (car (car p)))
747 exp-data)))) 765 math-expr-data))))
748 (setq p (cdr p))) 766 (setq p (cdr p)))
749 (not p))) 767 (not p)))
750 (setq op (assoc "2x" math-expr-opers)))) 768 (setq op (assoc "2x" math-expr-opers))))
751 (not (and exp-term (equal exp-data exp-term))) 769 (not (and exp-term (equal math-expr-data exp-term)))
752 (>= (nth 2 op) exp-prec)) 770 (>= (nth 2 op) exp-prec))
753 (if (not (equal (car op) "2x")) 771 (if (not (equal (car op) "2x"))
754 (math-read-token)) 772 (math-read-token))
@@ -787,13 +805,13 @@
787 (if x 805 (if x
788 (and (integerp (car rule)) 806 (and (integerp (car rule))
789 (>= (car rule) prec) 807 (>= (car rule) prec)
790 (equal exp-data 808 (equal math-expr-data
791 (car (setq rule (cdr rule))))) 809 (car (setq rule (cdr rule)))))
792 (equal exp-data (car rule))))) 810 (equal math-expr-data (car rule)))))
793 (let ((save-exp-pos exp-pos) 811 (let ((save-exp-pos math-exp-pos)
794 (save-exp-old-pos exp-old-pos) 812 (save-exp-old-pos math-exp-old-pos)
795 (save-exp-token exp-token) 813 (save-exp-token math-exp-token)
796 (save-exp-data exp-data)) 814 (save-exp-data math-expr-data))
797 (or (not (listp 815 (or (not (listp
798 (setq matches (calc-match-user-syntax rule)))) 816 (setq matches (calc-match-user-syntax rule))))
799 (let ((args (progn 817 (let ((args (progn
@@ -856,22 +874,23 @@
856 (if match 874 (if match
857 (not (setq match (math-multi-subst 875 (not (setq match (math-multi-subst
858 match args matches))) 876 match args matches)))
859 (setq exp-old-pos save-exp-old-pos 877 (setq math-exp-old-pos save-exp-old-pos
860 exp-token save-exp-token 878 math-exp-token save-exp-token
861 exp-data save-exp-data 879 math-expr-data save-exp-data
862 exp-pos save-exp-pos))))))) 880 math-exp-pos save-exp-pos)))))))
863 (setq p (cdr p))) 881 (setq p (cdr p)))
864 (and p match))) 882 (and p match)))
865 883
866(defun calc-match-user-syntax (p &optional term) 884(defun calc-match-user-syntax (p &optional term)
867 (let ((matches nil) 885 (let ((matches nil)
868 (save-exp-pos exp-pos) 886 (save-exp-pos math-exp-pos)
869 (save-exp-old-pos exp-old-pos) 887 (save-exp-old-pos math-exp-old-pos)
870 (save-exp-token exp-token) 888 (save-exp-token math-exp-token)
871 (save-exp-data exp-data)) 889 (save-exp-data math-expr-data)
890 m)
872 (while (and p 891 (while (and p
873 (cond ((stringp (car p)) 892 (cond ((stringp (car p))
874 (and (equal exp-data (car p)) 893 (and (equal math-expr-data (car p))
875 (progn 894 (progn
876 (math-read-token) 895 (math-read-token)
877 t))) 896 t)))
@@ -895,7 +914,7 @@
895 (cons 'vec (and (listp m) m)))))) 914 (cons 'vec (and (listp m) m))))))
896 (or (listp m) (not (nth 2 (car p))) 915 (or (listp m) (not (nth 2 (car p)))
897 (not (eq (aref (car (nth 2 (car p))) 0) ?\$)) 916 (not (eq (aref (car (nth 2 (car p))) 0) ?\$))
898 (eq exp-token 'end))) 917 (eq math-exp-token 'end)))
899 (t 918 (t
900 (setq m (calc-match-user-syntax (nth 1 (car p)) 919 (setq m (calc-match-user-syntax (nth 1 (car p))
901 (car (nth 2 (car p))))) 920 (car (nth 2 (car p)))))
@@ -903,22 +922,22 @@
903 (let ((vec (cons 'vec m)) 922 (let ((vec (cons 'vec m))
904 opos mm) 923 opos mm)
905 (while (and (listp 924 (while (and (listp
906 (setq opos exp-pos 925 (setq opos math-exp-pos
907 mm (calc-match-user-syntax 926 mm (calc-match-user-syntax
908 (or (nth 2 (car p)) 927 (or (nth 2 (car p))
909 (nth 1 (car p))) 928 (nth 1 (car p)))
910 (car (nth 2 (car p)))))) 929 (car (nth 2 (car p))))))
911 (> exp-pos opos)) 930 (> math-exp-pos opos))
912 (setq vec (nconc vec mm))) 931 (setq vec (nconc vec mm)))
913 (setq matches (nconc matches (list vec)))) 932 (setq matches (nconc matches (list vec))))
914 (and (eq (car (car p)) '*) 933 (and (eq (car (car p)) '*)
915 (setq matches (nconc matches (list '(vec))))))))) 934 (setq matches (nconc matches (list '(vec)))))))))
916 (setq p (cdr p))) 935 (setq p (cdr p)))
917 (if p 936 (if p
918 (setq exp-pos save-exp-pos 937 (setq math-exp-pos save-exp-pos
919 exp-old-pos save-exp-old-pos 938 math-exp-old-pos save-exp-old-pos
920 exp-token save-exp-token 939 math-exp-token save-exp-token
921 exp-data save-exp-data 940 math-expr-data save-exp-data
922 matches "Failed")) 941 matches "Failed"))
923 matches)) 942 matches))
924 943
@@ -940,28 +959,28 @@
940 959
941(defun math-read-if (cond op) 960(defun math-read-if (cond op)
942 (let ((then (math-read-expr-level 0))) 961 (let ((then (math-read-expr-level 0)))
943 (or (equal exp-data ":") 962 (or (equal math-expr-data ":")
944 (throw 'syntax "Expected ':'")) 963 (throw 'syntax "Expected ':'"))
945 (math-read-token) 964 (math-read-token)
946 (list 'calcFunc-if cond then (math-read-expr-level (nth 3 op))))) 965 (list 'calcFunc-if cond then (math-read-expr-level (nth 3 op)))))
947 966
948(defun math-factor-after () 967(defun math-factor-after ()
949 (let ((exp-pos exp-pos) 968 (let ((math-exp-pos math-exp-pos)
950 exp-old-pos exp-token exp-data) 969 math-exp-old-pos math-exp-token math-expr-data)
951 (math-read-token) 970 (math-read-token)
952 (or (memq exp-token '(number symbol dollar hash string)) 971 (or (memq math-exp-token '(number symbol dollar hash string))
953 (and (assoc exp-data '(("-") ("+") ("!") ("|") ("/"))) 972 (and (assoc math-expr-data '(("-") ("+") ("!") ("|") ("/")))
954 (assoc (concat "u" exp-data) math-expr-opers)) 973 (assoc (concat "u" math-expr-data) math-expr-opers))
955 (eq (nth 2 (assoc exp-data math-expr-opers)) -1) 974 (eq (nth 2 (assoc math-expr-data math-expr-opers)) -1)
956 (assoc exp-data '(("(") ("[") ("{")))))) 975 (assoc math-expr-data '(("(") ("[") ("{"))))))
957 976
958(defun math-read-factor () 977(defun math-read-factor ()
959 (let (op) 978 (let (op)
960 (cond ((eq exp-token 'number) 979 (cond ((eq math-exp-token 'number)
961 (let ((num (math-read-number exp-data))) 980 (let ((num (math-read-number math-expr-data)))
962 (if (not num) 981 (if (not num)
963 (progn 982 (progn
964 (setq exp-old-pos exp-pos) 983 (setq math-exp-old-pos math-exp-pos)
965 (throw 'syntax "Bad format"))) 984 (throw 'syntax "Bad format")))
966 (math-read-token) 985 (math-read-token)
967 (if (and math-read-expr-quotes 986 (if (and math-read-expr-quotes
@@ -971,14 +990,14 @@
971 ((and calc-user-parse-table 990 ((and calc-user-parse-table
972 (setq op (calc-check-user-syntax))) 991 (setq op (calc-check-user-syntax)))
973 op) 992 op)
974 ((or (equal exp-data "-") 993 ((or (equal math-expr-data "-")
975 (equal exp-data "+") 994 (equal math-expr-data "+")
976 (equal exp-data "!") 995 (equal math-expr-data "!")
977 (equal exp-data "|") 996 (equal math-expr-data "|")
978 (equal exp-data "/")) 997 (equal math-expr-data "/"))
979 (setq exp-data (concat "u" exp-data)) 998 (setq math-expr-data (concat "u" math-expr-data))
980 (math-read-factor)) 999 (math-read-factor))
981 ((and (setq op (assoc exp-data math-expr-opers)) 1000 ((and (setq op (assoc math-expr-data math-expr-opers))
982 (eq (nth 2 op) -1)) 1001 (eq (nth 2 op) -1))
983 (if (consp (nth 1 op)) 1002 (if (consp (nth 1 op))
984 (funcall (car (nth 1 op)) op) 1003 (funcall (car (nth 1 op)) op)
@@ -990,20 +1009,20 @@
990 (equal (car op) "u-")) 1009 (equal (car op) "u-"))
991 (math-neg val)) 1010 (math-neg val))
992 (t (list (nth 1 op) val)))))) 1011 (t (list (nth 1 op) val))))))
993 ((eq exp-token 'symbol) 1012 ((eq math-exp-token 'symbol)
994 (let ((sym (intern exp-data))) 1013 (let ((sym (intern math-expr-data)))
995 (math-read-token) 1014 (math-read-token)
996 (if (equal exp-data calc-function-open) 1015 (if (equal math-expr-data calc-function-open)
997 (let ((f (assq sym math-expr-function-mapping))) 1016 (let ((f (assq sym math-expr-function-mapping)))
998 (math-read-token) 1017 (math-read-token)
999 (if (consp (cdr f)) 1018 (if (consp (cdr f))
1000 (funcall (car (cdr f)) f sym) 1019 (funcall (car (cdr f)) f sym)
1001 (let ((args (if (or (equal exp-data calc-function-close) 1020 (let ((args (if (or (equal math-expr-data calc-function-close)
1002 (eq exp-token 'end)) 1021 (eq math-exp-token 'end))
1003 nil 1022 nil
1004 (math-read-expr-list)))) 1023 (math-read-expr-list))))
1005 (if (not (or (equal exp-data calc-function-close) 1024 (if (not (or (equal math-expr-data calc-function-close)
1006 (eq exp-token 'end))) 1025 (eq math-exp-token 'end)))
1007 (throw 'syntax "Expected `)'")) 1026 (throw 'syntax "Expected `)'"))
1008 (math-read-token) 1027 (math-read-token)
1009 (if (and (eq calc-language 'fortran) args 1028 (if (and (eq calc-language 'fortran) args
@@ -1045,44 +1064,44 @@
1045 4)) 1064 4))
1046 (cdr v)))))) 1065 (cdr v))))))
1047 (while (and (memq calc-language '(c pascal maple)) 1066 (while (and (memq calc-language '(c pascal maple))
1048 (equal exp-data "[")) 1067 (equal math-expr-data "["))
1049 (math-read-token) 1068 (math-read-token)
1050 (setq val (append (list 'calcFunc-subscr val) 1069 (setq val (append (list 'calcFunc-subscr val)
1051 (math-read-expr-list))) 1070 (math-read-expr-list)))
1052 (if (equal exp-data "]") 1071 (if (equal math-expr-data "]")
1053 (math-read-token) 1072 (math-read-token)
1054 (throw 'syntax "Expected ']'"))) 1073 (throw 'syntax "Expected ']'")))
1055 val))))) 1074 val)))))
1056 ((eq exp-token 'dollar) 1075 ((eq math-exp-token 'dollar)
1057 (let ((abs (if (> exp-data 0) exp-data (- exp-data)))) 1076 (let ((abs (if (> math-expr-data 0) math-expr-data (- math-expr-data))))
1058 (if (>= (length calc-dollar-values) abs) 1077 (if (>= (length calc-dollar-values) abs)
1059 (let ((num exp-data)) 1078 (let ((num math-expr-data))
1060 (math-read-token) 1079 (math-read-token)
1061 (setq calc-dollar-used (max calc-dollar-used num)) 1080 (setq calc-dollar-used (max calc-dollar-used num))
1062 (math-check-complete (nth (1- abs) calc-dollar-values))) 1081 (math-check-complete (nth (1- abs) calc-dollar-values)))
1063 (throw 'syntax (if calc-dollar-values 1082 (throw 'syntax (if calc-dollar-values
1064 "Too many $'s" 1083 "Too many $'s"
1065 "$'s not allowed in this context"))))) 1084 "$'s not allowed in this context")))))
1066 ((eq exp-token 'hash) 1085 ((eq math-exp-token 'hash)
1067 (or calc-hashes-used 1086 (or calc-hashes-used
1068 (throw 'syntax "#'s not allowed in this context")) 1087 (throw 'syntax "#'s not allowed in this context"))
1069 (calc-extensions) 1088 (calc-extensions)
1070 (if (<= exp-data (length calc-arg-values)) 1089 (if (<= math-expr-data (length calc-arg-values))
1071 (let ((num exp-data)) 1090 (let ((num math-expr-data))
1072 (math-read-token) 1091 (math-read-token)
1073 (setq calc-hashes-used (max calc-hashes-used num)) 1092 (setq calc-hashes-used (max calc-hashes-used num))
1074 (nth (1- num) calc-arg-values)) 1093 (nth (1- num) calc-arg-values))
1075 (throw 'syntax "Too many # arguments"))) 1094 (throw 'syntax "Too many # arguments")))
1076 ((equal exp-data "(") 1095 ((equal math-expr-data "(")
1077 (let* ((exp (let ((exp-keep-spaces nil)) 1096 (let* ((exp (let ((math-exp-keep-spaces nil))
1078 (math-read-token) 1097 (math-read-token)
1079 (if (or (equal exp-data "\\dots") 1098 (if (or (equal math-expr-data "\\dots")
1080 (equal exp-data "\\ldots")) 1099 (equal math-expr-data "\\ldots"))
1081 '(neg (var inf var-inf)) 1100 '(neg (var inf var-inf))
1082 (math-read-expr-level 0))))) 1101 (math-read-expr-level 0)))))
1083 (let ((exp-keep-spaces nil)) 1102 (let ((math-exp-keep-spaces nil))
1084 (cond 1103 (cond
1085 ((equal exp-data ",") 1104 ((equal math-expr-data ",")
1086 (progn 1105 (progn
1087 (math-read-token) 1106 (math-read-token)
1088 (let ((exp2 (math-read-expr-level 0))) 1107 (let ((exp2 (math-read-expr-level 0)))
@@ -1090,7 +1109,7 @@
1090 (if (and exp2 (Math-realp exp) (Math-realp exp2)) 1109 (if (and exp2 (Math-realp exp) (Math-realp exp2))
1091 (math-normalize (list 'cplx exp exp2)) 1110 (math-normalize (list 'cplx exp exp2))
1092 (list '+ exp (list '* exp2 '(var i var-i)))))))) 1111 (list '+ exp (list '* exp2 '(var i var-i))))))))
1093 ((equal exp-data ";") 1112 ((equal math-expr-data ";")
1094 (progn 1113 (progn
1095 (math-read-token) 1114 (math-read-token)
1096 (let ((exp2 (math-read-expr-level 0))) 1115 (let ((exp2 (math-read-expr-level 0)))
@@ -1103,36 +1122,36 @@
1103 (list '* 1122 (list '*
1104 (math-to-radians-2 exp2) 1123 (math-to-radians-2 exp2)
1105 '(var i var-i))))))))) 1124 '(var i var-i)))))))))
1106 ((or (equal exp-data "\\dots") 1125 ((or (equal math-expr-data "\\dots")
1107 (equal exp-data "\\ldots")) 1126 (equal math-expr-data "\\ldots"))
1108 (progn 1127 (progn
1109 (math-read-token) 1128 (math-read-token)
1110 (let ((exp2 (if (or (equal exp-data ")") 1129 (let ((exp2 (if (or (equal math-expr-data ")")
1111 (equal exp-data "]") 1130 (equal math-expr-data "]")
1112 (eq exp-token 'end)) 1131 (eq math-exp-token 'end))
1113 '(var inf var-inf) 1132 '(var inf var-inf)
1114 (math-read-expr-level 0)))) 1133 (math-read-expr-level 0))))
1115 (setq exp 1134 (setq exp
1116 (list 'intv 1135 (list 'intv
1117 (if (equal exp-data ")") 0 1) 1136 (if (equal math-expr-data ")") 0 1)
1118 exp 1137 exp
1119 exp2))))))) 1138 exp2)))))))
1120 (if (not (or (equal exp-data ")") 1139 (if (not (or (equal math-expr-data ")")
1121 (and (equal exp-data "]") (eq (car-safe exp) 'intv)) 1140 (and (equal math-expr-data "]") (eq (car-safe exp) 'intv))
1122 (eq exp-token 'end))) 1141 (eq math-exp-token 'end)))
1123 (throw 'syntax "Expected `)'")) 1142 (throw 'syntax "Expected `)'"))
1124 (math-read-token) 1143 (math-read-token)
1125 exp)) 1144 exp))
1126 ((eq exp-token 'string) 1145 ((eq math-exp-token 'string)
1127 (calc-extensions) 1146 (calc-extensions)
1128 (math-read-string)) 1147 (math-read-string))
1129 ((equal exp-data "[") 1148 ((equal math-expr-data "[")
1130 (calc-extensions) 1149 (calc-extensions)
1131 (math-read-brackets t "]")) 1150 (math-read-brackets t "]"))
1132 ((equal exp-data "{") 1151 ((equal math-expr-data "{")
1133 (calc-extensions) 1152 (calc-extensions)
1134 (math-read-brackets nil "}")) 1153 (math-read-brackets nil "}"))
1135 ((equal exp-data "<") 1154 ((equal math-expr-data "<")
1136 (calc-extensions) 1155 (calc-extensions)
1137 (math-read-angle-brackets)) 1156 (math-read-angle-brackets))
1138 (t (throw 'syntax "Expected a number"))))) 1157 (t (throw 'syntax "Expected a number")))))
diff --git a/lisp/calc/calc-comb.el b/lisp/calc/calc-comb.el
index c7ecbecc80b..8b0dffe3f15 100644
--- a/lisp/calc/calc-comb.el
+++ b/lisp/calc/calc-comb.el
@@ -82,6 +82,11 @@
82 4877 4889 4903 4909 4919 4931 4933 4937 4943 4951 4957 4967 4969 4973 82 4877 4889 4903 4909 4919 4931 4933 4937 4943 4951 4957 4967 4969 4973
83 4987 4993 4999 5003]) 83 4987 4993 4999 5003])
84 84
85;; The variable math-prime-factors-finished is set by calcFunc-prfac to
86;; indicate whether factoring is complete, and used by calcFunc-factors,
87;; calcFunc-totient and calcFunc-moebius.
88(defvar math-prime-factors-finished)
89
85;;; Combinatorics 90;;; Combinatorics
86 91
87(defun calc-gcd (arg) 92(defun calc-gcd (arg)
@@ -195,6 +200,8 @@
195 (res (math-prime-test n iters))) 200 (res (math-prime-test n iters)))
196 (calc-report-prime-test res)))) 201 (calc-report-prime-test res))))
197 202
203(defvar calc-verbose-nextprime nil)
204
198(defun calc-next-prime (iters) 205(defun calc-next-prime (iters)
199 (interactive "p") 206 (interactive "p")
200 (calc-slow-wrapper 207 (calc-slow-wrapper
@@ -386,7 +393,7 @@
386 (if (math-evenp temp) 393 (if (math-evenp temp)
387 even 394 even
388 (math-div (calcFunc-fact n) even)))) 395 (math-div (calcFunc-fact n) even))))
389 (list 'calcFunc-dfact max)))) 396 (list 'calcFunc-dfact n))))
390 ((equal n '(var inf var-inf)) n) 397 ((equal n '(var inf var-inf)) n)
391 (t (calc-record-why 'natnump n) 398 (t (calc-record-why 'natnump n)
392 (list 'calcFunc-dfact n)))) 399 (list 'calcFunc-dfact n))))
@@ -484,6 +491,12 @@
484 (math-stirling-number n m 0)) 491 (math-stirling-number n m 0))
485 492
486(defvar math-stirling-cache (vector [[1]] [[1]])) 493(defvar math-stirling-cache (vector [[1]] [[1]]))
494
495;; The variable math-stirling-local-cache is local to
496;; math-stirling-number, but is used by math-stirling-1
497;; and math-stirling-2, which are called by math-stirling-number.
498(defvar math-stirling-local-cache)
499
487(defun math-stirling-number (n m k) 500(defun math-stirling-number (n m k)
488 (or (math-num-natnump n) (math-reject-arg n 'natnump)) 501 (or (math-num-natnump n) (math-reject-arg n 'natnump))
489 (or (math-num-natnump m) (math-reject-arg m 'natnump)) 502 (or (math-num-natnump m) (math-reject-arg m 'natnump))
@@ -493,14 +506,16 @@
493 (or (integerp m) (math-reject-arg m 'fixnump)) 506 (or (integerp m) (math-reject-arg m 'fixnump))
494 (if (< n m) 507 (if (< n m)
495 0 508 0
496 (let ((cache (aref math-stirling-cache k))) 509 (let ((math-stirling-local-cache (aref math-stirling-cache k)))
497 (while (<= (length cache) n) 510 (while (<= (length math-stirling-local-cache) n)
498 (let ((i (1- (length cache))) 511 (let ((i (1- (length math-stirling-local-cache)))
499 row) 512 row)
500 (setq cache (vconcat cache (make-vector (length cache) nil))) 513 (setq math-stirling-local-cache
501 (aset math-stirling-cache k cache) 514 (vconcat math-stirling-local-cache
502 (while (< (setq i (1+ i)) (length cache)) 515 (make-vector (length math-stirling-local-cache) nil)))
503 (aset cache i (setq row (make-vector (1+ i) nil))) 516 (aset math-stirling-cache k math-stirling-local-cache)
517 (while (< (setq i (1+ i)) (length math-stirling-local-cache))
518 (aset math-stirling-local-cache i (setq row (make-vector (1+ i) nil)))
504 (aset row 0 0) 519 (aset row 0 0)
505 (aset row i 1)))) 520 (aset row i 1))))
506 (if (= k 1) 521 (if (= k 1)
@@ -508,14 +523,14 @@
508 (math-stirling-2 n m))))) 523 (math-stirling-2 n m)))))
509 524
510(defun math-stirling-1 (n m) 525(defun math-stirling-1 (n m)
511 (or (aref (aref cache n) m) 526 (or (aref (aref math-stirling-local-cache n) m)
512 (aset (aref cache n) m 527 (aset (aref math-stirling-local-cache n) m
513 (math-add (math-stirling-1 (1- n) (1- m)) 528 (math-add (math-stirling-1 (1- n) (1- m))
514 (math-mul (- 1 n) (math-stirling-1 (1- n) m)))))) 529 (math-mul (- 1 n) (math-stirling-1 (1- n) m))))))
515 530
516(defun math-stirling-2 (n m) 531(defun math-stirling-2 (n m)
517 (or (aref (aref cache n) m) 532 (or (aref (aref math-stirling-local-cache n) m)
518 (aset (aref cache n) m 533 (aset (aref math-stirling-local-cache n) m
519 (math-add (math-stirling-2 (1- n) (1- m)) 534 (math-add (math-stirling-2 (1- n) (1- m))
520 (math-mul m (math-stirling-2 (1- n) m)))))) 535 (math-mul m (math-stirling-2 (1- n) m))))))
521 536
@@ -527,8 +542,13 @@
527 542
528;;; Produce a random 10-bit integer, with (random) if no seed provided, 543;;; Produce a random 10-bit integer, with (random) if no seed provided,
529;;; or else with Numerical Recipes algorithm ran3 / Knuth 3.2.2-A. 544;;; or else with Numerical Recipes algorithm ran3 / Knuth 3.2.2-A.
545
546(defvar var-RandSeed nil)
547(defvar math-random-cache nil)
548(defvar math-gaussian-cache nil)
549
530(defun math-init-random-base () 550(defun math-init-random-base ()
531 (if (and (boundp 'var-RandSeed) var-RandSeed) 551 (if var-RandSeed
532 (if (eq (car-safe var-RandSeed) 'vec) 552 (if (eq (car-safe var-RandSeed) 'vec)
533 nil 553 nil
534 (if (Math-integerp var-RandSeed) 554 (if (Math-integerp var-RandSeed)
@@ -555,13 +575,13 @@
555 (random t) 575 (random t)
556 (setq var-RandSeed nil 576 (setq var-RandSeed nil
557 math-random-cache nil 577 math-random-cache nil
558 i 0
559 math-random-shift -4) ; assume RAND_MAX >= 16383 578 math-random-shift -4) ; assume RAND_MAX >= 16383
560 ;; This exercises the random number generator and also helps 579 ;; This exercises the random number generator and also helps
561 ;; deduce a better value for RAND_MAX. 580 ;; deduce a better value for RAND_MAX.
562 (while (< (setq i (1+ i)) 30) 581 (let ((i 0))
563 (if (> (lsh (math-abs (random)) math-random-shift) 4095) 582 (while (< (setq i (1+ i)) 30)
564 (setq math-random-shift (1- math-random-shift))))) 583 (if (> (lsh (math-abs (random)) math-random-shift) 4095)
584 (setq math-random-shift (1- math-random-shift))))))
565 (setq math-last-RandSeed var-RandSeed 585 (setq math-last-RandSeed var-RandSeed
566 math-gaussian-cache nil)) 586 math-gaussian-cache nil))
567 587
@@ -583,8 +603,8 @@
583;;; Avoid various pitfalls that may lurk in the built-in (random) function! 603;;; Avoid various pitfalls that may lurk in the built-in (random) function!
584;;; Shuffling algorithm from Numerical Recipes, section 7.1. 604;;; Shuffling algorithm from Numerical Recipes, section 7.1.
585(defun math-random-digit () 605(defun math-random-digit ()
586 (let (i) 606 (let (i math-random-last)
587 (or (and (boundp 'var-RandSeed) (eq var-RandSeed math-last-RandSeed)) 607 (or (eq var-RandSeed math-last-RandSeed)
588 (math-init-random-base)) 608 (math-init-random-base))
589 (or math-random-cache 609 (or math-random-cache
590 (progn 610 (progn
@@ -599,7 +619,6 @@
599 (aset math-random-cache i (math-random-base)) 619 (aset math-random-cache i (math-random-base))
600 (>= math-random-last 1000))) 620 (>= math-random-last 1000)))
601 math-random-last)) 621 math-random-last))
602(setq math-random-cache nil)
603 622
604;;; Produce an N-digit random integer. 623;;; Produce an N-digit random integer.
605(defun math-random-digits (n) 624(defun math-random-digits (n)
@@ -639,7 +658,6 @@
639 (setq math-gaussian-cache (cons calc-internal-prec 658 (setq math-gaussian-cache (cons calc-internal-prec
640 (math-mul v1 fac))) 659 (math-mul v1 fac)))
641 (math-mul v2 fac)))))) 660 (math-mul v2 fac))))))
642(setq math-gaussian-cache nil)
643 661
644;;; Produce a random integer or real 0 <= N < MAX. 662;;; Produce a random integer or real 0 <= N < MAX.
645(defun calcFunc-random (max) 663(defun calcFunc-random (max)
@@ -765,6 +783,12 @@
765;;; (nil unknown) if non-prime with no known factors, 783;;; (nil unknown) if non-prime with no known factors,
766;;; (t) if prime, 784;;; (t) if prime,
767;;; (maybe N P) if probably prime (after N iters with probability P%) 785;;; (maybe N P) if probably prime (after N iters with probability P%)
786(defvar math-prime-test-cache '(-1))
787
788(defvar math-prime-test-cache-k)
789(defvar math-prime-test-cache-q)
790(defvar math-prime-test-cache-nm1)
791
768(defun math-prime-test (n iters) 792(defun math-prime-test (n iters)
769 (if (and (Math-vectorp n) (cdr n)) 793 (if (and (Math-vectorp n) (cdr n))
770 (setq n (nth (1- (length n)) n))) 794 (setq n (nth (1- (length n)) n)))
@@ -849,7 +873,6 @@
849 (1- iters) 873 (1- iters)
850 0))) 874 0)))
851 res)) 875 res))
852(defvar math-prime-test-cache '(-1))
853 876
854(defun calcFunc-prime (n &optional iters) 877(defun calcFunc-prime (n &optional iters)
855 (or (math-num-integerp n) (math-reject-arg n 'integerp)) 878 (or (math-num-integerp n) (math-reject-arg n 'integerp))
@@ -965,7 +988,6 @@
965 (if (Math-realp n) 988 (if (Math-realp n)
966 (calcFunc-nextprime (math-trunc n) iters) 989 (calcFunc-nextprime (math-trunc n) iters)
967 (math-reject-arg n 'integerp)))) 990 (math-reject-arg n 'integerp))))
968(setq calc-verbose-nextprime nil)
969 991
970(defun calcFunc-prevprime (n &optional iters) 992(defun calcFunc-prevprime (n &optional iters)
971 (if (Math-integerp n) 993 (if (Math-integerp n)
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 4679cf8abaa..77057fd4a7a 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -108,6 +108,7 @@
108 (define-key calc-mode-map "\C-w" 'calc-kill-region) 108 (define-key calc-mode-map "\C-w" 'calc-kill-region)
109 (define-key calc-mode-map "\M-w" 'calc-copy-region-as-kill) 109 (define-key calc-mode-map "\M-w" 'calc-copy-region-as-kill)
110 (define-key calc-mode-map "\C-y" 'calc-yank) 110 (define-key calc-mode-map "\C-y" 'calc-yank)
111 (define-key calc-mode-map [mouse-2] 'calc-yank)
111 (define-key calc-mode-map "\C-_" 'calc-undo) 112 (define-key calc-mode-map "\C-_" 'calc-undo)
112 (define-key calc-mode-map "\C-xu" 'calc-undo) 113 (define-key calc-mode-map "\C-xu" 'calc-undo)
113 (define-key calc-mode-map "\M-\C-m" 'calc-last-args) 114 (define-key calc-mode-map "\M-\C-m" 'calc-last-args)
@@ -662,16 +663,6 @@
662 (define-key calc-alg-map "\e\C-m" 'calc-last-args-stub) 663 (define-key calc-alg-map "\e\C-m" 'calc-last-args-stub)
663 (define-key calc-alg-map "\e\177" 'calc-pop-above) 664 (define-key calc-alg-map "\e\177" 'calc-pop-above)
664 665
665 ;; The following is a relic for backward compatability only.
666 ;; The calc-define property list is now the recommended method.
667 (if (and (boundp 'calc-ext-defs)
668 calc-ext-defs)
669 (progn
670 (calc-need-macros)
671 (message "Evaluating calc-ext-defs...")
672 (eval (cons 'progn calc-ext-defs))
673 (setq calc-ext-defs nil)))
674
675;;;; (Autoloads here) 666;;;; (Autoloads here)
676 (mapcar (function (lambda (x) 667 (mapcar (function (lambda (x)
677 (mapcar (function (lambda (func) 668 (mapcar (function (lambda (func)
@@ -1769,10 +1760,13 @@ calc-kill calc-kill-region calc-yank))))
1769 (cdr res) 1760 (cdr res)
1770 res))) 1761 res)))
1771 1762
1763(defvar calc-z-prefix-buf nil)
1764(defvar calc-z-prefix-msgs nil)
1765
1772(defun calc-z-prefix-help () 1766(defun calc-z-prefix-help ()
1773 (interactive) 1767 (interactive)
1774 (let* ((msgs nil) 1768 (let* ((calc-z-prefix-msgs nil)
1775 (buf "") 1769 (calc-z-prefix-buf "")
1776 (kmap (sort (copy-sequence (calc-user-key-map)) 1770 (kmap (sort (copy-sequence (calc-user-key-map))
1777 (function (lambda (x y) (< (car x) (car y)))))) 1771 (function (lambda (x y) (< (car x) (car y))))))
1778 (flags (apply 'logior 1772 (flags (apply 'logior
@@ -1783,12 +1777,12 @@ calc-kill calc-kill-region calc-yank))))
1783 (if (= (logand flags 8) 0) 1777 (if (= (logand flags 8) 0)
1784 (calc-user-function-list kmap 7) 1778 (calc-user-function-list kmap 7)
1785 (calc-user-function-list kmap 1) 1779 (calc-user-function-list kmap 1)
1786 (setq msgs (cons buf msgs) 1780 (setq calc-z-prefix-msgs (cons calc-z-prefix-buf calc-z-prefix-msgs)
1787 buf "") 1781 calc-z-prefix-buf "")
1788 (calc-user-function-list kmap 6)) 1782 (calc-user-function-list kmap 6))
1789 (if (/= flags 0) 1783 (if (/= flags 0)
1790 (setq msgs (cons buf msgs))) 1784 (setq calc-z-prefix-msgs (cons calc-z-prefix-buf calc-z-prefix-msgs)))
1791 (calc-do-prefix-help (nreverse msgs) "user" ?z))) 1785 (calc-do-prefix-help (nreverse calc-z-prefix-msgs) "user" ?z)))
1792 1786
1793(defun calc-user-function-classify (key) 1787(defun calc-user-function-classify (key)
1794 (cond ((/= key (downcase key)) ; upper-case 1788 (cond ((/= key (downcase key)) ; upper-case
@@ -1822,14 +1816,15 @@ calc-kill calc-kill-region calc-yank))))
1822 (upcase key) 1816 (upcase key)
1823 (downcase name)))) 1817 (downcase name))))
1824 (char-to-string (upcase key))))) 1818 (char-to-string (upcase key)))))
1825 (if (= (length buf) 0) 1819 (if (= (length calc-z-prefix-buf) 0)
1826 (setq buf (concat (if (= flags 1) "SHIFT + " "") 1820 (setq calc-z-prefix-buf (concat (if (= flags 1) "SHIFT + " "")
1827 desc)) 1821 desc))
1828 (if (> (+ (length buf) (length desc)) 58) 1822 (if (> (+ (length calc-z-prefix-buf) (length desc)) 58)
1829 (setq msgs (cons buf msgs) 1823 (setq calc-z-prefix-msgs
1830 buf (concat (if (= flags 1) "SHIFT + " "") 1824 (cons calc-z-prefix-buf calc-z-prefix-msgs)
1825 calc-z-prefix-buf (concat (if (= flags 1) "SHIFT + " "")
1831 desc)) 1826 desc))
1832 (setq buf (concat buf ", " desc)))))) 1827 (setq calc-z-prefix-buf (concat calc-z-prefix-buf ", " desc))))))
1833 (calc-user-function-list (cdr map) flags)))) 1828 (calc-user-function-list (cdr map) flags))))
1834 1829
1835 1830
@@ -1854,10 +1849,10 @@ calc-kill calc-kill-region calc-yank))))
1854 (last-prec (intern (concat (symbol-name name) "-last-prec"))) 1849 (last-prec (intern (concat (symbol-name name) "-last-prec")))
1855 (last-val (intern (concat (symbol-name name) "-last")))) 1850 (last-val (intern (concat (symbol-name name) "-last"))))
1856 (list 'progn 1851 (list 'progn
1857 (list 'setq cache-prec (if init (math-numdigs (nth 1 init)) -100)) 1852 (list 'defvar cache-prec (if init (math-numdigs (nth 1 init)) -100))
1858 (list 'setq cache-val (list 'quote init)) 1853 (list 'defvar cache-val (list 'quote init))
1859 (list 'setq last-prec -100) 1854 (list 'defvar last-prec -100)
1860 (list 'setq last-val nil) 1855 (list 'defvar last-val nil)
1861 (list 'setq 'math-cache-list 1856 (list 'setq 'math-cache-list
1862 (list 'cons 1857 (list 'cons
1863 (list 'quote cache-prec) 1858 (list 'quote cache-prec)
@@ -2223,25 +2218,25 @@ calc-kill calc-kill-region calc-yank))))
2223 (math-normalize (car a)) 2218 (math-normalize (car a))
2224 (error "Can't use multi-valued function in an expression"))))) 2219 (error "Can't use multi-valued function in an expression")))))
2225 2220
2226(defun math-normalize-nonstandard () ; uses "a" 2221(defun math-normalize-nonstandard ()
2227 (if (consp calc-simplify-mode) 2222 (if (consp calc-simplify-mode)
2228 (progn 2223 (progn
2229 (setq calc-simplify-mode 'none 2224 (setq calc-simplify-mode 'none
2230 math-simplify-only (car-safe (cdr-safe a))) 2225 math-simplify-only (car-safe (cdr-safe math-normalize-a)))
2231 nil) 2226 nil)
2232 (and (symbolp (car a)) 2227 (and (symbolp (car math-normalize-a))
2233 (or (eq calc-simplify-mode 'none) 2228 (or (eq calc-simplify-mode 'none)
2234 (and (eq calc-simplify-mode 'num) 2229 (and (eq calc-simplify-mode 'num)
2235 (let ((aptr (setq a (cons 2230 (let ((aptr (setq math-normalize-a
2236 (car a) 2231 (cons
2237 (mapcar 'math-normalize (cdr a)))))) 2232 (car math-normalize-a)
2233 (mapcar 'math-normalize
2234 (cdr math-normalize-a))))))
2238 (while (and aptr (math-constp (car aptr))) 2235 (while (and aptr (math-constp (car aptr)))
2239 (setq aptr (cdr aptr))) 2236 (setq aptr (cdr aptr)))
2240 aptr))) 2237 aptr)))
2241 (cons (car a) (mapcar 'math-normalize (cdr a)))))) 2238 (cons (car math-normalize-a)
2242 2239 (mapcar 'math-normalize (cdr math-normalize-a))))))
2243
2244
2245 2240
2246 2241
2247;;; Normalize a bignum digit list by trimming high-end zeros. [L l] 2242;;; Normalize a bignum digit list by trimming high-end zeros. [L l]
@@ -2619,22 +2614,27 @@ calc-kill calc-kill-region calc-yank))))
2619 2614
2620(defvar var-FactorRules 'calc-FactorRules) 2615(defvar var-FactorRules 'calc-FactorRules)
2621 2616
2622(defun math-map-tree (mmt-func mmt-expr &optional mmt-many) 2617(defvar math-mt-many nil)
2623 (or mmt-many (setq mmt-many 1000000)) 2618(defvar math-mt-func nil)
2619
2620(defun math-map-tree (math-mt-func mmt-expr &optional math-mt-many)
2621 (or math-mt-many (setq math-mt-many 1000000))
2624 (math-map-tree-rec mmt-expr)) 2622 (math-map-tree-rec mmt-expr))
2625 2623
2626(defun math-map-tree-rec (mmt-expr) 2624(defun math-map-tree-rec (mmt-expr)
2627 (or (= mmt-many 0) 2625 (or (= math-mt-many 0)
2628 (let ((mmt-done nil) 2626 (let ((mmt-done nil)
2629 mmt-nextval) 2627 mmt-nextval)
2630 (while (not mmt-done) 2628 (while (not mmt-done)
2631 (while (and (/= mmt-many 0) 2629 (while (and (/= math-mt-many 0)
2632 (setq mmt-nextval (funcall mmt-func mmt-expr)) 2630 (setq mmt-nextval (funcall math-mt-func mmt-expr))
2633 (not (equal mmt-expr mmt-nextval))) 2631 (not (equal mmt-expr mmt-nextval)))
2634 (setq mmt-expr mmt-nextval 2632 (setq mmt-expr mmt-nextval
2635 mmt-many (if (> mmt-many 0) (1- mmt-many) (1+ mmt-many)))) 2633 math-mt-many (if (> math-mt-many 0)
2634 (1- math-mt-many)
2635 (1+ math-mt-many))))
2636 (if (or (Math-primp mmt-expr) 2636 (if (or (Math-primp mmt-expr)
2637 (<= mmt-many 0)) 2637 (<= math-mt-many 0))
2638 (setq mmt-done t) 2638 (setq mmt-done t)
2639 (setq mmt-nextval (cons (car mmt-expr) 2639 (setq mmt-nextval (cons (car mmt-expr)
2640 (mapcar 'math-map-tree-rec 2640 (mapcar 'math-map-tree-rec
@@ -2885,22 +2885,24 @@ calc-kill calc-kill-region calc-yank))))
2885 2885
2886;;; Expression parsing. 2886;;; Expression parsing.
2887 2887
2888(defun math-read-expr (exp-str) 2888(defvar math-expr-data)
2889 (let ((exp-pos 0) 2889
2890 (exp-old-pos 0) 2890(defun math-read-expr (math-exp-str)
2891 (exp-keep-spaces nil) 2891 (let ((math-exp-pos 0)
2892 exp-token exp-data) 2892 (math-exp-old-pos 0)
2893 (while (setq exp-token (string-match "\\.\\.\\([^.]\\|.[^.]\\)" exp-str)) 2893 (math-exp-keep-spaces nil)
2894 (setq exp-str (concat (substring exp-str 0 exp-token) "\\dots" 2894 math-exp-token math-expr-data)
2895 (substring exp-str (+ exp-token 2))))) 2895 (while (setq math-exp-token (string-match "\\.\\.\\([^.]\\|.[^.]\\)" math-exp-str))
2896 (setq math-exp-str (concat (substring math-exp-str 0 math-exp-token) "\\dots"
2897 (substring math-exp-str (+ math-exp-token 2)))))
2896 (math-build-parse-table) 2898 (math-build-parse-table)
2897 (math-read-token) 2899 (math-read-token)
2898 (let ((val (catch 'syntax (math-read-expr-level 0)))) 2900 (let ((val (catch 'syntax (math-read-expr-level 0))))
2899 (if (stringp val) 2901 (if (stringp val)
2900 (list 'error exp-old-pos val) 2902 (list 'error math-exp-old-pos val)
2901 (if (equal exp-token 'end) 2903 (if (equal math-exp-token 'end)
2902 val 2904 val
2903 (list 'error exp-old-pos "Syntax error")))))) 2905 (list 'error math-exp-old-pos "Syntax error"))))))
2904 2906
2905(defun math-read-plain-expr (exp-str &optional error-check) 2907(defun math-read-plain-expr (exp-str &optional error-check)
2906 (let* ((calc-language nil) 2908 (let* ((calc-language nil)
@@ -2913,8 +2915,8 @@ calc-kill calc-kill-region calc-yank))))
2913 2915
2914 2916
2915(defun math-read-string () 2917(defun math-read-string ()
2916 (let ((str (read-from-string (concat exp-data "\"")))) 2918 (let ((str (read-from-string (concat math-expr-data "\""))))
2917 (or (and (= (cdr str) (1+ (length exp-data))) 2919 (or (and (= (cdr str) (1+ (length math-expr-data)))
2918 (stringp (car str))) 2920 (stringp (car str)))
2919 (throw 'syntax "Error in string constant")) 2921 (throw 'syntax "Error in string constant"))
2920 (math-read-token) 2922 (math-read-token)
diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el
index 31f9e776a0c..e64983ad33d 100644
--- a/lisp/calc/calc-forms.el
+++ b/lisp/calc/calc-forms.el
@@ -1791,8 +1791,8 @@ and ends on the last Sunday of October at 2 a.m."
1791 1791
1792 1792
1793(defun math-read-angle-brackets () 1793(defun math-read-angle-brackets ()
1794 (let* ((last (or (math-check-for-commas t) (length exp-str))) 1794 (let* ((last (or (math-check-for-commas t) (length math-exp-str)))
1795 (str (substring exp-str exp-pos last)) 1795 (str (substring math-exp-str math-exp-pos last))
1796 (res 1796 (res
1797 (if (string-match "\\` *\\([a-zA-Z#][a-zA-Z0-9#]* *,? *\\)*:" str) 1797 (if (string-match "\\` *\\([a-zA-Z#][a-zA-Z0-9#]* *,? *\\)*:" str)
1798 (let ((str1 (substring str 0 (1- (match-end 0)))) 1798 (let ((str1 (substring str 0 (1- (match-end 0))))
@@ -1818,7 +1818,7 @@ and ends on the last Sunday of October at 2 a.m."
1818 (throw 'syntax res)) 1818 (throw 'syntax res))
1819 (if (eq (car-safe res) 'error) 1819 (if (eq (car-safe res) 'error)
1820 (throw 'syntax (nth 2 res))) 1820 (throw 'syntax (nth 2 res)))
1821 (setq exp-pos (1+ last)) 1821 (setq math-exp-pos (1+ last))
1822 (math-read-token) 1822 (math-read-token)
1823 res)) 1823 res))
1824 1824
diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el
index bb6699a4ac9..ee00e022553 100644
--- a/lisp/calc/calc-lang.el
+++ b/lisp/calc/calc-lang.el
@@ -263,15 +263,15 @@
263 (let ((math-parsing-fortran-vector '(end . "\000"))) 263 (let ((math-parsing-fortran-vector '(end . "\000")))
264 (prog1 264 (prog1
265 (math-read-brackets t "]") 265 (math-read-brackets t "]")
266 (setq exp-token (car math-parsing-fortran-vector) 266 (setq math-exp-token (car math-parsing-fortran-vector)
267 exp-data (cdr math-parsing-fortran-vector))))) 267 math-expr-data (cdr math-parsing-fortran-vector)))))
268 268
269(defun math-parse-fortran-vector-end (x op) 269(defun math-parse-fortran-vector-end (x op)
270 (if math-parsing-fortran-vector 270 (if math-parsing-fortran-vector
271 (progn 271 (progn
272 (setq math-parsing-fortran-vector (cons exp-token exp-data) 272 (setq math-parsing-fortran-vector (cons math-exp-token math-expr-data)
273 exp-token 'end 273 math-exp-token 'end
274 exp-data "\000") 274 math-expr-data "\000")
275 x) 275 x)
276 (throw 'syntax "Unmatched closing `/'"))) 276 (throw 'syntax "Unmatched closing `/'")))
277 277
@@ -384,15 +384,15 @@
384 384
385(defun math-parse-tex-sum (f val) 385(defun math-parse-tex-sum (f val)
386 (let (low high save) 386 (let (low high save)
387 (or (equal exp-data "_") (throw 'syntax "Expected `_'")) 387 (or (equal math-expr-data "_") (throw 'syntax "Expected `_'"))
388 (math-read-token) 388 (math-read-token)
389 (setq save exp-old-pos) 389 (setq save math-exp-old-pos)
390 (setq low (math-read-factor)) 390 (setq low (math-read-factor))
391 (or (eq (car-safe low) 'calcFunc-eq) 391 (or (eq (car-safe low) 'calcFunc-eq)
392 (progn 392 (progn
393 (setq exp-old-pos (1+ save)) 393 (setq math-exp-old-pos (1+ save))
394 (throw 'syntax "Expected equation"))) 394 (throw 'syntax "Expected equation")))
395 (or (equal exp-data "^") (throw 'syntax "Expected `^'")) 395 (or (equal math-expr-data "^") (throw 'syntax "Expected `^'"))
396 (math-read-token) 396 (math-read-token)
397 (setq high (math-read-factor)) 397 (setq high (math-read-factor))
398 (list (nth 2 f) (math-read-factor) (nth 1 low) (nth 2 low) high))) 398 (list (nth 2 f) (math-read-factor) (nth 1 low) (nth 2 low) high)))
@@ -484,31 +484,31 @@
484 484
485(defun math-parse-eqn-matrix (f sym) 485(defun math-parse-eqn-matrix (f sym)
486 (let ((vec nil)) 486 (let ((vec nil))
487 (while (assoc exp-data '(("ccol") ("lcol") ("rcol"))) 487 (while (assoc math-expr-data '(("ccol") ("lcol") ("rcol")))
488 (math-read-token) 488 (math-read-token)
489 (or (equal exp-data calc-function-open) 489 (or (equal math-expr-data calc-function-open)
490 (throw 'syntax "Expected `{'")) 490 (throw 'syntax "Expected `{'"))
491 (math-read-token) 491 (math-read-token)
492 (setq vec (cons (cons 'vec (math-read-expr-list)) vec)) 492 (setq vec (cons (cons 'vec (math-read-expr-list)) vec))
493 (or (equal exp-data calc-function-close) 493 (or (equal math-expr-data calc-function-close)
494 (throw 'syntax "Expected `}'")) 494 (throw 'syntax "Expected `}'"))
495 (math-read-token)) 495 (math-read-token))
496 (or (equal exp-data calc-function-close) 496 (or (equal math-expr-data calc-function-close)
497 (throw 'syntax "Expected `}'")) 497 (throw 'syntax "Expected `}'"))
498 (math-read-token) 498 (math-read-token)
499 (math-transpose (cons 'vec (nreverse vec))))) 499 (math-transpose (cons 'vec (nreverse vec)))))
500 500
501(defun math-parse-eqn-prime (x sym) 501(defun math-parse-eqn-prime (x sym)
502 (if (eq (car-safe x) 'var) 502 (if (eq (car-safe x) 'var)
503 (if (equal exp-data calc-function-open) 503 (if (equal math-expr-data calc-function-open)
504 (progn 504 (progn
505 (math-read-token) 505 (math-read-token)
506 (let ((args (if (or (equal exp-data calc-function-close) 506 (let ((args (if (or (equal math-expr-data calc-function-close)
507 (eq exp-token 'end)) 507 (eq math-exp-token 'end))
508 nil 508 nil
509 (math-read-expr-list)))) 509 (math-read-expr-list))))
510 (if (not (or (equal exp-data calc-function-close) 510 (if (not (or (equal math-expr-data calc-function-close)
511 (eq exp-token 'end))) 511 (eq math-exp-token 'end)))
512 (throw 'syntax "Expected `)'")) 512 (throw 'syntax "Expected `)'"))
513 (math-read-token) 513 (math-read-token)
514 (cons (intern (format "calcFunc-%s'" (nth 1 x))) args))) 514 (cons (intern (format "calcFunc-%s'" (nth 1 x))) args)))
@@ -622,10 +622,10 @@
622 622
623(defun math-read-math-subscr (x op) 623(defun math-read-math-subscr (x op)
624 (let ((idx (math-read-expr-level 0))) 624 (let ((idx (math-read-expr-level 0)))
625 (or (and (equal exp-data "]") 625 (or (and (equal math-expr-data "]")
626 (progn 626 (progn
627 (math-read-token) 627 (math-read-token)
628 (equal exp-data "]"))) 628 (equal math-expr-data "]")))
629 (throw 'syntax "Expected ']]'")) 629 (throw 'syntax "Expected ']]'"))
630 (math-read-token) 630 (math-read-token)
631 (list 'calcFunc-subscr x idx))) 631 (list 'calcFunc-subscr x idx)))
diff --git a/lisp/calc/calc-poly.el b/lisp/calc/calc-poly.el
index 213b7dc4474..6ede0888319 100644
--- a/lisp/calc/calc-poly.el
+++ b/lisp/calc/calc-poly.el
@@ -1040,7 +1040,7 @@
1040 (memq (car-safe (nth 1 expr)) '(+ -)) 1040 (memq (car-safe (nth 1 expr)) '(+ -))
1041 (integerp (nth 2 expr)) 1041 (integerp (nth 2 expr))
1042 (if (> (nth 2 expr) 0) 1042 (if (> (nth 2 expr) 0)
1043 (or (and (or (> mmt-many 500000) (< mmt-many -500000)) 1043 (or (and (or (> math-mt-many 500000) (< math-mt-many -500000))
1044 (math-expand-power (nth 1 expr) (nth 2 expr) 1044 (math-expand-power (nth 1 expr) (nth 2 expr)
1045 nil t)) 1045 nil t))
1046 (list '* 1046 (list '*
diff --git a/lisp/calc/calc-rewr.el b/lisp/calc/calc-rewr.el
index 47b48bd88d8..fd361bd3eee 100644
--- a/lisp/calc/calc-rewr.el
+++ b/lisp/calc/calc-rewr.el
@@ -166,7 +166,7 @@
166 166
167 167
168 168
169(defun math-rewrite (whole-expr rules &optional mmt-many) 169(defun math-rewrite (whole-expr rules &optional math-mt-many)
170 (let ((crules (math-compile-rewrites rules)) 170 (let ((crules (math-compile-rewrites rules))
171 (heads (math-rewrite-heads whole-expr)) 171 (heads (math-rewrite-heads whole-expr))
172 (trace-buffer (get-buffer "*Trace*")) 172 (trace-buffer (get-buffer "*Trace*"))
@@ -176,20 +176,20 @@
176 (calc-line-numbering nil) 176 (calc-line-numbering nil)
177 (calc-show-selections t) 177 (calc-show-selections t)
178 (calc-why nil) 178 (calc-why nil)
179 (mmt-func (function 179 (math-mt-func (function
180 (lambda (x) 180 (lambda (x)
181 (let ((result (math-apply-rewrites x (cdr crules) 181 (let ((result (math-apply-rewrites x (cdr crules)
182 heads crules))) 182 heads crules)))
183 (if result 183 (if result
184 (progn 184 (progn
185 (if trace-buffer 185 (if trace-buffer
186 (let ((fmt (math-format-stack-value 186 (let ((fmt (math-format-stack-value
187 (list result nil nil)))) 187 (list result nil nil))))
188 (save-excursion 188 (save-excursion
189 (set-buffer trace-buffer) 189 (set-buffer trace-buffer)
190 (insert "\nrewrite to\n" fmt "\n")))) 190 (insert "\nrewrite to\n" fmt "\n"))))
191 (setq heads (math-rewrite-heads result heads t)))) 191 (setq heads (math-rewrite-heads result heads t))))
192 result))))) 192 result)))))
193 (if trace-buffer 193 (if trace-buffer
194 (let ((fmt (math-format-stack-value (list whole-expr nil nil)))) 194 (let ((fmt (math-format-stack-value (list whole-expr nil nil))))
195 (save-excursion 195 (save-excursion
@@ -197,22 +197,22 @@
197 (setq truncate-lines t) 197 (setq truncate-lines t)
198 (goto-char (point-max)) 198 (goto-char (point-max))
199 (insert "\n\nBegin rewriting\n" fmt "\n")))) 199 (insert "\n\nBegin rewriting\n" fmt "\n"))))
200 (or mmt-many (setq mmt-many (or (nth 1 (car crules)) 200 (or math-mt-many (setq math-mt-many (or (nth 1 (car crules))
201 math-rewrite-default-iters))) 201 math-rewrite-default-iters)))
202 (if (equal mmt-many '(var inf var-inf)) (setq mmt-many 1000000)) 202 (if (equal math-mt-many '(var inf var-inf)) (setq math-mt-many 1000000))
203 (if (equal mmt-many '(neg (var inf var-inf))) (setq mmt-many -1000000)) 203 (if (equal math-mt-many '(neg (var inf var-inf))) (setq math-mt-many -1000000))
204 (math-rewrite-phase (nth 3 (car crules))) 204 (math-rewrite-phase (nth 3 (car crules)))
205 (if trace-buffer 205 (if trace-buffer
206 (let ((fmt (math-format-stack-value (list whole-expr nil nil)))) 206 (let ((fmt (math-format-stack-value (list whole-expr nil nil))))
207 (save-excursion 207 (save-excursion
208 (set-buffer trace-buffer) 208 (set-buffer trace-buffer)
209 (insert "\nDone rewriting" 209 (insert "\nDone rewriting"
210 (if (= mmt-many 0) " (reached iteration limit)" "") 210 (if (= math-mt-many 0) " (reached iteration limit)" "")
211 ":\n" fmt "\n")))) 211 ":\n" fmt "\n"))))
212 whole-expr)) 212 whole-expr))
213 213
214(defun math-rewrite-phase (sched) 214(defun math-rewrite-phase (sched)
215 (while (and sched (/= mmt-many 0)) 215 (while (and sched (/= math-mt-many 0))
216 (if (listp (car sched)) 216 (if (listp (car sched))
217 (while (let ((save-expr whole-expr)) 217 (while (let ((save-expr whole-expr))
218 (math-rewrite-phase (car sched)) 218 (math-rewrite-phase (car sched))
diff --git a/lisp/calc/calc-vec.el b/lisp/calc/calc-vec.el
index 51d7450278e..a78f98ec3cc 100644
--- a/lisp/calc/calc-vec.el
+++ b/lisp/calc/calc-vec.el
@@ -1466,103 +1466,103 @@
1466(defun math-read-brackets (space-sep close) 1466(defun math-read-brackets (space-sep close)
1467 (and space-sep (setq space-sep (not (math-check-for-commas)))) 1467 (and space-sep (setq space-sep (not (math-check-for-commas))))
1468 (math-read-token) 1468 (math-read-token)
1469 (while (eq exp-token 'space) 1469 (while (eq math-exp-token 'space)
1470 (math-read-token)) 1470 (math-read-token))
1471 (if (or (equal exp-data close) 1471 (if (or (equal math-expr-data close)
1472 (eq exp-token 'end)) 1472 (eq math-exp-token 'end))
1473 (progn 1473 (progn
1474 (math-read-token) 1474 (math-read-token)
1475 '(vec)) 1475 '(vec))
1476 (let ((save-exp-pos exp-pos) 1476 (let ((save-exp-pos math-exp-pos)
1477 (save-exp-old-pos exp-old-pos) 1477 (save-exp-old-pos math-exp-old-pos)
1478 (save-exp-token exp-token) 1478 (save-exp-token math-exp-token)
1479 (save-exp-data exp-data) 1479 (save-exp-data math-expr-data)
1480 (vals (let ((exp-keep-spaces space-sep)) 1480 (vals (let ((math-exp-keep-spaces space-sep))
1481 (if (or (equal exp-data "\\dots") 1481 (if (or (equal math-expr-data "\\dots")
1482 (equal exp-data "\\ldots")) 1482 (equal math-expr-data "\\ldots"))
1483 '(vec (neg (var inf var-inf))) 1483 '(vec (neg (var inf var-inf)))
1484 (catch 'syntax (math-read-vector)))))) 1484 (catch 'syntax (math-read-vector))))))
1485 (if (stringp vals) 1485 (if (stringp vals)
1486 (if space-sep 1486 (if space-sep
1487 (let ((error-exp-pos exp-pos) 1487 (let ((error-exp-pos math-exp-pos)
1488 (error-exp-old-pos exp-old-pos) 1488 (error-exp-old-pos math-exp-old-pos)
1489 vals2) 1489 vals2)
1490 (setq exp-pos save-exp-pos 1490 (setq math-exp-pos save-exp-pos
1491 exp-old-pos save-exp-old-pos 1491 math-exp-old-pos save-exp-old-pos
1492 exp-token save-exp-token 1492 math-exp-token save-exp-token
1493 exp-data save-exp-data) 1493 math-expr-data save-exp-data)
1494 (let ((exp-keep-spaces nil)) 1494 (let ((math-exp-keep-spaces nil))
1495 (setq vals2 (catch 'syntax (math-read-vector)))) 1495 (setq vals2 (catch 'syntax (math-read-vector))))
1496 (if (and (not (stringp vals2)) 1496 (if (and (not (stringp vals2))
1497 (or (assoc exp-data '(("\\ldots") ("\\dots") (";"))) 1497 (or (assoc math-expr-data '(("\\ldots") ("\\dots") (";")))
1498 (equal exp-data close) 1498 (equal math-expr-data close)
1499 (eq exp-token 'end))) 1499 (eq math-exp-token 'end)))
1500 (setq space-sep nil 1500 (setq space-sep nil
1501 vals vals2) 1501 vals vals2)
1502 (setq exp-pos error-exp-pos 1502 (setq math-exp-pos error-exp-pos
1503 exp-old-pos error-exp-old-pos) 1503 math-exp-old-pos error-exp-old-pos)
1504 (throw 'syntax vals))) 1504 (throw 'syntax vals)))
1505 (throw 'syntax vals))) 1505 (throw 'syntax vals)))
1506 (if (or (equal exp-data "\\dots") 1506 (if (or (equal math-expr-data "\\dots")
1507 (equal exp-data "\\ldots")) 1507 (equal math-expr-data "\\ldots"))
1508 (progn 1508 (progn
1509 (math-read-token) 1509 (math-read-token)
1510 (setq vals (if (> (length vals) 2) 1510 (setq vals (if (> (length vals) 2)
1511 (cons 'calcFunc-mul (cdr vals)) (nth 1 vals))) 1511 (cons 'calcFunc-mul (cdr vals)) (nth 1 vals)))
1512 (let ((exp2 (if (or (equal exp-data close) 1512 (let ((exp2 (if (or (equal math-expr-data close)
1513 (equal exp-data ")") 1513 (equal math-expr-data ")")
1514 (eq exp-token 'end)) 1514 (eq math-exp-token 'end))
1515 '(var inf var-inf) 1515 '(var inf var-inf)
1516 (math-read-expr-level 0)))) 1516 (math-read-expr-level 0))))
1517 (setq vals 1517 (setq vals
1518 (list 'intv 1518 (list 'intv
1519 (if (equal exp-data ")") 2 3) 1519 (if (equal math-expr-data ")") 2 3)
1520 vals 1520 vals
1521 exp2))) 1521 exp2)))
1522 (if (not (or (equal exp-data close) 1522 (if (not (or (equal math-expr-data close)
1523 (equal exp-data ")") 1523 (equal math-expr-data ")")
1524 (eq exp-token 'end))) 1524 (eq math-exp-token 'end)))
1525 (throw 'syntax "Expected `]'"))) 1525 (throw 'syntax "Expected `]'")))
1526 (if (equal exp-data ";") 1526 (if (equal math-expr-data ";")
1527 (let ((exp-keep-spaces space-sep)) 1527 (let ((math-exp-keep-spaces space-sep))
1528 (setq vals (cons 'vec (math-read-matrix (list vals)))))) 1528 (setq vals (cons 'vec (math-read-matrix (list vals))))))
1529 (if (not (or (equal exp-data close) 1529 (if (not (or (equal math-expr-data close)
1530 (eq exp-token 'end))) 1530 (eq math-exp-token 'end)))
1531 (throw 'syntax "Expected `]'"))) 1531 (throw 'syntax "Expected `]'")))
1532 (or (eq exp-token 'end) 1532 (or (eq math-exp-token 'end)
1533 (math-read-token)) 1533 (math-read-token))
1534 vals))) 1534 vals)))
1535 1535
1536(defun math-check-for-commas (&optional balancing) 1536(defun math-check-for-commas (&optional balancing)
1537 (let ((count 0) 1537 (let ((count 0)
1538 (pos (1- exp-pos))) 1538 (pos (1- math-exp-pos)))
1539 (while (and (>= count 0) 1539 (while (and (>= count 0)
1540 (setq pos (string-match 1540 (setq pos (string-match
1541 (if balancing "[],[{}()<>]" "[],[{}()]") 1541 (if balancing "[],[{}()<>]" "[],[{}()]")
1542 exp-str (1+ pos))) 1542 math-exp-str (1+ pos)))
1543 (or (/= (aref exp-str pos) ?,) (> count 0) balancing)) 1543 (or (/= (aref math-exp-str pos) ?,) (> count 0) balancing))
1544 (cond ((memq (aref exp-str pos) '(?\[ ?\{ ?\( ?\<)) 1544 (cond ((memq (aref math-exp-str pos) '(?\[ ?\{ ?\( ?\<))
1545 (setq count (1+ count))) 1545 (setq count (1+ count)))
1546 ((memq (aref exp-str pos) '(?\] ?\} ?\) ?\>)) 1546 ((memq (aref math-exp-str pos) '(?\] ?\} ?\) ?\>))
1547 (setq count (1- count))))) 1547 (setq count (1- count)))))
1548 (if balancing 1548 (if balancing
1549 pos 1549 pos
1550 (and pos (= (aref exp-str pos) ?,))))) 1550 (and pos (= (aref math-exp-str pos) ?,)))))
1551 1551
1552(defun math-read-vector () 1552(defun math-read-vector ()
1553 (let* ((val (list (math-read-expr-level 0))) 1553 (let* ((val (list (math-read-expr-level 0)))
1554 (last val)) 1554 (last val))
1555 (while (progn 1555 (while (progn
1556 (while (eq exp-token 'space) 1556 (while (eq math-exp-token 'space)
1557 (math-read-token)) 1557 (math-read-token))
1558 (and (not (eq exp-token 'end)) 1558 (and (not (eq math-exp-token 'end))
1559 (not (equal exp-data ";")) 1559 (not (equal math-expr-data ";"))
1560 (not (equal exp-data close)) 1560 (not (equal math-expr-data close))
1561 (not (equal exp-data "\\dots")) 1561 (not (equal math-expr-data "\\dots"))
1562 (not (equal exp-data "\\ldots")))) 1562 (not (equal math-expr-data "\\ldots"))))
1563 (if (equal exp-data ",") 1563 (if (equal math-expr-data ",")
1564 (math-read-token)) 1564 (math-read-token))
1565 (while (eq exp-token 'space) 1565 (while (eq math-exp-token 'space)
1566 (math-read-token)) 1566 (math-read-token))
1567 (let ((rest (list (math-read-expr-level 0)))) 1567 (let ((rest (list (math-read-expr-level 0))))
1568 (setcdr last rest) 1568 (setcdr last rest)
@@ -1570,9 +1570,9 @@
1570 (cons 'vec val))) 1570 (cons 'vec val)))
1571 1571
1572(defun math-read-matrix (mat) 1572(defun math-read-matrix (mat)
1573 (while (equal exp-data ";") 1573 (while (equal math-expr-data ";")
1574 (math-read-token) 1574 (math-read-token)
1575 (while (eq exp-token 'space) 1575 (while (eq math-exp-token 'space)
1576 (math-read-token)) 1576 (math-read-token))
1577 (setq mat (nconc mat (list (math-read-vector))))) 1577 (setq mat (nconc mat (list (math-read-vector)))))
1578 mat) 1578 mat)
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 4ace5fb6780..6480b1960a5 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -654,6 +654,20 @@ If nil, selections displayed but ignored.")
654 calc-word-size 654 calc-word-size
655 calc-internal-prec)) 655 calc-internal-prec))
656 656
657(defvar calc-mode-hook nil
658 "Hook run when entering calc-mode.")
659
660(defvar calc-trail-mode-hook nil
661 "Hook run when entering calc-trail-mode.")
662
663(defvar calc-start-hook nil
664 "Hook run when calc is started.")
665
666(defvar calc-end-hook nil
667 "Hook run when calc is quit.")
668
669(defvar calc-load-hook nil
670 "Hook run when calc.el is loaded.")
657 671
658;; Verify that Calc is running on the right kind of system. 672;; Verify that Calc is running on the right kind of system.
659(defvar calc-emacs-type-lucid (not (not (string-match "Lucid" emacs-version)))) 673(defvar calc-emacs-type-lucid (not (not (string-match "Lucid" emacs-version))))
@@ -1056,9 +1070,6 @@ Notations: 3.14e6 3.14 * 10^6
1056 (progn 1070 (progn
1057 (setq calc-loaded-settings-file t) 1071 (setq calc-loaded-settings-file t)
1058 (load calc-settings-file t))) ; t = missing-ok 1072 (load calc-settings-file t))) ; t = missing-ok
1059 (if (and (eq window-system 'x) (boundp 'mouse-map))
1060 (substitute-key-definition 'x-paste-text 'calc-x-paste-text
1061 mouse-map))
1062 (let ((p command-line-args)) 1073 (let ((p command-line-args))
1063 (while p 1074 (while p
1064 (and (equal (car p) "-f") 1075 (and (equal (car p) "-f")
@@ -1069,14 +1080,6 @@ Notations: 3.14e6 3.14 * 10^6
1069 (run-hooks 'calc-mode-hook) 1080 (run-hooks 'calc-mode-hook)
1070 (calc-refresh t) 1081 (calc-refresh t)
1071 (calc-set-mode-line) 1082 (calc-set-mode-line)
1072 ;; The calc-defs variable is a relic. Use calc-define properties instead.
1073 (when (and (boundp 'calc-defs)
1074 calc-defs)
1075 (message "Evaluating calc-defs...")
1076 (calc-need-macros)
1077 (eval (cons 'progn calc-defs))
1078 (setq calc-defs nil)
1079 (calc-set-mode-line))
1080 (calc-check-defines)) 1083 (calc-check-defines))
1081 1084
1082(defvar calc-check-defines 'calc-check-defines) ; suitable for run-hooks 1085(defvar calc-check-defines 'calc-check-defines) ; suitable for run-hooks
@@ -1163,20 +1166,18 @@ commands given here will actually operate on the *Calculator* stack."
1163 (switch-to-buffer (current-buffer) t) 1166 (switch-to-buffer (current-buffer) t)
1164 (if (get-buffer-window (current-buffer)) 1167 (if (get-buffer-window (current-buffer))
1165 (select-window (get-buffer-window (current-buffer))) 1168 (select-window (get-buffer-window (current-buffer)))
1166 (if (and (boundp 'calc-window-hook) calc-window-hook) 1169 (let ((w (get-largest-window)))
1167 (run-hooks 'calc-window-hook) 1170 (if (and pop-up-windows
1168 (let ((w (get-largest-window))) 1171 (> (window-height w)
1169 (if (and pop-up-windows 1172 (+ window-min-height calc-window-height 2)))
1170 (> (window-height w) 1173 (progn
1171 (+ window-min-height calc-window-height 2))) 1174 (setq w (split-window w
1172 (progn 1175 (- (window-height w)
1173 (setq w (split-window w 1176 calc-window-height 2)
1174 (- (window-height w) 1177 nil))
1175 calc-window-height 2) 1178 (set-window-buffer w (current-buffer))
1176 nil)) 1179 (select-window w))
1177 (set-window-buffer w (current-buffer)) 1180 (pop-to-buffer (current-buffer))))))
1178 (select-window w))
1179 (pop-to-buffer (current-buffer)))))))
1180 (save-excursion 1181 (save-excursion
1181 (set-buffer (calc-trail-buffer)) 1182 (set-buffer (calc-trail-buffer))
1182 (and calc-display-trail 1183 (and calc-display-trail
@@ -1722,27 +1723,6 @@ See calc-keypad for details."
1722 (calc-refresh align))) 1723 (calc-refresh align)))
1723 (setq calc-refresh-count (1+ calc-refresh-count))) 1724 (setq calc-refresh-count (1+ calc-refresh-count)))
1724 1725
1725
1726(defun calc-x-paste-text (arg)
1727 "Move point to mouse position and insert window system cut buffer contents.
1728If mouse is pressed in Calc window, push cut buffer contents onto the stack."
1729 (x-mouse-select arg)
1730 (if (memq major-mode '(calc-mode calc-trail-mode))
1731 (progn
1732 (calc-wrapper
1733 (calc-extensions)
1734 (let* ((buf (x-get-cut-buffer))
1735 (val (math-read-exprs (calc-clean-newlines buf))))
1736 (if (eq (car-safe val) 'error)
1737 (progn
1738 (setq val (math-read-exprs buf))
1739 (if (eq (car-safe val) 'error)
1740 (error "%s in yanked data" (nth 2 val)))))
1741 (calc-enter-result 0 "Xynk" val))))
1742 (x-paste-text arg)))
1743
1744
1745
1746;;;; The Calc Trail buffer. 1726;;;; The Calc Trail buffer.
1747 1727
1748(defun calc-check-trail-aligned () 1728(defun calc-check-trail-aligned ()
@@ -1808,10 +1788,8 @@ If mouse is pressed in Calc window, push cut buffer contents onto the stack."
1808 (not (if flag (memq flag '(nil 0)) win))) 1788 (not (if flag (memq flag '(nil 0)) win)))
1809 (if (null win) 1789 (if (null win)
1810 (progn 1790 (progn
1811 (if (and (boundp 'calc-trail-window-hook) calc-trail-window-hook) 1791 (let ((w (split-window nil (/ (* (window-width) 2) 3) t)))
1812 (run-hooks 'calc-trail-window-hook) 1792 (set-window-buffer w calc-trail-buffer))
1813 (let ((w (split-window nil (/ (* (window-width) 2) 3) t)))
1814 (set-window-buffer w calc-trail-buffer)))
1815 (calc-wrapper 1793 (calc-wrapper
1816 (setq overlay-arrow-string calc-trail-overlay 1794 (setq overlay-arrow-string calc-trail-overlay
1817 overlay-arrow-position calc-trail-pointer) 1795 overlay-arrow-position calc-trail-pointer)
@@ -2254,62 +2232,72 @@ If mouse is pressed in Calc window, push cut buffer contents onto the stack."
2254(defvar math-eval-rules-cache) 2232(defvar math-eval-rules-cache)
2255(defvar math-eval-rules-cache-other) 2233(defvar math-eval-rules-cache-other)
2256;;; Reduce an object to canonical (normalized) form. [O o; Z Z] [Public] 2234;;; Reduce an object to canonical (normalized) form. [O o; Z Z] [Public]
2257(defun math-normalize (a) 2235
2236(defvar math-normalize-a)
2237(defun math-normalize (math-normalize-a)
2258 (cond 2238 (cond
2259 ((not (consp a)) 2239 ((not (consp math-normalize-a))
2260 (if (integerp a) 2240 (if (integerp math-normalize-a)
2261 (if (or (>= a 1000000) (<= a -1000000)) 2241 (if (or (>= math-normalize-a 1000000) (<= math-normalize-a -1000000))
2262 (math-bignum a) 2242 (math-bignum math-normalize-a)
2263 a) 2243 math-normalize-a)
2264 a)) 2244 math-normalize-a))
2265 ((eq (car a) 'bigpos) 2245 ((eq (car math-normalize-a) 'bigpos)
2266 (if (eq (nth (1- (length a)) a) 0) 2246 (if (eq (nth (1- (length math-normalize-a)) math-normalize-a) 0)
2267 (let* ((last (setq a (copy-sequence a))) (digs a)) 2247 (let* ((last (setq math-normalize-a
2248 (copy-sequence math-normalize-a))) (digs math-normalize-a))
2268 (while (setq digs (cdr digs)) 2249 (while (setq digs (cdr digs))
2269 (or (eq (car digs) 0) (setq last digs))) 2250 (or (eq (car digs) 0) (setq last digs)))
2270 (setcdr last nil))) 2251 (setcdr last nil)))
2271 (if (cdr (cdr (cdr a))) 2252 (if (cdr (cdr (cdr math-normalize-a)))
2272 a 2253 math-normalize-a
2273 (cond 2254 (cond
2274 ((cdr (cdr a)) (+ (nth 1 a) (* (nth 2 a) 1000))) 2255 ((cdr (cdr math-normalize-a)) (+ (nth 1 math-normalize-a)
2275 ((cdr a) (nth 1 a)) 2256 (* (nth 2 math-normalize-a) 1000)))
2257 ((cdr math-normalize-a) (nth 1 math-normalize-a))
2276 (t 0)))) 2258 (t 0))))
2277 ((eq (car a) 'bigneg) 2259 ((eq (car math-normalize-a) 'bigneg)
2278 (if (eq (nth (1- (length a)) a) 0) 2260 (if (eq (nth (1- (length math-normalize-a)) math-normalize-a) 0)
2279 (let* ((last (setq a (copy-sequence a))) (digs a)) 2261 (let* ((last (setq math-normalize-a (copy-sequence math-normalize-a)))
2262 (digs math-normalize-a))
2280 (while (setq digs (cdr digs)) 2263 (while (setq digs (cdr digs))
2281 (or (eq (car digs) 0) (setq last digs))) 2264 (or (eq (car digs) 0) (setq last digs)))
2282 (setcdr last nil))) 2265 (setcdr last nil)))
2283 (if (cdr (cdr (cdr a))) 2266 (if (cdr (cdr (cdr math-normalize-a)))
2284 a 2267 math-normalize-a
2285 (cond 2268 (cond
2286 ((cdr (cdr a)) (- (+ (nth 1 a) (* (nth 2 a) 1000)))) 2269 ((cdr (cdr math-normalize-a)) (- (+ (nth 1 math-normalize-a)
2287 ((cdr a) (- (nth 1 a))) 2270 (* (nth 2 math-normalize-a) 1000))))
2271 ((cdr math-normalize-a) (- (nth 1 math-normalize-a)))
2288 (t 0)))) 2272 (t 0))))
2289 ((eq (car a) 'float) 2273 ((eq (car math-normalize-a) 'float)
2290 (math-make-float (math-normalize (nth 1 a)) (nth 2 a))) 2274 (math-make-float (math-normalize (nth 1 math-normalize-a))
2291 ((or (memq (car a) '(frac cplx polar hms date mod sdev intv vec var quote 2275 (nth 2 math-normalize-a)))
2292 special-const calcFunc-if calcFunc-lambda 2276 ((or (memq (car math-normalize-a)
2293 calcFunc-quote calcFunc-condition 2277 '(frac cplx polar hms date mod sdev intv vec var quote
2294 calcFunc-evalto)) 2278 special-const calcFunc-if calcFunc-lambda
2295 (integerp (car a)) 2279 calcFunc-quote calcFunc-condition
2296 (and (consp (car a)) (not (eq (car (car a)) 'lambda)))) 2280 calcFunc-evalto))
2281 (integerp (car math-normalize-a))
2282 (and (consp (car math-normalize-a))
2283 (not (eq (car (car math-normalize-a)) 'lambda))))
2297 (calc-extensions) 2284 (calc-extensions)
2298 (math-normalize-fancy a)) 2285 (math-normalize-fancy math-normalize-a))
2299 (t 2286 (t
2300 (or (and calc-simplify-mode 2287 (or (and calc-simplify-mode
2301 (calc-extensions) 2288 (calc-extensions)
2302 (math-normalize-nonstandard)) 2289 (math-normalize-nonstandard))
2303 (let ((args (mapcar 'math-normalize (cdr a)))) 2290 (let ((args (mapcar 'math-normalize (cdr math-normalize-a))))
2304 (or (condition-case err 2291 (or (condition-case err
2305 (let ((func (assq (car a) '( ( + . math-add ) 2292 (let ((func
2306 ( - . math-sub ) 2293 (assq (car math-normalize-a) '( ( + . math-add )
2307 ( * . math-mul ) 2294 ( - . math-sub )
2308 ( / . math-div ) 2295 ( * . math-mul )
2309 ( % . math-mod ) 2296 ( / . math-div )
2310 ( ^ . math-pow ) 2297 ( % . math-mod )
2311 ( neg . math-neg ) 2298 ( ^ . math-pow )
2312 ( | . math-concat ) )))) 2299 ( neg . math-neg )
2300 ( | . math-concat ) ))))
2313 (or (and var-EvalRules 2301 (or (and var-EvalRules
2314 (progn 2302 (progn
2315 (or (eq var-EvalRules math-eval-rules-cache-tag) 2303 (or (eq var-EvalRules math-eval-rules-cache-tag)
@@ -2317,51 +2305,54 @@ If mouse is pressed in Calc window, push cut buffer contents onto the stack."
2317 (calc-extensions) 2305 (calc-extensions)
2318 (math-recompile-eval-rules))) 2306 (math-recompile-eval-rules)))
2319 (and (or math-eval-rules-cache-other 2307 (and (or math-eval-rules-cache-other
2320 (assq (car a) math-eval-rules-cache)) 2308 (assq (car math-normalize-a)
2309 math-eval-rules-cache))
2321 (math-apply-rewrites 2310 (math-apply-rewrites
2322 (cons (car a) args) 2311 (cons (car math-normalize-a) args)
2323 (cdr math-eval-rules-cache) 2312 (cdr math-eval-rules-cache)
2324 nil math-eval-rules-cache)))) 2313 nil math-eval-rules-cache))))
2325 (if func 2314 (if func
2326 (apply (cdr func) args) 2315 (apply (cdr func) args)
2327 (and (or (consp (car a)) 2316 (and (or (consp (car math-normalize-a))
2328 (fboundp (car a)) 2317 (fboundp (car math-normalize-a))
2329 (and (not calc-extensions-loaded) 2318 (and (not calc-extensions-loaded)
2330 (calc-extensions) 2319 (calc-extensions)
2331 (fboundp (car a)))) 2320 (fboundp (car math-normalize-a))))
2332 (apply (car a) args))))) 2321 (apply (car math-normalize-a) args)))))
2333 (wrong-number-of-arguments 2322 (wrong-number-of-arguments
2334 (calc-record-why "*Wrong number of arguments" 2323 (calc-record-why "*Wrong number of arguments"
2335 (cons (car a) args)) 2324 (cons (car math-normalize-a) args))
2336 nil) 2325 nil)
2337 (wrong-type-argument 2326 (wrong-type-argument
2338 (or calc-next-why (calc-record-why "Wrong type of argument" 2327 (or calc-next-why
2339 (cons (car a) args))) 2328 (calc-record-why "Wrong type of argument"
2329 (cons (car math-normalize-a) args)))
2340 nil) 2330 nil)
2341 (args-out-of-range 2331 (args-out-of-range
2342 (calc-record-why "*Argument out of range" (cons (car a) args)) 2332 (calc-record-why "*Argument out of range"
2333 (cons (car math-normalize-a) args))
2343 nil) 2334 nil)
2344 (inexact-result 2335 (inexact-result
2345 (calc-record-why "No exact representation for result" 2336 (calc-record-why "No exact representation for result"
2346 (cons (car a) args)) 2337 (cons (car math-normalize-a) args))
2347 nil) 2338 nil)
2348 (math-overflow 2339 (math-overflow
2349 (calc-record-why "*Floating-point overflow occurred" 2340 (calc-record-why "*Floating-point overflow occurred"
2350 (cons (car a) args)) 2341 (cons (car math-normalize-a) args))
2351 nil) 2342 nil)
2352 (math-underflow 2343 (math-underflow
2353 (calc-record-why "*Floating-point underflow occurred" 2344 (calc-record-why "*Floating-point underflow occurred"
2354 (cons (car a) args)) 2345 (cons (car math-normalize-a) args))
2355 nil) 2346 nil)
2356 (void-variable 2347 (void-variable
2357 (if (eq (nth 1 err) 'var-EvalRules) 2348 (if (eq (nth 1 err) 'var-EvalRules)
2358 (progn 2349 (progn
2359 (setq var-EvalRules nil) 2350 (setq var-EvalRules nil)
2360 (math-normalize (cons (car a) args))) 2351 (math-normalize (cons (car math-normalize-a) args)))
2361 (calc-record-why "*Variable is void" (nth 1 err))))) 2352 (calc-record-why "*Variable is void" (nth 1 err)))))
2362 (if (consp (car a)) 2353 (if (consp (car math-normalize-a))
2363 (math-dimension-error) 2354 (math-dimension-error)
2364 (cons (car a) args)))))))) 2355 (cons (car math-normalize-a) args))))))))
2365 2356
2366 2357
2367 2358
diff --git a/lisp/calc/calcalg2.el b/lisp/calc/calcalg2.el
index 2a463009e58..ff23c3e5421 100644
--- a/lisp/calc/calcalg2.el
+++ b/lisp/calc/calcalg2.el
@@ -738,8 +738,12 @@
738 (setcar (cdr cur-record) 'cancelled))) 738 (setcar (cdr cur-record) 'cancelled)))
739 (math-replace-integral-parts (car expr))))))) 739 (math-replace-integral-parts (car expr)))))))
740 740
741(defvar math-linear-subst-tried t
742 "Non-nil means that a linear substitution has been tried.")
743
741(defun math-do-integral (expr) 744(defun math-do-integral (expr)
742 (let (t1 t2) 745 (let ((math-linear-subst-tried nil)
746 t1 t2)
743 (or (cond ((not (math-expr-contains expr math-integ-var)) 747 (or (cond ((not (math-expr-contains expr math-integ-var))
744 (math-mul expr math-integ-var)) 748 (math-mul expr math-integ-var))
745 ((equal expr math-integ-var) 749 ((equal expr math-integ-var)
@@ -977,9 +981,8 @@
977 981
978 ;; Integration by substitution, for various likely sub-expressions. 982 ;; Integration by substitution, for various likely sub-expressions.
979 ;; (In first pass, we look only for sub-exprs that are linear in X.) 983 ;; (In first pass, we look only for sub-exprs that are linear in X.)
980 (or (if math-enable-subst 984 (or (math-integ-try-linear-substitutions expr)
981 (math-integ-try-substitutions expr) 985 (math-integ-try-substitutions expr)
982 (math-integ-try-linear-substitutions expr))
983 986
984 ;; If function has sines and cosines, try tan(x/2) substitution. 987 ;; If function has sines and cosines, try tan(x/2) substitution.
985 (and (let ((p (setq rat-in (math-expr-rational-in expr)))) 988 (and (let ((p (setq rat-in (math-expr-rational-in expr))))
@@ -1189,6 +1192,7 @@
1189 1192
1190;;; Look for substitutions of the form u = a x + b. 1193;;; Look for substitutions of the form u = a x + b.
1191(defun math-integ-try-linear-substitutions (sub-expr) 1194(defun math-integ-try-linear-substitutions (sub-expr)
1195 (setq math-linear-subst-tried t)
1192 (and (not (Math-primp sub-expr)) 1196 (and (not (Math-primp sub-expr))
1193 (or (and (not (memq (car sub-expr) '(+ - * / neg))) 1197 (or (and (not (memq (car sub-expr) '(+ - * / neg)))
1194 (not (and (eq (car sub-expr) '^) 1198 (not (and (eq (car sub-expr) '^)
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 945119f06df..679c4b991b6 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -1974,19 +1974,20 @@ message contains an appointment, don't make a diary entry."
1974 (throw 'finished t)))) 1974 (throw 'finished t))))
1975 nil)) 1975 nil))
1976 1976
1977(defun diary-from-outlook () 1977(defun diary-from-outlook (&optional noconfirm)
1978 "Maybe snarf diary entry from current Outlook-generated message. 1978 "Maybe snarf diary entry from current Outlook-generated message.
1979Currently knows about Gnus and Rmail modes." 1979Currently knows about Gnus and Rmail modes. Unless the optional
1980 (interactive) 1980argument NOCONFIRM is non-nil (which is the case when this
1981function is called interactively), then if an entry is found the
1982user is asked to confirm its addition."
1983 (interactive "p")
1981 (let ((func (cond 1984 (let ((func (cond
1982 ((eq major-mode 'rmail-mode) 1985 ((eq major-mode 'rmail-mode)
1983 #'diary-from-outlook-rmail) 1986 #'diary-from-outlook-rmail)
1984 ((memq major-mode '(gnus-summary-mode gnus-article-mode)) 1987 ((memq major-mode '(gnus-summary-mode gnus-article-mode))
1985 #'diary-from-outlook-gnus) 1988 #'diary-from-outlook-gnus)
1986 (t (error "Don't know how to snarf in `%s'" major-mode))))) 1989 (t (error "Don't know how to snarf in `%s'" major-mode)))))
1987 (if (interactive-p) 1990 (funcall func noconfirm)))
1988 (call-interactively func)
1989 (funcall func))))
1990 1991
1991 1992
1992(defvar gnus-article-mime-handles) 1993(defvar gnus-article-mime-handles)
@@ -1996,11 +1997,14 @@ Currently knows about Gnus and Rmail modes."
1996(autoload 'gnus-narrow-to-body "gnus") 1997(autoload 'gnus-narrow-to-body "gnus")
1997(autoload 'mm-get-part "mm-decode") 1998(autoload 'mm-get-part "mm-decode")
1998 1999
1999(defun diary-from-outlook-gnus () 2000(defun diary-from-outlook-gnus (&optional noconfirm)
2000 "Maybe snarf diary entry from Outlook-generated message in Gnus. 2001 "Maybe snarf diary entry from Outlook-generated message in Gnus.
2001Add this to `gnus-article-prepare-hook' to notice appointments 2002Unless the optional argument NOCONFIRM is non-nil (which is the case when
2003this function is called interactively), then if an entry is found the
2004user is asked to confirm its addition.
2005Add this function to `gnus-article-prepare-hook' to notice appointments
2002automatically." 2006automatically."
2003 (interactive) 2007 (interactive "p")
2004 (with-current-buffer gnus-article-buffer 2008 (with-current-buffer gnus-article-buffer
2005 (let ((subject (gnus-fetch-field "subject")) 2009 (let ((subject (gnus-fetch-field "subject"))
2006 (body (if gnus-article-mime-handles 2010 (body (if gnus-article-mime-handles
@@ -2011,8 +2015,7 @@ automatically."
2011 (gnus-narrow-to-body) 2015 (gnus-narrow-to-body)
2012 (buffer-string))))) 2016 (buffer-string)))))
2013 (when (diary-from-outlook-internal t) 2017 (when (diary-from-outlook-internal t)
2014 (when (or (interactive-p) 2018 (when (or noconfirm (y-or-n-p "Snarf diary entry? "))
2015 (y-or-n-p "Snarf diary entry? "))
2016 (diary-from-outlook-internal) 2019 (diary-from-outlook-internal)
2017 (message "Diary entry added")))))) 2020 (message "Diary entry added"))))))
2018 2021
@@ -2021,9 +2024,12 @@ automatically."
2021 2024
2022(defvar rmail-buffer) 2025(defvar rmail-buffer)
2023 2026
2024(defun diary-from-outlook-rmail () 2027(defun diary-from-outlook-rmail (&optional noconfirm)
2025 "Maybe snarf diary entry from Outlook-generated message in Rmail." 2028 "Maybe snarf diary entry from Outlook-generated message in Rmail.
2026 (interactive) 2029Unless the optional argument NOCONFIRM is non-nil (which is the case when
2030this function is called interactively), then if an entry is found the
2031user is asked to confirm its addition."
2032 (interactive "p")
2027 (with-current-buffer rmail-buffer 2033 (with-current-buffer rmail-buffer
2028 (let ((subject (mail-fetch-field "subject")) 2034 (let ((subject (mail-fetch-field "subject"))
2029 (body (buffer-substring (save-excursion 2035 (body (buffer-substring (save-excursion
@@ -2031,8 +2037,7 @@ automatically."
2031 (point)) 2037 (point))
2032 (point-max)))) 2038 (point-max))))
2033 (when (diary-from-outlook-internal t) 2039 (when (diary-from-outlook-internal t)
2034 (when (or (interactive-p) 2040 (when (or noconfirm (y-or-n-p "Snarf diary entry? "))
2035 (y-or-n-p "Snarf diary entry? "))
2036 (diary-from-outlook-internal) 2041 (diary-from-outlook-internal)
2037 (message "Diary entry added")))))) 2042 (message "Diary entry added"))))))
2038 2043
diff --git a/lisp/cvs-status.el b/lisp/cvs-status.el
index 419f8567a90..324da8d3ce1 100644
--- a/lisp/cvs-status.el
+++ b/lisp/cvs-status.el
@@ -1,6 +1,6 @@
1;;; cvs-status.el --- major mode for browsing `cvs status' output -*- coding: utf-8 -*- 1;;; cvs-status.el --- major mode for browsing `cvs status' output -*- coding: utf-8 -*-
2 2
3;; Copyright (C) 1999, 2000, 03, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
4 4
5;; Author: Stefan Monnier <monnier@cs.yale.edu> 5;; Author: Stefan Monnier <monnier@cs.yale.edu>
6;; Keywords: pcl-cvs cvs status tree tools 6;; Keywords: pcl-cvs cvs status tree tools
@@ -31,8 +31,8 @@
31;;; Code: 31;;; Code:
32 32
33(eval-when-compile (require 'cl)) 33(eval-when-compile (require 'cl))
34(eval-when-compile (require 'pcvs))
35(require 'pcvs-util) 34(require 'pcvs-util)
35(eval-when-compile (require 'pcvs))
36 36
37;;; 37;;;
38 38
@@ -50,7 +50,7 @@
50 ("\M-p" . cvs-status-prev) 50 ("\M-p" . cvs-status-prev)
51 ("t" . cvs-status-cvstrees) 51 ("t" . cvs-status-cvstrees)
52 ("T" . cvs-status-trees) 52 ("T" . cvs-status-trees)
53 (">" . cvs-status-checkout)) 53 (">" . cvs-mode-checkout))
54 "CVS-Status' keymap." 54 "CVS-Status' keymap."
55 :group 'cvs-status 55 :group 'cvs-status
56 :inherit 'cvs-mode-map) 56 :inherit 'cvs-mode-map)
@@ -89,7 +89,7 @@
89(defconst cvs-status-font-lock-defaults 89(defconst cvs-status-font-lock-defaults
90 '(cvs-status-font-lock-keywords t nil nil nil (font-lock-multiline . t))) 90 '(cvs-status-font-lock-keywords t nil nil nil (font-lock-multiline . t)))
91 91
92 92(defvar cvs-minor-wrap-function)
93(put 'cvs-status-mode 'mode-class 'special) 93(put 'cvs-status-mode 'mode-class 'special)
94;;;###autoload 94;;;###autoload
95(define-derived-mode cvs-status-mode fundamental-mode "CVS-Status" 95(define-derived-mode cvs-status-mode fundamental-mode "CVS-Status"
@@ -108,7 +108,8 @@
108 (let* ((file (match-string 1)) 108 (let* ((file (match-string 1))
109 (cvsdir (and (re-search-backward cvs-status-dir-re nil t) 109 (cvsdir (and (re-search-backward cvs-status-dir-re nil t)
110 (match-string 1))) 110 (match-string 1)))
111 (pcldir (and (re-search-backward cvs-pcl-cvs-dirchange-re nil t) 111 (pcldir (and (if (boundp 'cvs-pcl-cvs-dirchange-re)
112 (re-search-backward cvs-pcl-cvs-dirchange-re nil t))
112 (match-string 1))) 113 (match-string 1)))
113 (dir "")) 114 (dir ""))
114 (let ((default-directory "")) 115 (let ((default-directory ""))
@@ -466,25 +467,6 @@ Optional prefix ARG chooses between two representations."
466 ;;(sit-for 0) 467 ;;(sit-for 0)
467 )))))) 468 ))))))
468 469
469(defun-cvs-mode (cvs-status-checkout . NOARGS) (dir)
470 "Run cvs-checkout against the tag under the point.
471The files are stored to DIR."
472 (interactive
473 (let* ((module (cvs-get-module))
474 (branch (cvs-prefix-get 'cvs-branch-prefix))
475 (prompt (format "CVS Checkout Directory for `%s%s': "
476 module
477 (if branch (format "(branch: %s)" branch)
478 ""))))
479 (list
480 (read-directory-name prompt
481 nil default-directory nil))))
482 (let ((modules (cvs-string->strings (cvs-get-module)))
483 (flags (cvs-add-branch-prefix
484 (cvs-flags-query 'cvs-checkout-flags "cvs checkout flags")))
485 (cvs-cvsroot (cvs-get-cvsroot)))
486 (cvs-checkout modules dir flags)))
487
488(defun cvs-tree-tags-insert (tags prev) 470(defun cvs-tree-tags-insert (tags prev)
489 (when tags 471 (when tags
490 (let* ((tag (car tags)) 472 (let* ((tag (car tags))
@@ -556,5 +538,5 @@ The files are stored to DIR."
556 538
557(provide 'cvs-status) 539(provide 'cvs-status)
558 540
559;;; arch-tag: db8b5094-d02a-473e-a476-544e89ff5ad0 541;; arch-tag: db8b5094-d02a-473e-a476-544e89ff5ad0
560;;; cvs-status.el ends here 542;;; cvs-status.el ends here
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 2693575f4e2..0c84245b6c1 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -499,7 +499,10 @@ as well as widgets, buttons, overlays, and text properties."
499 (format (if (< code 256) "0x%02X" "0x%04X") code) 499 (format (if (< code 256) "0x%02X" "0x%04X") code)
500 (format "0x%04X%04X" (car code) (cdr code)))) 500 (format "0x%04X%04X" (car code) (cdr code))))
501 ("syntax" 501 ("syntax"
502 ,(let ((syntax (syntax-after pos))) 502 ,(let* ((st (if parse-sexp-lookup-properties
503 (get-char-property pos 'syntax-table)))
504 (syntax (if (consp st) st
505 (aref (or st (syntax-table)) (char-after pos)))))
503 (with-temp-buffer 506 (with-temp-buffer
504 (internal-describe-syntax-value syntax) 507 (internal-describe-syntax-value syntax)
505 (buffer-string)))) 508 (buffer-string))))
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 28521a0d7c4..779532fbca0 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -129,7 +129,8 @@ determine where the desktop is saved."
129 (const :tag "Ask if desktop file exists, else don't save" ask-if-exists) 129 (const :tag "Ask if desktop file exists, else don't save" ask-if-exists)
130 (const :tag "Save if desktop file exists, else don't" if-exists) 130 (const :tag "Save if desktop file exists, else don't" if-exists)
131 (const :tag "Never save" nil)) 131 (const :tag "Never save" nil))
132 :group 'desktop) 132 :group 'desktop
133 :version "21.4")
133 134
134(defcustom desktop-base-file-name 135(defcustom desktop-base-file-name
135 (convert-standard-filename ".emacs.desktop") 136 (convert-standard-filename ".emacs.desktop")
@@ -142,7 +143,8 @@ determine where the desktop is saved."
142 "List of directories to search for the desktop file. 143 "List of directories to search for the desktop file.
143The base name of the file is specified in `desktop-base-file-name'." 144The base name of the file is specified in `desktop-base-file-name'."
144 :type '(repeat directory) 145 :type '(repeat directory)
145 :group 'desktop) 146 :group 'desktop
147 :version "21.4")
146 148
147(defcustom desktop-missing-file-warning nil 149(defcustom desktop-missing-file-warning nil
148 "*If non-nil then `desktop-read' asks if a non-existent file should be recreated. 150 "*If non-nil then `desktop-read' asks if a non-existent file should be recreated.
@@ -151,19 +153,22 @@ Also pause for a moment to display message about errors signaled in
151 153
152If nil, just print error messages in the message buffer." 154If nil, just print error messages in the message buffer."
153 :type 'boolean 155 :type 'boolean
154 :group 'desktop) 156 :group 'desktop
157 :version "21.4")
155 158
156(defcustom desktop-no-desktop-file-hook nil 159(defcustom desktop-no-desktop-file-hook nil
157 "Normal hook run when `desktop-read' can't find a desktop file. 160 "Normal hook run when `desktop-read' can't find a desktop file.
158May e.g. be used to show a dired buffer." 161May e.g. be used to show a dired buffer."
159 :type 'hook 162 :type 'hook
160 :group 'desktop) 163 :group 'desktop
164 :version "21.4")
161 165
162(defcustom desktop-after-read-hook nil 166(defcustom desktop-after-read-hook nil
163 "Normal hook run after a successful `desktop-read'. 167 "Normal hook run after a successful `desktop-read'.
164May e.g. be used to show a buffer list." 168May e.g. be used to show a buffer list."
165 :type 'hook 169 :type 'hook
166 :group 'desktop) 170 :group 'desktop
171 :version "21.4")
167 172
168(defcustom desktop-save-hook nil 173(defcustom desktop-save-hook nil
169 "Normal hook run before the desktop is saved in a desktop file. 174 "Normal hook run before the desktop is saved in a desktop file.
@@ -198,14 +203,16 @@ An element may be variable name (a symbol) or a cons cell of the form
198\(VAR . FORM). Symbols are set to nil and for cons cells VAR is set 203\(VAR . FORM). Symbols are set to nil and for cons cells VAR is set
199to the value obtained by evaluateing FORM." 204to the value obtained by evaluateing FORM."
200 :type '(repeat (restricted-sexp :match-alternatives (symbolp consp))) 205 :type '(repeat (restricted-sexp :match-alternatives (symbolp consp)))
201 :group 'desktop) 206 :group 'desktop
207 :version "21.4")
202 208
203(defcustom desktop-clear-preserve-buffers-regexp 209(defcustom desktop-clear-preserve-buffers-regexp
204 "^\\(\\*scratch\\*\\|\\*Messages\\*\\|\\*tramp/.+\\*\\)$" 210 "^\\(\\*scratch\\*\\|\\*Messages\\*\\|\\*tramp/.+\\*\\)$"
205 "Regexp identifying buffers that `desktop-clear' should not delete. 211 "Regexp identifying buffers that `desktop-clear' should not delete.
206See also `desktop-clear-preserve-buffers'." 212See also `desktop-clear-preserve-buffers'."
207 :type 'regexp 213 :type 'regexp
208 :group 'desktop) 214 :group 'desktop
215 :version "21.4")
209 216
210(defcustom desktop-clear-preserve-buffers nil 217(defcustom desktop-clear-preserve-buffers nil
211 "*List of buffer names that `desktop-clear' should not delete. 218 "*List of buffer names that `desktop-clear' should not delete.
@@ -257,7 +264,8 @@ Possible values are:
257 tilde -- Relative to ~. 264 tilde -- Relative to ~.
258 local -- Relative to directory of desktop file." 265 local -- Relative to directory of desktop file."
259 :type '(choice (const absolute) (const tilde) (const local)) 266 :type '(choice (const absolute) (const tilde) (const local))
260 :group 'desktop) 267 :group 'desktop
268 :version "21.4")
261 269
262;;;###autoload 270;;;###autoload
263(defvar desktop-save-buffer nil 271(defvar desktop-save-buffer nil
diff --git a/lisp/dired.el b/lisp/dired.el
index c0fc33729c2..4553683b181 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -546,8 +546,14 @@ Optional third argument FILTER, if non-nil, is a function to select
546 (if current-prefix-arg 546 (if current-prefix-arg
547 (read-string "Dired listing switches: " 547 (read-string "Dired listing switches: "
548 dired-listing-switches)) 548 dired-listing-switches))
549 (read-directory-name (format "Dired %s(directory): " str) 549 ;; If a dialog is about to be used, call read-directory-name so
550 nil default-directory nil)))) 550 ;; the dialog code knows we want directories. Some dialogs can
551 ;; only select directories or files when popped up, not both.
552 (if (next-read-file-uses-dialog-p)
553 (read-directory-name (format "Dired %s(directory): " str)
554 nil default-directory nil)
555 (read-file-name (format "Dired %s(directory): " str)
556 nil default-directory nil)))))
551 557
552;;;###autoload (define-key ctl-x-map "d" 'dired) 558;;;###autoload (define-key ctl-x-map "d" 'dired)
553;;;###autoload 559;;;###autoload
diff --git a/lisp/ebuff-menu.el b/lisp/ebuff-menu.el
index bed46c71618..2bfbace4c4b 100644
--- a/lisp/ebuff-menu.el
+++ b/lisp/ebuff-menu.el
@@ -38,9 +38,12 @@
38 38
39(defvar electric-buffer-menu-mode-map nil) 39(defvar electric-buffer-menu-mode-map nil)
40 40
41(defvar electric-buffer-menu-mode-hook nil
42 "Normal hook run by `electric-buffer-list'.")
43
41;;;###autoload 44;;;###autoload
42(defun electric-buffer-list (arg) 45(defun electric-buffer-list (arg)
43 "Pops up a buffer describing the set of Emacs buffers. 46 "Pop up a buffer describing the set of Emacs buffers.
44Vaguely like ITS lunar select buffer; combining typeoutoid buffer 47Vaguely like ITS lunar select buffer; combining typeoutoid buffer
45listing with menuoid buffer selection. 48listing with menuoid buffer selection.
46 49
@@ -50,9 +53,9 @@ window, marking buffers to be selected, saved or deleted.
50 53
51To exit and select a new buffer, type a space when the cursor is on 54To exit and select a new buffer, type a space when the cursor is on
52the appropriate line of the buffer-list window. Other commands are 55the appropriate line of the buffer-list window. Other commands are
53much like those of buffer-menu-mode. 56much like those of `Buffer-menu-mode'.
54 57
55Calls value of `electric-buffer-menu-mode-hook' on entry if non-nil. 58Run hooks in `electric-buffer-menu-mode-hook' on entry.
56 59
57\\{electric-buffer-menu-mode-map}" 60\\{electric-buffer-menu-mode-map}"
58 (interactive "P") 61 (interactive "P")
@@ -144,8 +147,8 @@ Letters do not insert themselves; instead, they are commands.
144 147
145\\{electric-buffer-menu-mode-map} 148\\{electric-buffer-menu-mode-map}
146 149
147Entry to this mode via command electric-buffer-list calls the value of 150Entry to this mode via command `electric-buffer-list' calls the value of
148electric-buffer-menu-mode-hook if it is non-nil." 151`electric-buffer-menu-mode-hook'."
149 (kill-all-local-variables) 152 (kill-all-local-variables)
150 (use-local-map electric-buffer-menu-mode-map) 153 (use-local-map electric-buffer-menu-mode-map)
151 (setq mode-name "Electric Buffer Menu") 154 (setq mode-name "Electric Buffer Menu")
@@ -223,8 +226,8 @@ electric-buffer-menu-mode-hook if it is non-nil."
223 226
224(defun Electric-buffer-menu-select () 227(defun Electric-buffer-menu-select ()
225 "Leave Electric Buffer Menu, selecting buffers and executing changes. 228 "Leave Electric Buffer Menu, selecting buffers and executing changes.
226Saves buffers marked \"S\". Deletes buffers marked \"K\". 229Save buffers marked \"S\". Delete buffers marked \"K\".
227Selects buffer at point and displays buffers marked \">\" in other windows." 230Select buffer at point and display buffers marked \">\" in other windows."
228 (interactive) 231 (interactive)
229 (throw 'electric-buffer-menu-select (point))) 232 (throw 'electric-buffer-menu-select (point)))
230 233
@@ -237,7 +240,7 @@ Selects buffer at point and displays buffers marked \">\" in other windows."
237 240
238(defun Electric-buffer-menu-quit () 241(defun Electric-buffer-menu-quit ()
239 "Leave Electric Buffer Menu, restoring previous window configuration. 242 "Leave Electric Buffer Menu, restoring previous window configuration.
240Does not execute select, save, or delete commands." 243Skip execution of select, save, and delete commands."
241 (interactive) 244 (interactive)
242 (throw 'electric-buffer-menu-select nil)) 245 (throw 'electric-buffer-menu-select nil))
243 246
@@ -258,7 +261,7 @@ Type \\[Electric-buffer-menu-quit] to exit, \
258 261
259(defun Electric-buffer-menu-mode-view-buffer () 262(defun Electric-buffer-menu-mode-view-buffer ()
260 "View buffer on current line in Electric Buffer Menu. 263 "View buffer on current line in Electric Buffer Menu.
261Returns to Electric Buffer Menu when done." 264Return to Electric Buffer Menu when done."
262 (interactive) 265 (interactive)
263 (let ((bufnam (Buffer-menu-buffer nil))) 266 (let ((bufnam (Buffer-menu-buffer nil)))
264 (if bufnam 267 (if bufnam
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index da1e5fba8b2..11d1b112736 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1,7 +1,7 @@
1;;; bytecomp.el --- compilation of Lisp code into byte code 1;;; bytecomp.el --- compilation of Lisp code into byte code
2 2
3;; Copyright (C) 1985,86,87,92,94,1998,2000,01,02,03,2004 3;; Copyright (C) 1985, 1986, 1987, 1992, 1994, 1998, 2000, 2001, 2002,
4;; Free Software Foundation, Inc. 4;; 2003, 2004 Free Software Foundation, Inc.
5 5
6;; Author: Jamie Zawinski <jwz@lucid.com> 6;; Author: Jamie Zawinski <jwz@lucid.com>
7;; Hallvard Furuseth <hbf@ulrik.uio.no> 7;; Hallvard Furuseth <hbf@ulrik.uio.no>
@@ -447,7 +447,9 @@ Each element looks like (MACRONAME . DEFINITION). It is
447 "Alist of functions defined in the file being compiled. 447 "Alist of functions defined in the file being compiled.
448This is so we can inline them when necessary. 448This is so we can inline them when necessary.
449Each element looks like (FUNCTIONNAME . DEFINITION). It is 449Each element looks like (FUNCTIONNAME . DEFINITION). It is
450\(FUNCTIONNAME . nil) when a function is redefined as a macro.") 450\(FUNCTIONNAME . nil) when a function is redefined as a macro.
451It is \(FUNCTIONNAME . t) when all we know is that it was defined,
452and we don't know the definition.")
451 453
452(defvar byte-compile-unresolved-functions nil 454(defvar byte-compile-unresolved-functions nil
453 "Alist of undefined functions to which calls have been compiled. 455 "Alist of undefined functions to which calls have been compiled.
@@ -1103,6 +1105,10 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
1103 1105
1104;;; sanity-checking arglists 1106;;; sanity-checking arglists
1105 1107
1108;; If a function has an entry saying (FUNCTION . t).
1109;; that means we know it is defined but we don't know how.
1110;; If a function has an entry saying (FUNCTION . nil),
1111;; that means treat it as not defined.
1106(defun byte-compile-fdefinition (name macro-p) 1112(defun byte-compile-fdefinition (name macro-p)
1107 (let* ((list (if macro-p 1113 (let* ((list (if macro-p
1108 byte-compile-macro-environment 1114 byte-compile-macro-environment
@@ -1168,7 +1174,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
1168(defun byte-compile-callargs-warn (form) 1174(defun byte-compile-callargs-warn (form)
1169 (let* ((def (or (byte-compile-fdefinition (car form) nil) 1175 (let* ((def (or (byte-compile-fdefinition (car form) nil)
1170 (byte-compile-fdefinition (car form) t))) 1176 (byte-compile-fdefinition (car form) t)))
1171 (sig (if def 1177 (sig (if (and def (not (eq def t)))
1172 (byte-compile-arglist-signature 1178 (byte-compile-arglist-signature
1173 (if (eq 'lambda (car-safe def)) 1179 (if (eq 'lambda (car-safe def))
1174 (nth 1 def) 1180 (nth 1 def)
@@ -1198,7 +1204,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
1198 (byte-compile-format-warn form) 1204 (byte-compile-format-warn form)
1199 ;; Check to see if the function will be available at runtime 1205 ;; Check to see if the function will be available at runtime
1200 ;; and/or remember its arity if it's unknown. 1206 ;; and/or remember its arity if it's unknown.
1201 (or (and (or sig (fboundp (car form))) ; might be a subr or autoload. 1207 (or (and (or def (fboundp (car form))) ; might be a subr or autoload.
1202 (not (memq (car form) byte-compile-noruntime-functions))) 1208 (not (memq (car form) byte-compile-noruntime-functions)))
1203 (eq (car form) byte-compile-current-form) ; ## this doesn't work 1209 (eq (car form) byte-compile-current-form) ; ## this doesn't work
1204 ; with recursion. 1210 ; with recursion.
@@ -1209,9 +1215,8 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
1209 (if cons 1215 (if cons
1210 (or (memq n (cdr cons)) 1216 (or (memq n (cdr cons))
1211 (setcdr cons (cons n (cdr cons)))) 1217 (setcdr cons (cons n (cdr cons))))
1212 (setq byte-compile-unresolved-functions 1218 (push (list (car form) n)
1213 (cons (list (car form) n) 1219 byte-compile-unresolved-functions))))))
1214 byte-compile-unresolved-functions)))))))
1215 1220
1216(defun byte-compile-format-warn (form) 1221(defun byte-compile-format-warn (form)
1217 "Warn if FORM is `format'-like with inconsistent args. 1222 "Warn if FORM is `format'-like with inconsistent args.
@@ -1243,7 +1248,7 @@ extra args."
1243;; number of arguments. 1248;; number of arguments.
1244(defun byte-compile-arglist-warn (form macrop) 1249(defun byte-compile-arglist-warn (form macrop)
1245 (let ((old (byte-compile-fdefinition (nth 1 form) macrop))) 1250 (let ((old (byte-compile-fdefinition (nth 1 form) macrop)))
1246 (if old 1251 (if (and old (not (eq old t)))
1247 (let ((sig1 (byte-compile-arglist-signature 1252 (let ((sig1 (byte-compile-arglist-signature
1248 (if (eq 'lambda (car-safe old)) 1253 (if (eq 'lambda (car-safe old))
1249 (nth 1 old) 1254 (nth 1 old)
@@ -2123,9 +2128,9 @@ list that represents a doc string reference.
2123 (eq (car (nth 1 form)) 'quote) 2128 (eq (car (nth 1 form)) 'quote)
2124 (consp (cdr (nth 1 form))) 2129 (consp (cdr (nth 1 form)))
2125 (symbolp (nth 1 (nth 1 form)))) 2130 (symbolp (nth 1 (nth 1 form))))
2126 (add-to-list 'byte-compile-function-environment 2131 (push (cons (nth 1 (nth 1 form))
2127 (cons (nth 1 (nth 1 form)) 2132 (cons 'autoload (cdr (cdr form))))
2128 (cons 'autoload (cdr (cdr form)))))) 2133 byte-compile-function-environment))
2129 (if (stringp (nth 3 form)) 2134 (if (stringp (nth 3 form))
2130 form 2135 form
2131 ;; No doc string, so we can compile this as a normal form. 2136 ;; No doc string, so we can compile this as a normal form.
@@ -3610,7 +3615,6 @@ being undefined will be suppressed."
3610(byte-defop-compiler-1 defconst byte-compile-defvar) 3615(byte-defop-compiler-1 defconst byte-compile-defvar)
3611(byte-defop-compiler-1 autoload) 3616(byte-defop-compiler-1 autoload)
3612(byte-defop-compiler-1 lambda byte-compile-lambda-form) 3617(byte-defop-compiler-1 lambda byte-compile-lambda-form)
3613(byte-defop-compiler-1 defalias)
3614 3618
3615(defun byte-compile-defun (form) 3619(defun byte-compile-defun (form)
3616 ;; This is not used for file-level defuns with doc strings. 3620 ;; This is not used for file-level defuns with doc strings.
@@ -3712,22 +3716,22 @@ being undefined will be suppressed."
3712 (error "`lambda' used as function name is invalid")) 3716 (error "`lambda' used as function name is invalid"))
3713 3717
3714;; Compile normally, but deal with warnings for the function being defined. 3718;; Compile normally, but deal with warnings for the function being defined.
3715(defun byte-compile-defalias (form) 3719(put 'defalias 'byte-hunk-handler 'byte-compile-file-form-defalias)
3720(defun byte-compile-file-form-defalias (form)
3716 (if (and (consp (cdr form)) (consp (nth 1 form)) 3721 (if (and (consp (cdr form)) (consp (nth 1 form))
3717 (eq (car (nth 1 form)) 'quote) 3722 (eq (car (nth 1 form)) 'quote)
3718 (consp (cdr (nth 1 form))) 3723 (consp (cdr (nth 1 form)))
3719 (symbolp (nth 1 (nth 1 form))) 3724 (symbolp (nth 1 (nth 1 form))))
3720 (consp (nthcdr 2 form)) 3725 (let ((constant
3721 (consp (nth 2 form)) 3726 (and (consp (nthcdr 2 form))
3722 (eq (car (nth 2 form)) 'quote) 3727 (consp (nth 2 form))
3723 (consp (cdr (nth 2 form))) 3728 (eq (car (nth 2 form)) 'quote)
3724 (symbolp (nth 1 (nth 2 form)))) 3729 (consp (cdr (nth 2 form)))
3725 (progn 3730 (symbolp (nth 1 (nth 2 form))))))
3726 (byte-compile-defalias-warn (nth 1 (nth 1 form))) 3731 (byte-compile-defalias-warn (nth 1 (nth 1 form)))
3727 (setq byte-compile-function-environment 3732 (push (cons (nth 1 (nth 1 form))
3728 (cons (cons (nth 1 (nth 1 form)) 3733 (if constant (nth 1 (nth 2 form)) t))
3729 (nth 1 (nth 2 form))) 3734 byte-compile-function-environment)))
3730 byte-compile-function-environment))))
3731 (byte-compile-normal-call form)) 3735 (byte-compile-normal-call form))
3732 3736
3733;; Turn off warnings about prior calls to the function being defalias'd. 3737;; Turn off warnings about prior calls to the function being defalias'd.
@@ -3930,7 +3934,7 @@ invoked interactively."
3930 (while rest 3934 (while rest
3931 (or (nth 1 (car rest)) 3935 (or (nth 1 (car rest))
3932 (null (setq f (car (car rest)))) 3936 (null (setq f (car (car rest))))
3933 (byte-compile-fdefinition f t) 3937 (functionp (byte-compile-fdefinition f t))
3934 (commandp (byte-compile-fdefinition f nil)) 3938 (commandp (byte-compile-fdefinition f nil))
3935 (setq uncalled (cons f uncalled))) 3939 (setq uncalled (cons f uncalled)))
3936 (setq rest (cdr rest))) 3940 (setq rest (cdr rest)))
@@ -4112,5 +4116,5 @@ For example, invoke `emacs -batch -f batch-byte-recompile-directory .'."
4112 4116
4113(run-hooks 'bytecomp-load-hook) 4117(run-hooks 'bytecomp-load-hook)
4114 4118
4115;;; arch-tag: 9c97b0f0-8745-4571-bfc3-8dceb677292a 4119;; arch-tag: 9c97b0f0-8745-4571-bfc3-8dceb677292a
4116;;; bytecomp.el ends here 4120;;; bytecomp.el ends here
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index e039b80aee5..b0f3b9b9d3e 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -42,25 +42,7 @@ menus, turn this variable off, otherwise it is probably better to keep it on."
42 :version "20.3") 42 :version "20.3")
43 43
44(defsubst easy-menu-intern (s) 44(defsubst easy-menu-intern (s)
45 (if (stringp s) 45 (if (stringp s) (intern s) s))
46 (let ((copy (copy-sequence s))
47 (pos 0)
48 found)
49 ;; For each letter that starts a word, flip its case.
50 ;; This way, the usual convention for menu strings (capitalized)
51 ;; corresponds to the usual convention for menu item event types
52 ;; (all lower case). It's a 1-1 mapping so causes no conflicts.
53 (while (setq found (string-match "\\<\\sw" copy pos))
54 (setq pos (match-end 0))
55 (unless (= (upcase (aref copy found))
56 (downcase (aref copy found)))
57 (aset copy found
58 (if (= (upcase (aref copy found))
59 (aref copy found))
60 (downcase (aref copy found))
61 (upcase (aref copy found))))))
62 (intern copy))
63 s))
64 46
65;;;###autoload 47;;;###autoload
66(put 'easy-menu-define 'lisp-indent-function 'defun) 48(put 'easy-menu-define 'lisp-indent-function 'defun)
@@ -242,9 +224,9 @@ possibly preceded by keyword pairs as described in `easy-menu-define'."
242 (setq visible (or arg ''nil))))) 224 (setq visible (or arg ''nil)))))
243 (if (equal visible ''nil) 225 (if (equal visible ''nil)
244 nil ; Invisible menu entry, return nil. 226 nil ; Invisible menu entry, return nil.
245 (if (and visible (not (easy-menu-always-true visible))) 227 (if (and visible (not (easy-menu-always-true-p visible)))
246 (setq prop (cons :visible (cons visible prop)))) 228 (setq prop (cons :visible (cons visible prop))))
247 (if (and enable (not (easy-menu-always-true enable))) 229 (if (and enable (not (easy-menu-always-true-p enable)))
248 (setq prop (cons :enable (cons enable prop)))) 230 (setq prop (cons :enable (cons enable prop))))
249 (if filter (setq prop (cons :filter (cons filter prop)))) 231 (if filter (setq prop (cons :filter (cons filter prop))))
250 (if help (setq prop (cons :help (cons help prop)))) 232 (if help (setq prop (cons :help (cons help prop))))
@@ -363,12 +345,12 @@ ITEM defines an item as in `easy-menu-define'."
363 (cons cmd keys)))) 345 (cons cmd keys))))
364 (setq cache-specified nil)) 346 (setq cache-specified nil))
365 (if keys (setq prop (cons :keys (cons keys prop))))) 347 (if keys (setq prop (cons :keys (cons keys prop)))))
366 (if (and visible (not (easy-menu-always-true visible))) 348 (if (and visible (not (easy-menu-always-true-p visible)))
367 (if (equal visible ''nil) 349 (if (equal visible ''nil)
368 ;; Invisible menu item. Don't insert into keymap. 350 ;; Invisible menu item. Don't insert into keymap.
369 (setq remove t) 351 (setq remove t)
370 (setq prop (cons :visible (cons visible prop))))))) 352 (setq prop (cons :visible (cons visible prop)))))))
371 (if (and active (not (easy-menu-always-true active))) 353 (if (and active (not (easy-menu-always-true-p active)))
372 (setq prop (cons :enable (cons active prop)))) 354 (setq prop (cons :enable (cons active prop))))
373 (if (and (or no-name cache-specified) 355 (if (and (or no-name cache-specified)
374 (or (null cache) (stringp cache) (vectorp cache))) 356 (or (null cache) (stringp cache) (vectorp cache)))
@@ -396,6 +378,7 @@ otherwise put the new binding last in MENU.
396BEFORE can be either a string (menu item name) or a symbol 378BEFORE can be either a string (menu item name) or a symbol
397\(the fake function key for the menu item). 379\(the fake function key for the menu item).
398KEY does not have to be a symbol, and comparison is done with equal." 380KEY does not have to be a symbol, and comparison is done with equal."
381 (if (symbolp menu) (setq menu (indirect-function menu)))
399 (let ((inserted (null item)) ; Fake already inserted. 382 (let ((inserted (null item)) ; Fake already inserted.
400 tail done) 383 tail done)
401 (while (not done) 384 (while (not done)
@@ -426,7 +409,8 @@ KEY does not have to be a symbol, and comparison is done with equal."
426 409
427(defun easy-menu-name-match (name item) 410(defun easy-menu-name-match (name item)
428 "Return t if NAME is the name of menu item ITEM. 411 "Return t if NAME is the name of menu item ITEM.
429NAME can be either a string, or a symbol." 412NAME can be either a string, or a symbol.
413ITEM should be a keymap binding of the form (KEY . MENU-ITEM)."
430 (if (consp item) 414 (if (consp item)
431 (if (symbolp name) 415 (if (symbolp name)
432 (eq (car-safe item) name) 416 (eq (car-safe item) name)
@@ -436,10 +420,9 @@ NAME can be either a string, or a symbol."
436 (error nil)) ;`item' might not be a proper list. 420 (error nil)) ;`item' might not be a proper list.
437 ;; Also check the string version of the symbol name, 421 ;; Also check the string version of the symbol name,
438 ;; for backwards compatibility. 422 ;; for backwards compatibility.
439 (eq (car-safe item) (intern name)) 423 (eq (car-safe item) (intern name)))))))
440 (eq (car-safe item) (easy-menu-intern name)))))))
441 424
442(defun easy-menu-always-true (x) 425(defun easy-menu-always-true-p (x)
443 "Return true if form X never evaluates to nil." 426 "Return true if form X never evaluates to nil."
444 (if (consp x) (and (eq (car x) 'quote) (cadr x)) 427 (if (consp x) (and (eq (car x) 'quote) (cadr x))
445 (or (eq x t) (not (symbolp x))))) 428 (or (eq x t) (not (symbolp x)))))
@@ -540,15 +523,10 @@ earlier by `easy-menu-define' or `easy-menu-create-menu'."
540 (easy-menu-define-key map (easy-menu-intern (car item)) 523 (easy-menu-define-key map (easy-menu-intern (car item))
541 (cdr item) before) 524 (cdr item) before)
542 (if (or (keymapp item) 525 (if (or (keymapp item)
543 (and (symbolp item) (keymapp (symbol-value item)))) 526 (and (symbolp item) (keymapp (symbol-value item))
527 (setq item (symbol-value item))))
544 ;; Item is a keymap, find the prompt string and use as item name. 528 ;; Item is a keymap, find the prompt string and use as item name.
545 (let ((tail (easy-menu-get-map item nil)) name) 529 (setq item (cons (keymap-prompt item) item)))
546 (if (not (keymapp item)) (setq item tail))
547 (while (and (null name) (consp (setq tail (cdr tail)))
548 (not (keymapp tail)))
549 (if (stringp (car tail)) (setq name (car tail)) ; Got a name.
550 (setq tail (cdr tail))))
551 (setq item (cons name item))))
552 (easy-menu-do-add-item map item before))) 530 (easy-menu-do-add-item map item before)))
553 531
554(defun easy-menu-item-present-p (map path name) 532(defun easy-menu-item-present-p (map path name)
@@ -591,10 +569,24 @@ If item is an old format item, a new format item is returned."
591 (cons name item)) ; Keymap or new menu format 569 (cons name item)) ; Keymap or new menu format
592 ))) 570 )))
593 571
594(defun easy-menu-get-map-look-for-name (name submap) 572(defun easy-menu-lookup-name (map name)
595 (while (and submap (not (easy-menu-name-match name (car submap)))) 573 "Lookup menu item NAME in keymap MAP.
596 (setq submap (cdr submap))) 574Like `lookup-key' except that NAME is not an array but just a single key
597 submap) 575and that NAME can be a string representing the menu item's name."
576 (or (lookup-key map (vector (easy-menu-intern name)))
577 (when (stringp name)
578 ;; `lookup-key' failed and we have a menu item name: look at the
579 ;; actual menu entries's names.
580 (catch 'found
581 (map-keymap (lambda (key item)
582 (if (condition-case nil (member name item)
583 (error nil))
584 ;; Found it!! Look for it again with
585 ;; `lookup-key' so as to handle inheritance and
586 ;; to extract the actual command/keymap bound to
587 ;; `name' from the item (via get_keyelt).
588 (throw 'found (lookup-key map (vector key)))))
589 map)))))
598 590
599(defun easy-menu-get-map (map path &optional to-modify) 591(defun easy-menu-get-map (map path &optional to-modify)
600 "Return a sparse keymap in which to add or remove an item. 592 "Return a sparse keymap in which to add or remove an item.
@@ -605,34 +597,34 @@ wants to modify in the map that we return.
605In some cases we use that to select between the local and global maps." 597In some cases we use that to select between the local and global maps."
606 (setq map 598 (setq map
607 (catch 'found 599 (catch 'found
608 (let* ((key (vconcat (unless map '(menu-bar)) 600 (if (and map (symbolp map) (not (keymapp map)))
609 (mapcar 'easy-menu-intern path))) 601 (setq map (symbol-value map)))
610 (maps (mapcar (lambda (map) 602 (let ((maps (if map (list map) (current-active-maps))))
611 (setq map (lookup-key map key)) 603 ;; Look for PATH in each map.
612 (while (and (symbolp map) (keymapp map)) 604 (unless map (push 'menu-bar path))
613 (setq map (symbol-function map))) 605 (dolist (name path)
614 map) 606 (setq maps
615 (if map 607 (delq nil (mapcar (lambda (map)
616 (list (if (and (symbolp map) 608 (setq map (easy-menu-lookup-name
617 (not (keymapp map))) 609 map name))
618 (symbol-value map) map)) 610 (and (keymapp map) map))
619 (current-active-maps))))) 611 maps))))
612
620 ;; Prefer a map that already contains the to-be-modified entry. 613 ;; Prefer a map that already contains the to-be-modified entry.
621 (when to-modify 614 (when to-modify
622 (dolist (map maps) 615 (dolist (map maps)
623 (when (and (keymapp map) 616 (when (easy-menu-lookup-name map to-modify)
624 (easy-menu-get-map-look-for-name to-modify map))
625 (throw 'found map)))) 617 (throw 'found map))))
626 ;; Use the first valid map. 618 ;; Use the first valid map.
627 (dolist (map maps) 619 (when maps (throw 'found (car maps)))
628 (when (keymapp map) 620
629 (throw 'found map)))
630 ;; Otherwise, make one up. 621 ;; Otherwise, make one up.
631 ;; Hardcoding current-local-map is lame, but it's difficult 622 ;; Hardcoding current-local-map is lame, but it's difficult
632 ;; to know what the caller intended for us to do ;-( 623 ;; to know what the caller intended for us to do ;-(
633 (let* ((name (if path (format "%s" (car (reverse path))))) 624 (let* ((name (if path (format "%s" (car (reverse path)))))
634 (newmap (make-sparse-keymap name))) 625 (newmap (make-sparse-keymap name)))
635 (define-key (or map (current-local-map)) key 626 (define-key (or map (current-local-map))
627 (apply 'vector (mapcar 'easy-menu-intern path))
636 (if name (cons name newmap) newmap)) 628 (if name (cons name newmap) newmap))
637 newmap)))) 629 newmap))))
638 (or (keymapp map) (error "Malformed menu in easy-menu: (%s)" map)) 630 (or (keymapp map) (error "Malformed menu in easy-menu: (%s)" map))
@@ -640,5 +632,5 @@ In some cases we use that to select between the local and global maps."
640 632
641(provide 'easymenu) 633(provide 'easymenu)
642 634
643;;; arch-tag: 2a04020d-90d2-476d-a7c6-71e072007a4a 635;; arch-tag: 2a04020d-90d2-476d-a7c6-71e072007a4a
644;;; easymenu.el ends here 636;;; easymenu.el ends here
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 9a7b9efc333..0a6e3fed349 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -714,8 +714,10 @@ already is one.)"
714 (if (and (eq (following-char) ?.) 714 (if (and (eq (following-char) ?.)
715 (save-excursion 715 (save-excursion
716 (forward-char 1) 716 (forward-char 1)
717 (and (>= (following-char) ?0) 717 (or (and (eq (aref edebug-read-syntax-table (following-char))
718 (<= (following-char) ?9)))) 718 'symbol)
719 (not (= (following-char) ?\;)))
720 (memq (following-char) '(?\, ?\.)))))
719 'symbol 721 'symbol
720 (aref edebug-read-syntax-table (following-char)))) 722 (aref edebug-read-syntax-table (following-char))))
721 723
diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el
index d701db9e9b6..82ce6f404f7 100644
--- a/lisp/emacs-lisp/elp.el
+++ b/lisp/emacs-lisp/elp.el
@@ -564,7 +564,6 @@ displayed."
564 (generate-new-buffer elp-results-buffer)))) 564 (generate-new-buffer elp-results-buffer))))
565 (set-buffer resultsbuf) 565 (set-buffer resultsbuf)
566 (erase-buffer) 566 (erase-buffer)
567 (beginning-of-buffer)
568 ;; get the length of the longest function name being profiled 567 ;; get the length of the longest function name being profiled
569 (let* ((longest 0) 568 (let* ((longest 0)
570 (title "Function Name") 569 (title "Function Name")
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index fefa340f2b3..cbee9fd626e 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -946,10 +946,11 @@ With a prefix argument, narrows region to last command output."
946 (eshell-bol) 946 (eshell-bol)
947 (kill-region (point) here)))) 947 (kill-region (point) here))))
948 948
949(defun eshell-show-maximum-output () 949(defun eshell-show-maximum-output (&optional interactive)
950 "Put the end of the buffer at the bottom of the window." 950 "Put the end of the buffer at the bottom of the window.
951 (interactive) 951When run interactively, widen the buffer first."
952 (if (interactive-p) 952 (interactive "p")
953 (if interactive
953 (widen)) 954 (widen))
954 (goto-char (point-max)) 955 (goto-char (point-max))
955 (recenter -1)) 956 (recenter -1))
@@ -1005,7 +1006,7 @@ a key."
1005 (let ((pos (point))) 1006 (let ((pos (point)))
1006 (if (bobp) 1007 (if (bobp)
1007 (if (interactive-p) 1008 (if (interactive-p)
1008 (error "Buffer too short to truncate")) 1009 (message "Buffer too short to truncate"))
1009 (delete-region (point-min) (point)) 1010 (delete-region (point-min) (point))
1010 (if (interactive-p) 1011 (if (interactive-p)
1011 (message "Truncated buffer from %d to %d lines (%.1fk freed)" 1012 (message "Truncated buffer from %d to %d lines (%.1fk freed)"
diff --git a/lisp/files.el b/lisp/files.el
index 523a5a12f7b..f0203082c73 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -676,7 +676,7 @@ The truename of a file name is found by chasing symbolic links
676both at the level of the file and at the level of the directories 676both at the level of the file and at the level of the directories
677containing it, until no links are left at any level. 677containing it, until no links are left at any level.
678 678
679\(fn FILENAME)" 679\(fn FILENAME)" ;; Don't document the optional arguments.
680 ;; COUNTER and PREV-DIRS are only used in recursive calls. 680 ;; COUNTER and PREV-DIRS are only used in recursive calls.
681 ;; COUNTER can be a cons cell whose car is the count of how many 681 ;; COUNTER can be a cons cell whose car is the count of how many
682 ;; more links to chase before getting an error. 682 ;; more links to chase before getting an error.
@@ -1751,6 +1751,30 @@ in that case, this function acts as if `enable-local-variables' were t."
1751 ("BROWSE\\'" . ebrowse-tree-mode) 1751 ("BROWSE\\'" . ebrowse-tree-mode)
1752 ("\\.ebrowse\\'" . ebrowse-tree-mode) 1752 ("\\.ebrowse\\'" . ebrowse-tree-mode)
1753 ("#\\*mail\\*" . mail-mode) 1753 ("#\\*mail\\*" . mail-mode)
1754 ("\\.g\\'" . antlr-mode)
1755 ("\\.ses\\'" . ses-mode)
1756 ("\\.\\(soa\\|zone\\)\\'" . dns-mode)
1757 ("\\.docbook\\'" . sgml-mode)
1758 ("/config\\.\\(?:bat\\|log\\)\\'" . fundamental-mode)
1759 ;; Windows candidates may be opened case sensitively on Unix
1760 ("\\.\\(?:[iI][nN][iI]\\|[lL][sS][tT]\\|[rR][eE][gG]\\|[sS][yY][sS]\\)\\'" . conf-mode)
1761 ("\\.\\(?:desktop\\|la\\)\\'" . conf-unix-mode)
1762 ("java.+\\.conf\\'" . conf-javaprop-mode)
1763 ("\\.properties\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-javaprop-mode)
1764 ;; *.cf, *.cfg, *.conf, *.config[.local|.de_DE.UTF8|...], */config
1765 ("[/.]c\\(?:on\\)?f\\(?:i?g\\)?\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-mode)
1766 ("\\`/etc/\\(?:DIR_COLORS\\|ethers\\|.?fstab\\|.*hosts\\|lesskey\\|login\\.?de\\(?:fs\\|vperm\\)\\|magic\\|mtab\\|permissions\\|protocols\\|rpc\\|services\\)\\'" . conf-space-mode)
1767 ("\\`/etc/\\(?:aliases\\|hosts\\..+\\|ksysguarddrc\\|opera6rc\\)\\'" . conf-mode)
1768 ;; either user's dot-files or under /etc or some such
1769 ("/\\.?\\(?:gnokiirc\\|kde.*rc\\|mime\\.types\\|wgetrc\\)\\'" . conf-mode)
1770 ;; alas not all ~/.*rc files are like this
1771 ("/\\.\\(?:enigma\\|gltron\\|hxplayer\\|net\\|neverball\\|qt/.+\\|realplayer\\|scummvm\\|sversion\\|sylpheed/.+\\|xmp\\)rc\\'" . conf-mode)
1772 ("/\\.\\(?:gdbtkinit\\|grip\\|orbital/.+txt\\|rhosts\\|tuxracer/options\\)\\'" . conf-mode)
1773 ("/\\.?X\\(?:default\\|resource\\|re\\)s\\>" . conf-xdefaults-mode)
1774 ("/X11.+app-defaults/" . conf-xdefaults-mode)
1775 ("/X11.+locale/.+/Compose\\'" . conf-colon-mode)
1776 ;; this contains everything twice, with space and with colon :-(
1777 ("/X11.+locale/compose\\.dir\\'" . conf-javaprop-mode)
1754 ;; Get rid of any trailing .n.m and try again. 1778 ;; Get rid of any trailing .n.m and try again.
1755 ;; This is for files saved by cvs-merge that look like .#<file>.<rev> 1779 ;; This is for files saved by cvs-merge that look like .#<file>.<rev>
1756 ;; or .#<file>.<rev>-<rev> or VC's <file>.~<rev>~. 1780 ;; or .#<file>.<rev>-<rev> or VC's <file>.~<rev>~.
@@ -1761,11 +1785,7 @@ in that case, this function acts as if `enable-local-variables' were t."
1761 ;; for the sake of ChangeLog.1, etc. 1785 ;; for the sake of ChangeLog.1, etc.
1762 ;; and after the .scm.[0-9] and CVS' <file>.<rev> patterns too. 1786 ;; and after the .scm.[0-9] and CVS' <file>.<rev> patterns too.
1763 ("\\.[1-9]\\'" . nroff-mode) 1787 ("\\.[1-9]\\'" . nroff-mode)
1764 ("\\.g\\'" . antlr-mode) 1788 ("\\.\\(?:orig\\|in\\|[bB][aA][kK]\\)\\'" nil t)))
1765 ("\\.ses\\'" . ses-mode)
1766 ("\\.orig\\'" nil t) ; from patch
1767 ("\\.\\(soa\\|zone\\)\\'" . dns-mode)
1768 ("\\.in\\'" nil t)))
1769 "Alist of filename patterns vs corresponding major mode functions. 1789 "Alist of filename patterns vs corresponding major mode functions.
1770Each element looks like (REGEXP . FUNCTION) or (REGEXP FUNCTION NON-NIL). 1790Each element looks like (REGEXP . FUNCTION) or (REGEXP FUNCTION NON-NIL).
1771\(NON-NIL stands for anything that is not nil; the value does not matter.) 1791\(NON-NIL stands for anything that is not nil; the value does not matter.)
@@ -1846,26 +1866,32 @@ regular expression. The mode is then determined as the mode associated
1846with that interpreter in `interpreter-mode-alist'.") 1866with that interpreter in `interpreter-mode-alist'.")
1847 1867
1848(defvar magic-mode-alist 1868(defvar magic-mode-alist
1849 '(;; The < comes before the groups (but the first) to reduce backtracking. 1869 `(;; The < comes before the groups (but the first) to reduce backtracking.
1850 ;; Is there a nicer way of getting . including \n?
1851 ;; TODO: UTF-16 <?xml may be preceded by a BOM 0xff 0xfe or 0xfe 0xff. 1870 ;; TODO: UTF-16 <?xml may be preceded by a BOM 0xff 0xfe or 0xfe 0xff.
1852 ("\\(?:<\\?xml\\s +[^>]*>\\)?\\s *<\\(?:!--\\(?:.\\|\n\\)*?-->\\s *<\\)*\\(?:!DOCTYPE\\s +[^>]*>\\s *<\\)?\\s *\\(?:!--\\(?:.\\|\n\\)*?-->\\s *<\\)*[Hh][Tt][Mm][Ll]" . html-mode) 1871 (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")
1872 (comment-re (concat "\\(?:!--" incomment-re "*-->\\s *<\\)")))
1873 (concat "\\(?:<\\?xml\\s +[^>]*>\\)?\\s *<"
1874 comment-re "*"
1875 "\\(?:!DOCTYPE\\s +[^>]*>\\s *<\\s *" comment-re "*\\)?"
1876 "[Hh][Tt][Mm][Ll]")) . html-mode)
1853 ;; These two must come after html, because they are more general: 1877 ;; These two must come after html, because they are more general:
1854 ("<\\?xml " . xml-mode) 1878 ("<\\?xml " . xml-mode)
1855 ("\\s *<\\(?:!--\\(?:.\\|\n\\)*?-->\\s *<\\)*!DOCTYPE " . sgml-mode) 1879 (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")
1856 ("%![^V]" . ps-mode)) 1880 (comment-re (concat "\\(?:!--" incomment-re "*-->\\s *<\\)")))
1857 "Alist of buffer beginnings vs corresponding major mode functions. 1881 (concat "\\s *<" comment-re "*!DOCTYPE ")) . sgml-mode)
1882 ("%![^V]" . ps-mode)
1883 ("# xmcd " . conf-unix-mode))
1884 "Alist of buffer beginnings vs. corresponding major mode functions.
1858Each element looks like (REGEXP . FUNCTION). FUNCTION will be 1885Each element looks like (REGEXP . FUNCTION). FUNCTION will be
1859called, unless it is nil.") 1886called, unless it is nil (to allow `auto-mode-alist' to override).")
1860 1887
1861(defun set-auto-mode (&optional keep-mode-if-same) 1888(defun set-auto-mode (&optional keep-mode-if-same)
1862 "Select major mode appropriate for current buffer. 1889 "Select major mode appropriate for current buffer.
1863 1890
1864This checks for a -*- mode tag in the buffer's text, checks the 1891This checks for a -*- mode tag in the buffer's text, checks the
1865interpreter that runs this file against `interpreter-mode-alist', 1892interpreter that runs this file against `interpreter-mode-alist',
1866compares the buffer beginning against `magic-mode-alist', 1893compares the buffer beginning against `magic-mode-alist', or
1867or compares the filename against the entries in 1894compares the filename against the entries in `auto-mode-alist'.
1868`auto-mode-alist'.
1869 1895
1870It does not check for the `mode:' local variable in the 1896It does not check for the `mode:' local variable in the
1871Local Variables section of the file; for that, use `hack-local-variables'. 1897Local Variables section of the file; for that, use `hack-local-variables'.
@@ -1876,13 +1902,11 @@ If `enable-local-variables' is nil, this function does not check for a
1876If the optional argument KEEP-MODE-IF-SAME is non-nil, then we 1902If the optional argument KEEP-MODE-IF-SAME is non-nil, then we
1877only set the major mode, if that would change it." 1903only set the major mode, if that would change it."
1878 ;; Look for -*-MODENAME-*- or -*- ... mode: MODENAME; ... -*- 1904 ;; Look for -*-MODENAME-*- or -*- ... mode: MODENAME; ... -*-
1879 (let (end done mode modes xml) 1905 (let (end done mode modes)
1880 ;; Find a -*- mode tag 1906 ;; Find a -*- mode tag
1881 (save-excursion 1907 (save-excursion
1882 (goto-char (point-min)) 1908 (goto-char (point-min))
1883 (skip-chars-forward " \t\n") 1909 (skip-chars-forward " \t\n")
1884 ;; While we're at this point, check xml for later.
1885 (setq xml (looking-at "<\\?xml \\|<!DOCTYPE"))
1886 (and enable-local-variables 1910 (and enable-local-variables
1887 (setq end (set-auto-mode-1)) 1911 (setq end (set-auto-mode-1))
1888 (if (save-excursion (search-forward ":" end t)) 1912 (if (save-excursion (search-forward ":" end t))
@@ -1912,6 +1936,7 @@ only set the major mode, if that would change it."
1912 (message "Ignoring unknown mode `%s'" mode) 1936 (message "Ignoring unknown mode `%s'" mode)
1913 (setq done t) 1937 (setq done t)
1914 (or (set-auto-mode-0 mode keep-mode-if-same) 1938 (or (set-auto-mode-0 mode keep-mode-if-same)
1939 ;; continuing would call minor modes again, toggling them off
1915 (throw 'nop nil))))) 1940 (throw 'nop nil)))))
1916 ;; If we didn't, look for an interpreter specified in the first line. 1941 ;; If we didn't, look for an interpreter specified in the first line.
1917 ;; As a special case, allow for things like "#!/bin/env perl", which 1942 ;; As a special case, allow for things like "#!/bin/env perl", which
@@ -1924,16 +1949,19 @@ only set the major mode, if that would change it."
1924 ;; Map interpreter name to a mode, signalling we're done at the 1949 ;; Map interpreter name to a mode, signalling we're done at the
1925 ;; same time. 1950 ;; same time.
1926 done (assoc (file-name-nondirectory mode) 1951 done (assoc (file-name-nondirectory mode)
1927 interpreter-mode-alist))) 1952 interpreter-mode-alist))
1928 ;; If we found an interpreter mode to use, invoke it now. 1953 ;; If we found an interpreter mode to use, invoke it now.
1929 (if done 1954 (if done
1930 (set-auto-mode-0 (cdr done) keep-mode-if-same) 1955 (set-auto-mode-0 (cdr done) keep-mode-if-same)))
1956 ;; If we didn't, match the buffer beginning against magic-mode-alist.
1957 (unless done
1931 (if (setq done (save-excursion 1958 (if (setq done (save-excursion
1932 (goto-char (point-min)) 1959 (goto-char (point-min))
1933 (assoc-default nil magic-mode-alist 1960 (assoc-default nil magic-mode-alist
1934 (lambda (re dummy) 1961 (lambda (re dummy)
1935 (looking-at re))))) 1962 (looking-at re)))))
1936 (set-auto-mode-0 done keep-mode-if-same) 1963 (set-auto-mode-0 done keep-mode-if-same)
1964 ;; Compare the filename against the entries in auto-mode-alist.
1937 (if buffer-file-name 1965 (if buffer-file-name
1938 (let ((name buffer-file-name)) 1966 (let ((name buffer-file-name))
1939 ;; Remove backup-suffixes from file name. 1967 ;; Remove backup-suffixes from file name.
@@ -1943,7 +1971,7 @@ only set the major mode, if that would change it."
1943 (let ((case-fold-search 1971 (let ((case-fold-search
1944 (memq system-type '(vax-vms windows-nt cygwin)))) 1972 (memq system-type '(vax-vms windows-nt cygwin))))
1945 (if (and (setq mode (assoc-default name auto-mode-alist 1973 (if (and (setq mode (assoc-default name auto-mode-alist
1946 'string-match)) 1974 'string-match))
1947 (consp mode) 1975 (consp mode)
1948 (cadr mode)) 1976 (cadr mode))
1949 (setq mode (car mode) 1977 (setq mode (car mode)
@@ -1952,7 +1980,6 @@ only set the major mode, if that would change it."
1952 (when mode 1980 (when mode
1953 (set-auto-mode-0 mode keep-mode-if-same))))))))) 1981 (set-auto-mode-0 mode keep-mode-if-same)))))))))
1954 1982
1955
1956;; When `keep-mode-if-same' is set, we are working on behalf of 1983;; When `keep-mode-if-same' is set, we are working on behalf of
1957;; set-visited-file-name. In that case, if the major mode specified is the 1984;; set-visited-file-name. In that case, if the major mode specified is the
1958;; same one we already have, don't actually reset it. We don't want to lose 1985;; same one we already have, don't actually reset it. We don't want to lose
@@ -1971,7 +1998,6 @@ same, do nothing and return nil."
1971 (funcall mode) 1998 (funcall mode)
1972 mode)) 1999 mode))
1973 2000
1974
1975(defun set-auto-mode-1 () 2001(defun set-auto-mode-1 ()
1976 "Find the -*- spec in the buffer. 2002 "Find the -*- spec in the buffer.
1977Call with point at the place to start searching from. 2003Call with point at the place to start searching from.
diff --git a/lisp/filesets.el b/lisp/filesets.el
index cd42be63738..8599cb01d93 100644
--- a/lisp/filesets.el
+++ b/lisp/filesets.el
@@ -295,7 +295,8 @@ key is supported."
295(defgroup filesets nil 295(defgroup filesets nil
296 "The fileset swapper." 296 "The fileset swapper."
297 :prefix "filesets-" 297 :prefix "filesets-"
298 :group 'convenience) 298 :group 'convenience
299 :version "21.4")
299 300
300(defcustom filesets-menu-name "Filesets" 301(defcustom filesets-menu-name "Filesets"
301 "*Filesets' menu name." 302 "*Filesets' menu name."
@@ -1355,7 +1356,7 @@ Use the viewer defined in EV-ENTRY (a valid element of
1355 (run-hooks 'oh)) 1356 (run-hooks 'oh))
1356 (set-buffer-modified-p nil) 1357 (set-buffer-modified-p nil)
1357 (setq buffer-read-only t) 1358 (setq buffer-read-only t)
1358 (beginning-of-buffer)) 1359 (goto-char (point-min)))
1359 (when oh 1360 (when oh
1360 (run-hooks 'oh)))) 1361 (run-hooks 'oh))))
1361 (filesets-error 'error 1362 (filesets-error 'error
@@ -1592,7 +1593,8 @@ SAVE-FUNCTION takes no argument, but works on the current buffer."
1592(defun filesets-cmd-show-result (cmd output) 1593(defun filesets-cmd-show-result (cmd output)
1593 "Show OUTPUT of CMD (a shell command)." 1594 "Show OUTPUT of CMD (a shell command)."
1594 (pop-to-buffer "*Filesets: Shell Command Output*") 1595 (pop-to-buffer "*Filesets: Shell Command Output*")
1595 (end-of-buffer) 1596 (with-no-warnings
1597 (end-of-buffer))
1596 (insert "*** ") 1598 (insert "*** ")
1597 (insert cmd) 1599 (insert cmd)
1598 (newline) 1600 (newline)
@@ -1637,7 +1639,7 @@ Replace <file-name> or <<file-name>> with filename."
1637 (save-restriction 1639 (save-restriction
1638 (let ((buffer (filesets-find-file this))) 1640 (let ((buffer (filesets-find-file this)))
1639 (when buffer 1641 (when buffer
1640 (beginning-of-buffer) 1642 (goto-char (point-min))
1641 (let () 1643 (let ()
1642 (cond 1644 (cond
1643 ((stringp fn) 1645 ((stringp fn)
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 2a2777d102b..3dae3fa686a 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1,7 +1,7 @@
1;;; font-lock.el --- Electric font lock mode 1;;; font-lock.el --- Electric font lock mode
2 2
3;; Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999, 2000, 2001, 02, 2003, 2004 3;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4;; Free Software Foundation, Inc. 4;; 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
5 5
6;; Author: jwz, then rms, then sm 6;; Author: jwz, then rms, then sm
7;; Maintainer: FSF 7;; Maintainer: FSF
@@ -1289,20 +1289,20 @@ START should be at the beginning of a line."
1289 (if loudly (message "Fontifying %s... (syntactically...)" (buffer-name))) 1289 (if loudly (message "Fontifying %s... (syntactically...)" (buffer-name)))
1290 (goto-char start) 1290 (goto-char start)
1291 ;; 1291 ;;
1292 ;; Find the state at the `beginning-of-line' before `start'. 1292 ;; Find the `start' state.
1293 (setq state (or ppss (syntax-ppss start))) 1293 (setq state (or ppss (syntax-ppss start)))
1294 ;; 1294 ;;
1295 ;; Find each interesting place between here and `end'. 1295 ;; Find each interesting place between here and `end'.
1296 (while 1296 (while
1297 (progn 1297 (progn
1298 (setq state (parse-partial-sexp (point) end nil nil state
1299 'syntax-table))
1298 (when (or (nth 3 state) (nth 4 state)) 1300 (when (or (nth 3 state) (nth 4 state))
1299 (setq face (funcall font-lock-syntactic-face-function state)) 1301 (setq face (funcall font-lock-syntactic-face-function state))
1300 (setq beg (max (nth 8 state) start)) 1302 (setq beg (max (nth 8 state) start))
1301 (setq state (parse-partial-sexp (point) end nil nil state 1303 (setq state (parse-partial-sexp (point) end nil nil state
1302 'syntax-table)) 1304 'syntax-table))
1303 (when face (put-text-property beg (point) 'face face))) 1305 (when face (put-text-property beg (point) 'face face)))
1304 (setq state (parse-partial-sexp (point) end nil nil state
1305 'syntax-table))
1306 (< (point) end))))) 1306 (< (point) end)))))
1307 1307
1308;;; End of Syntactic fontification functions. 1308;;; End of Syntactic fontification functions.
@@ -2004,5 +2004,5 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item."
2004 2004
2005(provide 'font-lock) 2005(provide 'font-lock)
2006 2006
2007;;; arch-tag: 682327e4-64d8-4057-b20b-1fbb9f1fc54c 2007;; arch-tag: 682327e4-64d8-4057-b20b-1fbb9f1fc54c
2008;;; font-lock.el ends here 2008;;; font-lock.el ends here
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 0b93724e9e5..b605875da89 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,23 @@
12004-11-10 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gnus-art.el (gnus-emphasis-alist): Don't hide asterisks by
4 default; improve customization type.
5 (gnus-emphasis-custom-with-format): New macro.
6 (gnus-emphasis-custom-value-to-external): New function.
7 (gnus-emphasis-custom-value-to-internal): New function.
8
92004-11-07 Katsumi Yamaoka <yamaoka@jpl.org>
10
11 * gnus-msg.el (gnus-configure-posting-styles): Don't cause the
12 "Args out of range" error. Reported by Arnaud Giersch
13 <arnaud.giersch@free.fr>.
14
152004-11-04 Richard M. Stallman <rms@gnu.org>
16
17 * spam.el (spam group): Add :version.
18
19 * pgg-def.el (pgg group): Add :version.
20
12004-11-04 Katsumi Yamaoka <yamaoka@jpl.org> 212004-11-04 Katsumi Yamaoka <yamaoka@jpl.org>
2 22
3 * gnus-art. (gnus-article-edit-article): Don't associate the 23 * gnus-art. (gnus-article-edit-article): Don't associate the
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index c0266300983..a87348188f9 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -321,27 +321,55 @@ advertisements. For example:
321 :version "21.4" 321 :version "21.4"
322 :group 'gnus-article-washing) 322 :group 'gnus-article-washing)
323 323
324(defmacro gnus-emphasis-custom-with-format (&rest body)
325 `(let ((format "\
326\\(\\s-\\|^\\|\\=\\|[-\"]\\|\\s(\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*[.,]?\\)%s\\)\
327\\(\\([-,.;:!?\"]\\|\\s)\\)+\\s-\\|[?!.]\\s-\\|\\s)\\|\\s-\\)"))
328 ,@body))
329
330(defun gnus-emphasis-custom-value-to-external (value)
331 (gnus-emphasis-custom-with-format
332 (if (consp (car value))
333 (list (format format (car (car value)) (cdr (car value)))
334 2
335 (if (nth 1 value) 2 3)
336 (nth 2 value))
337 value)))
338
339(defun gnus-emphasis-custom-value-to-internal (value)
340 (gnus-emphasis-custom-with-format
341 (let ((regexp (concat "\\`"
342 (format (regexp-quote format)
343 "\\([^()]+\\)" "\\([^()]+\\)")
344 "\\'"))
345 pattern)
346 (if (string-match regexp (setq pattern (car value)))
347 (list (cons (match-string 1 pattern) (match-string 2 pattern))
348 (= (nth 2 value) 2)
349 (nth 3 value))
350 value))))
351
324(defcustom gnus-emphasis-alist 352(defcustom gnus-emphasis-alist
325 (let ((format 353 (let ((types
326 "\\(\\s-\\|^\\|\\=\\|[-\"]\\|\\s(\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*[.,]?\\)%s\\)\\(\\([-,.;:!?\"]\\|\\s)\\)+\\s-\\|[?!.]\\s-\\|\\s)\\|\\s-\\)") 354 '(("\\*" "\\*" bold nil 2)
327 (types
328 '(("\\*" "\\*" bold)
329 ("_" "_" underline) 355 ("_" "_" underline)
330 ("/" "/" italic) 356 ("/" "/" italic)
331 ("_/" "/_" underline-italic) 357 ("_/" "/_" underline-italic)
332 ("_\\*" "\\*_" underline-bold) 358 ("_\\*" "\\*_" underline-bold)
333 ("\\*/" "/\\*" bold-italic) 359 ("\\*/" "/\\*" bold-italic)
334 ("_\\*/" "/\\*_" underline-bold-italic)))) 360 ("_\\*/" "/\\*_" underline-bold-italic))))
335 `(,@(mapcar 361 (nconc
336 (lambda (spec) 362 (gnus-emphasis-custom-with-format
337 (list 363 (mapcar (lambda (spec)
338 (format format (car spec) (cadr spec)) 364 (list (format format (car spec) (cadr spec))
339 2 3 (intern (format "gnus-emphasis-%s" (nth 2 spec))))) 365 (or (nth 3 spec) 2)
340 types) 366 (or (nth 4 spec) 3)
341 ("\\(\\s-\\|^\\)\\(-\\(\\(\\w\\|-[^-]\\)+\\)-\\)\\(\\s-\\|[?!.,;]\\)" 367 (intern (format "gnus-emphasis-%s" (nth 2 spec)))))
342 2 3 gnus-emphasis-strikethru) 368 types))
343 ("\\(\\s-\\|^\\)\\(_\\(\\(\\w\\|_[^_]\\)+\\)_\\)\\(\\s-\\|[?!.,;]\\)" 369 '(("\\(\\s-\\|^\\)\\(-\\(\\(\\w\\|-[^-]\\)+\\)-\\)\\(\\s-\\|[?!.,;]\\)"
344 2 3 gnus-emphasis-underline))) 370 2 3 gnus-emphasis-strikethru)
371 ("\\(\\s-\\|^\\)\\(_\\(\\(\\w\\|_[^_]\\)+\\)_\\)\\(\\s-\\|[?!.,;]\\)"
372 2 3 gnus-emphasis-underline))))
345 "*Alist that says how to fontify certain phrases. 373 "*Alist that says how to fontify certain phrases.
346Each item looks like this: 374Each item looks like this:
347 375
@@ -352,11 +380,43 @@ is a number that says what regular expression grouping used to find
352the entire emphasized word. The third is a number that says what 380the entire emphasized word. The third is a number that says what
353regexp grouping should be displayed and highlighted. The fourth 381regexp grouping should be displayed and highlighted. The fourth
354is the face used for highlighting." 382is the face used for highlighting."
355 :type '(repeat (list :value ("" 0 0 default) 383 :type
356 regexp 384 '(repeat
357 (integer :tag "Match group") 385 (menu-choice
358 (integer :tag "Emphasize group") 386 :format "%[Customizing Style%]\n%v"
359 face)) 387 :indent 2
388 (group :tag "Default"
389 :value ("" 0 0 default)
390 :value-create
391 (lambda (widget)
392 (let ((value (widget-get
393 (cadr (widget-get (widget-get widget :parent)
394 :args))
395 :value)))
396 (if (not (eq (nth 2 value) 'default))
397 (widget-put
398 widget
399 :value
400 (gnus-emphasis-custom-value-to-external value))))
401 (widget-group-value-create widget))
402 (regexp :format "%t: %v\n" :size 1)
403 (integer :format "Match group: %v\n" :size 0)
404 (integer :format "Emphasize group: %v\n" :size 0)
405 face)
406 (group :tag "Simple"
407 :value (("_" . "_") nil default)
408 (cons :format "%v"
409 (regexp :format "Start regexp: %v\n" :size 0)
410 (regexp :format "End regexp: %v\n" :size 0))
411 (boolean :format "Show start and end patterns: %[%v%]\n"
412 :on " On " :off " Off ")
413 face)))
414 :get (lambda (symbol)
415 (mapcar 'gnus-emphasis-custom-value-to-internal
416 (default-value symbol)))
417 :set (lambda (symbol value)
418 (set-default symbol (mapcar 'gnus-emphasis-custom-value-to-external
419 value)))
360 :group 'gnus-article-emphasis) 420 :group 'gnus-article-emphasis)
361 421
362(defcustom gnus-emphasize-whitespace-regexp "^[ \t]+\\|[ \t]*\n" 422(defcustom gnus-emphasize-whitespace-regexp "^[ \t]+\\|[ \t]*\n"
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index 6b093480940..7948efc2572 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -1871,11 +1871,13 @@ this is a reply."
1871 (when (and filep v) 1871 (when (and filep v)
1872 (setq v (with-temp-buffer 1872 (setq v (with-temp-buffer
1873 (insert-file-contents v) 1873 (insert-file-contents v)
1874 (goto-char (point-max)) 1874 (buffer-substring
1875 (skip-chars-backward "\n") 1875 (point-min)
1876 (delete-region (+ (point) (if (bolp) 0 1)) 1876 (progn
1877 (point-max)) 1877 (goto-char (point-max))
1878 (buffer-string)))) 1878 (if (zerop (skip-chars-backward "\n"))
1879 (point)
1880 (1+ (point))))))))
1879 (setq results (delq (assoc element results) results)) 1881 (setq results (delq (assoc element results) results))
1880 (push (cons element v) results)))) 1882 (push (cons element v) results))))
1881 ;; Now we have all the styles, so we insert them. 1883 ;; Now we have all the styles, so we insert them.
diff --git a/lisp/gnus/pgg-def.el b/lisp/gnus/pgg-def.el
index b8d9cbec807..046f57dbbfe 100644
--- a/lisp/gnus/pgg-def.el
+++ b/lisp/gnus/pgg-def.el
@@ -29,7 +29,8 @@
29 29
30(defgroup pgg () 30(defgroup pgg ()
31 "Glue for the various PGP implementations." 31 "Glue for the various PGP implementations."
32 :group 'mime) 32 :group 'mime
33 :version "21.4")
33 34
34(defcustom pgg-default-scheme 'gpg 35(defcustom pgg-default-scheme 'gpg
35 "Default PGP scheme." 36 "Default PGP scheme."
diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el
index 1dc9058dd1f..075408b8fc7 100644
--- a/lisp/gnus/spam.el
+++ b/lisp/gnus/spam.el
@@ -76,7 +76,8 @@
76;;; Main parameters. 76;;; Main parameters.
77 77
78(defgroup spam nil 78(defgroup spam nil
79 "Spam configuration.") 79 "Spam configuration."
80 :version "21.4")
80 81
81(defcustom spam-directory (nnheader-concat gnus-directory "spam/") 82(defcustom spam-directory (nnheader-concat gnus-directory "spam/")
82 "Directory for spam whitelists and blacklists." 83 "Directory for spam whitelists and blacklists."
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 8f2a1b7fa6e..c06a7b1ee73 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -228,9 +228,14 @@ KIND should be `var' for a variable or `subr' for a subroutine."
228 (if (eobp) 228 (if (eobp)
229 (insert-file-contents-literally 229 (insert-file-contents-literally
230 (expand-file-name internal-doc-file-name doc-directory))) 230 (expand-file-name internal-doc-file-name doc-directory)))
231 (search-forward (concat "" name "\n")) 231 (let ((file (catch 'loop
232 (while t
233 (let ((pnt (search-forward (concat "" name "\n"))))
232 (re-search-backward "S\\(.*\\)") 234 (re-search-backward "S\\(.*\\)")
233 (let ((file (match-string 1))) 235 (let ((file (match-string 1)))
236 (if (member file build-files)
237 (throw 'loop file)
238 (goto-char pnt))))))))
234 (if (string-match "\\.\\(o\\|obj\\)\\'" file) 239 (if (string-match "\\.\\(o\\|obj\\)\\'" file)
235 (setq file (replace-match ".c" t t file))) 240 (setq file (replace-match ".c" t t file)))
236 (if (string-match "\\.c\\'" file) 241 (if (string-match "\\.c\\'" file)
diff --git a/lisp/imenu.el b/lisp/imenu.el
index 7c775dc6337..16116025fb8 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -126,7 +126,9 @@ If `on-mouse' use a popup menu when `imenu' was invoked with the mouse."
126(defcustom imenu-eager-completion-buffer 126(defcustom imenu-eager-completion-buffer
127 (not (eq imenu-always-use-completion-buffer-p 'never)) 127 (not (eq imenu-always-use-completion-buffer-p 'never))
128 "If non-nil, eagerly popup the completion buffer." 128 "If non-nil, eagerly popup the completion buffer."
129 :type 'boolean) 129 :type 'boolean
130 :group 'imenu
131 :version "21.4")
130 132
131(defcustom imenu-after-jump-hook nil 133(defcustom imenu-after-jump-hook nil
132 "*Hooks called after jumping to a place in the buffer. 134 "*Hooks called after jumping to a place in the buffer.
diff --git a/lisp/info-look.el b/lisp/info-look.el
index 3f3ea7c2fd4..4bc90c7e5aa 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -328,22 +328,22 @@ If optional argument QUERY is non-nil, query for the help mode."
328 (modes (info-lookup->all-modes topic mode)) 328 (modes (info-lookup->all-modes topic mode))
329 (window (selected-window)) 329 (window (selected-window))
330 found doc-spec node prefix suffix doc-found) 330 found doc-spec node prefix suffix doc-found)
331 (if (or (not info-lookup-other-window-flag) 331 (if (not (eq major-mode 'Info-mode))
332 (eq (current-buffer) (get-buffer "*info*"))) 332 (if (not info-lookup-other-window-flag)
333 (info) 333 (info)
334 (progn 334 (progn
335 (save-window-excursion (info)) 335 (save-window-excursion (info))
336 ;; Determine whether or not the Info buffer is visible in 336 ;; Determine whether or not the Info buffer is visible in
337 ;; another frame on the same display. If it is, simply raise 337 ;; another frame on the same display. If it is, simply raise
338 ;; that frame. Otherwise, display it in another window. 338 ;; that frame. Otherwise, display it in another window.
339 (let* ((window (get-buffer-window "*info*" t)) 339 (let* ((window (get-buffer-window "*info*" t))
340 (info-frame (and window (window-frame window)))) 340 (info-frame (and window (window-frame window))))
341 (if (and info-frame 341 (if (and info-frame
342 (display-multi-frame-p) 342 (display-multi-frame-p)
343 (memq info-frame (frames-on-display-list)) 343 (memq info-frame (frames-on-display-list))
344 (not (eq info-frame (selected-frame)))) 344 (not (eq info-frame (selected-frame))))
345 (select-frame info-frame) 345 (select-frame info-frame)
346 (switch-to-buffer-other-window "*info*"))))) 346 (switch-to-buffer-other-window "*info*"))))))
347 (while (and (not found) modes) 347 (while (and (not found) modes)
348 (setq doc-spec (info-lookup->doc-spec topic (car modes))) 348 (setq doc-spec (info-lookup->doc-spec topic (car modes)))
349 (while (and (not found) doc-spec) 349 (while (and (not found) doc-spec)
@@ -633,11 +633,11 @@ Return nil if there is nothing appropriate in the buffer near point."
633 :mode 'c-mode :topic 'symbol 633 :mode 'c-mode :topic 'symbol
634 :regexp "\\(struct \\|union \\|enum \\)?[_a-zA-Z][_a-zA-Z0-9]*" 634 :regexp "\\(struct \\|union \\|enum \\)?[_a-zA-Z][_a-zA-Z0-9]*"
635 :doc-spec '(("(libc)Function Index" nil 635 :doc-spec '(("(libc)Function Index" nil
636 "^[ \t]+- \\(Function\\|Macro\\): .*\\<" "\\>") 636 "^[ \t]+-+ \\(Function\\|Macro\\): .*\\<" "\\>")
637 ("(libc)Variable Index" nil 637 ("(libc)Variable Index" nil
638 "^[ \t]+- \\(Variable\\|Macro\\): .*\\<" "\\>") 638 "^[ \t]+-+ \\(Variable\\|Macro\\): .*\\<" "\\>")
639 ("(libc)Type Index" nil 639 ("(libc)Type Index" nil
640 "^[ \t]+- Data Type: \\<" "\\>") 640 "^[ \t]+-+ Data Type: \\<" "\\>")
641 ("(termcap)Var Index" nil 641 ("(termcap)Var Index" nil
642 "^[ \t]*`" "'")) 642 "^[ \t]*`" "'"))
643 :parse-rule 'info-lookup-guess-c-symbol) 643 :parse-rule 'info-lookup-guess-c-symbol)
@@ -673,7 +673,7 @@ Return nil if there is nothing appropriate in the buffer near point."
673 (lambda (item) 673 (lambda (item)
674 (if (string-match "^\\([a-zA-Z]+\\|[^a-zA-Z]\\)\\( .*\\)?$" item) 674 (if (string-match "^\\([a-zA-Z]+\\|[^a-zA-Z]\\)\\( .*\\)?$" item)
675 (concat "@" (match-string 1 item)))) 675 (concat "@" (match-string 1 item))))
676 "`" "'"))) 676 "`" "[' ]")))
677 677
678(info-lookup-maybe-add-help 678(info-lookup-maybe-add-help
679 :mode 'm4-mode 679 :mode 'm4-mode
@@ -690,7 +690,7 @@ Return nil if there is nothing appropriate in the buffer near point."
690 ("(autoconf)Autoconf Macro Index" 690 ("(autoconf)Autoconf Macro Index"
691 (lambda (item) 691 (lambda (item)
692 (if (string-match "^A._" item) item (concat "AC_" item))) 692 (if (string-match "^A._" item) item (concat "AC_" item)))
693 "^[ \t]+- \\(Macro\\|Variable\\): .*\\<" "\\>") 693 "^[ \t]+-+ \\(Macro\\|Variable\\): .*\\<" "\\>")
694 ;; M4 Macro Index entries are without "AS_" prefixes, and 694 ;; M4 Macro Index entries are without "AS_" prefixes, and
695 ;; mostly without "m4_" prefixes. "dnl" is an exception, not 695 ;; mostly without "m4_" prefixes. "dnl" is an exception, not
696 ;; wanting any prefix. So AS_ is added back to upper-case 696 ;; wanting any prefix. So AS_ is added back to upper-case
@@ -705,13 +705,13 @@ Return nil if there is nothing appropriate in the buffer near point."
705 (concat "AS_" item)) 705 (concat "AS_" item))
706 (t 706 (t
707 (concat "m4_" item))))) 707 (concat "m4_" item)))))
708 "^[ \t]+- Macro: .*\\<" "\\>") 708 "^[ \t]+-+ Macro: .*\\<" "\\>")
709 ;; Autotest Macro Index entries are without "AT_". 709 ;; Autotest Macro Index entries are without "AT_".
710 ("(autoconf)Autotest Macro Index" "AT_" 710 ("(autoconf)Autotest Macro Index" "AT_"
711 "^[ \t]+- Macro: .*\\<" "\\>") 711 "^[ \t]+-+ Macro: .*\\<" "\\>")
712 ;; This is for older versions (probably pre autoconf 2.5x): 712 ;; This is for older versions (probably pre autoconf 2.5x):
713 ("(autoconf)Macro Index" "AC_" 713 ("(autoconf)Macro Index" "AC_"
714 "^[ \t]+- \\(Macro\\|Variable\\): .*\\<" "\\>") 714 "^[ \t]+-+ \\(Macro\\|Variable\\): .*\\<" "\\>")
715 ;; Automake has index entries for its notes on various autoconf 715 ;; Automake has index entries for its notes on various autoconf
716 ;; macros (eg. AC_PROG_CC). Ensure this is after the autoconf 716 ;; macros (eg. AC_PROG_CC). Ensure this is after the autoconf
717 ;; index, so as to prefer the autoconf docs. 717 ;; index, so as to prefer the autoconf docs.
@@ -788,13 +788,13 @@ Return nil if there is nothing appropriate in the buffer near point."
788 ;; Variables normally appear in nodes as just `foo'. 788 ;; Variables normally appear in nodes as just `foo'.
789 ("(emacs)Variable Index" nil "`" "'") 789 ("(emacs)Variable Index" nil "`" "'")
790 ;; Almost all functions, variables, etc appear in nodes as 790 ;; Almost all functions, variables, etc appear in nodes as
791 ;; " - Function: foo" etc. A small number of aliases and 791 ;; " -- Function: foo" etc. A small number of aliases and
792 ;; symbols appear only as `foo', and will miss out on exact 792 ;; symbols appear only as `foo', and will miss out on exact
793 ;; positions. Allowing `foo' would hit too many false matches 793 ;; positions. Allowing `foo' would hit too many false matches
794 ;; for things that should go to Function: etc, and those latter 794 ;; for things that should go to Function: etc, and those latter
795 ;; are much more important. Perhaps this could change if some 795 ;; are much more important. Perhaps this could change if some
796 ;; sort of fallback match scheme existed. 796 ;; sort of fallback match scheme existed.
797 ("(elisp)Index" nil "^ - .*: " "\\( \\|$\\)"))) 797 ("(elisp)Index" nil "^ -+ .*: " "\\( \\|$\\)")))
798 798
799(info-lookup-maybe-add-help 799(info-lookup-maybe-add-help
800 :mode 'lisp-interaction-mode 800 :mode 'lisp-interaction-mode
@@ -814,14 +814,14 @@ Return nil if there is nothing appropriate in the buffer near point."
814 :ignore-case t 814 :ignore-case t
815 ;; Aubrey Jaffer's rendition from <URL:ftp://ftp-swiss.ai.mit.edu/pub/scm> 815 ;; Aubrey Jaffer's rendition from <URL:ftp://ftp-swiss.ai.mit.edu/pub/scm>
816 :doc-spec '(("(r5rs)Index" nil 816 :doc-spec '(("(r5rs)Index" nil
817 "^[ \t]+- [^:]+:[ \t]*" "\\b"))) 817 "^[ \t]+-+ [^:]+:[ \t]*" "\\b")))
818 818
819(info-lookup-maybe-add-help 819(info-lookup-maybe-add-help
820 :mode 'octave-mode 820 :mode 'octave-mode
821 :regexp "[_a-zA-Z0-9]+" 821 :regexp "[_a-zA-Z0-9]+"
822 :doc-spec '(("(octave)Function Index" nil 822 :doc-spec '(("(octave)Function Index" nil
823 "^ - [^:]+:[ ]+\\(\\[[^=]*=[ ]+\\)?" nil) 823 "^ -+ [^:]+:[ ]+\\(\\[[^=]*=[ ]+\\)?" nil)
824 ("(octave)Variable Index" nil "^ - [^:]+:[ ]+" nil) 824 ("(octave)Variable Index" nil "^ -+ [^:]+:[ ]+" nil)
825 ;; Catch lines of the form "xyz statement" 825 ;; Catch lines of the form "xyz statement"
826 ("(octave)Concept Index" 826 ("(octave)Concept Index"
827 (lambda (item) 827 (lambda (item)
@@ -829,15 +829,15 @@ Return nil if there is nothing appropriate in the buffer near point."
829 ((string-match "^\\([A-Z]+\\) statement\\b" item) 829 ((string-match "^\\([A-Z]+\\) statement\\b" item)
830 (match-string 1 item)) 830 (match-string 1 item))
831 (t nil))) 831 (t nil)))
832 nil; "^ - [^:]+:[ ]+" don't think this prefix is useful here. 832 nil; "^ -+ [^:]+:[ ]+" don't think this prefix is useful here.
833 nil))) 833 nil)))
834 834
835(info-lookup-maybe-add-help 835(info-lookup-maybe-add-help
836 :mode 'maxima-mode 836 :mode 'maxima-mode
837 :ignore-case t 837 :ignore-case t
838 :regexp "[a-zA-Z_%]+" 838 :regexp "[a-zA-Z_%]+"
839 :doc-spec '( ("(maxima)Function and Variable Index" nil 839 :doc-spec '( ("(maxima)Function and Variable Index" nil
840 "^ - [^:]+:[ ]+\\(\\[[^=]*=[ ]+\\)?" nil))) 840 "^ -+ [^:]+:[ ]+\\(\\[[^=]*=[ ]+\\)?" nil)))
841 841
842(info-lookup-maybe-add-help 842(info-lookup-maybe-add-help
843 :mode 'inferior-maxima-mode 843 :mode 'inferior-maxima-mode
diff --git a/lisp/info.el b/lisp/info.el
index 2e0ddd0fb02..cc7ed2ae59b 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -657,10 +657,10 @@ is preserved, if possible."
657 (equal old-nodename Info-current-node)) 657 (equal old-nodename Info-current-node))
658 (progn 658 (progn
659 ;; note goto-line is no good, we want to measure from point-min 659 ;; note goto-line is no good, we want to measure from point-min
660 (beginning-of-buffer) 660 (goto-char (point-min))
661 (forward-line wline) 661 (forward-line wline)
662 (set-window-start (selected-window) (point)) 662 (set-window-start (selected-window) (point))
663 (beginning-of-buffer) 663 (goto-char (point-min))
664 (forward-line pline) 664 (forward-line pline)
665 (move-to-column pcolumn)) 665 (move-to-column pcolumn))
666 ;; only add to the history when coming from a different file+node 666 ;; only add to the history when coming from a different file+node
@@ -1476,11 +1476,26 @@ If DIRECTION is `backward', search in the reverse direction."
1476 (save-excursion 1476 (save-excursion
1477 (save-restriction 1477 (save-restriction
1478 (widen) 1478 (widen)
1479 (when backward
1480 ;; Hide Info file header for backward search
1481 (narrow-to-region (save-excursion
1482 (goto-char (point-min))
1483 (search-forward "\n\^_")
1484 (1- (point)))
1485 (point-max)))
1479 (while (and (not give-up) 1486 (while (and (not give-up)
1480 (or (null found) 1487 (save-match-data
1481 (if backward 1488 (or (null found)
1482 (isearch-range-invisible found beg-found) 1489 (if backward
1483 (isearch-range-invisible beg-found found)))) 1490 (isearch-range-invisible found beg-found)
1491 (isearch-range-invisible beg-found found))
1492 ;; Skip node header line
1493 (save-excursion (forward-line -1)
1494 (looking-at "\^_"))
1495 ;; Skip Tag Table node
1496 (save-excursion
1497 (and (search-backward "\^_" nil t)
1498 (looking-at "\^_\nTag Table"))))))
1484 (if (if backward 1499 (if (if backward
1485 (re-search-backward regexp bound t) 1500 (re-search-backward regexp bound t)
1486 (re-search-forward regexp bound t)) 1501 (re-search-forward regexp bound t))
@@ -1531,14 +1546,29 @@ If DIRECTION is `backward', search in the reverse direction."
1531 (while list 1546 (while list
1532 (message "Searching subfile %s..." (cdr (car list))) 1547 (message "Searching subfile %s..." (cdr (car list)))
1533 (Info-read-subfile (car (car list))) 1548 (Info-read-subfile (car (car list)))
1534 (if backward (goto-char (point-max))) 1549 (when backward
1550 ;; Hide Info file header for backward search
1551 (narrow-to-region (save-excursion
1552 (goto-char (point-min))
1553 (search-forward "\n\^_")
1554 (1- (point)))
1555 (point-max))
1556 (goto-char (point-max)))
1535 (setq list (cdr list)) 1557 (setq list (cdr list))
1536 (setq give-up nil found nil) 1558 (setq give-up nil found nil)
1537 (while (and (not give-up) 1559 (while (and (not give-up)
1538 (or (null found) 1560 (save-match-data
1539 (if backward 1561 (or (null found)
1540 (isearch-range-invisible found beg-found) 1562 (if backward
1541 (isearch-range-invisible beg-found found)))) 1563 (isearch-range-invisible found beg-found)
1564 (isearch-range-invisible beg-found found))
1565 ;; Skip node header line
1566 (save-excursion (forward-line -1)
1567 (looking-at "\^_"))
1568 ;; Skip Tag Table node
1569 (save-excursion
1570 (and (search-backward "\^_" nil t)
1571 (looking-at "\^_\nTag Table"))))))
1542 (if (if backward 1572 (if (if backward
1543 (re-search-backward regexp nil t) 1573 (re-search-backward regexp nil t)
1544 (re-search-forward regexp nil t)) 1574 (re-search-forward regexp nil t))
diff --git a/lisp/international/iso-cvt.el b/lisp/international/iso-cvt.el
index b0dffc40f50..d7baabb29c8 100644
--- a/lisp/international/iso-cvt.el
+++ b/lisp/international/iso-cvt.el
@@ -1,7 +1,8 @@
1;;; iso-cvt.el --- translate ISO 8859-1 from/to various encodings -*- coding: iso-latin-1 -*- 1;;; iso-cvt.el --- translate ISO 8859-1 from/to various encodings -*- coding: iso-latin-1 -*-
2;; This file was formerly called gm-lingo.el. 2;; This file was formerly called gm-lingo.el.
3 3
4;; Copyright (C) 1993, 1994, 1995, 1996, 1998, 2000 Free Software Foundation, Inc. 4;; Copyright (C) 1993, 1994, 1995, 1996, 1998, 2000, 2003, 2004
5;; Free Software Foundation, Inc.
5 6
6;; Author: Michael Gschwind <mike@vlsivie.tuwien.ac.at> 7;; Author: Michael Gschwind <mike@vlsivie.tuwien.ac.at>
7;; Keywords: tex, iso, latin, i18n 8;; Keywords: tex, iso, latin, i18n
@@ -828,69 +829,67 @@ Optional arg BUFFER is ignored (for use in `format-alist')."
828 829
829;;;###autoload 830;;;###autoload
830(defun iso-cvt-define-menu () 831(defun iso-cvt-define-menu ()
831 "Add submenus to the Files menu, to convert to and from various formats." 832 "Add submenus to the File menu, to convert to and from various formats."
832 (interactive) 833 (interactive)
833 834
834 (define-key menu-bar-files-menu [load-as-separator] '("--")) 835 (let ((load-as-menu-map (make-sparse-keymap "Load As..."))
835 836 (insert-as-menu-map (make-sparse-keymap "Insert As..."))
836 (define-key menu-bar-files-menu [load-as] '("Load As..." . load-as)) 837 (write-as-menu-map (make-sparse-keymap "Write As..."))
837 (defvar load-as-menu-map (make-sparse-keymap "Load As...")) 838 (translate-to-menu-map (make-sparse-keymap "Translate to..."))
838 (fset 'load-as load-as-menu-map) 839 (translate-from-menu-map (make-sparse-keymap "Translate from..."))
839 840 (menu menu-bar-file-menu))
840 ;;(define-key menu-bar-files-menu [insert-as] '("Insert As..." . insert-as)) 841
841 (defvar insert-as-menu-map (make-sparse-keymap "Insert As...")) 842 (define-key menu [load-as-separator] '("--"))
842 (fset 'insert-as insert-as-menu-map) 843
843 844 (define-key menu [load-as] '("Load As..." . iso-cvt-load-as))
844 (define-key menu-bar-files-menu [write-as] '("Write As..." . write-as)) 845 (fset 'iso-cvt-load-as load-as-menu-map)
845 (defvar write-as-menu-map (make-sparse-keymap "Write As...")) 846
846 (fset 'write-as write-as-menu-map) 847 ;;(define-key menu [insert-as] '("Insert As..." . iso-cvt-insert-as))
847 848 (fset 'iso-cvt-insert-as insert-as-menu-map)
848 (define-key menu-bar-files-menu [translate-separator] '("--")) 849
849 850 (define-key menu [write-as] '("Write As..." . iso-cvt-write-as))
850 (define-key menu-bar-files-menu [translate-to] '("Translate to..." . translate-to)) 851 (fset 'iso-cvt-write-as write-as-menu-map)
851 (defvar translate-to-menu-map (make-sparse-keymap "Translate to...")) 852
852 (fset 'translate-to translate-to-menu-map) 853 (define-key menu [translate-separator] '("--"))
853 854
854 (define-key menu-bar-files-menu [translate-from] '("Translate from..." . translate-from)) 855 (define-key menu [translate-to] '("Translate to..." . iso-cvt-translate-to))
855 (defvar translate-from-menu-map (make-sparse-keymap "Translate from...")) 856 (fset 'iso-cvt-translate-to translate-to-menu-map)
856 (fset 'translate-from translate-from-menu-map) 857
857 858 (define-key menu [translate-from] '("Translate from..." . iso-cvt-translate-from))
858 (let ((file-types (reverse format-alist)) 859 (fset 'iso-cvt-translate-from translate-from-menu-map)
859 name 860
860 str-name) 861 (dolist (file-type (reverse format-alist))
861 (while file-types 862 (let ((name (car file-type))
862 (setq name (car (car file-types)) 863 (str-name (cadr file-type)))
863 str-name (car (cdr (car file-types))) 864 (if (stringp str-name)
864 file-types (cdr file-types)) 865 (progn
865 (if (stringp str-name) 866 (define-key load-as-menu-map (vector name)
866 (progn 867 (cons str-name
867 (define-key load-as-menu-map (vector name) 868 `(lambda (file)
868 (cons str-name 869 (interactive ,(format "FFind file (as %s): " name))
869 `(lambda (file) 870 (format-find-file file ',name))))
870 (interactive (format "FFind file (as %s): " ,name)) 871 (define-key insert-as-menu-map (vector name)
871 (format-find-file file ',name)))) 872 (cons str-name
872 (define-key insert-as-menu-map (vector name) 873 `(lambda (file)
873 (cons str-name 874 (interactive (format "FInsert file (as %s): " ,name))
874 `(lambda (file) 875 (format-insert-file file ',name))))
875 (interactive (format "FInsert file (as %s): " ,name)) 876 (define-key write-as-menu-map (vector name)
876 (format-insert-file file ',name)))) 877 (cons str-name
877 (define-key write-as-menu-map (vector name) 878 `(lambda (file)
878 (cons str-name 879 (interactive (format "FWrite file (as %s): " ,name))
879 `(lambda (file) 880 (format-write-file file ',name))))
880 (interactive (format "FWrite file (as %s): " ,name)) 881 (define-key translate-to-menu-map (vector name)
881 (format-write-file file ',name)))) 882 (cons str-name
882 (define-key translate-to-menu-map (vector name) 883 `(lambda ()
883 (cons str-name 884 (interactive)
884 `(lambda () 885 (format-encode-buffer ',name))))
885 (interactive) 886 (define-key translate-from-menu-map (vector name)
886 (format-encode-buffer ',name)))) 887 (cons str-name
887 (define-key translate-from-menu-map (vector name) 888 `(lambda ()
888 (cons str-name 889 (interactive)
889 `(lambda () 890 (format-decode-buffer ',name))))))))))
890 (interactive)
891 (format-decode-buffer ',name)))))))))
892 891
893(provide 'iso-cvt) 892(provide 'iso-cvt)
894 893
895;;; arch-tag: 64ae843f-ed0e-43e1-ba50-ffd581b90840 894;; arch-tag: 64ae843f-ed0e-43e1-ba50-ffd581b90840
896;;; iso-cvt.el ends here 895;;; iso-cvt.el ends here
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 97fd8bc56e5..fca6c6a18ab 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -1,7 +1,8 @@
1;;; mule-cmds.el --- commands for mulitilingual environment -*-coding: iso-2022-7bit -*- 1;;; mule-cmds.el --- commands for mulitilingual environment -*-coding: iso-2022-7bit -*-
2
3;; Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2;; Copyright (C) 1995, 2003 Electrotechnical Laboratory, JAPAN. 4;; Copyright (C) 1995, 2003 Electrotechnical Laboratory, JAPAN.
3;; Licensed to the Free Software Foundation. 5;; Licensed to the Free Software Foundation.
4;; Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
5;; Copyright (C) 2003 6;; Copyright (C) 2003
6;; National Institute of Advanced Industrial Science and Technology (AIST) 7;; National Institute of Advanced Industrial Science and Technology (AIST)
7;; Registration Number H13PRO009 8;; Registration Number H13PRO009
@@ -611,6 +612,175 @@ The meaning is the same as the argument ACCEPT-DEFAULT-P of the
611function `select-safe-coding-system' (which see). This variable 612function `select-safe-coding-system' (which see). This variable
612overrides that argument.") 613overrides that argument.")
613 614
615(defun select-safe-coding-system-interactively (from to codings unsafe
616 &optional rejected default)
617 "Select interactively a coding system for the region FROM ... TO.
618FROM can be a string, as in `write-region'.
619CODINGS is the list of base coding systems known to be safe for this region,
620 typically obtained with `find-coding-systems-region'.
621UNSAFE is a list of coding systems known to be unsafe for this region.
622REJECTED is a list of coding systems which were safe but for some reason
623 were not recommended in the particular context.
624DEFAULT is the coding system to use by default in the query."
625 ;; At first, if some defaults are unsafe, record at most 11
626 ;; problematic characters and their positions for them by turning
627 ;; (CODING ...)
628 ;; into
629 ;; ((CODING (POS . CHAR) (POS . CHAR) ...) ...)
630 (if unsafe
631 (setq unsafe
632 (mapcar #'(lambda (coding)
633 (cons coding
634 (if (stringp from)
635 (mapcar #'(lambda (pos)
636 (cons pos (aref from pos)))
637 (unencodable-char-position
638 0 (length from) coding
639 11 from))
640 (mapcar #'(lambda (pos)
641 (cons pos (char-after pos)))
642 (unencodable-char-position
643 from to coding 11)))))
644 unsafe)))
645
646 ;; Change each safe coding system to the corresponding
647 ;; mime-charset name if it is also a coding system. Such a name
648 ;; is more friendly to users.
649 (let ((l codings)
650 mime-charset)
651 (while l
652 (setq mime-charset (coding-system-get (car l) 'mime-charset))
653 (if (and mime-charset (coding-system-p mime-charset))
654 (setcar l mime-charset))
655 (setq l (cdr l))))
656
657 ;; Don't offer variations with locking shift, which you
658 ;; basically never want.
659 (let (l)
660 (dolist (elt codings (setq codings (nreverse l)))
661 (unless (or (eq 'coding-category-iso-7-else
662 (coding-system-category elt))
663 (eq 'coding-category-iso-8-else
664 (coding-system-category elt)))
665 (push elt l))))
666
667 ;; Remove raw-text, emacs-mule and no-conversion unless nothing
668 ;; else is available.
669 (setq codings
670 (or (delq 'raw-text
671 (delq 'emacs-mule
672 (delq 'no-conversion codings)))
673 '(raw-text emacs-mule no-conversion)))
674
675 (let ((window-configuration (current-window-configuration))
676 (bufname (buffer-name))
677 coding-system)
678 (save-excursion
679 ;; If some defaults are unsafe, make sure the offending
680 ;; buffer is displayed.
681 (when (and unsafe (not (stringp from)))
682 (pop-to-buffer bufname)
683 (goto-char (apply 'min (mapcar #'(lambda (x) (car (cadr x)))
684 unsafe))))
685 ;; Then ask users to select one from CODINGS while showing
686 ;; the reason why none of the defaults are not used.
687 (with-output-to-temp-buffer "*Warning*"
688 (with-current-buffer standard-output
689 (if (and (null rejected) (null unsafe))
690 (insert "No default coding systems to try for "
691 (if (stringp from)
692 (format "string \"%s\"." from)
693 (format "buffer `%s'." bufname)))
694 (insert
695 "These default coding systems were tried to encode"
696 (if (stringp from)
697 (concat " \"" (if (> (length from) 10)
698 (concat (substring from 0 10) "...\"")
699 (concat from "\"")))
700 (format " text\nin the buffer `%s'" bufname))
701 ":\n")
702 (let ((pos (point))
703 (fill-prefix " "))
704 (dolist (x (append rejected unsafe))
705 (princ " ") (princ (car x)))
706 (insert "\n")
707 (fill-region-as-paragraph pos (point)))
708 (when rejected
709 (insert "These safely encodes the target text,
710but it is not recommended for encoding text in this context,
711e.g., for sending an email message.\n ")
712 (dolist (x rejected)
713 (princ " ") (princ x))
714 (insert "\n"))
715 (when unsafe
716 (insert (if rejected "And the others"
717 "However, each of them")
718 " encountered these problematic characters:\n")
719 (dolist (coding unsafe)
720 (insert (format " %s:" (car coding)))
721 (let ((i 0)
722 (func1
723 #'(lambda (bufname pos)
724 (when (buffer-live-p (get-buffer bufname))
725 (pop-to-buffer bufname)
726 (goto-char pos))))
727 (func2
728 #'(lambda (bufname pos coding)
729 (when (buffer-live-p (get-buffer bufname))
730 (pop-to-buffer bufname)
731 (if (< (point) pos)
732 (goto-char pos)
733 (forward-char 1)
734 (search-unencodable-char coding)
735 (forward-char -1))))))
736 (dolist (elt (cdr coding))
737 (insert " ")
738 (if (stringp from)
739 (insert (if (< i 10) (cdr elt) "..."))
740 (if (< i 10)
741 (insert-text-button
742 (cdr elt)
743 :type 'help-xref
744 'help-echo
745 "mouse-2, RET: jump to this character"
746 'help-function func1
747 'help-args (list bufname (car elt)))
748 (insert-text-button
749 "..."
750 :type 'help-xref
751 'help-echo
752 "mouse-2, RET: next unencodable character"
753 'help-function func2
754 'help-args (list bufname (car elt)
755 (car coding)))))
756 (setq i (1+ i))))
757 (insert "\n"))
758 (insert "\
759The first problematic character is at point in the displayed buffer,\n"
760 (substitute-command-keys "\
761and \\[universal-argument] \\[what-cursor-position] will give information about it.\n"))))
762 (insert "\nSelect \
763one of the following safe coding systems, or edit the buffer:\n")
764 (let ((pos (point))
765 (fill-prefix " "))
766 (dolist (x codings)
767 (princ " ") (princ x))
768 (insert "\n")
769 (fill-region-as-paragraph pos (point)))
770 (insert "Or specify any other coding system
771at the risk of losing the problematic characters.\n")))
772
773 ;; Read a coding system.
774 (setq coding-system
775 (read-coding-system
776 (format "Select coding system (default %s): " default)
777 default))
778 (setq last-coding-system-specified coding-system))
779
780 (kill-buffer "*Warning*")
781 (set-window-configuration window-configuration)
782 coding-system))
783
614(defun select-safe-coding-system (from to &optional default-coding-system 784(defun select-safe-coding-system (from to &optional default-coding-system
615 accept-default-p file) 785 accept-default-p file)
616 "Ask a user to select a safe coding system from candidates. 786 "Ask a user to select a safe coding system from candidates.
@@ -705,7 +875,6 @@ and TO is ignored."
705 875
706 (let ((codings (find-coding-systems-region from to)) 876 (let ((codings (find-coding-systems-region from to))
707 (coding-system nil) 877 (coding-system nil)
708 (bufname (buffer-name))
709 safe rejected unsafe) 878 safe rejected unsafe)
710 ;; Classify the defaults into safe, rejected, and unsafe. 879 ;; Classify the defaults into safe, rejected, and unsafe.
711 (dolist (elt default-coding-system) 880 (dolist (elt default-coding-system)
@@ -1344,12 +1513,14 @@ If INPUT-METHOD is nil, deactivate any current input method."
1344 current-input-method-title nil) 1513 current-input-method-title nil)
1345 (force-mode-line-update))))) 1514 (force-mode-line-update)))))
1346 1515
1347(defun set-input-method (input-method) 1516(defun set-input-method (input-method &optional interactive)
1348 "Select and activate input method INPUT-METHOD for the current buffer. 1517 "Select and activate input method INPUT-METHOD for the current buffer.
1349This also sets the default input method to the one you specify. 1518This also sets the default input method to the one you specify.
1350If INPUT-METHOD is nil, this function turns off the input method, and 1519If INPUT-METHOD is nil, this function turns off the input method, and
1351also causes you to be prompted for a name of an input method the next 1520also causes you to be prompted for a name of an input method the next
1352time you invoke \\[toggle-input-method]. 1521time you invoke \\[toggle-input-method].
1522When called interactively, the optional arg INTERACTIVE is non-nil,
1523which marks the variable `default-input-method' as set for Custom buffers.
1353 1524
1354To deactivate the input method interactively, use \\[toggle-input-method]. 1525To deactivate the input method interactively, use \\[toggle-input-method].
1355To deactivate it programmatically, use \\[inactivate-input-method]." 1526To deactivate it programmatically, use \\[inactivate-input-method]."
@@ -1357,14 +1528,15 @@ To deactivate it programmatically, use \\[inactivate-input-method]."
1357 (let* ((default (or (car input-method-history) default-input-method))) 1528 (let* ((default (or (car input-method-history) default-input-method)))
1358 (list (read-input-method-name 1529 (list (read-input-method-name
1359 (if default "Select input method (default %s): " "Select input method: ") 1530 (if default "Select input method (default %s): " "Select input method: ")
1360 default t)))) 1531 default t)
1532 t)))
1361 (activate-input-method input-method) 1533 (activate-input-method input-method)
1362 (setq default-input-method input-method) 1534 (setq default-input-method input-method)
1363 (when (interactive-p) 1535 (when interactive
1364 (customize-mark-as-set 'default-input-method)) 1536 (customize-mark-as-set 'default-input-method))
1365 default-input-method) 1537 default-input-method)
1366 1538
1367(defun toggle-input-method (&optional arg) 1539(defun toggle-input-method (&optional arg interactive)
1368 "Enable or disable multilingual text input method for the current buffer. 1540 "Enable or disable multilingual text input method for the current buffer.
1369Only one input method can be enabled at any time in a given buffer. 1541Only one input method can be enabled at any time in a given buffer.
1370 1542
@@ -1377,9 +1549,12 @@ minibuffer.
1377 1549
1378With a prefix argument, read an input method name with the minibuffer 1550With a prefix argument, read an input method name with the minibuffer
1379and enable that one. The default is the most recent input method specified 1551and enable that one. The default is the most recent input method specified
1380\(not including the currently active input method, if any)." 1552\(not including the currently active input method, if any).
1381 1553
1382 (interactive "P") 1554When called interactively, the optional arg INTERACTIVE is non-nil,
1555which marks the variable `default-input-method' as set for Custom buffers."
1556
1557 (interactive "P\np")
1383 (if (and current-input-method (not arg)) 1558 (if (and current-input-method (not arg))
1384 (inactivate-input-method) 1559 (inactivate-input-method)
1385 (let ((default (or (car input-method-history) default-input-method))) 1560 (let ((default (or (car input-method-history) default-input-method)))
@@ -1396,7 +1571,7 @@ and enable that one. The default is the most recent input method specified
1396 (unless default-input-method 1571 (unless default-input-method
1397 (prog1 1572 (prog1
1398 (setq default-input-method current-input-method) 1573 (setq default-input-method current-input-method)
1399 (when (interactive-p) 1574 (when interactive
1400 (customize-mark-as-set 'default-input-method))))))) 1575 (customize-mark-as-set 'default-input-method)))))))
1401 1576
1402(eval-when-compile (autoload 'help-buffer "help-mode")) 1577(eval-when-compile (autoload 'help-buffer "help-mode"))
@@ -2545,5 +2720,5 @@ If CODING-SYSTEM can't safely encode CHAR, return nil."
2545(defvar nonascii-translation-table nil "This variable is obsolete.") 2720(defvar nonascii-translation-table nil "This variable is obsolete.")
2546 2721
2547 2722
2548;;; arch-tag: b382c432-4b36-460e-bf4c-05efd0bb18dc 2723;; arch-tag: b382c432-4b36-460e-bf4c-05efd0bb18dc
2549;;; mule-cmds.el ends here 2724;;; mule-cmds.el ends here
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 5b55c4ff025..f29e19a2fcb 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -2101,7 +2101,7 @@ This function is intended to be added to `auto-coding-functions'."
2101 (save-excursion 2101 (save-excursion
2102 (forward-line 10) 2102 (forward-line 10)
2103 (point)))) 2103 (point))))
2104 (when (and (search-forward "<html>" size t) 2104 (when (and (search-forward "<html" size t)
2105 (re-search-forward "<meta\\s-+http-equiv=\"content-type\"\\s-+content=\"text/\\sw+;\\s-*charset=\\(.+?\\)\"" size t)) 2105 (re-search-forward "<meta\\s-+http-equiv=\"content-type\"\\s-+content=\"text/\\sw+;\\s-*charset=\\(.+?\\)\"" size t))
2106 (let* ((match (match-string 1)) 2106 (let* ((match (match-string 1))
2107 (sym (intern (downcase match)))) 2107 (sym (intern (downcase match))))
diff --git a/lisp/macros.el b/lisp/macros.el
index 0de5d223ee0..bb9fda41a45 100644
--- a/lisp/macros.el
+++ b/lisp/macros.el
@@ -63,7 +63,14 @@ bindings.
63 63
64To save a kbd macro, visit a file of Lisp code such as your `~/.emacs', 64To save a kbd macro, visit a file of Lisp code such as your `~/.emacs',
65use this command, and then save the file." 65use this command, and then save the file."
66 (interactive "CInsert kbd macro (name): \nP") 66 (interactive (list (intern (completing-read "Insert kbd macro (name): "
67 obarray
68 (lambda (elt)
69 (and (fboundp elt)
70 (or (stringp (symbol-function elt))
71 (vectorp (symbol-function elt)))))
72 t))
73 current-prefix-arg))
67 (let (definition) 74 (let (definition)
68 (if (string= (symbol-name macroname) "") 75 (if (string= (symbol-name macroname) "")
69 (progn 76 (progn
diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el
index af7f8b62e03..0f5925021e8 100644
--- a/lisp/mail/supercite.el
+++ b/lisp/mail/supercite.el
@@ -1424,18 +1424,21 @@ Optional CITATION overrides any citation automatically selected."
1424 nil) 1424 nil)
1425 1425
1426;; interactive functions 1426;; interactive functions
1427(defun sc-cite-region (start end &optional confirm-p) 1427(defun sc-cite-region (start end &optional confirm-p interactive)
1428 "Cite a region delineated by START and END. 1428 "Cite a region delineated by START and END.
1429If optional CONFIRM-P is non-nil, the attribution is confirmed before 1429If optional CONFIRM-P is non-nil, the attribution is confirmed before
1430its use in the citation string. This function first runs 1430its use in the citation string. This function first runs
1431`sc-pre-cite-hook'." 1431`sc-pre-cite-hook'.
1432 (interactive "r\nP") 1432
1433When called interactively, the optional arg INTERACTIVE is non-nil,
1434and that means call `sc-select-attribution' too."
1435 (interactive "r\nP\np")
1433 (undo-boundary) 1436 (undo-boundary)
1434 (let ((frame (or (sc-scan-info-alist sc-cite-frame-alist) 1437 (let ((frame (or (sc-scan-info-alist sc-cite-frame-alist)
1435 sc-default-cite-frame)) 1438 sc-default-cite-frame))
1436 (sc-confirm-always-p (if confirm-p t sc-confirm-always-p))) 1439 (sc-confirm-always-p (if confirm-p t sc-confirm-always-p)))
1437 (run-hooks 'sc-pre-cite-hook) 1440 (run-hooks 'sc-pre-cite-hook)
1438 (if (interactive-p) 1441 (if interactive
1439 (sc-select-attribution)) 1442 (sc-select-attribution))
1440 (regi-interpret frame start end))) 1443 (regi-interpret frame start end)))
1441 1444
@@ -1978,16 +1981,15 @@ cited."
1978 (insert (sc-mail-field "sc-citation")) 1981 (insert (sc-mail-field "sc-citation"))
1979 (error "Line is already cited")))) 1982 (error "Line is already cited"))))
1980 1983
1981(defun sc-version (arg) 1984(defun sc-version (message)
1982 "Echo the current version of Supercite in the minibuffer. 1985 "Echo the current version of Supercite in the minibuffer.
1983With \\[universal-argument] (universal-argument), or if run non-interactively, 1986If MESSAGE is non-nil (interactively, with no prefix argument),
1984inserts the version string in the current buffer instead." 1987inserts the version string in the current buffer instead."
1985 (interactive "P") 1988 (interactive (not current-prefix-arg))
1986 (let ((verstr (format "Using Supercite.el %s" sc-version))) 1989 (let ((verstr (format "Using Supercite.el %s" sc-version)))
1987 (if (or (consp arg) 1990 (if message
1988 (not (interactive-p))) 1991 (message verstr)
1989 (insert "`sc-version' says: " verstr) 1992 (insert "`sc-version' says: " verstr))))
1990 (message verstr))))
1991 1993
1992(defun sc-describe () 1994(defun sc-describe ()
1993 " 1995 "
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 2c1d37c80e2..597e77b6165 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -63,78 +63,78 @@ A large number or nil slows down menu responsiveness."
63 (cons "Options" menu-bar-options-menu)) 63 (cons "Options" menu-bar-options-menu))
64(defvar menu-bar-edit-menu (make-sparse-keymap "Edit")) 64(defvar menu-bar-edit-menu (make-sparse-keymap "Edit"))
65(define-key global-map [menu-bar edit] (cons "Edit" menu-bar-edit-menu)) 65(define-key global-map [menu-bar edit] (cons "Edit" menu-bar-edit-menu))
66(defvar menu-bar-files-menu (make-sparse-keymap "File")) 66(defvar menu-bar-file-menu (make-sparse-keymap "File"))
67(define-key global-map [menu-bar files] (cons "File" menu-bar-files-menu)) 67(define-key global-map [menu-bar file] (cons "File" menu-bar-file-menu))
68 68
69;; This alias is for compatibility with 19.28 and before. 69;; This alias is for compatibility with 19.28 and before.
70(defvar menu-bar-file-menu menu-bar-files-menu) 70(defvar menu-bar-files-menu menu-bar-file-menu)
71 71
72;; This is referenced by some code below; it is defined in uniquify.el 72;; This is referenced by some code below; it is defined in uniquify.el
73(defvar uniquify-buffer-name-style) 73(defvar uniquify-buffer-name-style)
74 74
75 75
76;; The "File" menu items 76;; The "File" menu items
77(define-key menu-bar-files-menu [exit-emacs] 77(define-key menu-bar-file-menu [exit-emacs]
78 '(menu-item "Exit Emacs" save-buffers-kill-emacs 78 '(menu-item "Exit Emacs" save-buffers-kill-emacs
79 :help "Save unsaved buffers, then exit")) 79 :help "Save unsaved buffers, then exit"))
80 80
81(define-key menu-bar-files-menu [separator-exit] 81(define-key menu-bar-file-menu [separator-exit]
82 '("--")) 82 '("--"))
83 83
84;; Don't use delete-frame as event name because that is a special 84;; Don't use delete-frame as event name because that is a special
85;; event. 85;; event.
86(define-key menu-bar-files-menu [delete-this-frame] 86(define-key menu-bar-file-menu [delete-this-frame]
87 '(menu-item "Delete Frame" delete-frame 87 '(menu-item "Delete Frame" delete-frame
88 :visible (fboundp 'delete-frame) 88 :visible (fboundp 'delete-frame)
89 :enable (delete-frame-enabled-p) 89 :enable (delete-frame-enabled-p)
90 :help "Delete currently selected frame")) 90 :help "Delete currently selected frame"))
91(define-key menu-bar-files-menu [make-frame-on-display] 91(define-key menu-bar-file-menu [make-frame-on-display]
92 '(menu-item "New Frame on Display..." make-frame-on-display 92 '(menu-item "New Frame on Display..." make-frame-on-display
93 :visible (fboundp 'make-frame-on-display) 93 :visible (fboundp 'make-frame-on-display)
94 :help "Open a new frame on another display")) 94 :help "Open a new frame on another display"))
95(define-key menu-bar-files-menu [make-frame] 95(define-key menu-bar-file-menu [make-frame]
96 '(menu-item "New Frame" make-frame-command 96 '(menu-item "New Frame" make-frame-command
97 :visible (fboundp 'make-frame-command) 97 :visible (fboundp 'make-frame-command)
98 :help "Open a new frame")) 98 :help "Open a new frame"))
99 99
100(define-key menu-bar-files-menu [one-window] 100(define-key menu-bar-file-menu [one-window]
101 '(menu-item "Unsplit Windows" delete-other-windows 101 '(menu-item "Unsplit Windows" delete-other-windows
102 :enable (not (one-window-p t nil)) 102 :enable (not (one-window-p t nil))
103 :help "Make selected window fill its frame")) 103 :help "Make selected window fill its frame"))
104 104
105(define-key menu-bar-files-menu [split-window] 105(define-key menu-bar-file-menu [split-window]
106 '(menu-item "Split Window" split-window-vertically 106 '(menu-item "Split Window" split-window-vertically
107 :help "Split selected window in two")) 107 :help "Split selected window in two"))
108 108
109(define-key menu-bar-files-menu [separator-window] 109(define-key menu-bar-file-menu [separator-window]
110 '(menu-item "--")) 110 '(menu-item "--"))
111 111
112(define-key menu-bar-files-menu [ps-print-region] 112(define-key menu-bar-file-menu [ps-print-region]
113 '(menu-item "Postscript Print Region (B+W)" ps-print-region 113 '(menu-item "Postscript Print Region (B+W)" ps-print-region
114 :enable mark-active 114 :enable mark-active
115 :help "Pretty-print marked region in black and white to PostScript printer")) 115 :help "Pretty-print marked region in black and white to PostScript printer"))
116(define-key menu-bar-files-menu [ps-print-buffer] 116(define-key menu-bar-file-menu [ps-print-buffer]
117 '(menu-item "Postscript Print Buffer (B+W)" ps-print-buffer 117 '(menu-item "Postscript Print Buffer (B+W)" ps-print-buffer
118 :help "Pretty-print current buffer in black and white to PostScript printer")) 118 :help "Pretty-print current buffer in black and white to PostScript printer"))
119(define-key menu-bar-files-menu [ps-print-region-faces] 119(define-key menu-bar-file-menu [ps-print-region-faces]
120 '(menu-item "Postscript Print Region" ps-print-region-with-faces 120 '(menu-item "Postscript Print Region" ps-print-region-with-faces
121 :enable mark-active 121 :enable mark-active
122 :help "Pretty-print marked region to PostScript printer")) 122 :help "Pretty-print marked region to PostScript printer"))
123(define-key menu-bar-files-menu [ps-print-buffer-faces] 123(define-key menu-bar-file-menu [ps-print-buffer-faces]
124 '(menu-item "Postscript Print Buffer" ps-print-buffer-with-faces 124 '(menu-item "Postscript Print Buffer" ps-print-buffer-with-faces
125 :help "Pretty-print current buffer to PostScript printer")) 125 :help "Pretty-print current buffer to PostScript printer"))
126(define-key menu-bar-files-menu [print-region] 126(define-key menu-bar-file-menu [print-region]
127 '(menu-item "Print Region" print-region 127 '(menu-item "Print Region" print-region
128 :enable mark-active 128 :enable mark-active
129 :help "Print region between mark and current position")) 129 :help "Print region between mark and current position"))
130(define-key menu-bar-files-menu [print-buffer] 130(define-key menu-bar-file-menu [print-buffer]
131 '(menu-item "Print Buffer" print-buffer 131 '(menu-item "Print Buffer" print-buffer
132 :help "Print current buffer with page headings")) 132 :help "Print current buffer with page headings"))
133 133
134(define-key menu-bar-files-menu [separator-print] 134(define-key menu-bar-file-menu [separator-print]
135 '(menu-item "--")) 135 '(menu-item "--"))
136 136
137(define-key menu-bar-files-menu [recover-session] 137(define-key menu-bar-file-menu [recover-session]
138 '(menu-item "Recover Crashed Session..." recover-session 138 '(menu-item "Recover Crashed Session..." recover-session
139 :enable (and auto-save-list-file-prefix 139 :enable (and auto-save-list-file-prefix
140 (file-directory-p 140 (file-directory-p
@@ -148,7 +148,7 @@ A large number or nil slows down menu responsiveness."
148 auto-save-list-file-prefix))) 148 auto-save-list-file-prefix)))
149 t)) 149 t))
150 :help "Recover edits from a crashed session")) 150 :help "Recover edits from a crashed session"))
151(define-key menu-bar-files-menu [revert-buffer] 151(define-key menu-bar-file-menu [revert-buffer]
152 '(menu-item "Revert Buffer" revert-buffer 152 '(menu-item "Revert Buffer" revert-buffer
153 :enable (or revert-buffer-function 153 :enable (or revert-buffer-function
154 revert-buffer-insert-file-contents-function 154 revert-buffer-insert-file-contents-function
@@ -157,12 +157,12 @@ A large number or nil slows down menu responsiveness."
157 (not (verify-visited-file-modtime 157 (not (verify-visited-file-modtime
158 (current-buffer)))))) 158 (current-buffer))))))
159 :help "Re-read current buffer from its file")) 159 :help "Re-read current buffer from its file"))
160(define-key menu-bar-files-menu [write-file] 160(define-key menu-bar-file-menu [write-file]
161 '(menu-item "Save Buffer As..." write-file 161 '(menu-item "Save Buffer As..." write-file
162 :enable (not (window-minibuffer-p 162 :enable (not (window-minibuffer-p
163 (frame-selected-window menu-updating-frame))) 163 (frame-selected-window menu-updating-frame)))
164 :help "Write current buffer to another file")) 164 :help "Write current buffer to another file"))
165(define-key menu-bar-files-menu [save-buffer] 165(define-key menu-bar-file-menu [save-buffer]
166 '(menu-item "Save (current buffer)" save-buffer 166 '(menu-item "Save (current buffer)" save-buffer
167 :enable (and (buffer-modified-p) 167 :enable (and (buffer-modified-p)
168 (buffer-file-name) 168 (buffer-file-name)
@@ -170,27 +170,27 @@ A large number or nil slows down menu responsiveness."
170 (frame-selected-window menu-updating-frame)))) 170 (frame-selected-window menu-updating-frame))))
171 :help "Save current buffer to its file")) 171 :help "Save current buffer to its file"))
172 172
173(define-key menu-bar-files-menu [separator-save] 173(define-key menu-bar-file-menu [separator-save]
174 '(menu-item "--")) 174 '(menu-item "--"))
175 175
176(define-key menu-bar-files-menu [kill-buffer] 176(define-key menu-bar-file-menu [kill-buffer]
177 '(menu-item "Close (current buffer)" kill-this-buffer 177 '(menu-item "Close (current buffer)" kill-this-buffer
178 :enable (kill-this-buffer-enabled-p) 178 :enable (kill-this-buffer-enabled-p)
179 :help "Discard current buffer")) 179 :help "Discard current buffer"))
180(define-key menu-bar-files-menu [insert-file] 180(define-key menu-bar-file-menu [insert-file]
181 '(menu-item "Insert File..." insert-file 181 '(menu-item "Insert File..." insert-file
182 :enable (not (window-minibuffer-p 182 :enable (not (window-minibuffer-p
183 (frame-selected-window menu-updating-frame))) 183 (frame-selected-window menu-updating-frame)))
184 :help "Insert another file into current buffer")) 184 :help "Insert another file into current buffer"))
185(define-key menu-bar-files-menu [dired] 185(define-key menu-bar-file-menu [dired]
186 '(menu-item "Open Directory..." dired 186 '(menu-item "Open Directory..." dired
187 :help "Read a directory, operate on its files")) 187 :help "Read a directory, operate on its files"))
188(define-key menu-bar-files-menu [open-file] 188(define-key menu-bar-file-menu [open-file]
189 '(menu-item "Open File..." find-file-existing 189 '(menu-item "Open File..." find-file-existing
190 :enable (not (window-minibuffer-p 190 :enable (not (window-minibuffer-p
191 (frame-selected-window menu-updating-frame))) 191 (frame-selected-window menu-updating-frame)))
192 :help "Read an existing file into an Emacs buffer")) 192 :help "Read an existing file into an Emacs buffer"))
193(define-key menu-bar-files-menu [new-file] 193(define-key menu-bar-file-menu [new-file]
194 '(menu-item "New File..." find-file 194 '(menu-item "New File..." find-file
195 :enable (not (window-minibuffer-p 195 :enable (not (window-minibuffer-p
196 (frame-selected-window menu-updating-frame))) 196 (frame-selected-window menu-updating-frame)))
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 2a467aa8069..865b5e96297 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -1068,8 +1068,7 @@ If MODE is 2 then do the same for lines."
1068 (unless ignore 1068 (unless ignore
1069 ;; For certain special keys, delete the region. 1069 ;; For certain special keys, delete the region.
1070 (if (member key mouse-region-delete-keys) 1070 (if (member key mouse-region-delete-keys)
1071 (delete-region (overlay-start mouse-drag-overlay) 1071 (delete-region (mark t) (point))
1072 (overlay-end mouse-drag-overlay))
1073 ;; Otherwise, unread the key so it gets executed normally. 1072 ;; Otherwise, unread the key so it gets executed normally.
1074 (setq unread-command-events 1073 (setq unread-command-events
1075 (nconc events unread-command-events)))) 1074 (nconc events unread-command-events))))
diff --git a/lisp/mwheel.el b/lisp/mwheel.el
index 0194160bcf4..231b7c3d6e3 100644
--- a/lisp/mwheel.el
+++ b/lisp/mwheel.el
@@ -1,6 +1,6 @@
1;;; mwheel.el --- Wheel mouse support 1;;; mwheel.el --- Wheel mouse support
2 2
3;; Copyright (C) 1998,2000,2001,2002 Free Software Foundation, Inc. 3;; Copyright (C) 1998, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
4;; Maintainer: William M. Perry <wmperry@gnu.org> 4;; Maintainer: William M. Perry <wmperry@gnu.org>
5;; Keywords: mouse 5;; Keywords: mouse
6 6
@@ -137,7 +137,7 @@ less than a full screen."
137 (integer :tag "Specific # of lines") 137 (integer :tag "Specific # of lines")
138 (float :tag "Fraction of window")))))) 138 (float :tag "Fraction of window"))))))
139 139
140(defcustom mouse-wheel-progessive-speed t 140(defcustom mouse-wheel-progressive-speed t
141 "If non-nil, the faster the user moves the wheel, the faster the scrolling. 141 "If non-nil, the faster the user moves the wheel, the faster the scrolling.
142Note that this has no effect when `mouse-wheel-scroll-amount' specifies 142Note that this has no effect when `mouse-wheel-scroll-amount' specifies
143a \"near full screen\" scroll or when the mouse wheel sends key instead 143a \"near full screen\" scroll or when the mouse wheel sends key instead
@@ -197,7 +197,7 @@ This should only be bound to mouse buttons 4 and 5."
197 (let ((list-elt mouse-wheel-scroll-amount)) 197 (let ((list-elt mouse-wheel-scroll-amount))
198 (while (consp (setq amt (pop list-elt)))))) 198 (while (consp (setq amt (pop list-elt))))))
199 (if (floatp amt) (setq amt (1+ (truncate (* amt (window-height)))))) 199 (if (floatp amt) (setq amt (1+ (truncate (* amt (window-height))))))
200 (when (and mouse-wheel-progessive-speed (numberp amt)) 200 (when (and mouse-wheel-progressive-speed (numberp amt))
201 ;; When the double-mouse-N comes in, a mouse-N has been executed already, 201 ;; When the double-mouse-N comes in, a mouse-N has been executed already,
202 ;; So by adding things up we get a squaring up (1, 3, 6, 10, 15, ...). 202 ;; So by adding things up we get a squaring up (1, 3, 6, 10, 15, ...).
203 (setq amt (* amt (event-click-count event)))) 203 (setq amt (* amt (event-click-count event))))
@@ -250,5 +250,5 @@ Returns non-nil if the new state is enabled."
250 250
251(provide 'mwheel) 251(provide 'mwheel)
252 252
253;;; arch-tag: 50ed00e7-3686-4b7a-8037-fb31aa5c237f 253;; arch-tag: 50ed00e7-3686-4b7a-8037-fb31aa5c237f
254;;; mwheel.el ends here 254;;; mwheel.el ends here
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 1dbd97f0073..098f2988f1b 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -357,6 +357,15 @@ Defaults to the value of `browse-url-epiphany-arguments' at the time
357 :type '(repeat (string :tag "Argument")) 357 :type '(repeat (string :tag "Argument"))
358 :group 'browse-url) 358 :group 'browse-url)
359 359
360;; GNOME means of invoking either Mozilla or Netrape.
361(defvar browse-url-gnome-moz-program "gnome-moz-remote")
362
363(defcustom browse-url-gnome-moz-arguments '()
364 "*A list of strings passed to the GNOME mozilla viewer as arguments."
365 :version "21.1"
366 :type '(repeat (string :tag "Argument"))
367 :group 'browse-url)
368
360(defcustom browse-url-mozilla-new-window-is-tab nil 369(defcustom browse-url-mozilla-new-window-is-tab nil
361 "*Whether to open up new windows in a tab or a new window. 370 "*Whether to open up new windows in a tab or a new window.
362If non-nil, then open the URL in a new tab rather than a new window if 371If non-nil, then open the URL in a new tab rather than a new window if
@@ -596,10 +605,11 @@ for use in `interactive'."
596 (not (eq (null browse-url-new-window-flag) 605 (not (eq (null browse-url-new-window-flag)
597 (null current-prefix-arg))))) 606 (null current-prefix-arg)))))
598 607
599;; interactive-p needs to be called at a function's top-level, hence 608;; called-interactive-p needs to be called at a function's top-level, hence
600;; the macro. 609;; this macro. We use that rather than interactive-p because
610;; use in a keyboard macro should not change this behavior.
601(defmacro browse-url-maybe-new-window (arg) 611(defmacro browse-url-maybe-new-window (arg)
602 `(if (not (interactive-p)) 612 `(if (or noninteractive (not (called-interactively-p)))
603 ,arg 613 ,arg
604 browse-url-new-window-flag)) 614 browse-url-new-window-flag))
605 615
@@ -1031,14 +1041,6 @@ used instead of `browse-url-new-window-flag'."
1031 browse-url-epiphany-program 1041 browse-url-epiphany-program
1032 (append browse-url-epiphany-startup-arguments (list url)))))) 1042 (append browse-url-epiphany-startup-arguments (list url))))))
1033 1043
1034;; GNOME means of invoking either Mozilla or Netrape.
1035(defvar browse-url-gnome-moz-program "gnome-moz-remote")
1036(defcustom browse-url-gnome-moz-arguments '()
1037 "*A list of strings passed to the GNOME mozilla viewer as arguments."
1038 :version "21.1"
1039 :type '(repeat (string :tag "Argument"))
1040 :group 'browse-url)
1041
1042;;;###autoload 1044;;;###autoload
1043(defun browse-url-gnome-moz (url &optional new-window) 1045(defun browse-url-gnome-moz (url &optional new-window)
1044 "Ask Mozilla/Netscape to load URL via the GNOME program `gnome-moz-remote'. 1046 "Ask Mozilla/Netscape to load URL via the GNOME program `gnome-moz-remote'.
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 5a71a50c5db..502dc5e5115 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -159,7 +159,8 @@ Nil means to use a separate filename syntax for Tramp.")
159 159
160(defgroup tramp nil 160(defgroup tramp nil
161 "Edit remote files with a combination of rsh and rcp or similar programs." 161 "Edit remote files with a combination of rsh and rcp or similar programs."
162 :group 'files) 162 :group 'files
163 :version "21.4")
163 164
164(defcustom tramp-verbose 9 165(defcustom tramp-verbose 9
165 "*Verbosity level for tramp.el. 0 means be silent, 10 is most verbose." 166 "*Verbosity level for tramp.el. 0 means be silent, 10 is most verbose."
@@ -1535,8 +1536,9 @@ cat /tmp/tramp.$$
1535rm -f /tmp/tramp.$$ 1536rm -f /tmp/tramp.$$
1536}" 1537}"
1537 "Shell function to implement `uudecode' to standard output. 1538 "Shell function to implement `uudecode' to standard output.
1538Many systems support `uudecode -o -' for this or `uudecode -p', but 1539Many systems support `uudecode -o /dev/stdout' for this or
1539some systems don't, and for them we have this shell function.") 1540`uudecode -o -' or `uudecode -p', but some systems don't, and for
1541them we have this shell function.")
1540 1542
1541;; Perl script to implement `file-attributes' in a Lisp `read'able 1543;; Perl script to implement `file-attributes' in a Lisp `read'able
1542;; output. If you are hacking on this, note that you get *no* output 1544;; output. If you are hacking on this, note that you get *no* output
@@ -5970,6 +5972,8 @@ locale to C and sets up the remote shell search path."
5970 base64-encode-region base64-decode-region) 5972 base64-encode-region base64-decode-region)
5971 ("recode data..base64" "recode base64..data" 5973 ("recode data..base64" "recode base64..data"
5972 base64-encode-region base64-decode-region) 5974 base64-encode-region base64-decode-region)
5975 ("uuencode xxx" "uudecode -o /dev/stdout"
5976 tramp-uuencode-region uudecode-decode-region)
5973 ("uuencode xxx" "uudecode -o -" 5977 ("uuencode xxx" "uudecode -o -"
5974 tramp-uuencode-region uudecode-decode-region) 5978 tramp-uuencode-region uudecode-decode-region)
5975 ("uuencode xxx" "uudecode -p" 5979 ("uuencode xxx" "uudecode -p"
diff --git a/lisp/outline.el b/lisp/outline.el
index 2d2663b12f2..89e9e193e9c 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -723,7 +723,7 @@ Show the heading too, if it is currently invisible."
723 (progn (outline-next-preface) (point)) nil))) 723 (progn (outline-next-preface) (point)) nil)))
724 724
725(defun hide-body () 725(defun hide-body ()
726 "Hide all of buffer except headings." 726 "Hide all body lines in buffer, leaving all headings visible."
727 (interactive) 727 (interactive)
728 (hide-region-body (point-min) (point-max))) 728 (hide-region-body (point-min) (point-max)))
729 729
@@ -738,7 +738,8 @@ Show the heading too, if it is currently invisible."
738 (narrow-to-region start end) 738 (narrow-to-region start end)
739 (goto-char (point-min)) 739 (goto-char (point-min))
740 (if (outline-on-heading-p) 740 (if (outline-on-heading-p)
741 (outline-end-of-heading)) 741 (outline-end-of-heading)
742 (outline-next-preface))
742 (while (not (eobp)) 743 (while (not (eobp))
743 (outline-flag-region (point) 744 (outline-flag-region (point)
744 (progn (outline-next-preface) (point)) t) 745 (progn (outline-next-preface) (point)) t)
diff --git a/lisp/paren.el b/lisp/paren.el
index 6c5f9dece99..10695a41098 100644
--- a/lisp/paren.el
+++ b/lisp/paren.el
@@ -139,8 +139,8 @@ in `show-paren-style' after `show-paren-delay' seconds of Emacs idle time."
139(defun show-paren-function () 139(defun show-paren-function ()
140 (if show-paren-mode 140 (if show-paren-mode
141 (let ((oldpos (point)) 141 (let ((oldpos (point))
142 (dir (cond ((eq (car (syntax-after (1- (point)))) 5) -1) 142 (dir (cond ((eq (car (syntax-after (1- (point)))) ?\)) -1)
143 ((eq (car (syntax-after (point))) 4) 1))) 143 ((eq (car (syntax-after (point))) ?\() 1)))
144 pos mismatch face) 144 pos mismatch face)
145 ;; 145 ;;
146 ;; Find the other end of the sexp. 146 ;; Find the other end of the sexp.
diff --git a/lisp/pcvs.el b/lisp/pcvs.el
index 0a666927c52..0c8fe92f2d6 100644
--- a/lisp/pcvs.el
+++ b/lisp/pcvs.el
@@ -1,7 +1,7 @@
1;;; pcvs.el --- a front-end to CVS 1;;; pcvs.el --- a front-end to CVS
2 2
3;; Copyright (C) 1991,92,93,94,95,95,97,98,99,2000,02,03,2004 3;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4;; Free Software Foundation, Inc. 4;; 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
5 5
6;; Author: (The PCL-CVS Trust) pcl-cvs@cyclic.com 6;; Author: (The PCL-CVS Trust) pcl-cvs@cyclic.com
7;; (Per Cederqvist) ceder@lysator.liu.se 7;; (Per Cederqvist) ceder@lysator.liu.se
@@ -923,6 +923,21 @@ With a prefix argument, prompt for cvs FLAGS to use."
923 (append flags modules) nil 'new 923 (append flags modules) nil 'new
924 :noexist t)) 924 :noexist t))
925 925
926(defun-cvs-mode (cvs-mode-checkout . NOARGS) (dir)
927 "Run cvs checkout against the current branch.
928The files are stored to DIR."
929 (interactive
930 (let* ((branch (cvs-prefix-get 'cvs-branch-prefix))
931 (prompt (format "CVS Checkout Directory for `%s%s': "
932 (cvs-get-module)
933 (if branch (format " (branch: %s)" branch)
934 ""))))
935 (list (read-directory-name prompt nil default-directory nil))))
936 (let ((modules (cvs-string->strings (cvs-get-module)))
937 (flags (cvs-add-branch-prefix
938 (cvs-flags-query 'cvs-checkout-flags "cvs checkout flags")))
939 (cvs-cvsroot (cvs-get-cvsroot)))
940 (cvs-checkout modules dir flags)))
926 941
927;;;; 942;;;;
928;;;; The code for running a "cvs update" and friends in various ways. 943;;;; The code for running a "cvs update" and friends in various ways.
@@ -2353,5 +2368,5 @@ The exact behavior is determined also by `cvs-dired-use-hook'."
2353 2368
2354(provide 'pcvs) 2369(provide 'pcvs)
2355 2370
2356;;; arch-tag: 8e3a7494-0453-4389-9ab3-a557ce9fab61 2371;; arch-tag: 8e3a7494-0453-4389-9ab3-a557ce9fab61
2357;;; pcvs.el ends here 2372;;; pcvs.el ends here
diff --git a/lisp/printing.el b/lisp/printing.el
index 3efb53111fd..003e6893428 100644
--- a/lisp/printing.el
+++ b/lisp/printing.el
@@ -5,13 +5,13 @@
5 5
6;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> 6;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
7;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> 7;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
8;; Time-stamp: <2004/09/26 22:11:24 vinicius> 8;; Time-stamp: <2004/11/11 23:54:13 vinicius>
9;; Keywords: wp, print, PostScript 9;; Keywords: wp, print, PostScript
10;; Version: 6.8.1 10;; Version: 6.8.2
11;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ 11;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
12 12
13(defconst pr-version "6.8.1" 13(defconst pr-version "6.8.2"
14 "printing.el, v 6.8.1 <2004/09/26 vinicius> 14 "printing.el, v 6.8.2 <2004/11/11 vinicius>
15 15
16Please send all bug fixes and enhancements to 16Please send all bug fixes and enhancements to
17 Vinicius Jose Latorre <viniciusjl@ig.com.br> 17 Vinicius Jose Latorre <viniciusjl@ig.com.br>
@@ -1099,6 +1099,7 @@ Unless optional argument INPLACE is non-nil, return a new string."
1099 :tag "Printing Utilities" 1099 :tag "Printing Utilities"
1100 :link '(emacs-library-link :tag "Source Lisp File" "printing.el") 1100 :link '(emacs-library-link :tag "Source Lisp File" "printing.el")
1101 :prefix "pr-" 1101 :prefix "pr-"
1102 :version "20"
1102 :group 'wp 1103 :group 'wp
1103 :group 'postscript) 1104 :group 'postscript)
1104 1105
@@ -2474,20 +2475,16 @@ See `pr-ps-printer-alist'.")
2474 2475
2475(eval-and-compile 2476(eval-and-compile
2476 (defun pr-get-symbol (name) 2477 (defun pr-get-symbol (name)
2477 ;; Recent versions of easy-menu downcase names before interning them. 2478 (easy-menu-intern name))
2478 (and (fboundp 'easy-menu-name-match)
2479 (setq name (downcase name)))
2480 (or (intern-soft name)
2481 (make-symbol name)))
2482 2479
2483 (cond 2480 (cond
2484 ((eq ps-print-emacs-type 'emacs) ; GNU Emacs 2481 ((eq ps-print-emacs-type 'emacs) ; GNU Emacs
2485 (defsubst pr-region-active-p () 2482 (defun pr-region-active-p ()
2486 (and pr-auto-region transient-mark-mode mark-active))) 2483 (and pr-auto-region transient-mark-mode mark-active)))
2487 2484
2488 ((eq ps-print-emacs-type 'xemacs) ; XEmacs 2485 ((eq ps-print-emacs-type 'xemacs) ; XEmacs
2489 (defvar zmacs-region-stays nil) ; to avoid compilation gripes 2486 (defvar zmacs-region-stays nil) ; to avoid compilation gripes
2490 (defsubst pr-region-active-p () 2487 (defun pr-region-active-p ()
2491 (and pr-auto-region (not zmacs-region-stays) (ps-mark-active-p))))) 2488 (and pr-auto-region (not zmacs-region-stays) (ps-mark-active-p)))))
2492 2489
2493 2490
@@ -2907,18 +2904,18 @@ See `pr-ps-printer-alist'.")
2907 (pr-get-symbol "Printing"))))) 2904 (pr-get-symbol "Printing")))))
2908 ;; Emacs 21 2905 ;; Emacs 21
2909 (pr-menu-print-item 2906 (pr-menu-print-item
2910 (easy-menu-change '("files") "Print" pr-menu-spec "print-buffer") 2907 (easy-menu-change '("file") "Print" pr-menu-spec "print-buffer")
2911 (let ((items '("print-buffer" "print-region" 2908 (let ((items '("print-buffer" "print-region"
2912 "ps-print-buffer-faces" "ps-print-region-faces" 2909 "ps-print-buffer-faces" "ps-print-region-faces"
2913 "ps-print-buffer" "ps-print-region"))) 2910 "ps-print-buffer" "ps-print-region")))
2914 (while items 2911 (while items
2915 (easy-menu-remove-item nil '("files") (car items)) 2912 (easy-menu-remove-item nil '("file") (car items))
2916 (setq items (cdr items))) 2913 (setq items (cdr items)))
2917 (setq pr-menu-print-item nil 2914 (setq pr-menu-print-item nil
2918 pr-menu-bar (vector 'menu-bar 'files 2915 pr-menu-bar (vector 'menu-bar 'file
2919 (pr-get-symbol "Print"))))) 2916 (pr-get-symbol "Print")))))
2920 (t 2917 (t
2921 (easy-menu-change '("files") "Print" pr-menu-spec))) 2918 (easy-menu-change '("file") "Print" pr-menu-spec)))
2922 2919
2923 ;; Key binding 2920 ;; Key binding
2924 (global-set-key [print] 'pr-ps-fast-fire) 2921 (global-set-key [print] 'pr-ps-fast-fire)
@@ -6385,5 +6382,5 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order."
6385(provide 'printing) 6382(provide 'printing)
6386 6383
6387 6384
6388;;; arch-tag: 9ce9ac3f-0f60-4370-900b-1943215d9d18 6385;; arch-tag: 9ce9ac3f-0f60-4370-900b-1943215d9d18
6389;;; printing.el ends here 6386;;; printing.el ends here
diff --git a/lisp/progmodes/ada-xref.el b/lisp/progmodes/ada-xref.el
index 472cfc3053e..e7eb0657eac 100644
--- a/lisp/progmodes/ada-xref.el
+++ b/lisp/progmodes/ada-xref.el
@@ -1292,7 +1292,7 @@ If ARG is non-nil, ask the user to confirm the command."
1292 1292
1293 ;; Move to the end of the debugger buffer, so that it is automatically 1293 ;; Move to the end of the debugger buffer, so that it is automatically
1294 ;; scrolled from then on. 1294 ;; scrolled from then on.
1295 (end-of-buffer) 1295 (goto-char (point-max))
1296 1296
1297 ;; Display both the source window and the debugger window (the former 1297 ;; Display both the source window and the debugger window (the former
1298 ;; above the latter). No need to show the debugger window unless it 1298 ;; above the latter). No need to show the debugger window unless it
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 223455e9872..034cdaf5fdd 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -785,11 +785,14 @@ the function in `compilation-buffer-name-function', so you can set that
785to a function that generates a unique name." 785to a function that generates a unique name."
786 (interactive 786 (interactive
787 (list 787 (list
788 (if (or compilation-read-command current-prefix-arg) 788 (let ((command (eval compile-command)))
789 (read-from-minibuffer "Compile command: " 789 (if (or compilation-read-command current-prefix-arg)
790 (eval compile-command) nil nil 790 (read-from-minibuffer "Compile command: "
791 '(compile-history . 1)) 791 command nil nil
792 (eval compile-command)) 792 (if (equal (car compile-history) command)
793 '(compile-history . 1)
794 'compile-history))
795 command))
793 (consp current-prefix-arg))) 796 (consp current-prefix-arg)))
794 (unless (equal command (eval compile-command)) 797 (unless (equal command (eval compile-command))
795 (setq compile-command command)) 798 (setq compile-command command))
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 94458df56e8..38cc167d942 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -5292,7 +5292,7 @@ Customized by setting variables `cperl-shrink-wrap-info-frame',
5292 iniwin (selected-window) 5292 iniwin (selected-window)
5293 fr1 (window-frame iniwin)) 5293 fr1 (window-frame iniwin))
5294 (set-buffer buf) 5294 (set-buffer buf)
5295 (beginning-of-buffer) 5295 (goto-char (point-min))
5296 (or isvar 5296 (or isvar
5297 (progn (re-search-forward "^-X[ \t\n]") 5297 (progn (re-search-forward "^-X[ \t\n]")
5298 (forward-line -1))) 5298 (forward-line -1)))
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index 53165fbecb7..a1c4d539dd7 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -1223,14 +1223,16 @@ Return (TYPE NAME), or nil if not found."
1223With optional argument NUM, go forward that many balanced blocks. 1223With optional argument NUM, go forward that many balanced blocks.
1224If NUM is negative, go backward to the start of a block. 1224If NUM is negative, go backward to the start of a block.
1225Checks for consistency of block types and labels (if present), 1225Checks for consistency of block types and labels (if present),
1226and completes outermost block if necessary." 1226and completes outermost block if necessary.
1227Some of these things (which?) are not done if NUM is nil,
1228which only happens in a noninteractive call."
1227 (interactive "p") 1229 (interactive "p")
1228 (if (and num (< num 0)) (f90-beginning-of-block (- num))) 1230 (if (and num (< num 0)) (f90-beginning-of-block (- num)))
1229 (let ((f90-smart-end nil) ; for the final `f90-match-end' 1231 (let ((f90-smart-end nil) ; for the final `f90-match-end'
1230 (case-fold-search t) 1232 (case-fold-search t)
1231 (count (or num 1)) 1233 (count (or num 1))
1232 start-list start-this start-type start-label end-type end-label) 1234 start-list start-this start-type start-label end-type end-label)
1233 (if (interactive-p) (push-mark (point) t)) 1235 (if num (push-mark (point) t))
1234 (end-of-line) ; probably want this 1236 (end-of-line) ; probably want this
1235 (while (and (> count 0) (re-search-forward f90-blocks-re nil 'move)) 1237 (while (and (> count 0) (re-search-forward f90-blocks-re nil 'move))
1236 (beginning-of-line) 1238 (beginning-of-line)
@@ -1266,7 +1268,7 @@ and completes outermost block if necessary."
1266 (end-of-line)) 1268 (end-of-line))
1267 (if (> count 0) (error "Missing block end")) 1269 (if (> count 0) (error "Missing block end"))
1268 ;; Check outermost block. 1270 ;; Check outermost block.
1269 (if (interactive-p) 1271 (if num
1270 (save-excursion 1272 (save-excursion
1271 (beginning-of-line) 1273 (beginning-of-line)
1272 (skip-chars-forward " \t0-9") 1274 (skip-chars-forward " \t0-9")
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 90c0a50c7dc..7086e3b0b01 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -60,6 +60,7 @@
60(defvar gdb-previous-address nil) 60(defvar gdb-previous-address nil)
61(defvar gdb-previous-frame nil) 61(defvar gdb-previous-frame nil)
62(defvar gdb-current-frame nil) 62(defvar gdb-current-frame nil)
63(defvar gdb-current-stack-level nil)
63(defvar gdb-current-language nil) 64(defvar gdb-current-language nil)
64(defvar gdb-view-source t "Non-nil means that source code can be viewed.") 65(defvar gdb-view-source t "Non-nil means that source code can be viewed.")
65(defvar gdb-selected-view 'source "Code type that user wishes to view.") 66(defvar gdb-selected-view 'source "Code type that user wishes to view.")
@@ -183,6 +184,7 @@ detailed description of this mode.
183 (setq gdb-previous-address nil) 184 (setq gdb-previous-address nil)
184 (setq gdb-previous-frame nil) 185 (setq gdb-previous-frame nil)
185 (setq gdb-current-frame nil) 186 (setq gdb-current-frame nil)
187 (setq gdb-current-stack-level nil)
186 (setq gdb-view-source t) 188 (setq gdb-view-source t)
187 (setq gdb-selected-view 'source) 189 (setq gdb-selected-view 'source)
188 (setq gdb-var-list nil) 190 (setq gdb-var-list nil)
@@ -393,7 +395,8 @@ detailed description of this mode.
393 "If non-nil highlight values that have recently changed in the speedbar. 395 "If non-nil highlight values that have recently changed in the speedbar.
394The highlighting is done with `font-lock-warning-face'." 396The highlighting is done with `font-lock-warning-face'."
395 :type 'boolean 397 :type 'boolean
396 :group 'gud) 398 :group 'gud
399 :version "21.4")
397 400
398(defun gdb-speedbar-expand-node (text token indent) 401(defun gdb-speedbar-expand-node (text token indent)
399 "Expand the node the user clicked on. 402 "Expand the node the user clicked on.
@@ -1077,8 +1080,9 @@ static char *magick[] = {
1077 "Icon for disabled breakpoint in display margin.") 1080 "Icon for disabled breakpoint in display margin.")
1078 1081
1079;; Bitmap for breakpoint in fringe 1082;; Bitmap for breakpoint in fringe
1080(define-fringe-bitmap 'breakpoint 1083(and (display-images-p)
1081 "\x3c\x7e\xff\xff\xff\xff\x7e\x3c") 1084 (define-fringe-bitmap 'breakpoint
1085 "\x3c\x7e\xff\xff\xff\xff\x7e\x3c"))
1082 1086
1083(defface breakpoint-enabled-bitmap-face 1087(defface breakpoint-enabled-bitmap-face
1084 '((t 1088 '((t
@@ -1290,9 +1294,8 @@ static char *magick[] = {
1290 '(mouse-face highlight 1294 '(mouse-face highlight
1291 help-echo "mouse-2, RET: Select frame")) 1295 help-echo "mouse-2, RET: Select frame"))
1292 (beginning-of-line) 1296 (beginning-of-line)
1293 (when (and (or (looking-at "^#[0-9]*\\s-*\\S-* in \\(\\S-*\\)") 1297 (when (and (looking-at "^#\\([0-9]+\\)")
1294 (looking-at "^#[0-9]*\\s-*\\(\\S-*\\)")) 1298 (equal (match-string 1) gdb-current-stack-level))
1295 (equal (match-string 1) gdb-current-frame))
1296 (put-text-property (point-at-bol) (point-at-eol) 1299 (put-text-property (point-at-bol) (point-at-eol)
1297 'face '(:inverse-video t))) 1300 'face '(:inverse-video t)))
1298 (forward-line 1)))))) 1301 (forward-line 1))))))
@@ -2046,6 +2049,8 @@ BUFFER nil or omitted means use the current buffer."
2046 (delq 'gdb-get-current-frame gdb-pending-triggers)) 2049 (delq 'gdb-get-current-frame gdb-pending-triggers))
2047 (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer) 2050 (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
2048 (goto-char (point-min)) 2051 (goto-char (point-min))
2052 (if (looking-at "Stack level \\([0-9]+\\)")
2053 (setq gdb-current-stack-level (match-string 1)))
2049 (forward-line) 2054 (forward-line)
2050 (if (looking-at ".*=\\s-+0x\\(\\S-*\\)\\s-+in\\s-+\\(\\S-*?\\);? ") 2055 (if (looking-at ".*=\\s-+0x\\(\\S-*\\)\\s-+in\\s-+\\(\\S-*?\\);? ")
2051 (progn 2056 (progn
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el
index 692fce0234e..6720014ed31 100644
--- a/lisp/progmodes/idlw-shell.el
+++ b/lisp/progmodes/idlw-shell.el
@@ -508,11 +508,19 @@ the expression output by IDL."
508(defvar comint-last-input-start) 508(defvar comint-last-input-start)
509(defvar comint-last-input-end) 509(defvar comint-last-input-end)
510 510
511(defvar idlwave-shell-temp-pro-file nil
512 "Absolute pathname for temporary IDL file for compiling regions")
513
514(defvar idlwave-shell-temp-rinfo-save-file nil
515 "Absolute pathname for temporary IDL file save file for routine_info.
516This is used to speed up the reloading of the routine info procedure
517before use by the shell.")
518
511(defun idlwave-shell-temp-file (type) 519(defun idlwave-shell-temp-file (type)
512 "Return a temp file, creating it if necessary. 520 "Return a temp file, creating it if necessary.
513 521
514TYPE is either 'pro or 'rinfo, and idlwave-shell-temp-pro-file or 522TYPE is either `pro' or `rinfo', and `idlwave-shell-temp-pro-file' or
515idlwave-shell-temp-rinfo-save-file is set (respectively)." 523`idlwave-shell-temp-rinfo-save-file' is set (respectively)."
516 (cond 524 (cond
517 ((eq type 'rinfo) 525 ((eq type 'rinfo)
518 (or idlwave-shell-temp-rinfo-save-file 526 (or idlwave-shell-temp-rinfo-save-file
@@ -550,17 +558,6 @@ idlwave-shell-temp-rinfo-save-file is set (respectively)."
550 nil) 558 nil)
551 file))) 559 file)))
552 560
553;; Other variables
554(defvar idlwave-shell-temp-pro-file
555 nil
556 "Absolute pathname for temporary IDL file for compiling regions")
557
558(defvar idlwave-shell-temp-rinfo-save-file
559 nil
560 "Absolute pathname for temporary IDL file save file for routine_info.
561This is used to speed up the reloading of the routine info procedure
562before use by the shell.")
563
564(defvar idlwave-shell-dirstack-query "cd,current=___cur & print,___cur" 561(defvar idlwave-shell-dirstack-query "cd,current=___cur & print,___cur"
565 "Command used by `idlwave-shell-resync-dirs' to query IDL for 562 "Command used by `idlwave-shell-resync-dirs' to query IDL for
566the directory stack.") 563the directory stack.")
@@ -2523,6 +2520,10 @@ idlw-shell-examine-alist from which to select the help command text."
2523(defvar idlwave-shell-examine-window-alist nil 2520(defvar idlwave-shell-examine-window-alist nil
2524 "Variable to hold the win/height pairs for all *Examine* windows.") 2521 "Variable to hold the win/height pairs for all *Examine* windows.")
2525 2522
2523(defvar idlwave-shell-examine-map (make-sparse-keymap))
2524(define-key idlwave-shell-examine-map "q" 'idlwave-shell-examine-display-quit)
2525(define-key idlwave-shell-examine-map "c" 'idlwave-shell-examine-display-clear)
2526
2526(defun idlwave-shell-examine-display () 2527(defun idlwave-shell-examine-display ()
2527 "View the examine command output in a separate buffer." 2528 "View the examine command output in a separate buffer."
2528 (let (win cur-beg cur-end) 2529 (let (win cur-beg cur-end)
@@ -2603,10 +2604,6 @@ idlw-shell-examine-alist from which to select the help command text."
2603 (skip-chars-backward "\n") 2604 (skip-chars-backward "\n")
2604 (recenter -1))))) 2605 (recenter -1)))))
2605 2606
2606(defvar idlwave-shell-examine-map (make-sparse-keymap))
2607(define-key idlwave-shell-examine-map "q" 'idlwave-shell-examine-display-quit)
2608(define-key idlwave-shell-examine-map "c" 'idlwave-shell-examine-display-clear)
2609
2610(defun idlwave-shell-examine-display-quit () 2607(defun idlwave-shell-examine-display-quit ()
2611 (interactive) 2608 (interactive)
2612 (let ((win (selected-window))) 2609 (let ((win (selected-window)))
diff --git a/lisp/recentf.el b/lisp/recentf.el
index 4ef55d4e1bf..2fee8e637a8 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -98,7 +98,7 @@ Set VARIABLE with VALUE, and force a rebuild of the recentf menu."
98 :type 'string 98 :type 'string
99 :set 'recentf-menu-customization-changed) 99 :set 'recentf-menu-customization-changed)
100 100
101(defcustom recentf-menu-path '("files") 101(defcustom recentf-menu-path '("File")
102 "*Path where to add the recentf menu. 102 "*Path where to add the recentf menu.
103If nil add it at top level (see also `easy-menu-add-item')." 103If nil add it at top level (see also `easy-menu-add-item')."
104 :group 'recentf 104 :group 'recentf
diff --git a/lisp/simple.el b/lisp/simple.el
index cde0e75f030..69f51659751 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -67,6 +67,44 @@
67 (switch-to-buffer found))) 67 (switch-to-buffer found)))
68 68
69;;; next-error support framework 69;;; next-error support framework
70
71(defgroup next-error nil
72 "next-error support framework."
73 :group 'compilation
74 :version "21.4")
75
76(defface next-error
77 '((t (:inherit region)))
78 "Face used to highlight next error locus."
79 :group 'next-error
80 :version "21.4")
81
82(defcustom next-error-highlight 0.1
83 "*Highlighting of locations in selected source buffers.
84If number, highlight the locus in next-error face for given time in seconds.
85If t, use persistent overlays fontified in next-error face.
86If nil, don't highlight the locus in the source buffer.
87If `fringe-arrow', indicate the locus by the fringe arrow."
88 :type '(choice (number :tag "Delay")
89 (const :tag "Persistent overlay" t)
90 (const :tag "No highlighting" nil)
91 (const :tag "Fringe arrow" 'fringe-arrow))
92 :group 'next-error
93 :version "21.4")
94
95(defcustom next-error-highlight-no-select 0.1
96 "*Highlighting of locations in non-selected source buffers.
97If number, highlight the locus in next-error face for given time in seconds.
98If t, use persistent overlays fontified in next-error face.
99If nil, don't highlight the locus in the source buffer.
100If `fringe-arrow', indicate the locus by the fringe arrow."
101 :type '(choice (number :tag "Delay")
102 (const :tag "Persistent overlay" t)
103 (const :tag "No highlighting" nil)
104 (const :tag "Fringe arrow" 'fringe-arrow))
105 :group 'next-error
106 :version "21.4")
107
70(defvar next-error-last-buffer nil 108(defvar next-error-last-buffer nil
71 "The most recent next-error buffer. 109 "The most recent next-error buffer.
72A buffer becomes most recent when its compilation, grep, or 110A buffer becomes most recent when its compilation, grep, or
@@ -213,43 +251,6 @@ select the source buffer."
213 (interactive "p") 251 (interactive "p")
214 (next-error-no-select (- (or n 1)))) 252 (next-error-no-select (- (or n 1))))
215 253
216(defgroup next-error nil
217 "next-error support framework."
218 :group 'compilation
219 :version "21.4")
220
221(defface next-error
222 '((t (:inherit region)))
223 "Face used to highlight next error locus."
224 :group 'next-error
225 :version "21.4")
226
227(defcustom next-error-highlight 0.1
228 "*Highlighting of locations in selected source buffers.
229If number, highlight the locus in next-error face for given time in seconds.
230If t, use persistent overlays fontified in next-error face.
231If nil, don't highlight the locus in the source buffer.
232If `fringe-arrow', indicate the locus by the fringe arrow."
233 :type '(choice (number :tag "Delay")
234 (const :tag "Persistent overlay" t)
235 (const :tag "No highlighting" nil)
236 (const :tag "Fringe arrow" 'fringe-arrow))
237 :group 'next-error
238 :version "21.4")
239
240(defcustom next-error-highlight-no-select 0.1
241 "*Highlighting of locations in non-selected source buffers.
242If number, highlight the locus in next-error face for given time in seconds.
243If t, use persistent overlays fontified in next-error face.
244If nil, don't highlight the locus in the source buffer.
245If `fringe-arrow', indicate the locus by the fringe arrow."
246 :type '(choice (number :tag "Delay")
247 (const :tag "Persistent overlay" t)
248 (const :tag "No highlighting" nil)
249 (const :tag "Fringe arrow" 'fringe-arrow))
250 :group 'next-error
251 :version "21.4")
252
253;;; Internal variable for `next-error-follow-mode-post-command-hook'. 254;;; Internal variable for `next-error-follow-mode-post-command-hook'.
254(defvar next-error-follow-last-line nil) 255(defvar next-error-follow-last-line nil)
255 256
@@ -2280,6 +2281,8 @@ This command is similar to `copy-region-as-kill', except that it gives
2280visual feedback indicating the extent of the region being copied." 2281visual feedback indicating the extent of the region being copied."
2281 (interactive "r") 2282 (interactive "r")
2282 (copy-region-as-kill beg end) 2283 (copy-region-as-kill beg end)
2284 ;; This use of interactive-p is correct
2285 ;; because the code it controls just gives the user visual feedback.
2283 (if (interactive-p) 2286 (if (interactive-p)
2284 (let ((other-end (if (= (point) beg) end beg)) 2287 (let ((other-end (if (= (point) beg) end beg))
2285 (opoint (point)) 2288 (opoint (point))
@@ -3081,13 +3084,13 @@ It is the column where point was
3081at the start of current run of vertical motion commands. 3084at the start of current run of vertical motion commands.
3082When the `track-eol' feature is doing its job, the value is 9999.") 3085When the `track-eol' feature is doing its job, the value is 9999.")
3083 3086
3084(defcustom line-move-ignore-invisible nil 3087(defcustom line-move-ignore-invisible t
3085 "*Non-nil means \\[next-line] and \\[previous-line] ignore invisible lines. 3088 "*Non-nil means \\[next-line] and \\[previous-line] ignore invisible lines.
3086Outline mode sets this." 3089Outline mode sets this."
3087 :type 'boolean 3090 :type 'boolean
3088 :group 'editing-basics) 3091 :group 'editing-basics)
3089 3092
3090(defun line-move-invisible (pos) 3093(defun line-move-invisible-p (pos)
3091 "Return non-nil if the character after POS is currently invisible." 3094 "Return non-nil if the character after POS is currently invisible."
3092 (let ((prop 3095 (let ((prop
3093 (get-char-property pos 'invisible))) 3096 (get-char-property pos 'invisible)))
@@ -3098,7 +3101,8 @@ Outline mode sets this."
3098 3101
3099;; This is the guts of next-line and previous-line. 3102;; This is the guts of next-line and previous-line.
3100;; Arg says how many lines to move. 3103;; Arg says how many lines to move.
3101(defun line-move (arg) 3104;; The value is t if we can move the specified number of lines.
3105(defun line-move (arg &optional noerror to-end)
3102 ;; Don't run any point-motion hooks, and disregard intangibility, 3106 ;; Don't run any point-motion hooks, and disregard intangibility,
3103 ;; for intermediate positions. 3107 ;; for intermediate positions.
3104 (let ((inhibit-point-motion-hooks t) 3108 (let ((inhibit-point-motion-hooks t)
@@ -3114,6 +3118,7 @@ Outline mode sets this."
3114 (or (not (bolp)) (eq last-command 'end-of-line))) 3118 (or (not (bolp)) (eq last-command 'end-of-line)))
3115 9999 3119 9999
3116 (current-column)))) 3120 (current-column))))
3121
3117 (if (and (not (integerp selective-display)) 3122 (if (and (not (integerp selective-display))
3118 (not line-move-ignore-invisible)) 3123 (not line-move-ignore-invisible))
3119 ;; Use just newline characters. 3124 ;; Use just newline characters.
@@ -3129,28 +3134,43 @@ Outline mode sets this."
3129 (and (zerop (forward-line arg)) 3134 (and (zerop (forward-line arg))
3130 (bolp) 3135 (bolp)
3131 (setq arg 0))) 3136 (setq arg 0)))
3132 (signal (if (< arg 0) 3137 (unless noerror
3133 'beginning-of-buffer 3138 (signal (if (< arg 0)
3134 'end-of-buffer) 3139 'beginning-of-buffer
3135 nil)) 3140 'end-of-buffer)
3141 nil)))
3136 ;; Move by arg lines, but ignore invisible ones. 3142 ;; Move by arg lines, but ignore invisible ones.
3137 (while (> arg 0) 3143 (let (done)
3138 ;; If the following character is currently invisible, 3144 (while (and (> arg 0) (not done))
3139 ;; skip all characters with that same `invisible' property value. 3145 ;; If the following character is currently invisible,
3140 (while (and (not (eobp)) (line-move-invisible (point))) 3146 ;; skip all characters with that same `invisible' property value.
3141 (goto-char (next-char-property-change (point)))) 3147 (while (and (not (eobp)) (line-move-invisible-p (point)))
3142 ;; Now move a line. 3148 (goto-char (next-char-property-change (point))))
3143 (end-of-line) 3149 ;; Now move a line.
3144 (and (zerop (vertical-motion 1)) 3150 (end-of-line)
3145 (signal 'end-of-buffer nil)) 3151 (and (zerop (vertical-motion 1))
3146 (setq arg (1- arg))) 3152 (if (not noerror)
3147 (while (< arg 0) 3153 (signal 'end-of-buffer nil)
3148 (beginning-of-line) 3154 (setq done t)))
3149 (and (zerop (vertical-motion -1)) 3155 (unless done
3150 (signal 'beginning-of-buffer nil)) 3156 (setq arg (1- arg))))
3151 (setq arg (1+ arg)) 3157 (while (and (< arg 0) (not done))
3152 (while (and (not (bobp)) (line-move-invisible (1- (point)))) 3158 (beginning-of-line)
3153 (goto-char (previous-char-property-change (point))))))) 3159
3160 (if (zerop (vertical-motion -1))
3161 (if (not noerror)
3162 (signal 'beginning-of-buffer nil)
3163 (setq done t)))
3164 (unless done
3165 (setq arg (1+ arg))
3166 (while (and ;; Don't move over previous invis lines
3167 ;; if our target is the middle of this line.
3168 (or (zerop (or goal-column temporary-goal-column))
3169 (< arg 0))
3170 (not (bobp)) (line-move-invisible-p (1- (point))))
3171 (goto-char (previous-char-property-change (point))))))))
3172 ;; This is the value the function returns.
3173 (= arg 0))
3154 3174
3155 (cond ((> arg 0) 3175 (cond ((> arg 0)
3156 ;; If we did not move down as far as desired, 3176 ;; If we did not move down as far as desired,
@@ -3161,8 +3181,7 @@ Outline mode sets this."
3161 ;; at least go to end of line. 3181 ;; at least go to end of line.
3162 (beginning-of-line)) 3182 (beginning-of-line))
3163 (t 3183 (t
3164 (line-move-finish (or goal-column temporary-goal-column) opoint))))) 3184 (line-move-finish (or goal-column temporary-goal-column) opoint))))))
3165 nil)
3166 3185
3167(defun line-move-finish (column opoint) 3186(defun line-move-finish (column opoint)
3168 (let ((repeat t)) 3187 (let ((repeat t))
@@ -3175,9 +3194,11 @@ Outline mode sets this."
3175 (line-end 3194 (line-end
3176 ;; Compute the end of the line 3195 ;; Compute the end of the line
3177 ;; ignoring effectively intangible newlines. 3196 ;; ignoring effectively intangible newlines.
3178 (let ((inhibit-point-motion-hooks nil) 3197 (save-excursion
3179 (inhibit-field-text-motion t)) 3198 (let ((inhibit-point-motion-hooks nil)
3180 (save-excursion (end-of-line) (point))))) 3199 (inhibit-field-text-motion t))
3200 (end-of-line))
3201 (point))))
3181 3202
3182 ;; Move to the desired column. 3203 ;; Move to the desired column.
3183 (line-move-to-column column) 3204 (line-move-to-column column)
@@ -3228,13 +3249,13 @@ and `current-column' to be able to ignore invisible text."
3228 (move-to-column col)) 3249 (move-to-column col))
3229 3250
3230 (when (and line-move-ignore-invisible 3251 (when (and line-move-ignore-invisible
3231 (not (bolp)) (line-move-invisible (1- (point)))) 3252 (not (bolp)) (line-move-invisible-p (1- (point))))
3232 (let ((normal-location (point)) 3253 (let ((normal-location (point))
3233 (normal-column (current-column))) 3254 (normal-column (current-column)))
3234 ;; If the following character is currently invisible, 3255 ;; If the following character is currently invisible,
3235 ;; skip all characters with that same `invisible' property value. 3256 ;; skip all characters with that same `invisible' property value.
3236 (while (and (not (eobp)) 3257 (while (and (not (eobp))
3237 (line-move-invisible (point))) 3258 (line-move-invisible-p (point)))
3238 (goto-char (next-char-property-change (point)))) 3259 (goto-char (next-char-property-change (point))))
3239 ;; Have we advanced to a larger column position? 3260 ;; Have we advanced to a larger column position?
3240 (if (> (current-column) normal-column) 3261 (if (> (current-column) normal-column)
@@ -3247,9 +3268,45 @@ and `current-column' to be able to ignore invisible text."
3247 ;; but with a more reasonable buffer position. 3268 ;; but with a more reasonable buffer position.
3248 (goto-char normal-location) 3269 (goto-char normal-location)
3249 (let ((line-beg (save-excursion (beginning-of-line) (point)))) 3270 (let ((line-beg (save-excursion (beginning-of-line) (point))))
3250 (while (and (not (bolp)) (line-move-invisible (1- (point)))) 3271 (while (and (not (bolp)) (line-move-invisible-p (1- (point))))
3251 (goto-char (previous-char-property-change (point) line-beg)))))))) 3272 (goto-char (previous-char-property-change (point) line-beg))))))))
3252 3273
3274(defun move-end-of-line (arg)
3275 "Move point to end of current line.
3276With argument ARG not nil or 1, move forward ARG - 1 lines first.
3277If point reaches the beginning or end of buffer, it stops there.
3278To ignore intangibility, bind `inhibit-point-motion-hooks' to t.
3279
3280This command does not move point across a field boundary unless doing so
3281would move beyond there to a different line; if ARG is nil or 1, and
3282point starts at a field boundary, point does not move. To ignore field
3283boundaries bind `inhibit-field-text-motion' to t."
3284 (interactive "p")
3285 (or arg (setq arg 1))
3286 (let (done)
3287 (while (not done)
3288 (let ((newpos
3289 (save-excursion
3290 (let ((goal-column 0))
3291 (and (line-move arg t)
3292 (not (bobp))
3293 (progn
3294 (while (and (not (bobp)) (line-move-invisible-p (1- (point))))
3295 (goto-char (previous-char-property-change (point))))
3296 (backward-char 1)))
3297 (point)))))
3298 (goto-char newpos)
3299 (if (and (> (point) newpos)
3300 (eq (preceding-char) ?\n))
3301 (backward-char 1)
3302 (if (and (> (point) newpos) (not (eobp))
3303 (not (eq (following-char) ?\n)))
3304 ;; If we skipped something intangible
3305 ;; and now we're not really at eol,
3306 ;; keep going.
3307 (setq arg 1)
3308 (setq done t)))))))
3309
3253;;; Many people have said they rarely use this feature, and often type 3310;;; Many people have said they rarely use this feature, and often type
3254;;; it by accident. Maybe it shouldn't even be on a key. 3311;;; it by accident. Maybe it shouldn't even be on a key.
3255(put 'set-goal-column 'disabled t) 3312(put 'set-goal-column 'disabled t)
@@ -3298,7 +3355,8 @@ With arg N, put point N/10 of the way from the true beginning."
3298 (progn 3355 (progn
3299 (select-window window) 3356 (select-window window)
3300 ;; Set point and mark in that window's buffer. 3357 ;; Set point and mark in that window's buffer.
3301 (beginning-of-buffer arg) 3358 (with-no-warnings
3359 (beginning-of-buffer arg))
3302 ;; Set point accordingly. 3360 ;; Set point accordingly.
3303 (recenter '(t))) 3361 (recenter '(t)))
3304 (select-window orig-window)))) 3362 (select-window orig-window))))
@@ -3314,7 +3372,8 @@ With arg N, put point N/10 of the way from the true end."
3314 (unwind-protect 3372 (unwind-protect
3315 (progn 3373 (progn
3316 (select-window window) 3374 (select-window window)
3317 (end-of-buffer arg) 3375 (with-no-warnings
3376 (end-of-buffer arg))
3318 (recenter '(t))) 3377 (recenter '(t)))
3319 (select-window orig-window)))) 3378 (select-window orig-window))))
3320 3379
diff --git a/lisp/subr.el b/lisp/subr.el
index 54d382dea61..74614720227 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2209,12 +2209,20 @@ from `standard-syntax-table' otherwise."
2209 table)) 2209 table))
2210 2210
2211(defun syntax-after (pos) 2211(defun syntax-after (pos)
2212 "Return the syntax of the char after POS." 2212 "Return the syntax of the char after POS.
2213The value is either a syntax class character (a character that designates
2214a syntax in `modify-syntax-entry'), or a cons cell
2215of the form (CLASS . MATCH), where CLASS is the syntax class character
2216and MATCH is the matching parenthesis."
2213 (unless (or (< pos (point-min)) (>= pos (point-max))) 2217 (unless (or (< pos (point-min)) (>= pos (point-max)))
2214 (let ((st (if parse-sexp-lookup-properties 2218 (let* ((st (if parse-sexp-lookup-properties
2215 (get-char-property pos 'syntax-table)))) 2219 (get-char-property pos 'syntax-table)))
2216 (if (consp st) st 2220 (value
2217 (aref (or st (syntax-table)) (char-after pos)))))) 2221 (if (consp st) st
2222 (aref (or st (syntax-table)) (char-after pos))))
2223 (code (if (consp value) (car value) value)))
2224 (setq code (aref "-.w_()'\"$\\/<>@!|" code))
2225 (if (consp value) (cons code (cdr value)) code))))
2218 2226
2219(defun add-to-invisibility-spec (arg) 2227(defun add-to-invisibility-spec (arg)
2220 "Add elements to `buffer-invisibility-spec'. 2228 "Add elements to `buffer-invisibility-spec'.
diff --git a/lisp/tempo.el b/lisp/tempo.el
index 3ceb3e271f4..43f90b64766 100644
--- a/lisp/tempo.el
+++ b/lisp/tempo.el
@@ -1,6 +1,6 @@
1;;; tempo.el --- Flexible template insertion 1;;; tempo.el --- Flexible template insertion
2 2
3;; Copyright (C) 1994, 1995 Free Software Foundation, Inc. 3;; Copyright (C) 1994, 1995, 2004 Free Software Foundation, Inc.
4 4
5;; Author: David K}gedal <davidk@lysator.liu.se> 5;; Author: David K}gedal <davidk@lysator.liu.se>
6;; Created: 16 Feb 1994 6;; Created: 16 Feb 1994
@@ -172,7 +172,7 @@ documentation for the function `tempo-complete-tag' for more info.
172(defvar tempo-marks nil 172(defvar tempo-marks nil
173 "A list of marks to jump to with `\\[tempo-forward-mark]' and `\\[tempo-backward-mark]'.") 173 "A list of marks to jump to with `\\[tempo-forward-mark]' and `\\[tempo-backward-mark]'.")
174 174
175(defvar tempo-match-finder "\\b\\([^\\b]+\\)\\=" 175(defvar tempo-match-finder "\\b\\([[:word:]]+\\)\\="
176 "The regexp or function used to find the string to match against tags. 176 "The regexp or function used to find the string to match against tags.
177 177
178If `tempo-match-finder is a string, it should contain a regular 178If `tempo-match-finder is a string, it should contain a regular
@@ -182,7 +182,7 @@ the string between the first \\( and \\) is used for matching against
182each string in the tag list. If one is found, the whole text between 182each string in the tag list. If one is found, the whole text between
183the first \\( and the point is replaced with the inserted template. 183the first \\( and the point is replaced with the inserted template.
184 184
185You will probably want to include \\ \= at the end of the regexp to 185You will probably want to include \\=\\= at the end of the regexp to
186make sure that the string is matched only against text adjacent to the 186make sure that the string is matched only against text adjacent to the
187point. 187point.
188 188
diff --git a/lisp/textmodes/conf-mode.el b/lisp/textmodes/conf-mode.el
new file mode 100644
index 00000000000..cb692616947
--- /dev/null
+++ b/lisp/textmodes/conf-mode.el
@@ -0,0 +1,531 @@
1;;; conf-mode.el --- Simple major mode for editing conf/ini/properties files
2
3;; Copyright (C) 2004 by Daniel Pfeiffer <occitan@esperanto.org>
4;; Keywords: conf ini windows java
5
6;; This file is part of GNU Emacs.
7
8;; GNU Emacs is free software; you can redistribute it and/or modify
9;; it under the terms of the GNU General Public License as published by
10;; the Free Software Foundation; either version 2, or (at your option)
11;; any later version.
12
13;; GNU Emacs is distributed in the hope that it will be useful,
14;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;; GNU General Public License for more details.
17
18;; You should have received a copy of the GNU General Public License
19;; along with GNU Emacs; see the file COPYING. If not, write to the
20;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21;; Boston, MA 02111-1307, USA.
22
23;;; Commentary:
24;;
25;; This mode is designed to edit many similar varieties of Conf/Ini files and
26;; Java properties. It started out from Aurélien Tisné's ini-mode.
27;; `conf-space-keywords' were inspired by Robert Fitzgerald's any-ini-mode.
28
29
30;;; Code:
31
32(require 'newcomment)
33
34;; Variables:
35
36(defgroup conf nil
37 "Configuration files."
38 :group 'data
39 :version "21.4")
40
41(defcustom conf-assignment-column 24
42 "Align assignments to this column by default with \\[conf-align-assignments].
43If this number is negative, the `=' comes before the whitespace. Use 0 to
44not align (only setting space according to `conf-assignment-space')."
45 :type 'integer
46 :group 'conf)
47
48(defcustom conf-javaprop-assignment-column 32
49 "Value for `conf-assignment-column' in Java properties buffers."
50 :type 'integer
51 :group 'conf)
52
53(defcustom conf-colon-assignment-column (- (abs conf-assignment-column))
54 "Value for `conf-assignment-column' in Java properties buffers."
55 :type 'integer
56 :group 'conf)
57
58(defcustom conf-assignment-space t
59 "Put at least one space around assignments when aligning."
60 :type 'boolean
61 :group 'conf)
62
63(defcustom conf-colon-assignment-space nil
64 "Value for `conf-assignment-space' in colon style Conf mode buffers."
65 :type 'boolean
66 :group 'conf)
67
68
69(defvar conf-mode-map
70 (let ((map (make-sparse-keymap)))
71 (define-key map "\C-c\C-u" 'conf-unix-mode)
72 (define-key map "\C-c\C-w" 'conf-windows-mode)
73 (define-key map "\C-c\C-j" 'conf-javaprop-mode)
74 (define-key map "\C-c\C-s" 'conf-space-mode)
75 (define-key map "\C-c " 'conf-space-mode)
76 (define-key map "\C-c\C-c" 'conf-colon-mode)
77 (define-key map "\C-c:" 'conf-colon-mode)
78 (define-key map "\C-c\C-x" 'conf-xdefaults-mode)
79 (define-key map "\C-c\C-q" 'conf-quote-normal)
80 (define-key map "\C-c\"" 'conf-quote-normal)
81 (define-key map "\C-c'" 'conf-quote-normal)
82 (define-key map "\C-c\C-a" 'conf-align-assignments)
83 map)
84 "Local keymap for conf-mode buffers.")
85
86(defvar conf-mode-syntax-table
87 (let ((table (make-syntax-table)))
88 (modify-syntax-entry ?= "." table)
89 (modify-syntax-entry ?_ "_" table)
90 (modify-syntax-entry ?- "_" table)
91 (modify-syntax-entry ?. "_" table)
92 (modify-syntax-entry ?\' "\"" table)
93; (modify-syntax-entry ?: "_" table)
94 (modify-syntax-entry ?\; "<" table)
95 (modify-syntax-entry ?\n ">" table)
96 (modify-syntax-entry ?\r ">" table)
97 table)
98 "Syntax table in use in Windows style conf-mode buffers.")
99
100(defvar conf-unix-mode-syntax-table
101 (let ((table (make-syntax-table conf-mode-syntax-table)))
102 (modify-syntax-entry ?\# "<" table)
103 ;; override
104 (modify-syntax-entry ?\; "." table)
105 table)
106 "Syntax table in use in Unix style conf-mode buffers.")
107
108(defvar conf-javaprop-mode-syntax-table
109 (let ((table (make-syntax-table conf-unix-mode-syntax-table)))
110 (modify-syntax-entry ?/ ". 124" table)
111 (modify-syntax-entry ?* ". 23b" table)
112 table)
113 "Syntax table in use in Java prperties buffers.")
114
115(defvar conf-xdefaults-mode-syntax-table
116 (let ((table (make-syntax-table conf-mode-syntax-table)))
117 (modify-syntax-entry ?! "<" table)
118 ;; override
119 (modify-syntax-entry ?\; "." table)
120 table)
121 "Syntax table in use in Xdefaults style conf-mode buffers.")
122
123
124(defvar conf-font-lock-keywords
125 `(;; [section] (do this first because it may look like a parameter)
126 ("^[ \t]*\\[\\(.+\\)\\]" 1 'font-lock-type-face)
127 ;; var=val or var[index]=val
128 ("^[ \t]*\\(.+?\\)\\(?:\\[\\(.*?\\)\\]\\)?[ \t]*="
129 (1 'font-lock-variable-name-face)
130 (2 'font-lock-constant-face nil t))
131 ;; section { ... } (do this last because some assign ...{...)
132 ("^[ \t]*\\([^=:\n]+?\\)[ \t\n]*{[^{}]*?$" 1 'font-lock-type-face prepend))
133 "Keywords to hilight in Conf mode")
134
135(defvar conf-javaprop-font-lock-keywords
136 '(;; var=val
137 ("^[ \t]*\\(.+?\\)\\(?:\\.\\([0-9]+\\)\\(?:\\.\\(.+?\\)\\(?:\\.\\([0-9]+\\)\\(?:\\.\\(.+?\\)\\(?:\\.\\([0-9]+\\)\\(\\..+?\\)?\\)?\\)?\\)?\\)?\\)?\\([:= \t]\\|$\\)"
138 (1 'font-lock-variable-name-face)
139 (2 'font-lock-constant-face nil t)
140 (3 'font-lock-variable-name-face nil t)
141 (4 'font-lock-constant-face nil t)
142 (5 'font-lock-variable-name-face nil t)
143 (6 'font-lock-constant-face nil t)
144 (7 'font-lock-variable-name-face nil t)))
145 "Keywords to hilight in Conf Java Properties mode")
146
147(defvar conf-space-keywords-alist
148 '(("\\`/etc/gpm/" . "key\\|name\\|foreground\\|background\\|border\\|head")
149 ("\\`/etc/magic\\'" . "[^ \t]+[ \t]+\\(?:[bl]?e?\\(?:short\\|long\\)\\|byte\\|string\\)[^ \t]*")
150 ("/mod\\(?:ules\\|probe\\)\\.conf" . "alias\\|in\\(?:clude\\|stall\\)\\|options\\|remove")
151 ("/manpath\\.config" . "MAN\\(?:DATORY_MANPATH\\|PATH_MAP\\|DB_MAP\\)")
152 ("/sensors\\.conf" . "chip\\|bus\\|label\\|compute\\|set\\|ignore")
153 ("/sane\\(\\.d\\)?/" . "option\\|device\\|port\\|usb\\|sc\\(?:si\\|anner\\)")
154 ("/resmgr\\.conf" . "class\\|add\\|allow\\|deny")
155 ("/dictionary\\.lst\\'" . "DICT\\|HYPH\\|THES")
156 ("/tuxracer/options" . "set"))
157 "File name based settings for `conf-space-keywords'.")
158
159(defvar conf-space-keywords nil
160 "Regexps for functions that may come before a space assignment.
161This allows constructs such as
162keyword var value
163This variable is best set in the file local variables, or through
164`conf-space-keywords-alist'.")
165
166(defvar conf-space-font-lock-keywords
167 `(;; [section] (do this first because it may look like a parameter)
168 ("^[ \t]*\\[\\(.+\\)\\]" 1 'font-lock-type-face)
169 ;; section { ... } (do this first because it looks like a parameter)
170 ("^[ \t]*\\(.+?\\)[ \t\n]*{[^{}]*?$" 1 'font-lock-type-face)
171 ;; var val
172 (eval if conf-space-keywords
173 (list (concat "^[ \t]*\\(" conf-space-keywords "\\)[ \t]+\\([^\000- ]+\\)")
174 '(1 'font-lock-keyword-face)
175 '(2 'font-lock-variable-name-face))
176 '("^[ \t]*\\([^\000- ]+\\)" 1 'font-lock-variable-name-face)))
177 "Keywords to hilight in Conf Space mode")
178
179(defvar conf-colon-font-lock-keywords
180 `(;; [section] (do this first because it may look like a parameter)
181 ("^[ \t]*\\[\\(.+\\)\\]" 1 'font-lock-type-face)
182 ;; var: val
183 ("^[ \t]*\\(.+?\\)[ \t]*:"
184 (1 'font-lock-variable-name-face))
185 ;; section { ... } (do this last because some assign ...{...)
186 ("^[ \t]*\\([^:\n]+\\)[ \t\n]*{[^{}]*?$" 1 'font-lock-type-face prepend))
187 "Keywords to hilight in Conf Colon mode")
188
189(defvar conf-assignment-sign ?=
190 "What sign is used for assignments.")
191
192(defvar conf-assignment-regexp ".+?\\([ \t]*=[ \t]*\\)"
193 "Regexp to recognize assignments.
194It is anchored after the first sexp on a line. There must a
195grouping for the assignment sign, including leading and trailing
196whitespace.")
197
198
199;; If anybody can figure out how to get the same effect by configuring
200;; `align', I'd be glad to hear.
201(defun conf-align-assignments (&optional arg)
202 (interactive "P")
203 (setq arg (if arg
204 (prefix-numeric-value arg)
205 conf-assignment-column))
206 (save-excursion
207 (goto-char (point-min))
208 (while (not (eobp))
209 (let ((cs (comment-beginning))) ; go before comment if within
210 (if cs (goto-char cs)))
211 (while (forward-comment 9)) ; max-int?
212 (when (and (not (eobp))
213 (looking-at conf-assignment-regexp))
214 (goto-char (match-beginning 1))
215 (delete-region (point) (match-end 1))
216 (if conf-assignment-sign
217 (if (>= arg 0)
218 (progn
219 (indent-to-column arg)
220 (or (not conf-assignment-space) (memq (char-before (point)) '(? ?\t)) (insert ? ))
221 (insert conf-assignment-sign (if (and conf-assignment-space (not (eolp))) ?\ "")))
222 (insert (if conf-assignment-space ?\ "") conf-assignment-sign)
223 (unless (eolp)
224 (indent-to-column (- arg))
225 (or (not conf-assignment-space) (memq (char-before (point)) '(? ?\t)) (insert ? ))))
226 (unless (eolp)
227 (if (>= (current-column) (abs arg))
228 (insert ? )
229 (indent-to-column (abs arg))))))
230 (forward-line))))
231
232
233(defun conf-quote-normal ()
234 "Set the syntax of \" and ' to punctuation.
235This only affects the current buffer. Some conf files use quotes
236to delimit strings, while others allow quotes as simple parts of
237the assigned value. In those files font locking will be wrong,
238and you can correct it with this command. (Some files even do
239both, i.e. quotes delimit strings, except when they are
240unbalanced, but hey...)"
241 (interactive)
242 (let ((table (copy-syntax-table (syntax-table))))
243 (modify-syntax-entry ?\" "." table)
244 (modify-syntax-entry ?\' "." table)
245 (set-syntax-table table)
246 (and (boundp 'font-lock-mode)
247 font-lock-mode
248 (font-lock-fontify-buffer))))
249
250
251(defun conf-outline-level ()
252 (let ((depth 0)
253 (pt (match-end 0)))
254 (condition-case nil
255 (while (setq pt (scan-lists pt -1 1)
256 depth (1+ depth)))
257 (scan-error depth))))
258
259
260
261;;;###autoload
262(defun conf-mode (&optional comment syntax-table name)
263 "Mode for Unix and Windows Conf files and Java properties.
264Most conf files know only three kinds of constructs: parameter
265assignments optionally grouped into sections and comments. Yet
266there is a great range of variation in the exact syntax of conf
267files. See below for various wrapper commands that set up the
268details for some of the most widespread variants.
269
270This mode sets up font locking, outline, imenu and it provides
271alignment support through `conf-align-assignments'. If strings
272come out wrong, try `conf-quote-normal'.
273
274Some files allow continuation lines, either with a backslash at
275the end of line, or by indenting the next line (further). These
276constructs cannot currently be recognized.
277
278Because of this great variety of nuances, which are often not
279even clearly specified, please don't expect it to get every file
280quite right. Patches that clearly identify some special case,
281without breaking the general ones, are welcome.
282
283If instead you start this mode with the generic `conf-mode'
284command, it will parse the buffer. It will generally well
285identify the first four cases listed below. If the buffer
286doesn't have enough contents to decide, this is identical to
287`conf-windows-mode' on Windows, elsewhere to `conf-unix-mode'. See
288also `conf-space-mode', `conf-colon-mode', `conf-javaprop-mode' and
289`conf-xdefaults-mode'.
290
291\\{conf-mode-map}"
292
293 (interactive)
294 (if (not comment)
295 (let ((unix 0) (win 0) (equal 0) (colon 0) (space 0) (jp 0))
296 (save-excursion
297 (goto-char (point-min))
298 (while (not (eobp))
299 (skip-chars-forward " \t\f")
300 (cond ((eq (char-after) ?\#) (setq unix (1+ unix)))
301 ((eq (char-after) ?\;) (setq win (1+ win)))
302 ((eq (char-after) ?\[)) ; nop
303 ((eolp)) ; nop
304 ((eq (char-after) ?})) ; nop
305 ;; recognize at most double spaces within names
306 ((looking-at "[^ \t\n=:]+\\(?: ?[^ \t\n=:]+\\)*[ \t]*[=:]")
307 (if (eq (char-before (match-end 0)) ?=)
308 (setq equal (1+ equal))
309 (setq colon (1+ colon))))
310 ((looking-at "/[/*]") (setq jp (1+ jp)))
311 ((looking-at ".*{")) ; nop
312 ((setq space (1+ space))))
313 (forward-line)))
314 (if (> jp (max unix win 3))
315 (conf-javaprop-mode)
316 (if (> colon (max equal space))
317 (conf-colon-mode)
318 (if (> space (max equal colon))
319 (conf-space-mode)
320 (if (or (> win unix)
321 (and (= win unix) (eq system-type 'windows-nt)))
322 (conf-windows-mode)
323 (conf-unix-mode))))))
324 (kill-all-local-variables)
325 (use-local-map conf-mode-map)
326
327 (setq major-mode 'conf-mode
328 mode-name name)
329 (set (make-local-variable 'comment-start) comment)
330 (set (make-local-variable 'comment-start-skip)
331 (concat comment-start "+\\s *"))
332 (set (make-local-variable 'comment-use-syntax) t)
333 (set (make-local-variable 'parse-sexp-ignore-comments) t)
334 (set (make-local-variable 'outline-regexp)
335 "[ \t]*\\(?:\\[\\|.+[ \t\n]*{\\)")
336 (set (make-local-variable 'outline-heading-end-regexp)
337 "[\n}]")
338 (set (make-local-variable 'outline-level)
339 'conf-outline-level)
340 (set-syntax-table syntax-table)
341 (setq imenu-generic-expression
342 '(("Parameters" "^[ \t]*\\(.+?\\)[ \t]*=" 1)
343 ;; [section]
344 (nil "^[ \t]*\\[[ \t]*\\(.+\\)[ \t]*\\]" 1)
345 ;; section { ... }
346 (nil "^[ \t]*\\([^=:\n]+\\)[ \t\n]*{" 1)))
347
348 (run-mode-hooks 'conf-mode-hook)))
349
350;;;###autoload
351(defun conf-unix-mode ()
352 "Conf Mode starter for Unix style Conf files.
353Comments start with `#'.
354For details see `conf-mode'. Example:
355
356# Conf mode font-locks this right on Unix and with C-c C-u
357
358\[Desktop Entry]
359 Encoding=UTF-8
360 Name=The GIMP
361 Name[ca]=El GIMP
362 Name[cs]=GIMP"
363 (interactive)
364 (conf-mode "#" conf-unix-mode-syntax-table "Conf[Unix]"))
365
366;;;###autoload
367(defun conf-windows-mode ()
368 "Conf Mode starter for Windows style Conf files.
369Comments start with `;'.
370For details see `conf-mode'. Example:
371
372; Conf mode font-locks this right on Windows and with C-c C-w
373
374\[ExtShellFolderViews]
375Default={5984FFE0-28D4-11CF-AE66-08002B2E1262}
376{5984FFE0-28D4-11CF-AE66-08002B2E1262}={5984FFE0-28D4-11CF-AE66-08002B2E1262}
377
378\[{5984FFE0-28D4-11CF-AE66-08002B2E1262}]
379PersistMoniker=file://Folder.htt"
380 (interactive)
381 (conf-mode ";" conf-mode-syntax-table "Conf[WinIni]"))
382
383;; Here are a few more or less widespread styles. There are others, so
384;; obscure, they are not covered. E.g. RFC 2614 allows both Unix and Windows
385;; comments. Or the donkey has (* Pascal comments *) -- roll your own starter
386;; if you need it.
387
388;;;###autoload
389(defun conf-javaprop-mode ()
390 "Conf Mode starter for Java properties files.
391Comments start with `#' but are also recognized with `//' or
392between `/*' and `*/'.
393For details see `conf-mode'. Example:
394
395# Conf mode font-locks this right with C-c C-j (Java properties)
396// another kind of comment
397/* yet another */
398
399name:value
400name=value
401name value
402x.1 =
403x.2.y.1.z.1 =
404x.2.y.1.z.2.zz ="
405 (interactive)
406 (conf-mode "#" conf-javaprop-mode-syntax-table "Conf[JavaProp]")
407 (set (make-local-variable 'conf-assignment-column)
408 conf-javaprop-assignment-column)
409 (set (make-local-variable 'conf-assignment-regexp)
410 ".+?\\([ \t]*[=: \t][ \t]*\\|$\\)")
411 (set (make-local-variable 'conf-font-lock-keywords)
412 conf-javaprop-font-lock-keywords)
413 (setq comment-start-skip "\\(?:#+\\|/[/*]+\\)\\s *")
414 (setq imenu-generic-expression
415 '(("Parameters" "^[ \t]*\\(.+?\\)[=: \t]" 1))))
416
417;;;###autoload
418(defun conf-space-mode (&optional keywords)
419 "Conf Mode starter for space separated conf files.
420\"Assignments\" are with ` '. Keywords before the parameters are
421recognized according to `conf-space-keywords'. Interactively
422with a prefix ARG of `0' no keywords will be recognized. With
423any other prefix arg you will be prompted for a regexp to match
424the keywords. Programmatically you can pass such a regexp as
425KEYWORDS, or any non-nil non-string for no keywords.
426
427For details see `conf-mode'. Example:
428
429# Conf mode font-locks this right with C-c C-s (space separated)
430
431image/jpeg jpeg jpg jpe
432image/png png
433image/tiff tiff tif
434
435# Or with keywords (from a recognized file name):
436class desktop
437# Standard multimedia devices
438add /dev/audio desktop
439add /dev/mixer desktop"
440 (interactive
441 (list (if current-prefix-arg
442 (if (> (prefix-numeric-value current-prefix-arg) 0)
443 (read-string "Regexp to match keywords: ")
444 t))))
445 (conf-unix-mode)
446 (setq mode-name "Conf[Space]")
447 (set (make-local-variable 'conf-assignment-sign)
448 nil)
449 (set (make-local-variable 'conf-font-lock-keywords)
450 conf-space-font-lock-keywords)
451 ;; This doesn't seem right, but the next two depend on conf-space-keywords
452 ;; being set, while after-change-major-mode-hook might set up imenu, needing
453 ;; the following result:
454 (hack-local-variables-prop-line)
455 (hack-local-variables)
456 (if keywords
457 (set (make-local-variable 'conf-space-keywords)
458 (if (stringp keywords) keywords))
459 (or conf-space-keywords
460 (not buffer-file-name)
461 (set (make-local-variable 'conf-space-keywords)
462 (assoc-default buffer-file-name conf-space-keywords-alist
463 'string-match))))
464 (set (make-local-variable 'conf-assignment-regexp)
465 (if conf-space-keywords
466 (concat "\\(?:" conf-space-keywords "\\)[ \t]+.+?\\([ \t]+\\|$\\)")
467 ".+?\\([ \t]+\\|$\\)"))
468 (setq imenu-generic-expression
469 `(,@(cdr imenu-generic-expression)
470 ("Parameters"
471 ,(if conf-space-keywords
472 (concat "^[ \t]*\\(?:" conf-space-keywords
473 "\\)[ \t]+\\([^ \t\n]+\\)\\(?:[ \t]\\|$\\)")
474 "^[ \t]*\\([^ \t\n[]+\\)\\(?:[ \t]\\|$\\)")
475 1))))
476
477;;;###autoload
478(defun conf-colon-mode (&optional comment syntax-table name)
479 "Conf Mode starter for Colon files.
480\"Assignments\" are with `:'.
481For details see `conf-mode'. Example:
482
483# Conf mode font-locks this right with C-c C-c (colon)
484
485<Multi_key> <exclam> <exclam> : \"\\241\" exclamdown
486<Multi_key> <c> <slash> : \"\\242\" cent"
487 (interactive)
488 (if comment
489 (conf-mode comment syntax-table name)
490 (conf-unix-mode)
491 (setq mode-name "Conf[Colon]"))
492 (set (make-local-variable 'conf-assignment-space)
493 conf-colon-assignment-space)
494 (set (make-local-variable 'conf-assignment-column)
495 conf-colon-assignment-column)
496 (set (make-local-variable 'conf-assignment-sign)
497 ?:)
498 (set (make-local-variable 'conf-assignment-regexp)
499 ".+?\\([ \t]*:[ \t]*\\)")
500 (set (make-local-variable 'conf-font-lock-keywords)
501 conf-colon-font-lock-keywords)
502 (setq imenu-generic-expression
503 `(("Parameters" "^[ \t]*\\(.+?\\)[ \t]*:" 1)
504 ,@(cdr imenu-generic-expression))))
505
506;;;###autoload
507(defun conf-xdefaults-mode ()
508 "Conf Mode starter for Xdefaults files.
509Comments start with `!' and \"assignments\" are with `:'.
510For details see `conf-mode'. Example:
511
512! Conf mode font-locks this right with C-c C-x (.Xdefaults)
513
514*background: gray99
515*foreground: black"
516 (interactive)
517 (conf-colon-mode "!" conf-xdefaults-mode-syntax-table "Conf[Xdefaults]"))
518
519
520;; font lock support
521(if (boundp 'font-lock-defaults-alist)
522 (add-to-list
523 'font-lock-defaults-alist
524 (cons 'conf-mode
525 (list 'conf-font-lock-keywords nil t nil nil))))
526
527
528(provide 'conf-mode)
529
530;; arch-tag: 0a3805b2-0371-4d3a-8498-8897116b2356
531;;; conf-mode.el ends here
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 93a7ebd52e4..441d9972173 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -956,9 +956,7 @@ Mostly we check word delimiters."
956;*---------------------------------------------------------------------*/ 956;*---------------------------------------------------------------------*/
957(defun flyspell-word (&optional following) 957(defun flyspell-word (&optional following)
958 "Spell check a word." 958 "Spell check a word."
959 (interactive (list current-prefix-arg)) 959 (interactive (list ispell-following-word))
960 (if (interactive-p)
961 (setq following ispell-following-word))
962 (save-excursion 960 (save-excursion
963 ;; use the correct dictionary 961 ;; use the correct dictionary
964 (flyspell-accept-buffer-local-defs) 962 (flyspell-accept-buffer-local-defs)
@@ -1283,7 +1281,7 @@ Word syntax described by `ispell-dictionary-alist' (which see)."
1283(defun flyspell-external-point-words () 1281(defun flyspell-external-point-words ()
1284 (let ((buffer flyspell-external-ispell-buffer)) 1282 (let ((buffer flyspell-external-ispell-buffer))
1285 (set-buffer buffer) 1283 (set-buffer buffer)
1286 (beginning-of-buffer) 1284 (goto-char (point-min))
1287 (let ((size (- flyspell-large-region-end flyspell-large-region-beg)) 1285 (let ((size (- flyspell-large-region-end flyspell-large-region-beg))
1288 (start flyspell-large-region-beg)) 1286 (start flyspell-large-region-beg))
1289 ;; now we are done with ispell, we have to find the word in 1287 ;; now we are done with ispell, we have to find the word in
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index f0547d6d596..d221d39180f 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1410,12 +1410,9 @@ nil word is correct or spelling is accepted.
1410\(\"word\" arg\) word is hand entered. 1410\(\"word\" arg\) word is hand entered.
1411quit spell session exited." 1411quit spell session exited."
1412 1412
1413 (interactive (list nil nil current-prefix-arg)) 1413 (interactive (list ispell-following-word ispell-quietly current-prefix-arg))
1414 (if continue 1414 (if continue
1415 (ispell-continue) 1415 (ispell-continue)
1416 (if (interactive-p)
1417 (setq following ispell-following-word
1418 quietly ispell-quietly))
1419 (ispell-accept-buffer-local-defs) ; use the correct dictionary 1416 (ispell-accept-buffer-local-defs) ; use the correct dictionary
1420 (let ((cursor-location (point)) ; retain cursor location 1417 (let ((cursor-location (point)) ; retain cursor location
1421 (word (ispell-get-word following)) 1418 (word (ispell-get-word following))
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 28f3d7c3b27..6da9cc23aaa 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -1,6 +1,7 @@
1;;; sgml-mode.el --- SGML- and HTML-editing modes 1;;; sgml-mode.el --- SGML- and HTML-editing modes
2 2
3;; Copyright (C) 1992,95,96,98,2001,2002, 2003 Free Software Foundation, Inc. 3;; Copyright (C) 1992, 1995, 1996, 1998, 2001, 2002, 2003, 2004
4;; Free Software Foundation, Inc.
4 5
5;; Author: James Clark <jjc@jclark.com> 6;; Author: James Clark <jjc@jclark.com>
6;; Maintainer: FSF 7;; Maintainer: FSF
@@ -1051,53 +1052,79 @@ You might want to turn on `auto-fill-mode' to get better results."
1051 (and (>= start (point-min)) 1052 (and (>= start (point-min))
1052 (equal str (buffer-substring-no-properties start (point)))))) 1053 (equal str (buffer-substring-no-properties start (point))))))
1053 1054
1055(defun sgml-tag-text-p (start end)
1056 "Return non-nil if text between START and END is a tag.
1057Checks among other things that the tag does not contain spurious
1058unquoted < or > chars inside, which would indicate that it
1059really isn't a tag after all."
1060 (save-excursion
1061 (with-syntax-table sgml-tag-syntax-table
1062 (let ((pps (parse-partial-sexp start end 2)))
1063 (and (= (nth 0 pps) 0))))))
1064
1054(defun sgml-parse-tag-backward (&optional limit) 1065(defun sgml-parse-tag-backward (&optional limit)
1055 "Parse an SGML tag backward, and return information about the tag. 1066 "Parse an SGML tag backward, and return information about the tag.
1056Assume that parsing starts from within a textual context. 1067Assume that parsing starts from within a textual context.
1057Leave point at the beginning of the tag." 1068Leave point at the beginning of the tag."
1058 (let (tag-type tag-start tag-end name) 1069 (catch 'found
1059 (or (re-search-backward "[<>]" limit 'move) 1070 (let (tag-type tag-start tag-end name)
1060 (error "No tag found")) 1071 (or (re-search-backward "[<>]" limit 'move)
1061 (when (eq (char-after) ?<) 1072 (error "No tag found"))
1062 ;; Oops!! Looks like we were not in a textual context after all!. 1073 (when (eq (char-after) ?<)
1063 ;; Let's try to recover. 1074 ;; Oops!! Looks like we were not in a textual context after all!.
1064 (with-syntax-table sgml-tag-syntax-table 1075 ;; Let's try to recover.
1065 (forward-sexp) 1076 (with-syntax-table sgml-tag-syntax-table
1066 (forward-char -1))) 1077 (let ((pos (point)))
1067 (setq tag-end (1+ (point))) 1078 (condition-case nil
1068 (cond 1079 (forward-sexp)
1069 ((sgml-looking-back-at "--") ; comment 1080 (scan-error
1070 (setq tag-type 'comment 1081 ;; This < seems to be just a spurious one, let's ignore it.
1071 tag-start (search-backward "<!--" nil t))) 1082 (goto-char pos)
1072 ((sgml-looking-back-at "]]") ; cdata 1083 (throw 'found (sgml-parse-tag-backward limit))))
1073 (setq tag-type 'cdata 1084 ;; Check it is really a tag, without any extra < or > inside.
1074 tag-start (re-search-backward "<!\\[[A-Z]+\\[" nil t))) 1085 (unless (sgml-tag-text-p pos (point))
1075 (t 1086 (goto-char pos)
1076 (setq tag-start 1087 (throw 'found (sgml-parse-tag-backward limit)))
1077 (with-syntax-table sgml-tag-syntax-table 1088 (forward-char -1))))
1078 (goto-char tag-end) 1089 (setq tag-end (1+ (point)))
1079 (backward-sexp) 1090 (cond
1080 (point))) 1091 ((sgml-looking-back-at "--") ; comment
1081 (goto-char (1+ tag-start)) 1092 (setq tag-type 'comment
1082 (case (char-after) 1093 tag-start (search-backward "<!--" nil t)))
1083 (?! ; declaration 1094 ((sgml-looking-back-at "]]") ; cdata
1084 (setq tag-type 'decl)) 1095 (setq tag-type 'cdata
1085 (?? ; processing-instruction 1096 tag-start (re-search-backward "<!\\[[A-Z]+\\[" nil t)))
1086 (setq tag-type 'pi)) 1097 (t
1087 (?/ ; close-tag 1098 (setq tag-start
1088 (forward-char 1) 1099 (with-syntax-table sgml-tag-syntax-table
1089 (setq tag-type 'close 1100 (goto-char tag-end)
1090 name (sgml-parse-tag-name))) 1101 (condition-case nil
1091 (?% ; JSP tags 1102 (backward-sexp)
1092 (setq tag-type 'jsp)) 1103 (scan-error
1093 (t ; open or empty tag 1104 ;; This > isn't really the end of a tag. Skip it.
1094 (setq tag-type 'open 1105 (goto-char (1- tag-end))
1095 name (sgml-parse-tag-name)) 1106 (throw 'found (sgml-parse-tag-backward limit))))
1096 (if (or (eq ?/ (char-before (- tag-end 1))) 1107 (point)))
1097 (sgml-empty-tag-p name)) 1108 (goto-char (1+ tag-start))
1098 (setq tag-type 'empty)))))) 1109 (case (char-after)
1099 (goto-char tag-start) 1110 (?! ; declaration
1100 (sgml-make-tag tag-type tag-start tag-end name))) 1111 (setq tag-type 'decl))
1112 (?? ; processing-instruction
1113 (setq tag-type 'pi))
1114 (?/ ; close-tag
1115 (forward-char 1)
1116 (setq tag-type 'close
1117 name (sgml-parse-tag-name)))
1118 (?% ; JSP tags
1119 (setq tag-type 'jsp))
1120 (t ; open or empty tag
1121 (setq tag-type 'open
1122 name (sgml-parse-tag-name))
1123 (if (or (eq ?/ (char-before (- tag-end 1)))
1124 (sgml-empty-tag-p name))
1125 (setq tag-type 'empty))))))
1126 (goto-char tag-start)
1127 (sgml-make-tag tag-type tag-start tag-end name))))
1101 1128
1102(defun sgml-get-context (&optional until) 1129(defun sgml-get-context (&optional until)
1103 "Determine the context of the current position. 1130 "Determine the context of the current position.
@@ -1964,5 +1991,5 @@ Can be used as a value for `html-mode-hook'."
1964 1991
1965(provide 'sgml-mode) 1992(provide 'sgml-mode)
1966 1993
1967;;; arch-tag: 9675da94-b7f9-4bda-ad19-73ed7b4fb401 1994;; arch-tag: 9675da94-b7f9-4bda-ad19-73ed7b4fb401
1968;;; sgml-mode.el ends here 1995;;; sgml-mode.el ends here
diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el
index 7b13d498b2e..f064dd4dee0 100644
--- a/lisp/textmodes/table.el
+++ b/lisp/textmodes/table.el
@@ -645,7 +645,8 @@ See `table-insert' for examples about how to use."
645 :group 'editing 645 :group 'editing
646 :group 'wp 646 :group 'wp
647 :group 'paragraphs 647 :group 'paragraphs
648 :group 'fill) 648 :group 'fill
649 :version "21.4")
649 650
650(defgroup table-hooks nil 651(defgroup table-hooks nil
651 "Hooks for table manipulation utilities" 652 "Hooks for table manipulation utilities"
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index 6ff86b4cf0b..f8243f4a0ac 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -1,6 +1,6 @@
1;;; tooltip.el --- show tooltip windows 1;;; tooltip.el --- show tooltip windows
2 2
3;; Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1997, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
4 4
5;; Author: Gerd Moellmann <gerd@acm.org> 5;; Author: Gerd Moellmann <gerd@acm.org>
6;; Keywords: help c mouse tools 6;; Keywords: help c mouse tools
@@ -26,11 +26,7 @@
26 26
27;;; Code: 27;;; Code:
28 28
29(eval-when-compile 29(eval-when-compile (require 'cl)) ; for case macro
30 (require 'cl)
31 (require 'comint)
32 (require 'gud)
33 (require 'gdb-ui))
34 30
35 31
36;;; Customizable settings 32;;; Customizable settings
@@ -524,5 +520,5 @@ use either \\[customize] or the function `tooltip-mode'."
524 520
525(provide 'tooltip) 521(provide 'tooltip)
526 522
527;;; arch-tag: 3d61135e-4618-4a78-af28-183f6df5636f 523;; arch-tag: 3d61135e-4618-4a78-af28-183f6df5636f
528;;; tooltip.el ends here 524;;; tooltip.el ends here
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 261635d51e2..eb10dd2a933 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,8 @@
12004-11-12 Masatake YAMATO <jet@gyve.org>
2
3 * url-mailto.el (url-mailto): Fix a typo in the
4 comment.
5
12004-11-02 Masatake YAMATO <jet@gyve.org> 62004-11-02 Masatake YAMATO <jet@gyve.org>
2 7
3 * url-imap.el (url-imap-open-host): Don't use 8 * url-imap.el (url-imap-open-host): Don't use
diff --git a/lisp/url/url-mailto.el b/lisp/url/url-mailto.el
index f5192bcb03f..42793093117 100644
--- a/lisp/url/url-mailto.el
+++ b/lisp/url/url-mailto.el
@@ -63,7 +63,7 @@
63(defun url-mailto (url) 63(defun url-mailto (url)
64 "Handle the mailto: URL syntax." 64 "Handle the mailto: URL syntax."
65 (if (url-user url) 65 (if (url-user url)
66 ;; malformed mailto URL (mailto://wmperry@gnu.org instead of 66 ;; malformed mailto URL (mailto://wmperry@gnu.org) instead of
67 ;; mailto:wmperry@gnu.org 67 ;; mailto:wmperry@gnu.org
68 (url-set-filename url (concat (url-user url) "@" (url-filename url)))) 68 (url-set-filename url (concat (url-user url) "@" (url-filename url))))
69 (setq url (url-filename url)) 69 (setq url (url-filename url))