aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMiles Bader2005-03-31 09:58:14 +0000
committerMiles Bader2005-03-31 09:58:14 +0000
commit773415d9340f12db3bd8654de5014deec57d49b7 (patch)
tree579ecf466891c80df147934b0db24cb89d0abe3d /lisp
parente9d5a4e18a8955cf60e78c54a511fd8e1259716f (diff)
parent7c315e1cff9019c8af55921fab6f571e68b09623 (diff)
downloademacs-773415d9340f12db3bd8654de5014deec57d49b7.tar.gz
emacs-773415d9340f12db3bd8654de5014deec57d49b7.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-31
Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 206-222) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 45-52) - Update from CVS - Update from CVS: texi Makefile.in CVS keyw cruft - Update from CVS: ChangeLog tweaks
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog551
-rw-r--r--lisp/autoinsert.el13
-rw-r--r--lisp/autorevert.el2
-rw-r--r--lisp/bookmark.el12
-rw-r--r--lisp/calc/calc-embed.el22
-rw-r--r--lisp/calc/calc-forms.el7
-rw-r--r--lisp/calc/calc-help.el10
-rw-r--r--lisp/calc/calc-lang.el12
-rw-r--r--lisp/calc/calc-sel.el5
-rw-r--r--lisp/calc/calc.el6
-rw-r--r--lisp/calc/calcalg2.el2
-rw-r--r--lisp/calendar/appt.el9
-rw-r--r--lisp/calendar/cal-china.el4
-rw-r--r--lisp/calendar/cal-coptic.el4
-rw-r--r--lisp/calendar/cal-french.el4
-rw-r--r--lisp/calendar/cal-hebrew.el4
-rw-r--r--lisp/calendar/cal-islam.el4
-rw-r--r--lisp/calendar/cal-iso.el4
-rw-r--r--lisp/calendar/cal-julian.el4
-rw-r--r--lisp/calendar/cal-mayan.el4
-rw-r--r--lisp/calendar/cal-menu.el3
-rw-r--r--lisp/calendar/cal-move.el8
-rw-r--r--lisp/calendar/cal-persia.el4
-rw-r--r--lisp/calendar/cal-x.el13
-rw-r--r--lisp/calendar/calendar.el14
-rw-r--r--lisp/calendar/holidays.el4
-rw-r--r--lisp/calendar/lunar.el4
-rw-r--r--lisp/calendar/solar.el4
-rw-r--r--lisp/comint.el8
-rw-r--r--lisp/complete.el9
-rw-r--r--lisp/dired-aux.el10
-rw-r--r--lisp/dired.el3
-rw-r--r--lisp/ediff-hook.el16
-rw-r--r--lisp/emacs-lisp/advice.el14
-rw-r--r--lisp/emacs-lisp/cl-macs.el4
-rw-r--r--lisp/emacs-lisp/debug.el107
-rw-r--r--lisp/emacs-lisp/lisp-mode.el1
-rw-r--r--lisp/emacs-lisp/rx.el6
-rw-r--r--lisp/emulation/cua-base.el2
-rw-r--r--lisp/emulation/vi.el58
-rw-r--r--lisp/emulation/vip.el8
-rw-r--r--lisp/eshell/esh-io.el4
-rw-r--r--lisp/eshell/esh-var.el4
-rw-r--r--lisp/files.el39
-rw-r--r--lisp/filesets.el62
-rw-r--r--lisp/follow.el7
-rw-r--r--lisp/font-lock.el2
-rw-r--r--lisp/generic-x.el83
-rw-r--r--lisp/generic.el34
-rw-r--r--lisp/gnus/ChangeLog111
-rw-r--r--lisp/gnus/gnus-group.el6
-rw-r--r--lisp/gnus/gnus-srvr.el19
-rw-r--r--lisp/gnus/message.el3
-rw-r--r--lisp/gnus/mm-util.el30
-rw-r--r--lisp/gnus/nnmaildir.el4
-rw-r--r--lisp/gnus/rfc2047.el641
-rw-r--r--lisp/hi-lock.el8
-rw-r--r--lisp/hilit-chg.el20
-rw-r--r--lisp/image-mode.el84
-rw-r--r--lisp/info.el8
-rw-r--r--lisp/international/mule-cmds.el18
-rw-r--r--lisp/international/mule.el5
-rw-r--r--lisp/kmacro.el11
-rw-r--r--lisp/language/thai-util.el41
-rw-r--r--lisp/language/thai-word.el52
-rw-r--r--lisp/language/thai.el8
-rw-r--r--lisp/longlines.el393
-rw-r--r--lisp/mail/mailalias.el24
-rw-r--r--lisp/mail/supercite.el16
-rw-r--r--lisp/menu-bar.el18
-rw-r--r--lisp/mh-e/ChangeLog8
-rw-r--r--lisp/mh-e/mh-e.el10
-rw-r--r--lisp/mh-e/mh-identity.el4
-rw-r--r--lisp/mh-e/mh-mime.el7
-rw-r--r--lisp/midnight.el4
-rw-r--r--lisp/obsolete/iso-acc.el (renamed from lisp/international/iso-acc.el)5
-rw-r--r--lisp/progmodes/compile.el9
-rw-r--r--lisp/progmodes/cperl-mode.el4
-rw-r--r--lisp/progmodes/ebnf-abn.el6
-rw-r--r--lisp/progmodes/ebnf-bnf.el8
-rw-r--r--lisp/progmodes/ebnf-dtd.el6
-rw-r--r--lisp/progmodes/ebnf-ebx.el4
-rw-r--r--lisp/progmodes/ebnf-iso.el8
-rw-r--r--lisp/progmodes/ebnf-yac.el8
-rw-r--r--lisp/progmodes/ebnf2ps.el4
-rw-r--r--lisp/progmodes/f90.el29
-rw-r--r--lisp/progmodes/flymake.el486
-rw-r--r--lisp/progmodes/fortran.el183
-rw-r--r--lisp/progmodes/gdb-ui.el8
-rw-r--r--lisp/progmodes/gud.el22
-rw-r--r--lisp/progmodes/idlw-shell.el6
-rw-r--r--lisp/progmodes/idlwave.el13
-rw-r--r--lisp/progmodes/python.el65
-rw-r--r--lisp/progmodes/sh-script.el2
-rw-r--r--lisp/progmodes/vhdl-mode.el4
-rw-r--r--lisp/progmodes/which-func.el7
-rw-r--r--lisp/progmodes/xscheme.el5
-rw-r--r--lisp/ps-print.el13
-rw-r--r--lisp/register.el6
-rw-r--r--lisp/reveal.el4
-rw-r--r--lisp/simple.el61
-rw-r--r--lisp/term.el25
-rw-r--r--lisp/term/bobcat.el3
-rw-r--r--lisp/term/xterm.el2
-rw-r--r--lisp/textmodes/fill.el13
-rw-r--r--lisp/textmodes/ispell.el4
-rw-r--r--lisp/textmodes/org.el459
-rw-r--r--lisp/textmodes/refbib.el6
-rw-r--r--lisp/textmodes/refer.el4
-rw-r--r--lisp/textmodes/reftex-cite.el5
-rw-r--r--lisp/textmodes/reftex-index.el7
-rw-r--r--lisp/textmodes/reftex-parse.el5
-rw-r--r--lisp/textmodes/reftex-ref.el7
-rw-r--r--lisp/textmodes/reftex-vars.el25
-rw-r--r--lisp/textmodes/reftex.el19
-rw-r--r--lisp/textmodes/sgml-mode.el2
-rw-r--r--lisp/textmodes/tex-mode.el13
-rw-r--r--lisp/thumbs.el4
-rw-r--r--lisp/tooltip.el2
-rw-r--r--lisp/vc-cvs.el5
-rw-r--r--lisp/vc.el8
-rw-r--r--lisp/wdired.el3
-rw-r--r--lisp/window.el21
123 files changed, 3129 insertions, 1260 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6ca04808b67..91e775869e6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,12 +1,524 @@
12005-03-31 Kenichi Handa <handa@etlken2>
2
3 * textmodes/fill.el (fill-text-properties-at): New function.
4 (fill-newline): Use fill-text-properties-at instead of
5 text-properties-at.
6
72005-03-31 Karl Berry <karl@freefriends.org>
8
9 * textmodes/tex-mode.el (tex-compile): shell-quote-argument,
10 not comint-quote-filename.
11
122005-03-31 Olive Lin <olive.lin@versateladsl.be> (tiny change)
13
14 * textmodes/tex-mode.el (tex-start-tex) shell-quote-argument,
15 not comint-quote-filename.
16
172005-03-31 Thien-Thi Nguyen <ttn@gnu.org>
18
19 * help-fns.el (help-with-tutorial): Revert last change.
20
212005-03-31 Kim F. Storm <storm@cua.dk>
22
23 * emulation/cua-base.el (cua-scroll-down): Add CUA property.
24
252005-03-30 Paul Eggert <eggert@cs.ucla.edu>
26
27 * calendar/cal-china.el: Update reference to "Calendrical
28 Calculations" book; there's a new edition.
29 * calendar/cal-coptic.el: Likewise.
30 * calendar/cal-french.el: Likewise.
31 * calendar/cal-hebrew.el: Likewise.
32 * calendar/cal-islam.el: Likewise.
33 * calendar/cal-iso.el: Likewise.
34 * calendar/cal-julian.el: Likewise.
35 * calendar/cal-mayan.el: Likewise.
36 * calendar/cal-persia.el: Likewise.
37 * calendar/calendar.el: Likewise.
38 * calendar/holidays.el: Likewise.
39 * calendar/lunar.el: Likewise.
40 * calendar/solar.el: Likewise.
41
42 * calendar/calendar.el (calendar-day-abbrev-array): Remove trailing
43 white space from doc string.
44
452005-03-30 Jay Belanger <belanger@truman.edu>
46
47 * calc/calc-help.el (calc-full-help): Remove email address.
48
492005-03-30 Thien-Thi Nguyen <ttn@gnu.org>
50
51 * help-fns.el (help-with-tutorial): Delete title line.
52
532005-03-30 Glenn Morris <gmorris@ast.cam.ac.uk>
54
55 * calendar/cal-x.el (calendar-one-frame-setup)
56 (calendar-only-one-frame-setup, calendar-two-frame-setup): Use t
57 rather than 'symbol for set-window-dedicated-p.
58
59 * calendar/appt.el (appt-buffer-name): Make it a constant.
60 (appt-add): Doc fix.
61
62 * filesets.el (filesets-menu-path, filesets-menu-before)
63 (filesets-menu-in-menu): Doc fix. Now valid in GNU Emacs.
64 (filesets-menu-cache-file): Use directory ~/.emacs.d.
65 (filesets-add-submenu): Delete and use add-submenu instead.
66
672005-03-30 Carsten Dominik <dominik@science.uva.nl>
68
69 * org.el (org-agenda-phases-of-moon, org-agenda-sunrise-sunset)
70 (org-agenda-convert-date, org-agenda-goto-calendar): New commands.
71 (org-diary-default-entry): New function.
72 (org-get-entries-from-diary): Better parsing of diary entries
73 (org-agenda-check-no-diary): New function.
74 ("diary-lib"): Advice to function `add-to-diary-list', to allow
75 linking to diary entries.
76 (org-agenda-execute-calendar-command): New function
77 (org-agenda): Improved visible section in window. And
78 use `org-fit-agenda-window'.
79 (org-fit-agenda-window): New option.
80 (org-move-subtree-down): Better handling of empty lines
81 at end of subtree.
82 (org-cycle): Numeric prefix is interpreted now as show-subtree N
83 levels up.
84 (org-fontify-done-headline): New option.
85 (org-headline-done-face): New face.
86 (org-set-font-lock-defaults): Use `org-headline-done-face'.
87 (org-table-copy-down): renamed from
88 `org-table-copy-from-above'. When current field is non-empty, it
89 is copied to next row.
90 (org-table-copy-from-above): Fixed bug which made it
91 impossible to copy fields containing only a single non-white
92 character.
93
942005-03-30 Kim F. Storm <storm@cua.dk>
95
96 * kmacro.el (kmacro-end-macro): Isearch may store this command
97 into the macro -- so ignore it when executing keyboard macro.
98
992005-03-30 Nick Roberts <nickrob@snap.net.nz>
100
101 * tooltip.el (tooltip-gud-display): Use gud-overlay-arrow-position.
102
1032005-03-29 Kenichi Handa <handa@m17n.org>
104
105 * language/thai.el ("Thai"): Set setup-function and exit-function
106 for Thai language environment.
107
108 * language/thai-util.el: Require thai-word.
109 (thai-word-mode-map): New variable.
110 (thai-word-mode): New minor mode.
111 (setup-thai-language-environment-internal): New function.
112 (exit-thai-language-environment-internal): New function.
113
114 * language/thai-word.el (thai-word-table): Declare it by defvar,
115 use dolist to initialize it.
116 (thai-kill-word, thai-backward-kill-word, thai-transpose-words)
117 (thai-fill-find-break-point): New functions.
118
1192005-03-29 Richard M. Stallman <rms@gnu.org>
120
121 * simple.el (idle-update-delay): Move definition up.
122 (set-mark): Doc fix.
123
1242005-03-29 Chong Yidong <cyd@stupidchicken.com>
125
126 * longlines.el: New file.
127
128 * simple.el (buffer-substring-filters): New variable.
129 (filter-buffer-substring): New function.
130 (kill-region, copy-region-as-kill): Use it.
131
132 * register.el (copy-to-register, append-to-register)
133 (prepend-to-register): Use filter-buffer-substring.
134
1352005-03-30 Nick Roberts <nickrob@snap.net.nz>
136
137 * progmodes/gud.el (gdb): (Re)-initialise gud-filter-pending-text.
138 (gud-filter-pending-text): Move in front of gdb.
139 (gud-overlay-arrow-position): New variable.
140 (gud-sentinel, gud-display-line): Use it in place of
141 overlay-arrow-position.
142
1432005-03-29 Glenn Morris <gmorris@ast.cam.ac.uk>
144
145 * progmodes/fortran.el (fortran-if-indent): Doc fix.
146 (fortran-font-lock-keywords-2): Add "where", "elsewhere".
147 (fortran-font-lock-keywords-4): New variable.
148 (fortran-blocks-re, fortran-end-block-re)
149 (fortran-start-block-re): New constants, for hideshow.
150 (hs-special-modes-alist): Add a Fortran entry.
151 (fortran-mode-map): Bind fortran-end-of-block,
152 fortran-beginning-of-block to \M-\C-n, \M-\C-p.
153 (fortran-mode): Doc fix. Add fortran-font-lock-keywords-4.
154 (fortran-looking-at-if-then, fortran-end-of-block)
155 (fortran-beginning-of-block): New functions, for hideshow.
156
157 * progmodes/f90.el (f90-end-block-re, f90-start-block-re): Doc
158 fix. Tweak regexp.
159 (f90-beginning-of-block): Push mark first.
160
1612005-03-29 Jay Belanger <belanger@truman.edu>
162
163 * calc/calc.el: Update copyright date.
164 (calc-version): Increase to 2.1.
165 (calc-version-date): Remove.
166
167 * calc/calc-help.el: Update copyright date.
168 (calc-full-help): Remove reference to calc-version-date.
169 Update copyright date.
170
1712005-03-29 Stefan Monnier <monnier@iro.umontreal.ca>
172
173 * vc.el (vc-do-command): Use a pipe for async processes, so password
174 prompts don't show up at places where the user can't reply.
175
1762005-03-29 Olive Lin <olive.lin@versateladsl.be> (tiny change)
177
178 * textmodes/tex-mode.el (tex-send-command): shell-quote-argument
179 on the file name we pass to the inferior shell.
180
1812005-03-29 Stephan Stahl <stahl@eos.franken.de> (tiny change)
182
183 * progmodes/which-func.el (which-function): Be robust in the face of an
184 imenu--make-index-alist failure.
185
1862005-03-29 Stefan Monnier <monnier@iro.umontreal.ca>
187
188 * reveal.el (reveal-mode-map): Don't override C-a and C-e.
189
190 * progmodes/python.el (python-preoutput-filter): Fix last change.
191
1922005-03-29 Lute Kamstra <lute@gnu.org>
193
194 * emacs-lisp/debug.el (debug-on-entry): Handle autoloaded
195 functions and compiled macros.
196 (debug-convert-byte-code): Handle macros too.
197 (debug-on-entry-1): Don't signal an error when trying to clear a
198 function that is not set to debug on entry.
199
2002005-03-29 Jay Belanger <belanger@truman.edu>
201
202 * calc/calc-lang.el: Add functions to math-function-table
203 properties of tex and math.
204
2052005-03-29 Kenichi Handa <handa@m17n.org>
206
207 * ps-mule.el (ps-mule-plot-string): Translate characters by
208 ps-print-translation-table.
209 (ps-mule-begin-job): Call find-charset-region/string with
210 ps-print-translation-table.
211 (ps-mule-printable-p): Return t if CHARSET is ascii or latin-iso8859-1.
212
213 * ps-print.el (ps-print-translation-table): New variable.
214 (ps-plot-region): Translate characters by ps-print-translation-table.
215
2162005-03-29 Juri Linkov <juri@jurta.org>
217
218 * simple.el (next-error-highlight-timer): New variable.
219
220 * progmodes/compile.el (compilation-goto-locus):
221 Use `next-error-highlight-timer' instead of `sit-for'.
222
2232005-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
224
225 * mail/supercite.el (sc-mail-field): Use assoc-string.
226 (sc-get-address): Simplify regexps.
227
228 * files.el (minibuffer-with-setup-hook): New macro.
229 (find-file-read-args): Use it to avoid let-binding
230 minibuffer-with-setup-hook (which breaks turning on/off
231 file-name-shadow-mode while in the prompt).
232
233 * complete.el (PC-read-include-file-name-internal): Use test-completion.
234
2352005-03-28 Luc Teirlinck <teirllm@auburn.edu>
236
237 * font-lock.el: Bind `font-lock-fontify-block' to M-o M-o.
238
2392005-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
240
241 * window.el (window-buffer-height): Use count-screen-lines.
242
243 * progmodes/python.el (python-preoutput-leftover): New var.
244 (python-preoutput-filter): Use it.
245 (python-send-receive): Loop until all the result has been received.
246
2472005-03-28 Juri Linkov <juri@jurta.org>
248
249 * dired.el (dired-mode-map): Add ellipsis to "Compare directories".
250
251 * menu-bar.el (menu-bar-file-menu): Remove ellipsis from
252 "Recover Crashed Session".
253 (menu-bar-search-menu): Add ellipsis to "Search tagged files".
254 (menu-bar-replace-menu): Add ellipsis to "Replace in tagged files".
255 (menu-bar-goto-menu): Add ellipsis to "Set Tags File Name".
256 (menu-bar-goto-menu): Add ellipsis to "Tags Apropos".
257 (menu-bar-options-menu): Add ellipsis to "Set Font/Fontset".
258 (menu-bar-manuals-menu): Add ellipsis to "Find Command in Manual".
259 (menu-bar-manuals-menu): Add ellipsis to "Find Key in Manual".
260 (menu-bar-help-menu): Remove ellipsis from "Find Emacs Packages".
261
262 * ediff-hook.el (menu-bar-ediff-misc-menu, ediff-misc-menu):
263 Remove ellipsis from "Ediff Manual", "Customize Ediff", "List
264 Ediff Sessions", "Toggle use of separate control buffer frame",
265 "Use separate frame for Ediff control buffer".
266
267 * bookmark.el (menu-bar-bookmark-map): Add ellipsis to "Jump to
268 Bookmark", "Set Bookmark", "Insert Contents", "Insert Location",
269 "Rename Bookmark", "Delete Bookmark".
270
271 * info.el (Info-mode-menu): Remove ellipsis from "Index".
272 Add ellipsis to "Lookup a String", "Lookup a string in all indices".
273 Add `:active Info-index-alternatives' to "Next Matching Item".
274
275 * wdired.el (wdired-change-to-wdired-mode):
276 Mention `wdired-abort-changes' key in the initial message.
277
278 * international/mule.el (auto-coding-alist): Associate non-ascii
279 image filename extensions with `no-conversion'.
280
2812005-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
282
283 * international/iso-acc.el:
284 * obsolete/iso-acc.el: Move iso-acc to the obsolete subdir.
285
2862005-03-26 Luc Teirlinck <teirllm@auburn.edu>
287
288 * textmodes/sgml-mode.el (html-mode): Doc update.
289
290 * autorevert.el (auto-revert-check-vc-info): Minor doc fix.
291
2922005-03-26 Dan Nicolaescu <dann@ics.uci.edu>
293
294 * term.el (term-move-columns): Fix face after extending a line.
295 (term-insert-spaces): Likewise.
296 (term-reset-terminal): Fix off by one error.
297
2982005-03-26 Eli Zaretskii <eliz@gnu.org>
299
300 * international/mule.el (auto-coding-alist): Add .xpi files.
301
302 * files.el (auto-mode-alist): Add .xpi files.
303
3042005-03-26 Jure Cuhalev <gandalf@owca.info> (tiny change)
305
306 * textmodes/ispell.el (ispell-dictionary-alist-6): Add slovenian.
307
3082005-03-26 Eli Zaretskii <eliz@gnu.org>
309
310 * term/bobcat.el: Don't use keyswap.el, since it is now obsolete.
311
3122005-03-26 Glenn Morris <gmorris@ast.cam.ac.uk>
313
314 * calendar/cal-menu.el (top level): Delete local C-down-mouse-3
315 binding. Suggested by Stephan Stahl <stahl@eos.franken.de>.
316
317 * calendar/cal-move.el (calendar-beginning-of-year): Move the
318 cursor to Jan 1 when needed.
319 (calendar-end-of-year): Fix -/+ typo.
320 Reported by Chong Yidong <cyd@stupidchicken.com>.
321
3222005-03-26 Stefan Monnier <monnier@iro.umontreal.ca>
323
324 * progmodes/flymake.el (flymake-mode): Add autoload cookie.
325
326 * emacs-lisp/debug.el (debugger-record-expression): Add a missing
327 format to `message'. Inspired by Deepak Goel <deego@gnufans.org>.
328
3292005-03-25 Richard M. Stallman <rms@gnu.org>
330
331 * filesets.el (filesets-init): Add autoload.
332
333 * mail/mailalias.el (mail-directory): Doc fix.
334
3352005-03-25 Frederik Fouvry <fouvry@CoLi.Uni-SB.DE>
336
337 * mail/mailalias.el (mail-directory-process): Do nothing if
338 mail-directory-process is an atom.
339 (mail-get-names): Ignore mail-directory-names if it is an atom.
340 (mail-directory-process defvar): Doc fix.
341 (mail-names): Doc fix.
342
3432005-03-25 Johan Bockg,Ae(Brd <bojohan+mail@dd.chalmers.se> (tiny change)
344
345 * textmodes/flyspell.el (mail-mode-flyspell-verify): Fix regexp syntax.
346
3472005-03-26 Kenichi Handa <handa@m17n.org>
348
349 * international/mule-util.el (detect-coding-with-priority):
350 Call update-coding-systems-internal before detect-coding-region.
351
3522005-03-26 Nick Roberts <nickrob@snap.net.nz>
353
354 * progmodes/gdb-ui.el (gdb-breakpoints-mode-map)
355 (gdb-frames-mode-map): Add follow-link property.
356
3572005-03-25 Jay Belanger <belanger@truman.edu>
358
359 * calc/calcalg2.el (calc-solve-for): Use "Variable(s)" to prompt
360 for variables.
361
3622005-03-25 Juri Linkov <juri@jurta.org>
363
364 * image-mode.el: Optimize image filename extension regexps in
365 autoload cookies. Associate .x[bp]m with `image-mode-maybe'
366 in `auto-mode-alist'.
367 (image-mode): Add `image-toggle-display-text' to local hook
368 `change-major-mode-hook'. Display the image as an image by
369 default. Set `cursor-type' and `truncate-lines' if the image
370 is already displayed. Take into account the current mode (image
371 or text) in message.
372 (image-minor-mode): New minor mode.
373 (image-mode-maybe, image-toggle-display-text): New functions.
374 (image-toggle-display): Use called-interactively-p.
375 Let-bind `inhibit-read-only' to t.
376
377 * image-mode.el (image-minor-mode): Set `cursor-type' and
378 `truncate-lines' if the image is already displayed. Add turning
379 image-minor-mode off to `change-major-mode-hook'. Add message.
380 Call `image-toggle-display-text' after turning image-minor-mode off.
381
3822005-03-25 Stefan Monnier <monnier@iro.umontreal.ca>
383
384 * international/mule-cmds.el (set-locale-environment): For Mac OS X's
385 Terminal.app, use utf-8.
386 (set-display-table-and-terminal-coding-system): Add coding-system arg.
387 (set-locale-environment): Use it.
388
389 * term/xterm.el: Undo last change, better done in mule-cmds.el.
390
391 * emacs-lisp/rx.el (rx-constituents): Add symbol-start and symbol-end.
392
393 * progmodes/python.el (python-close-block-statement-p)
394 (python-outdent-p, python-current-defun): Use symbol-end.
395
3962005-03-25 Karl Chen <quarl@cs.berkeley.edu> (tiny change)
397
398 * files.el (save-some-buffers): Doc fix.
399
4002005-03-25 Werner Lemberg <wl@gnu.org>
401
402 * complete.el, thumbs.el: Replace `legal' with `valid'.
403 * calendar/calendar.el: Replace `legal' with `valid'.
404 * emacs-lisp/advice.el: Replace `legal' with `valid'.
405 * mail/supercite.el: Replace `legal' with `valid'.
406 * progmodes/cperl-mode.el, progmodes/idlw-shell.el,
407 progmodes/idlwave.el, progmodes/vhdl-mode.el: Replace `legal' with
408 `valid'.
409 * textmodes/reftex-vars.el, textmodes/reftex.el: Replace `legal'
410 with `valid'.
411
4122005-03-25 Werner Lemberg <wl@gnu.org>
413
414 * calc/calc-forms.el, calc/calc-sel: Replace `illegal' with `invalid'.
415 * midnight.el, vc-cvs.el: Replace `illegal' with `invalid'.
416 * emacs-lisp/cl-macs.el: Replace `illegal' with `invalid'.
417 * emulation/vip.el: Replace `illegal' with `invalid'.
418 * eshell/esh-io.el, eshell/esh-var.el: Replace `illegal' with `invalid'.
419 * mail/supercite.el: Replace `illegal' with `invalid'.
420 * progmodes/ebnf-abn.el, progmodes/ebnf-bnf.el,
421 progmodes/ebnf-ebx.el, progmodes/ebnf-dtd.el, progmodes/ebnf-iso.el,
422 progmodes/ebnf-yac.el, progmodes/ebnf2ps.el, progmodes/idlwave.el,
423 progmodes/sh-script.el, progmodes/xscheme.el: Replace `illegal' with
424 `invalid'.
425 * textmodes/refbib.el, textmodes/refer.el, textmodes/reftex-cite.el,
426 textmodes/reftex-index.el, textmodes/reftex-parse.el,
427 textmodes/reftex-ref.el, textmodes/reftex-vars.el,
428 textmodes/reftex.el, textmodes/org.el: Replace `illegal' with `invalid'.
429
4302005-03-24 Stefan Monnier <monnier@iro.umontreal.ca>
431
432 * progmodes/flymake.el (flymake-get-file-name-mode-and-masks)
433 (flymake-find-buildfile, flymake-find-possible-master-files)
434 (flymake-check-include, flymake-parse-line): Replace loops over the
435 length of lists, by loops over lists, to remove silly O(n,A2(B) behavior.
436
437 * progmodes/flymake.el (flymake-ensure-ends-with-slash): Remove.
438 Substitute file-name-as-directory in the rest of the file.
439 (flymake-get-common-file-prefix): Rewrite, using compare-strings.
440 (flymake-replace-region): Remove unused arg `buffer'.
441 (flymake-check-patch-master-file-buffer): Update calls to it.
442 (flymake-add-err-info): Remove unused var `count'.
443 (flymake-mode): Use define-minor-mode.
444
445 * progmodes/flymake.el: Use with-current-buffer.
446 (flymake-float-time, flymake-get-temp-dir, flymake-line-end-position)
447 flymake-replace-regexp-in-string, flymake-line-beginning-position)
448 (flymake-popup-menu, flymake-current-row, flymake-selected-frame):
449 Avoid testing for `xemacs'.
450 (flymake-nop): Move.
451 (flymake-region-has-flymake-overlays): Return the computed value.
452 (flymake-reformat-err-line-patterns-from-compile-el): Use dolist.
453 Remove unused var `endline'.
454 (flymake-get-line-count): Remove unused function.
455 (flymake-display-err-menu-for-current-line): Unused var move-mouse-pos.
456
457 * emulation/vi.el:
458 * generic.el:
459 * hilit-chg.el (global-highlight-changes):
460 * hi-lock.el (hi-lock-mode):
461 * follow.el: find-file-hooks -> find-file-hook.
462
463 * comint.el (comint-insert-input): Obey mouse-yank-at-point.
464
4652005-03-24 Juri Linkov <juri@jurta.org>
466
467 * dired.el (dired-mode-map): Add menu item "Compare directories"
468 for dired-compare-directories.
469
470 * dired-aux.el (dired-compare-directories): Add autoload cookie.
471 Doc fix. Replace `read-file-name' with `read-directory-name'.
472
4732005-03-24 Stefan Monnier <monnier@iro.umontreal.ca>
474
475 * term/xterm.el: If running in Terminal.app set coding-system to utf-8.
476
4772005-03-24 Jay Belanger <belanger@truman.edu>
478
479 * calc/calc-embed.el (calc-embedded-mode-change): Save all
480 relevant mode settings in calc-embedded-original-modes when modes
481 are permanently changed.
482
4832005-03-24 Stefan Monnier <monnier@iro.umontreal.ca>
484
485 * autoinsert.el: find-file-hooks -> find-file-hook.
486
4872005-03-24 Lute Kamstra <lute@gnu.org>
488
489 * generic.el (generic-font-lock-defaults): Make it obsolete.
490 (generic-font-lock-keywords): New variable to replace
491 generic-font-lock-defaults.
492 (generic-mode-set-font-lock): Delete it.
493 (generic-mode-internal): Don't call generic-mode-set-font-lock.
494 (generic-bracket-support): Add docstring.
495
496 * generic-x.el: Rename generic-font-lock-defaults to
497 generic-font-lock-keywords throughout.
498 (mailagent-rules-setup-function): Delete it.
499 (mailagent-rules-generic-mode): Use anonymous function instead.
500 (show-tabs-generic-mode-font-lock-defaults-1)
501 (show-tabs-generic-mode-font-lock-defaults-2): Make them constants.
502 Quote faces.
503 (show-tabs-tab-face, show-tabs-space-face): Specify background,
504 not foreground.
505
506 * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression):
507 Recognize define-generic-mode.
508
5092005-03-23 Stefan Monnier <monnier@iro.umontreal.ca>
510
511 * icomplete.el (icomplete-simple-completing-p): Don't turn on icomplete
512 if there's no completion table.
513
12005-03-23 Miles Bader <miles@gnu.org> 5142005-03-23 Miles Bader <miles@gnu.org>
2 515
3 * progmodes/gdb-ui.el (breakpoint-enabled, breakpoint-disabled): 516 * progmodes/gdb-ui.el (breakpoint-enabled, breakpoint-disabled):
4 Remove tty-specific variants, as they're no longer needed. 517 Remove tty-specific variants, as they're no longer needed.
5 518
62005-03-23 Lute Kamstra <lute@gnu.org> 5192005-03-23 Lute Kamstra <lute@gnu.org>
7 520
8 * generic-x.el: Code cleanup: make arguments constant whenever 521 * generic-x.el: Code cleanup: make args constant whenever possible.
9 possible.
10 (installshield-statement-keyword-list) 522 (installshield-statement-keyword-list)
11 (installshield-system-functions-list) 523 (installshield-system-functions-list)
12 (installshield-system-variables-list, installshield-types-list) 524 (installshield-system-variables-list, installshield-types-list)
@@ -14,8 +526,8 @@
14 526
15 * generic.el (generic-make-keywords-list): Add autoload cookie. 527 * generic.el (generic-make-keywords-list): Add autoload cookie.
16 528
17 * calendar/time-date.el: Add comment on time value formats. Don't 529 * calendar/time-date.el: Add comment on time value formats.
18 require parse-time. 530 Don't require parse-time.
19 (with-decoded-time-value): New macro. 531 (with-decoded-time-value): New macro.
20 (encode-time-value): New function. 532 (encode-time-value): New function.
21 (time-to-seconds, time-less-p, time-subtract, time-add): Use them. 533 (time-to-seconds, time-less-p, time-subtract, time-add): Use them.
@@ -34,8 +546,8 @@
34 (recentf-include-p): More robust. 546 (recentf-include-p): More robust.
35 (recentf-keep-p): New function. 547 (recentf-keep-p): New function.
36 (recentf-remove-if-non-kept): Rename from 548 (recentf-remove-if-non-kept): Rename from
37 `recentf-remove-if-non-readable'. Use `recentf-keep-p'. All 549 `recentf-remove-if-non-readable'. Use `recentf-keep-p'.
38 callers updated. 550 All callers updated.
39 (recentf-menu-items-for-commands): Fix help string. 551 (recentf-menu-items-for-commands): Fix help string.
40 (recentf-track-closed-file): Update. Doc fix. 552 (recentf-track-closed-file): Update. Doc fix.
41 (recentf-cleanup): Update. Count removed files. Doc fix. 553 (recentf-cleanup): Update. Count removed files. Doc fix.
@@ -124,8 +636,7 @@
124 636
1252005-03-21 Lute Kamstra <lute@gnu.org> 6372005-03-21 Lute Kamstra <lute@gnu.org>
126 638
127 * generic.el: Fix commentary section. Don't require cl for 639 * generic.el: Fix commentary section. Don't require cl for compilation.
128 compilation.
129 (generic-mode-list): Add autoload cookie. 640 (generic-mode-list): Add autoload cookie.
130 (generic-use-find-file-hook, generic-lines-to-scan) 641 (generic-use-find-file-hook, generic-lines-to-scan)
131 (generic-find-file-regexp, generic-ignore-files-regexp) 642 (generic-find-file-regexp, generic-ignore-files-regexp)
@@ -175,20 +686,27 @@
175 686
176 * tramp-smb.el (all): Remove debug construct for 687 * tramp-smb.el (all): Remove debug construct for
177 `with-parsed-tramp-file-name'. 688 `with-parsed-tramp-file-name'.
178 (tramp-smb-prompt): Prompt can contain spaces inside directory 689 (tramp-smb-prompt): Prompt can contain spaces inside directory names.
179 names.
180 (tramp-smb-handle-delete-directory, tramp-smb-handle-delete-file): 690 (tramp-smb-handle-delete-directory, tramp-smb-handle-delete-file):
181 No error message if DIRECTORY or FILENAME doesn't exist. 691 No error message if DIRECTORY or FILENAME doesn't exist.
182 (tramp-smb-open-connection): Check existence of 692 (tramp-smb-open-connection): Check existence of
183 `tramp-smb-program'. 693 `tramp-smb-program'.
184 694
6952005-03-20 Stefan Monnier <monnier@iro.umontreal.ca>
696
697 * progmodes/perl-mode.el (perl-font-lock-syntactic-face-function):
698 Properly handle the case where the `m' or `s' command's argument is not
699 yet terminated.
700 (perl-indent-new-calculate): New function.
701 (perl-indent-line): Use it.
702
1852005-03-20 Miles Bader <miles@gnu.org> 7032005-03-20 Miles Bader <miles@gnu.org>
186 704
187 * progmodes/gdb-ui.el (gdb-put-breakpoint-icon): Use breakpoint faces 705 * progmodes/gdb-ui.el (gdb-put-breakpoint-icon): Use breakpoint faces
188 in text-mode too. Change to new face names. 706 in text-mode too. Change to new face names.
189 (breakpoint-enabled): Renamed from `breakpoint-enabled-bitmap-face'. 707 (breakpoint-enabled): Rename from `breakpoint-enabled-bitmap-face'.
190 Add `:weight bold' attribute. 708 Add `:weight bold' attribute.
191 (breakpoint-disabled): Renamed from `breakpoint-disabled-bitmap-face'. 709 (breakpoint-disabled): Rename from `breakpoint-disabled-bitmap-face'.
192 710
1932005-03-19 Juri Linkov <juri@jurta.org> 7112005-03-19 Juri Linkov <juri@jurta.org>
194 712
@@ -205,8 +723,7 @@
205 723
2062005-03-19 Yoichi NAKAYAMA <yoichi@geiin.org> (tiny changes) 7242005-03-19 Yoichi NAKAYAMA <yoichi@geiin.org> (tiny changes)
207 725
208 * finder.el (finder-current-item): Throw an error on an empty 726 * finder.el (finder-current-item): Throw an error on an empty line.
209 line.
210 727
211 * man.el (Man-follow-manual-reference): If current-word returns 728 * man.el (Man-follow-manual-reference): If current-word returns
212 nil, use "". 729 nil, use "".
@@ -245,8 +762,8 @@
245 762
2462005-03-19 Vinicius Jose Latorre <viniciusjl@ig.com.br> 7632005-03-19 Vinicius Jose Latorre <viniciusjl@ig.com.br>
247 764
248 * ps-print.el (ps-generate-string-list, ps-generate-header-line): Use 765 * ps-print.el (ps-generate-string-list, ps-generate-header-line):
249 functionp instead of symbolp and fboundp. Reported by Drkm 766 Use functionp instead of symbolp and fboundp. Reported by Drkm
250 <darkman_spam@yahoo.fr>. 767 <darkman_spam@yahoo.fr>.
251 (ps-print-version): New version 6.6.6. 768 (ps-print-version): New version 6.6.6.
252 769
diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el
index ea3df8efa68..27f5555bb04 100644
--- a/lisp/autoinsert.el
+++ b/lisp/autoinsert.el
@@ -1,6 +1,7 @@
1;;; autoinsert.el --- automatic mode-dependent insertion of text into new files 1;;; autoinsert.el --- automatic mode-dependent insertion of text into new files
2 2
3;; Copyright (C) 1985, 86, 87, 94, 95, 98, 2000, 03 Free Software Foundation, Inc. 3;; Copyright (C) 1985, 1986, 1987, 1994, 1995, 1998, 2000, 2003, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Charlie Martin <crm@cs.duke.edu> 6;; Author: Charlie Martin <crm@cs.duke.edu>
6;; Adapted-By: Daniel Pfeiffer <occitan@esperanto.org> 7;; Adapted-By: Daniel Pfeiffer <occitan@esperanto.org>
@@ -33,7 +34,7 @@
33;; auto-mode-alist. 34;; auto-mode-alist.
34;; 35;;
35;; To use: 36;; To use:
36;; (add-hook 'find-file-hooks 'auto-insert) 37;; (add-hook 'find-file-hook 'auto-insert)
37;; setq auto-insert-directory to an appropriate slash-terminated value 38;; setq auto-insert-directory to an appropriate slash-terminated value
38;; 39;;
39;; You can also customize the variable `auto-insert-mode' to load the 40;; You can also customize the variable `auto-insert-mode' to load the
@@ -67,7 +68,7 @@ Insertion is possible when something appropriate is found in
67`auto-insert-alist'. When the insertion is marked as unmodified, you can 68`auto-insert-alist'. When the insertion is marked as unmodified, you can
68save it with \\[write-file] RET. 69save it with \\[write-file] RET.
69This variable is used when the function `auto-insert' is called, e.g. 70This variable is used when the function `auto-insert' is called, e.g.
70when you do (add-hook 'find-file-hooks 'auto-insert). 71when you do (add-hook 'find-file-hook 'auto-insert).
71With \\[auto-insert], this is always treated as if it were t." 72With \\[auto-insert], this is always treated as if it were t."
72 :type '(choice (const :tag "Insert if possible" t) 73 :type '(choice (const :tag "Insert if possible" t)
73 (const :tag "Do nothing" nil) 74 (const :tag "Do nothing" nil)
@@ -326,10 +327,10 @@ When Auto-insert mode is enabled, when new files are created you can
326insert a template for the file depending on the mode of the buffer." 327insert a template for the file depending on the mode of the buffer."
327 :global t :group 'auto-insert 328 :global t :group 'auto-insert
328 (if auto-insert-mode 329 (if auto-insert-mode
329 (add-hook 'find-file-hooks 'auto-insert) 330 (add-hook 'find-file-hook 'auto-insert)
330 (remove-hook 'find-file-hooks 'auto-insert))) 331 (remove-hook 'find-file-hook 'auto-insert)))
331 332
332(provide 'autoinsert) 333(provide 'autoinsert)
333 334
334;;; arch-tag: 5b6630ac-c735-43cf-b097-b78c622af909 335;; arch-tag: 5b6630ac-c735-43cf-b097-b78c622af909
335;;; autoinsert.el ends here 336;;; autoinsert.el ends here
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index d4a3d10d167..361a11a67ea 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -246,7 +246,7 @@ This currently works by automatically updating the version
246control info every `auto-revert-interval' seconds. Nevertheless, 246control info every `auto-revert-interval' seconds. Nevertheless,
247it should not cause excessive CPU usage on a reasonably fast 247it should not cause excessive CPU usage on a reasonably fast
248machine, if it does not apply to too many version controlled 248machine, if it does not apply to too many version controlled
249buffers. CPU usage depends on the version control system" 249buffers. CPU usage depends on the version control system."
250 :group 'auto-revert 250 :group 'auto-revert
251 :type 'boolean 251 :type 'boolean
252 :version "22.1") 252 :version "22.1")
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 949434baffb..869896b087a 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -2111,12 +2111,12 @@ strings returned are not."
2111 (define-key map [write] '("Save Bookmarks As..." . bookmark-write)) 2111 (define-key map [write] '("Save Bookmarks As..." . bookmark-write))
2112 (define-key map [save] '("Save Bookmarks" . bookmark-save)) 2112 (define-key map [save] '("Save Bookmarks" . bookmark-save))
2113 (define-key map [edit] '("Edit Bookmark List" . bookmark-bmenu-list)) 2113 (define-key map [edit] '("Edit Bookmark List" . bookmark-bmenu-list))
2114 (define-key map [delete] '("Delete Bookmark" . bookmark-delete)) 2114 (define-key map [delete] '("Delete Bookmark..." . bookmark-delete))
2115 (define-key map [rename] '("Rename Bookmark" . bookmark-rename)) 2115 (define-key map [rename] '("Rename Bookmark..." . bookmark-rename))
2116 (define-key map [locate] '("Insert Location" . bookmark-locate)) 2116 (define-key map [locate] '("Insert Location..." . bookmark-locate))
2117 (define-key map [insert] '("Insert Contents" . bookmark-insert)) 2117 (define-key map [insert] '("Insert Contents..." . bookmark-insert))
2118 (define-key map [set] '("Set Bookmark" . bookmark-set)) 2118 (define-key map [set] '("Set Bookmark..." . bookmark-set))
2119 (define-key map [jump] '("Jump to Bookmark" . bookmark-jump)) 2119 (define-key map [jump] '("Jump to Bookmark..." . bookmark-jump))
2120 map)) 2120 map))
2121 2121
2122;;;###autoload 2122;;;###autoload
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el
index 8a48b78e37e..2d2f66b1ebf 100644
--- a/lisp/calc/calc-embed.el
+++ b/lisp/calc/calc-embed.el
@@ -1257,26 +1257,8 @@ The command \\[yank] can retrieve it from there."
1257 calc-embedded-close-mode)))) 1257 calc-embedded-close-mode))))
1258 (setq vars (cdr vars) 1258 (setq vars (cdr vars)
1259 values (cdr values)))))) 1259 values (cdr values))))))
1260 (when (and vars calc-embedded-original-modes (eq calc-mode-save-mode 'save)) 1260 (when (and vars (eq calc-mode-save-mode 'save))
1261 (cond ((equal vars '(the-language)) 1261 (calc-embedded-save-original-modes))))
1262 (setcar calc-embedded-original-modes
1263 (cons calc-language calc-language-option)))
1264 ((equal vars '(the-display-just))
1265 (let* ((modes (cdr calc-embedded-original-modes))
1266 (just (assq 'calc-display-just modes))
1267 (origin (assq 'calc-display-origin modes)))
1268 (if just
1269 (setcdr just calc-display-just))
1270 (if origin
1271 (setcdr origin calc-display-origin))))
1272 (t
1273 (let ((modes (cdr calc-embedded-original-modes)))
1274 (while vars
1275 (let* ((var (car vars))
1276 (cell (assq var modes)))
1277 (if cell
1278 (setcdr cell (symbol-value var))))
1279 (setq vars (cdr vars)))))))))
1280 1262
1281(defun calc-embedded-var-change (var &optional buf) 1263(defun calc-embedded-var-change (var &optional buf)
1282 (if (symbolp var) 1264 (if (symbolp var)
diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el
index d4ddada6a0c..4870891231a 100644
--- a/lisp/calc/calc-forms.el
+++ b/lisp/calc/calc-forms.el
@@ -1,6 +1,7 @@
1;;; calc-forms.el --- data format conversion functions for Calc 1;;; calc-forms.el --- data format conversion functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: David Gillespie <daveg@synaptics.com> 6;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 7;; Maintainer: Jay Belanger <belanger@truman.edu>
@@ -1434,7 +1435,7 @@ and ends on the last Sunday of October at 2 a.m."
1434(defun calcFunc-badd (a b) 1435(defun calcFunc-badd (a b)
1435 (if (eq (car-safe b) 'date) 1436 (if (eq (car-safe b) 'date)
1436 (if (eq (car-safe a) 'date) 1437 (if (eq (car-safe a) 'date)
1437 (math-reject-arg nil "*Illegal combination in date arithmetic") 1438 (math-reject-arg nil "*Invalid combination in date arithmetic")
1438 (calcFunc-badd b a)) 1439 (calcFunc-badd b a))
1439 (if (eq (car-safe a) 'date) 1440 (if (eq (car-safe a) 'date)
1440 (if (Math-realp b) 1441 (if (Math-realp b)
@@ -1452,7 +1453,7 @@ and ends on the last Sunday of October at 2 a.m."
1452 (if hours 1453 (if hours
1453 (setq b (math-div b (cdr hours)))) 1454 (setq b (math-div b (cdr hours))))
1454 (calcFunc-badd a b)) 1455 (calcFunc-badd a b))
1455 (math-reject-arg nil "*Illegal combination in date arithmetic"))) 1456 (math-reject-arg nil "*Invalid combination in date arithmetic")))
1456 (math-reject-arg a 'datep)))) 1457 (math-reject-arg a 'datep))))
1457 1458
1458(defun calcFunc-holiday (a) 1459(defun calcFunc-holiday (a)
diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el
index dc7f0b17c1d..46b8cec2ac6 100644
--- a/lisp/calc/calc-help.el
+++ b/lisp/calc/calc-help.el
@@ -1,6 +1,6 @@
1;;; calc-help.el --- help display functions for Calc, 1;;; calc-help.el --- help display functions for Calc,
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2004 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2004, 2005
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: David Gillespie <daveg@synaptics.com> 6;; Author: David Gillespie <daveg@synaptics.com>
@@ -409,10 +409,10 @@ C-w Describe how there is no warranty for Calc."
409(defun calc-full-help () 409(defun calc-full-help ()
410 (interactive) 410 (interactive)
411 (with-output-to-temp-buffer "*Help*" 411 (with-output-to-temp-buffer "*Help*"
412 (princ (format "GNU Emacs Calculator version %s of %s.\n" 412 (princ (format "GNU Emacs Calculator version %s.\n"
413 calc-version calc-version-date)) 413 calc-version))
414 (princ " By Dave Gillespie, daveg@synaptics.com.\n") 414 (princ " By Dave Gillespie.\n")
415 (princ " Copyright (C) 1990, 1993 Free Software Foundation, Inc.\n\n") 415 (princ " Copyright (C) 2005 Free Software Foundation, Inc.\n\n")
416 (princ "Type `h s' for a more detailed summary.\n") 416 (princ "Type `h s' for a more detailed summary.\n")
417 (princ "Or type `h i' to read the full Calc manual on-line.\n\n") 417 (princ "Or type `h i' to read the full Calc manual on-line.\n\n")
418 (princ "Basic keys:\n") 418 (princ "Basic keys:\n")
diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el
index 2e5737349bc..9510507e276 100644
--- a/lisp/calc/calc-lang.el
+++ b/lisp/calc/calc-lang.el
@@ -388,6 +388,9 @@
388 ( \\arg . calcFunc-arg ) 388 ( \\arg . calcFunc-arg )
389 ( \\cos . calcFunc-cos ) 389 ( \\cos . calcFunc-cos )
390 ( \\cosh . calcFunc-cosh ) 390 ( \\cosh . calcFunc-cosh )
391 ( \\cot . calcFunc-cot )
392 ( \\coth . calcFunc-coth )
393 ( \\csc . calcFunc-csc )
391 ( \\det . calcFunc-det ) 394 ( \\det . calcFunc-det )
392 ( \\exp . calcFunc-exp ) 395 ( \\exp . calcFunc-exp )
393 ( \\gcd . calcFunc-gcd ) 396 ( \\gcd . calcFunc-gcd )
@@ -395,10 +398,11 @@
395 ( \\log . calcFunc-log10 ) 398 ( \\log . calcFunc-log10 )
396 ( \\max . calcFunc-max ) 399 ( \\max . calcFunc-max )
397 ( \\min . calcFunc-min ) 400 ( \\min . calcFunc-min )
398 ( \\tan . calcFunc-tan ) 401 ( \\sec . calcFunc-sec )
399 ( \\sin . calcFunc-sin ) 402 ( \\sin . calcFunc-sin )
400 ( \\sinh . calcFunc-sinh ) 403 ( \\sinh . calcFunc-sinh )
401 ( \\sqrt . calcFunc-sqrt ) 404 ( \\sqrt . calcFunc-sqrt )
405 ( \\tan . calcFunc-tan )
402 ( \\tanh . calcFunc-tanh ) 406 ( \\tanh . calcFunc-tanh )
403 ( \\phi . calcFunc-totient ) 407 ( \\phi . calcFunc-totient )
404 ( \\mu . calcFunc-moebius ))) 408 ( \\mu . calcFunc-moebius )))
@@ -686,6 +690,10 @@
686 ( Conjugate . calcFunc-conj ) 690 ( Conjugate . calcFunc-conj )
687 ( Cos . calcFunc-cos ) 691 ( Cos . calcFunc-cos )
688 ( Cosh . calcFunc-cosh ) 692 ( Cosh . calcFunc-cosh )
693 ( Cot . calcFunc-cot )
694 ( Coth . calcFunc-coth )
695 ( Csc . calcFunc-csc )
696 ( Csch . calcFunc-csch )
689 ( D . calcFunc-deriv ) 697 ( D . calcFunc-deriv )
690 ( Dt . calcFunc-tderiv ) 698 ( Dt . calcFunc-tderiv )
691 ( Det . calcFunc-det ) 699 ( Det . calcFunc-det )
@@ -708,6 +716,8 @@
708 ( Random . calcFunc-random ) 716 ( Random . calcFunc-random )
709 ( Round . calcFunc-round ) 717 ( Round . calcFunc-round )
710 ( Re . calcFunc-re ) 718 ( Re . calcFunc-re )
719 ( Sec . calcFunc-sec )
720 ( Sech . calcFunc-sech )
711 ( Sign . calcFunc-sign ) 721 ( Sign . calcFunc-sign )
712 ( Sin . calcFunc-sin ) 722 ( Sin . calcFunc-sin )
713 ( Sinh . calcFunc-sinh ) 723 ( Sinh . calcFunc-sinh )
diff --git a/lisp/calc/calc-sel.el b/lisp/calc/calc-sel.el
index 4ae0df5d3ba..04cb2bee2bd 100644
--- a/lisp/calc/calc-sel.el
+++ b/lisp/calc/calc-sel.el
@@ -1,6 +1,7 @@
1;;; calc-sel.el --- data selection functions for Calc 1;;; calc-sel.el --- data selection functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: David Gillespie <daveg@synaptics.com> 6;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 7;; Maintainer: Jay Belanger <belanger@truman.edu>
@@ -490,7 +491,7 @@
490 (mapcar 'calc-replace-sub-formula-rec (cdr expr)))))) 491 (mapcar 'calc-replace-sub-formula-rec (cdr expr))))))
491 492
492(defun calc-sel-error () 493(defun calc-sel-error ()
493 (error "Illegal operation on sub-formulas")) 494 (error "Invalid operation on sub-formulas"))
494 495
495(defun calc-replace-selections (n vals m) 496(defun calc-replace-selections (n vals m)
496 (if (calc-top-selected n m) 497 (if (calc-top-selected n m)
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 24336ad9333..639b6f31a68 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -1,6 +1,7 @@
1;;; calc.el --- the GNU Emacs calculator 1;;; calc.el --- the GNU Emacs calculator
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: David Gillespie <daveg@synaptics.com> 6;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 7;; Maintainer: Jay Belanger <belanger@truman.edu>
@@ -656,8 +657,7 @@ If nil, selections displayed but ignored.")
656(put 'math-underflow 'error-conditions '(error math-underflow calc-error)) 657(put 'math-underflow 'error-conditions '(error math-underflow calc-error))
657(put 'math-underflow 'error-message "Floating-point underflow occurred") 658(put 'math-underflow 'error-message "Floating-point underflow occurred")
658 659
659(defconst calc-version "2.02g") 660(defconst calc-version "2.1")
660(defconst calc-version-date "Mon Nov 19 2001")
661(defvar calc-trail-pointer nil) ; "Current" entry in trail buffer. 661(defvar calc-trail-pointer nil) ; "Current" entry in trail buffer.
662(defvar calc-trail-overlay nil) ; Value of overlay-arrow-string. 662(defvar calc-trail-overlay nil) ; Value of overlay-arrow-string.
663(defvar calc-undo-list nil) ; List of previous operations for undo. 663(defvar calc-undo-list nil) ; List of previous operations for undo.
diff --git a/lisp/calc/calcalg2.el b/lisp/calc/calcalg2.el
index a422ed33e45..d2459919fda 100644
--- a/lisp/calc/calcalg2.el
+++ b/lisp/calc/calcalg2.el
@@ -149,7 +149,7 @@
149 (and step (list step))))))) 149 (and step (list step)))))))
150 150
151(defun calc-solve-for (var) 151(defun calc-solve-for (var)
152 (interactive "sVariable to solve for: ") 152 (interactive "sVariable(s) to solve for: ")
153 (calc-slow-wrapper 153 (calc-slow-wrapper
154 (let ((func (if (calc-is-inverse) 154 (let ((func (if (calc-is-inverse)
155 (if (calc-is-hyperbolic) 'calcFunc-ffinv 'calcFunc-finv) 155 (if (calc-is-hyperbolic) 'calcFunc-ffinv 'calcFunc-finv)
diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el
index e11129414d3..8ace0be910b 100644
--- a/lisp/calendar/appt.el
+++ b/lisp/calendar/appt.el
@@ -1,9 +1,9 @@
1;;; appt.el --- appointment notification functions 1;;; appt.el --- appointment notification functions
2 2
3;; Copyright (C) 1989, 1990, 1994, 1998, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1989, 1990, 1994, 1998, 2004 Free Software Foundation, Inc.
4 4
5;; Author: Neil Mager <neilm@juliet.ll.mit.edu> 5;; Author: Neil Mager <neilm@juliet.ll.mit.edu>
6;; Maintainer: FSF 6;; Maintainer: Glenn Morris <gmorris@ast.cam.ac.uk>
7;; Keywords: calendar 7;; Keywords: calendar
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
@@ -181,7 +181,7 @@ Only relevant if reminders are being displayed in a window."
181 181
182;;; Internal variables below this point. 182;;; Internal variables below this point.
183 183
184(defvar appt-buffer-name " *appt-buf*" 184(defconst appt-buffer-name " *appt-buf*"
185 "Name of the appointments buffer.") 185 "Name of the appointments buffer.")
186 186
187(defvar appt-time-msg-list nil 187(defvar appt-time-msg-list nil
@@ -486,9 +486,8 @@ Usually just deletes the appointment buffer."
486 486
487;;;###autoload 487;;;###autoload
488(defun appt-add (new-appt-time new-appt-msg) 488(defun appt-add (new-appt-time new-appt-msg)
489 "Add an appointment for the day at NEW-APPT-TIME and issue message NEW-APPT-MSG. 489 "Add an appointment for today at NEW-APPT-TIME with message NEW-APPT-MSG.
490The time should be in either 24 hour format or am/pm format." 490The time should be in either 24 hour format or am/pm format."
491
492 (interactive "sTime (hh:mm[am/pm]): \nsMessage: ") 491 (interactive "sTime (hh:mm[am/pm]): \nsMessage: ")
493 (unless (string-match "[0-9]?[0-9][:.][0-9][0-9]\\(am\\|pm\\)?" 492 (unless (string-match "[0-9]?[0-9][:.][0-9][0-9]\\(am\\|pm\\)?"
494 new-appt-time) 493 new-appt-time)
diff --git a/lisp/calendar/cal-china.el b/lisp/calendar/cal-china.el
index 6e506b93f7d..303193e3d73 100644
--- a/lisp/calendar/cal-china.el
+++ b/lisp/calendar/cal-china.el
@@ -38,8 +38,8 @@
38;; The date of Chinese New Year is correct from 1644-2051. 38;; The date of Chinese New Year is correct from 1644-2051.
39 39
40;; Technical details of all the calendrical calculations can be found in 40;; Technical details of all the calendrical calculations can be found in
41;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold, 41;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
42;; Cambridge University Press (1997). 42;; and Nachum Dershowitz, Cambridge University Press (2001).
43 43
44;; Comments, corrections, and improvements should be sent to 44;; Comments, corrections, and improvements should be sent to
45;; Edward M. Reingold Department of Computer Science 45;; Edward M. Reingold Department of Computer Science
diff --git a/lisp/calendar/cal-coptic.el b/lisp/calendar/cal-coptic.el
index df1201a23c4..2aa111f2109 100644
--- a/lisp/calendar/cal-coptic.el
+++ b/lisp/calendar/cal-coptic.el
@@ -29,8 +29,8 @@
29;; diary.el that deal with the Coptic and Ethiopic calendars. 29;; diary.el that deal with the Coptic and Ethiopic calendars.
30 30
31;; Technical details of all the calendrical calculations can be found in 31;; Technical details of all the calendrical calculations can be found in
32;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold, 32;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
33;; Cambridge University Press (1997). 33;; and Nachum Dershowitz, Cambridge University Press (2001).
34 34
35;; Comments, corrections, and improvements should be sent to 35;; Comments, corrections, and improvements should be sent to
36;; Edward M. Reingold Department of Computer Science 36;; Edward M. Reingold Department of Computer Science
diff --git a/lisp/calendar/cal-french.el b/lisp/calendar/cal-french.el
index d988b008f53..c42e415eb25 100644
--- a/lisp/calendar/cal-french.el
+++ b/lisp/calendar/cal-french.el
@@ -29,8 +29,8 @@
29;; diary.el that deal with the French Revolutionary calendar. 29;; diary.el that deal with the French Revolutionary calendar.
30 30
31;; Technical details of the French Revolutionary calendar can be found in 31;; Technical details of the French Revolutionary calendar can be found in
32;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold, 32;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
33;; Cambridge University Press (1997), and in 33;; and Nachum Dershowitz, Cambridge University Press (2001), and in
34;; ``Calendrical Calculations, Part II: Three Historical Calendars'' by 34;; ``Calendrical Calculations, Part II: Three Historical Calendars'' by
35;; E. M. Reingold, N. Dershowitz, and S. M. Clamen, Software--Practice and 35;; E. M. Reingold, N. Dershowitz, and S. M. Clamen, Software--Practice and
36;; Experience, Volume 23, Number 4 (April, 1993), pages 383-404. 36;; Experience, Volume 23, Number 4 (April, 1993), pages 383-404.
diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el
index 776868159be..f66b4966e57 100644
--- a/lisp/calendar/cal-hebrew.el
+++ b/lisp/calendar/cal-hebrew.el
@@ -30,8 +30,8 @@
30;; diary.el that deal with the Hebrew calendar. 30;; diary.el that deal with the Hebrew calendar.
31 31
32;; Technical details of all the calendrical calculations can be found in 32;; Technical details of all the calendrical calculations can be found in
33;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold, 33;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
34;; Cambridge University Press (1997). 34;; and Nachum Dershowitz, Cambridge University Press (2001).
35 35
36;; Comments, corrections, and improvements should be sent to 36;; Comments, corrections, and improvements should be sent to
37;; Edward M. Reingold Department of Computer Science 37;; Edward M. Reingold Department of Computer Science
diff --git a/lisp/calendar/cal-islam.el b/lisp/calendar/cal-islam.el
index 8dcf5c29b1f..1ac6f0677b1 100644
--- a/lisp/calendar/cal-islam.el
+++ b/lisp/calendar/cal-islam.el
@@ -29,8 +29,8 @@
29;; diary.el that deal with the Islamic calendar. 29;; diary.el that deal with the Islamic calendar.
30 30
31;; Technical details of all the calendrical calculations can be found in 31;; Technical details of all the calendrical calculations can be found in
32;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold, 32;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
33;; Cambridge University Press (1997). 33;; and Nachum Dershowitz, Cambridge University Press (2001).
34 34
35;; Comments, corrections, and improvements should be sent to 35;; Comments, corrections, and improvements should be sent to
36;; Edward M. Reingold Department of Computer Science 36;; Edward M. Reingold Department of Computer Science
diff --git a/lisp/calendar/cal-iso.el b/lisp/calendar/cal-iso.el
index 058bdf071d7..8a40442e4fe 100644
--- a/lisp/calendar/cal-iso.el
+++ b/lisp/calendar/cal-iso.el
@@ -30,8 +30,8 @@
30;; diary.el that deal with the ISO calendar. 30;; diary.el that deal with the ISO calendar.
31 31
32;; Technical details of all the calendrical calculations can be found in 32;; Technical details of all the calendrical calculations can be found in
33;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold, 33;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
34;; Cambridge University Press (1997). 34;; and Nachum Dershowitz, Cambridge University Press (2001).
35 35
36;; Comments, corrections, and improvements should be sent to 36;; Comments, corrections, and improvements should be sent to
37;; Edward M. Reingold Department of Computer Science 37;; Edward M. Reingold Department of Computer Science
diff --git a/lisp/calendar/cal-julian.el b/lisp/calendar/cal-julian.el
index 67fb8515b24..2b7278f8ea6 100644
--- a/lisp/calendar/cal-julian.el
+++ b/lisp/calendar/cal-julian.el
@@ -29,8 +29,8 @@
29;; diary.el that deal with the Julian calendar. 29;; diary.el that deal with the Julian calendar.
30 30
31;; Technical details of all the calendrical calculations can be found in 31;; Technical details of all the calendrical calculations can be found in
32;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold, 32;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
33;; Cambridge University Press (1997). 33;; and Nachum Dershowitz, Cambridge University Press (2001).
34 34
35;; Comments, corrections, and improvements should be sent to 35;; Comments, corrections, and improvements should be sent to
36;; Edward M. Reingold Department of Computer Science 36;; Edward M. Reingold Department of Computer Science
diff --git a/lisp/calendar/cal-mayan.el b/lisp/calendar/cal-mayan.el
index c2c3e027c4b..92bbb5df23e 100644
--- a/lisp/calendar/cal-mayan.el
+++ b/lisp/calendar/cal-mayan.el
@@ -44,8 +44,8 @@
44;; Comments, improvements, and bug reports should be sent to Reingold. 44;; Comments, improvements, and bug reports should be sent to Reingold.
45 45
46;; Technical details of the Mayan calendrical calculations can be found in 46;; Technical details of the Mayan calendrical calculations can be found in
47;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold, 47;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
48;; Cambridge University Press (1997), and in 48;; and Nachum Dershowitz, Cambridge University Press (2001), and in
49;; ``Calendrical Calculations, Part II: Three Historical Calendars'' 49;; ``Calendrical Calculations, Part II: Three Historical Calendars''
50;; by E. M. Reingold, N. Dershowitz, and S. M. Clamen, 50;; by E. M. Reingold, N. Dershowitz, and S. M. Clamen,
51;; Software--Practice and Experience, Volume 23, Number 4 (April, 1993), 51;; Software--Practice and Experience, Volume 23, Number 4 (April, 1993),
diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el
index ceb4c56f7fd..408de3826d4 100644
--- a/lisp/calendar/cal-menu.el
+++ b/lisp/calendar/cal-menu.el
@@ -1,6 +1,6 @@
1;;; cal-menu.el --- calendar functions for menu bar and popup menu support 1;;; cal-menu.el --- calendar functions for menu bar and popup menu support
2 2
3;; Copyright (C) 1994, 1995, 2001, 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1994, 1995, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
6;; Lara Rios <lrios@coewl.cen.uiuc.edu> 6;; Lara Rios <lrios@coewl.cen.uiuc.edu>
@@ -52,7 +52,6 @@
52 52
53(defvar calendar-mouse-3-map (make-sparse-keymap "Calendar")) 53(defvar calendar-mouse-3-map (make-sparse-keymap "Calendar"))
54(define-key calendar-mode-map [down-mouse-3] calendar-mouse-3-map) 54(define-key calendar-mode-map [down-mouse-3] calendar-mouse-3-map)
55(define-key calendar-mode-map [C-down-mouse-3] calendar-mouse-3-map)
56 55
57(define-key calendar-mode-map [menu-bar moon] 56(define-key calendar-mode-map [menu-bar moon]
58 (cons "Moon" (make-sparse-keymap "Moon"))) 57 (cons "Moon" (make-sparse-keymap "Moon")))
diff --git a/lisp/calendar/cal-move.el b/lisp/calendar/cal-move.el
index 045c11ba1d7..e89ee2a26e2 100644
--- a/lisp/calendar/cal-move.el
+++ b/lisp/calendar/cal-move.el
@@ -1,8 +1,9 @@
1;;; cal-move.el --- calendar functions for movement in the calendar 1;;; cal-move.el --- calendar functions for movement in the calendar
2 2
3;; Copyright (C) 1995 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
6;; Maintainer: Glenn Morris <gmorris@ast.cam.ac.uk>
6;; Keywords: calendar 7;; Keywords: calendar
7;; Human-Keywords: calendar 8;; Human-Keywords: calendar
8 9
@@ -269,7 +270,8 @@ Moves forward if ARG is negative."
269 (if (and (= arg 1) 270 (if (and (= arg 1)
270 (calendar-date-is-visible-p jan-first)) 271 (calendar-date-is-visible-p jan-first))
271 (calendar-cursor-to-visible-date jan-first) 272 (calendar-cursor-to-visible-date jan-first)
272 (calendar-other-month 1 (- year (1- arg)))))) 273 (calendar-other-month 1 (- year (1- arg)))
274 (calendar-cursor-to-visible-date (list 1 1 displayed-year)))))
273 (run-hooks 'calendar-move-hook)) 275 (run-hooks 'calendar-move-hook))
274 276
275(defun calendar-end-of-year (arg) 277(defun calendar-end-of-year (arg)
@@ -287,7 +289,7 @@ Moves forward if ARG is negative."
287 (if (and (= arg 1) 289 (if (and (= arg 1)
288 (calendar-date-is-visible-p dec-31)) 290 (calendar-date-is-visible-p dec-31))
289 (calendar-cursor-to-visible-date dec-31) 291 (calendar-cursor-to-visible-date dec-31)
290 (calendar-other-month 12 (- year (1- arg))) 292 (calendar-other-month 12 (+ year (1- arg)))
291 (calendar-cursor-to-visible-date (list 12 31 displayed-year))))) 293 (calendar-cursor-to-visible-date (list 12 31 displayed-year)))))
292 (run-hooks 'calendar-move-hook)) 294 (run-hooks 'calendar-move-hook))
293 295
diff --git a/lisp/calendar/cal-persia.el b/lisp/calendar/cal-persia.el
index ff09c14b47d..dcbbcbd637e 100644
--- a/lisp/calendar/cal-persia.el
+++ b/lisp/calendar/cal-persia.el
@@ -29,8 +29,8 @@
29;; diary.el that deal with the Persian calendar. 29;; diary.el that deal with the Persian calendar.
30 30
31;; Technical details of all the calendrical calculations can be found in 31;; Technical details of all the calendrical calculations can be found in
32;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold, 32;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
33;; Cambridge University Press (1997). 33;; and Nachum Dershowitz, Cambridge University Press (2001).
34 34
35;; Comments, corrections, and improvements should be sent to 35;; Comments, corrections, and improvements should be sent to
36;; Edward M. Reingold Department of Computer Science 36;; Edward M. Reingold Department of Computer Science
diff --git a/lisp/calendar/cal-x.el b/lisp/calendar/cal-x.el
index 97fbb72af61..03b485a438a 100644
--- a/lisp/calendar/cal-x.el
+++ b/lisp/calendar/cal-x.el
@@ -1,9 +1,10 @@
1;;; cal-x.el --- calendar windows in dedicated frames in X 1;;; cal-x.el --- calendar windows in dedicated frames in X
2 2
3;; Copyright (C) 1994, 1995 Free Software Foundation, Inc. 3;; Copyright (C) 1994, 1995, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Michael Kifer <kifer@cs.sunysb.edu> 5;; Author: Michael Kifer <kifer@cs.sunysb.edu>
6;; Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <gmorris@ast.cam.ac.uk>
7;; Keywords: calendar 8;; Keywords: calendar
8;; Human-Keywords: calendar, dedicated frames, X Window System 9;; Human-Keywords: calendar, dedicated frames, X Window System
9 10
@@ -88,7 +89,7 @@ This function requires a display capable of multiple frames, else
88 (frame-parameters calendar-frame)))) 89 (frame-parameters calendar-frame))))
89 (iconify-or-deiconify-frame)) 90 (iconify-or-deiconify-frame))
90 (calendar-basic-setup arg) 91 (calendar-basic-setup arg)
91 (set-window-dedicated-p (selected-window) 'calendar) 92 (set-window-dedicated-p (selected-window) t)
92 (set-window-dedicated-p 93 (set-window-dedicated-p
93 (display-buffer 94 (display-buffer
94 (if (not (memq 'fancy-diary-display diary-display-hook)) 95 (if (not (memq 'fancy-diary-display diary-display-hook))
@@ -96,7 +97,7 @@ This function requires a display capable of multiple frames, else
96 (if (not (bufferp (get-buffer fancy-diary-buffer))) 97 (if (not (bufferp (get-buffer fancy-diary-buffer)))
97 (make-fancy-diary-buffer)) 98 (make-fancy-diary-buffer))
98 fancy-diary-buffer)) 99 fancy-diary-buffer))
99 'diary)))))) 100 t))))))
100 101
101(defun calendar-only-one-frame-setup (&optional arg) 102(defun calendar-only-one-frame-setup (&optional arg)
102 "Start calendar and display it in a dedicated frame. 103 "Start calendar and display it in a dedicated frame.
@@ -117,7 +118,7 @@ This function requires a display capable of multiple frames, else
117 (frame-parameters calendar-frame)))) 118 (frame-parameters calendar-frame))))
118 (iconify-or-deiconify-frame)) 119 (iconify-or-deiconify-frame))
119 (calendar-basic-setup arg) 120 (calendar-basic-setup arg)
120 (set-window-dedicated-p (selected-window) 'calendar)))))) 121 (set-window-dedicated-p (selected-window) t))))))
121 122
122(defun calendar-two-frame-setup (&optional arg) 123(defun calendar-two-frame-setup (&optional arg)
123 "Start calendar and diary in separate, dedicated frames. 124 "Start calendar and diary in separate, dedicated frames.
@@ -139,7 +140,7 @@ This function requires a display capable of multiple frames, else
139 (frame-parameters calendar-frame)))) 140 (frame-parameters calendar-frame))))
140 (iconify-or-deiconify-frame)) 141 (iconify-or-deiconify-frame))
141 (display-buffer calendar-buffer) 142 (display-buffer calendar-buffer)
142 (set-window-dedicated-p (selected-window) 'calendar) 143 (set-window-dedicated-p (selected-window) t)
143 (setq diary-frame (make-frame diary-frame-parameters)) 144 (setq diary-frame (make-frame diary-frame-parameters))
144 (run-hooks 'calendar-after-frame-setup-hooks) 145 (run-hooks 'calendar-after-frame-setup-hooks)
145 (select-frame diary-frame) 146 (select-frame diary-frame)
@@ -154,7 +155,7 @@ This function requires a display capable of multiple frames, else
154 (if (not (bufferp (get-buffer fancy-diary-buffer))) 155 (if (not (bufferp (get-buffer fancy-diary-buffer)))
155 (make-fancy-diary-buffer)) 156 (make-fancy-diary-buffer))
156 fancy-diary-buffer)) 157 fancy-diary-buffer))
157 'diary))))) 158 t)))))
158 159
159;; Formerly (get-file-buffer diary-file) was added to the list here, 160;; Formerly (get-file-buffer diary-file) was added to the list here,
160;; but that isn't clean, and the value could even be nil. 161;; but that isn't clean, and the value could even be nil.
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index baa18d769c2..5fc23a15cc9 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -75,13 +75,13 @@
75;; solar.el Sunrise/sunset, equinoxes/solstices 75;; solar.el Sunrise/sunset, equinoxes/solstices
76 76
77;; Technical details of all the calendrical calculations can be found in 77;; Technical details of all the calendrical calculations can be found in
78;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold, 78;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
79;; Cambridge University Press (1997). 79;; and Nachum Dershowitz, Cambridge University Press (2001).
80 80
81;; An earlier version of the technical details appeared in 81;; An earlier version of the technical details appeared in
82;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold, 82;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold,
83;; Software--Practice and Experience, Volume 20, Number 9 (September, 1990), 83;; Software--Practice and Experience, Volume 20, Number 9 (September, 1990),
84;; pages 899-928. ``Calendrical Calculations, Part II: Three Historical 84;; pages 899-928, and in ``Calendrical Calculations, Part II: Three Historical
85;; Calendars'' by E. M. Reingold, N. Dershowitz, and S. M. Clamen, 85;; Calendars'' by E. M. Reingold, N. Dershowitz, and S. M. Clamen,
86;; Software--Practice and Experience, Volume 23, Number 4 (April, 1993), 86;; Software--Practice and Experience, Volume 23, Number 4 (April, 1993),
87;; pages 383-404. 87;; pages 383-404.
@@ -2763,7 +2763,7 @@ in `calendar-day-name-array'. These abbreviations may be used
2763instead of the full names in the diary file. Do not include a 2763instead of the full names in the diary file. Do not include a
2764trailing `.' in the strings specified in this variable, though 2764trailing `.' in the strings specified in this variable, though
2765you may use such in the diary file. If any element of this array 2765you may use such in the diary file. If any element of this array
2766is nil, then the abbreviation will be constructed as the first 2766is nil, then the abbreviation will be constructed as the first
2767`calendar-abbrev-length' characters of the corresponding full name.") 2767`calendar-abbrev-length' characters of the corresponding full name.")
2768 2768
2769(defvar calendar-month-name-array 2769(defvar calendar-month-name-array
@@ -2884,20 +2884,20 @@ interpreted as BC; -1 being 1 BC, and so on."
2884 (redraw-calendar)) 2884 (redraw-calendar))
2885 2885
2886(defun calendar-date-is-visible-p (date) 2886(defun calendar-date-is-visible-p (date)
2887 "Return t if DATE is legal and is visible in the calendar window." 2887 "Return t if DATE is valid and is visible in the calendar window."
2888 (let ((gap (calendar-interval 2888 (let ((gap (calendar-interval
2889 displayed-month displayed-year 2889 displayed-month displayed-year
2890 (extract-calendar-month date) (extract-calendar-year date)))) 2890 (extract-calendar-month date) (extract-calendar-year date))))
2891 (and (calendar-date-is-legal-p date) (> 2 gap) (< -2 gap)))) 2891 (and (calendar-date-is-legal-p date) (> 2 gap) (< -2 gap))))
2892 2892
2893(defun calendar-date-is-legal-p (date) 2893(defun calendar-date-is-legal-p (date)
2894 "Return t if DATE is a legal date." 2894 "Return t if DATE is a valid date."
2895 (let ((month (extract-calendar-month date)) 2895 (let ((month (extract-calendar-month date))
2896 (day (extract-calendar-day date)) 2896 (day (extract-calendar-day date))
2897 (year (extract-calendar-year date))) 2897 (year (extract-calendar-year date)))
2898 (and (<= 1 month) (<= month 12) 2898 (and (<= 1 month) (<= month 12)
2899 (<= 1 day) (<= day (calendar-last-day-of-month month year)) 2899 (<= 1 day) (<= day (calendar-last-day-of-month month year))
2900 ;; BC dates left as non-legal, to suppress errors from 2900 ;; BC dates left as non-valid, to suppress errors from
2901 ;; complex holiday algorithms not suitable for years BC. 2901 ;; complex holiday algorithms not suitable for years BC.
2902 ;; Note there are side effects on calendar navigation. 2902 ;; Note there are side effects on calendar navigation.
2903 (<= 1 year)))) 2903 (<= 1 year))))
diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el
index 4493bd02a9c..6596657d454 100644
--- a/lisp/calendar/holidays.el
+++ b/lisp/calendar/holidays.el
@@ -30,8 +30,8 @@
30;; in calendar.el. 30;; in calendar.el.
31 31
32;; Technical details of all the calendrical calculations can be found in 32;; Technical details of all the calendrical calculations can be found in
33;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold, 33;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
34;; Cambridge University Press (1997). 34;; and Nachum Dershowitz, Cambridge University Press (2001).
35 35
36;; An earlier version of the technical details appeared in 36;; An earlier version of the technical details appeared in
37;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold, 37;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold,
diff --git a/lisp/calendar/lunar.el b/lisp/calendar/lunar.el
index 7efed3ff275..057419969fc 100644
--- a/lisp/calendar/lunar.el
+++ b/lisp/calendar/lunar.el
@@ -38,8 +38,8 @@
38;; person rewrite the code for the lunar calculations in this file! 38;; person rewrite the code for the lunar calculations in this file!
39 39
40;; Technical details of all the calendrical calculations can be found in 40;; Technical details of all the calendrical calculations can be found in
41;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold, 41;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
42;; Cambridge University Press (1997). 42;; and Nachum Dershowitz, Cambridge University Press (2001).
43 43
44;; Comments, corrections, and improvements should be sent to 44;; Comments, corrections, and improvements should be sent to
45;; Edward M. Reingold Department of Computer Science 45;; Edward M. Reingold Department of Computer Science
diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el
index 8a514fa6415..57a6c6a40a8 100644
--- a/lisp/calendar/solar.el
+++ b/lisp/calendar/solar.el
@@ -48,8 +48,8 @@
48;; 1951--2050. For other years the times will be within +/- 1 minute. 48;; 1951--2050. For other years the times will be within +/- 1 minute.
49 49
50;; Technical details of all the calendrical calculations can be found in 50;; Technical details of all the calendrical calculations can be found in
51;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold, 51;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
52;; Cambridge University Press (1997). 52;; and Nachum Dershowitz, Cambridge University Press (2001).
53 53
54;; Comments, corrections, and improvements should be sent to 54;; Comments, corrections, and improvements should be sent to
55;; Edward M. Reingold Department of Computer Science 55;; Edward M. Reingold Department of Computer Science
diff --git a/lisp/comint.el b/lisp/comint.el
index ccd02db39cf..feb0bb83de3 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1,7 +1,7 @@
1;;; comint.el --- general command interpreter in a window stuff 1;;; comint.el --- general command interpreter in a window stuff
2 2
3;; Copyright (C) 1988, 1990, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3;; Copyright (C) 1988, 1990, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4;; 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. 4;; 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6;; Author: Olin Shivers <shivers@cs.cmu.edu> 6;; Author: Olin Shivers <shivers@cs.cmu.edu>
7;; Simon Marshall <simon@gnu.org> 7;; Simon Marshall <simon@gnu.org>
@@ -791,14 +791,16 @@ buffer. The hook `comint-exec-hook' is run after each exec."
791 ;; This doesn't use "e" because it is supposed to work 791 ;; This doesn't use "e" because it is supposed to work
792 ;; for events without parameters. 792 ;; for events without parameters.
793 (interactive (list last-input-event)) 793 (interactive (list last-input-event))
794 (if event (mouse-set-point event))
795 (let ((pos (point))) 794 (let ((pos (point)))
796 (if (not (eq (get-char-property pos 'field) 'input)) 795 (if event (mouse-set-point event))
796 (if (not (eq (get-char-property (point) 'field) 'input))
797 ;; No input at POS, fall back to the global definition. 797 ;; No input at POS, fall back to the global definition.
798 (let* ((keys (this-command-keys)) 798 (let* ((keys (this-command-keys))
799 (last-key (and (vectorp keys) (aref keys (1- (length keys))))) 799 (last-key (and (vectorp keys) (aref keys (1- (length keys)))))
800 (fun (and last-key (lookup-key global-map (vector last-key))))) 800 (fun (and last-key (lookup-key global-map (vector last-key)))))
801 (goto-char pos)
801 (and fun (call-interactively fun))) 802 (and fun (call-interactively fun)))
803 (setq pos (point))
802 ;; There's previous input at POS, insert it at the end of the buffer. 804 ;; There's previous input at POS, insert it at the end of the buffer.
803 (goto-char (point-max)) 805 (goto-char (point-max))
804 ;; First delete any old unsent input at the end 806 ;; First delete any old unsent input at the end
diff --git a/lisp/complete.el b/lisp/complete.el
index d3c5de459d5..60bddd01f17 100644
--- a/lisp/complete.el
+++ b/lisp/complete.el
@@ -1,6 +1,6 @@
1;;; complete.el --- partial completion mechanism plus other goodies 1;;; complete.el --- partial completion mechanism plus other goodies
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 1999, 2000, 2003 3;; Copyright (C) 1990, 1991, 1992, 1993, 1999, 2000, 2003, 2005
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Dave Gillespie <daveg@synaptics.com> 6;; Author: Dave Gillespie <daveg@synaptics.com>
@@ -118,7 +118,7 @@ Some arcane rules:
118If `]' is in this string, it must come first. 118If `]' is in this string, it must come first.
119If `^' is in this string, it must not come first. 119If `^' is in this string, it must not come first.
120If `-' is in this string, it must come first or right after `]'. 120If `-' is in this string, it must come first or right after `]'.
121In other words, if S is this string, then `[S]' must be a legal Emacs regular 121In other words, if S is this string, then `[S]' must be a valid Emacs regular
122expression (not containing character ranges like `a-z')." 122expression (not containing character ranges like `a-z')."
123 :type 'string 123 :type 'string
124 :group 'partial-completion) 124 :group 'partial-completion)
@@ -937,12 +937,11 @@ absolute rather than relative to some directory on the SEARCH-PATH."
937 ((not completion-table) nil) 937 ((not completion-table) nil)
938 ((eq action nil) (try-completion str2 completion-table nil)) 938 ((eq action nil) (try-completion str2 completion-table nil))
939 ((eq action t) (all-completions str2 completion-table nil)) 939 ((eq action t) (all-completions str2 completion-table nil))
940 ((eq action 'lambda) 940 ((eq action 'lambda) (test-completion str2 completion-table nil))))
941 (eq (try-completion str2 completion-table nil) t))))
942 (funcall PC-old-read-file-name-internal string dir action))) 941 (funcall PC-old-read-file-name-internal string dir action)))
943 942
944 943
945(provide 'complete) 944(provide 'complete)
946 945
947;;; arch-tag: fc7e2768-ff44-4e22-b579-4d825b968458 946;; arch-tag: fc7e2768-ff44-4e22-b579-4d825b968458
948;;; complete.el ends here 947;;; complete.el ends here
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 2e210d084ba..9a1449823ca 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -91,13 +91,14 @@ With prefix arg, prompt for argument SWITCHES which is options for `diff'."
91 nil)) 91 nil))
92 (diff-backup (dired-get-filename) switches)) 92 (diff-backup (dired-get-filename) switches))
93 93
94;;;###autoload
94(defun dired-compare-directories (dir2 predicate) 95(defun dired-compare-directories (dir2 predicate)
95 "Mark files with different file attributes in two dired buffers. 96 "Mark files with different file attributes in two dired buffers.
96Compare file attributes of files in the current directory 97Compare file attributes of files in the current directory
97with file attributes in directory DIR2 using PREDICATE on pairs of files 98with file attributes in directory DIR2 using PREDICATE on pairs of files
98with the same name. Mark files for which PREDICATE returns non-nil. 99with the same name. Mark files for which PREDICATE returns non-nil.
99Mark files with different names if PREDICATE is nil (or interactively 100Mark files with different names if PREDICATE is nil (or interactively
100when the user enters empty input at the predicate prompt). 101with empty input at the predicate prompt).
101 102
102PREDICATE is a Lisp expression that can refer to the following variables: 103PREDICATE is a Lisp expression that can refer to the following variables:
103 104
@@ -117,9 +118,10 @@ Examples of PREDICATE:
117 (not (and (= (nth 2 fa1) (nth 2 fa2)) - mark files with different UID 118 (not (and (= (nth 2 fa1) (nth 2 fa2)) - mark files with different UID
118 (= (nth 3 fa1) (nth 3 fa2)))) and GID." 119 (= (nth 3 fa1) (nth 3 fa2)))) and GID."
119 (interactive 120 (interactive
120 (list (read-file-name (format "Compare %s with: " 121 (list (read-directory-name (format "Compare %s with: "
121 (dired-current-directory)) 122 (dired-current-directory))
122 (dired-dwim-target-directory)) 123 (dired-dwim-target-directory)
124 (dired-dwim-target-directory))
123 (read-from-minibuffer "Mark if (lisp expr or RET): " nil nil t nil "nil"))) 125 (read-from-minibuffer "Mark if (lisp expr or RET): " nil nil t nil "nil")))
124 (let* ((dir1 (dired-current-directory)) 126 (let* ((dir1 (dired-current-directory))
125 (file-alist1 (dired-files-attributes dir1)) 127 (file-alist1 (dired-files-attributes dir1))
diff --git a/lisp/dired.el b/lisp/dired.el
index f9eb97f549e..8ee19486a7e 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1251,6 +1251,9 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
1251 (define-key map [menu-bar immediate dashes] 1251 (define-key map [menu-bar immediate dashes]
1252 '("--")) 1252 '("--"))
1253 1253
1254 (define-key map [menu-bar immediate compare-directories]
1255 '(menu-item "Compare directories..." dired-compare-directories
1256 :help "Mark files with different attributes in two dired buffers"))
1254 (define-key map [menu-bar immediate backup-diff] 1257 (define-key map [menu-bar immediate backup-diff]
1255 '(menu-item "Compare with Backup" dired-backup-diff 1258 '(menu-item "Compare with Backup" dired-backup-diff
1256 :help "Diff file at cursor with its latest backup")) 1259 :help "Diff file at cursor with its latest backup"))
diff --git a/lisp/ediff-hook.el b/lisp/ediff-hook.el
index 7ea6f24d7bb..5394923aa36 100644
--- a/lisp/ediff-hook.el
+++ b/lisp/ediff-hook.el
@@ -131,10 +131,10 @@
131 )) 131 ))
132 (defvar ediff-misc-menu 132 (defvar ediff-misc-menu
133 '("Ediff Miscellanea" 133 '("Ediff Miscellanea"
134 ["Ediff Manual..." ediff-documentation t] 134 ["Ediff Manual" ediff-documentation t]
135 ["Customize Ediff..." ediff-customize t] 135 ["Customize Ediff" ediff-customize t]
136 ["List Ediff Sessions..." ediff-show-registry t] 136 ["List Ediff Sessions" ediff-show-registry t]
137 ["Use separate frame for Ediff control buffer..." 137 ["Use separate frame for Ediff control buffer"
138 ediff-toggle-multiframe 138 ediff-toggle-multiframe
139 :style toggle 139 :style toggle
140 :selected (if (and (featurep 'ediff-util) 140 :selected (if (and (featurep 'ediff-util)
@@ -242,14 +242,14 @@
242 242
243 ;; define ediff miscellanea 243 ;; define ediff miscellanea
244 (define-key menu-bar-ediff-misc-menu [emultiframe] 244 (define-key menu-bar-ediff-misc-menu [emultiframe]
245 '("Toggle use of separate control buffer frame..." 245 '("Toggle use of separate control buffer frame"
246 . ediff-toggle-multiframe)) 246 . ediff-toggle-multiframe))
247 (define-key menu-bar-ediff-misc-menu [eregistry] 247 (define-key menu-bar-ediff-misc-menu [eregistry]
248 '("List Ediff Sessions..." . ediff-show-registry)) 248 '("List Ediff Sessions" . ediff-show-registry))
249 (define-key menu-bar-ediff-misc-menu [ediff-cust] 249 (define-key menu-bar-ediff-misc-menu [ediff-cust]
250 '("Customize Ediff..." . ediff-customize)) 250 '("Customize Ediff" . ediff-customize))
251 (define-key menu-bar-ediff-misc-menu [ediff-doc] 251 (define-key menu-bar-ediff-misc-menu [ediff-doc]
252 '("Ediff Manual..." . ediff-documentation)) 252 '("Ediff Manual" . ediff-documentation))
253 ) 253 )
254 254
255 ) ; emacs case 255 ) ; emacs case
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index cfaac96bbb1..171b68e457c 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -1,6 +1,6 @@
1;;; advice.el --- an overloading mechanism for Emacs Lisp functions 1;;; advice.el --- an overloading mechanism for Emacs Lisp functions
2 2
3;; Copyright (C) 1993,1994,2000,01,2004 Free Software Foundation, Inc. 3;; Copyright (C) 1993,1994,2000,01,2004,2005 Free Software Foundation, Inc.
4 4
5;; Author: Hans Chalupsky <hans@cs.buffalo.edu> 5;; Author: Hans Chalupsky <hans@cs.buffalo.edu>
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -2173,7 +2173,7 @@ Redefining advices affect the construction of an advised definition."
2173;; ============================================ 2173;; ============================================
2174;; The advice-info of an advised function contains its `origname' which is 2174;; The advice-info of an advised function contains its `origname' which is
2175;; a symbol that is fbound to the original definition available at the first 2175;; a symbol that is fbound to the original definition available at the first
2176;; proper activation of the function after a legal re/definition. If the 2176;; proper activation of the function after a valid re/definition. If the
2177;; original was defined via fcell indirection then `origname' will be defined 2177;; original was defined via fcell indirection then `origname' will be defined
2178;; just so. Hence, to get hold of the actual original definition of a function 2178;; just so. Hence, to get hold of the actual original definition of a function
2179;; we need to use `ad-real-orig-definition'. 2179;; we need to use `ad-real-orig-definition'.
@@ -2238,7 +2238,7 @@ which PREDICATE returns non-nil)."
2238 ad-advice-classes)) 2238 ad-advice-classes))
2239 2239
2240(defun ad-read-advice-class (function &optional prompt default) 2240(defun ad-read-advice-class (function &optional prompt default)
2241 "Read a legal advice class with completion from the minibuffer. 2241 "Read a valid advice class with completion from the minibuffer.
2242An optional PROMPT will be used to prompt for the class. DEFAULT will 2242An optional PROMPT will be used to prompt for the class. DEFAULT will
2243be returned on empty input (defaults to the first non-empty advice 2243be returned on empty input (defaults to the first non-empty advice
2244class of FUNCTION)." 2244class of FUNCTION)."
@@ -2312,7 +2312,7 @@ be used to prompt for the function."
2312(defun ad-find-some-advice (function class name) 2312(defun ad-find-some-advice (function class name)
2313 "Find the first of FUNCTION's advices in CLASS matching NAME. 2313 "Find the first of FUNCTION's advices in CLASS matching NAME.
2314NAME can be a symbol or a regular expression matching part of an advice name. 2314NAME can be a symbol or a regular expression matching part of an advice name.
2315If CLASS is `any' all legal advice classes will be checked." 2315If CLASS is `any' all valid advice classes will be checked."
2316 (if (ad-is-advised function) 2316 (if (ad-is-advised function)
2317 (let (found-advice) 2317 (let (found-advice)
2318 (ad-dolist (advice-class ad-advice-classes) 2318 (ad-dolist (advice-class ad-advice-classes)
@@ -2332,7 +2332,7 @@ If CLASS is `any' all legal advice classes will be checked."
2332 "Set enable FLAG of FUNCTION's advices in CLASS matching NAME. 2332 "Set enable FLAG of FUNCTION's advices in CLASS matching NAME.
2333If NAME is a string rather than a symbol then it's interpreted as a regular 2333If NAME is a string rather than a symbol then it's interpreted as a regular
2334expression and all advices whose name contain a match for it will be 2334expression and all advices whose name contain a match for it will be
2335affected. If CLASS is `any' advices in all legal advice classes will be 2335affected. If CLASS is `any' advices in all valid advice classes will be
2336considered. The number of changed advices will be returned (or nil if 2336considered. The number of changed advices will be returned (or nil if
2337FUNCTION was not advised)." 2337FUNCTION was not advised)."
2338 (if (ad-is-advised function) 2338 (if (ad-is-advised function)
@@ -2369,7 +2369,7 @@ FUNCTION was not advised)."
2369 2369
2370(defun ad-enable-regexp-internal (regexp class flag) 2370(defun ad-enable-regexp-internal (regexp class flag)
2371 "Set enable FLAGs of all CLASS advices whose name contains a REGEXP match. 2371 "Set enable FLAGs of all CLASS advices whose name contains a REGEXP match.
2372If CLASS is `any' all legal advice classes are considered. The number of 2372If CLASS is `any' all valid advice classes are considered. The number of
2373affected advices will be returned." 2373affected advices will be returned."
2374 (let ((matched-advices 0)) 2374 (let ((matched-advices 0))
2375 (ad-do-advised-functions (advised-function) 2375 (ad-do-advised-functions (advised-function)
@@ -3755,7 +3755,7 @@ deactivation, which might run hooks and get into other trouble."
3755 (error nil)))) 3755 (error nil))))
3756 3756
3757 3757
3758;; Completion alist of legal `defadvice' flags 3758;; Completion alist of valid `defadvice' flags
3759(defvar ad-defadvice-flags 3759(defvar ad-defadvice-flags
3760 '(("protect") ("disable") ("activate") 3760 '(("protect") ("disable") ("activate")
3761 ("compile") ("preactivate") ("freeze"))) 3761 ("compile") ("preactivate") ("freeze")))
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index cbab83184e1..305f0dd9587 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -1,6 +1,6 @@
1;;; cl-macs.el --- Common Lisp macros -*-byte-compile-dynamic: t;-*- 1;;; cl-macs.el --- Common Lisp macros -*-byte-compile-dynamic: t;-*-
2 2
3;; Copyright (C) 1993, 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1993, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Dave Gillespie <daveg@synaptics.com> 5;; Author: Dave Gillespie <daveg@synaptics.com>
6;; Version: 2.02 6;; Version: 2.02
@@ -2219,7 +2219,7 @@ copier, a `NAME-p' predicate, and setf-able `NAME-SLOT' accessors.
2219 (if type 2219 (if type
2220 (progn 2220 (progn
2221 (or (memq type '(vector list)) 2221 (or (memq type '(vector list))
2222 (error "Illegal :type specifier: %s" type)) 2222 (error "Invalid :type specifier: %s" type))
2223 (if named (setq tag name))) 2223 (if named (setq tag name)))
2224 (setq type 'vector named 'true))) 2224 (setq type 'vector named 'true)))
2225 (or named (setq descs (delq (assq 'cl-tag-slot descs) descs))) 2225 (or named (setq descs (delq (assq 'cl-tag-slot descs) descs)))
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index e97e9012fc1..2149cba8720 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -584,10 +584,9 @@ Applies to the frame whose line point is on in the backtrace."
584 (terpri)) 584 (terpri))
585 585
586 (with-current-buffer (get-buffer debugger-record-buffer) 586 (with-current-buffer (get-buffer debugger-record-buffer)
587 (save-excursion 587 (message "%s"
588 (forward-line -1) 588 (buffer-substring (line-beginning-position 0)
589 (message 589 (line-end-position 0)))))
590 (buffer-substring (point) (progn (end-of-line) (point)))))))
591 590
592(put 'debugger-mode 'mode-class 'special) 591(put 'debugger-mode 'mode-class 'special)
593 592
@@ -633,24 +632,31 @@ which must be written in Lisp, not predefined.
633Use \\[cancel-debug-on-entry] to cancel the effect of this command. 632Use \\[cancel-debug-on-entry] to cancel the effect of this command.
634Redefining FUNCTION also cancels it." 633Redefining FUNCTION also cancels it."
635 (interactive "aDebug on entry (to function): ") 634 (interactive "aDebug on entry (to function): ")
636 ;; Handle a function that has been aliased to some other function. 635 (when (and (subrp (symbol-function function))
637 (if (and (subrp (symbol-function function)) 636 (eq (cdr (subr-arity (symbol-function function))) 'unevalled))
638 (eq (cdr (subr-arity (symbol-function function))) 'unevalled)) 637 (error "Function %s is a special form" function))
639 (error "Function %s is a special form" function)) 638 (if (or (symbolp (symbol-function function))
640 (if (or (symbolp (symbol-function function))
641 (subrp (symbol-function function))) 639 (subrp (symbol-function function)))
642 ;; Create a wrapper in which we can then add the necessary debug call. 640 ;; The function is built-in or aliased to another function.
641 ;; Create a wrapper in which we can add the debug call.
643 (fset function `(lambda (&rest debug-on-entry-args) 642 (fset function `(lambda (&rest debug-on-entry-args)
644 ,(interactive-form (symbol-function function)) 643 ,(interactive-form (symbol-function function))
645 (apply ',(symbol-function function) 644 (apply ',(symbol-function function)
646 debug-on-entry-args)))) 645 debug-on-entry-args)))
647 (or (consp (symbol-function function)) 646 (when (eq (car-safe (symbol-function function)) 'autoload)
648 (debug-convert-byte-code function)) 647 ;; The function is autoloaded. Load its real definition.
649 (or (consp (symbol-function function)) 648 (load (cadr (symbol-function function)) nil noninteractive nil t))
650 (error "Definition of %s is not a list" function)) 649 (when (or (not (consp (symbol-function function)))
650 (and (eq (car (symbol-function function)) 'macro)
651 (not (consp (cdr (symbol-function function))))))
652 ;; The function is byte-compiled. Create a wrapper in which
653 ;; we can add the debug call.
654 (debug-convert-byte-code function)))
655 (unless (consp (symbol-function function))
656 (error "Definition of %s is not a list" function))
651 (fset function (debug-on-entry-1 function t)) 657 (fset function (debug-on-entry-1 function t))
652 (or (memq function debug-function-list) 658 (unless (memq function debug-function-list)
653 (push function debug-function-list)) 659 (push function debug-function-list))
654 function) 660 function)
655 661
656;;;###autoload 662;;;###autoload
@@ -665,45 +671,52 @@ If argument is nil or an empty string, cancel for all functions."
665 (if name (intern name))))) 671 (if name (intern name)))))
666 (if (and function (not (string= function ""))) 672 (if (and function (not (string= function "")))
667 (progn 673 (progn
668 (let ((f (debug-on-entry-1 function nil))) 674 (let ((defn (debug-on-entry-1 function nil)))
669 (condition-case nil 675 (condition-case nil
670 (if (and (equal (nth 1 f) '(&rest debug-on-entry-args)) 676 (when (and (equal (nth 1 defn) '(&rest debug-on-entry-args))
671 (eq (car (nth 3 f)) 'apply)) 677 (eq (car (nth 3 defn)) 'apply))
672 ;; `f' is a wrapper introduced in debug-on-entry. 678 ;; `defn' is a wrapper introduced in debug-on-entry.
673 ;; Get rid of it since we don't need it any more. 679 ;; Get rid of it since we don't need it any more.
674 (setq f (nth 1 (nth 1 (nth 3 f))))) 680 (setq defn (nth 1 (nth 1 (nth 3 defn)))))
675 (error nil)) 681 (error nil))
676 (fset function f)) 682 (fset function defn))
677 (setq debug-function-list (delq function debug-function-list)) 683 (setq debug-function-list (delq function debug-function-list))
678 function) 684 function)
679 (message "Cancelling debug-on-entry for all functions") 685 (message "Cancelling debug-on-entry for all functions")
680 (mapcar 'cancel-debug-on-entry debug-function-list))) 686 (mapcar 'cancel-debug-on-entry debug-function-list)))
681 687
682(defun debug-convert-byte-code (function) 688(defun debug-convert-byte-code (function)
683 (let ((defn (symbol-function function))) 689 (let* ((defn (symbol-function function))
684 (if (not (consp defn)) 690 (macro (eq (car-safe defn) 'macro)))
685 ;; Assume a compiled code object. 691 (when macro (setq defn (cdr defn)))
686 (let* ((contents (append defn nil)) 692 (unless (consp defn)
687 (body 693 ;; Assume a compiled code object.
688 (list (list 'byte-code (nth 1 contents) 694 (let* ((contents (append defn nil))
689 (nth 2 contents) (nth 3 contents))))) 695 (body
690 (if (nthcdr 5 contents) 696 (list (list 'byte-code (nth 1 contents)
691 (setq body (cons (list 'interactive (nth 5 contents)) body))) 697 (nth 2 contents) (nth 3 contents)))))
692 (if (nth 4 contents) 698 (if (nthcdr 5 contents)
693 ;; Use `documentation' here, to get the actual string, 699 (setq body (cons (list 'interactive (nth 5 contents)) body)))
694 ;; in case the compiled function has a reference 700 (if (nth 4 contents)
695 ;; to the .elc file. 701 ;; Use `documentation' here, to get the actual string,
696 (setq body (cons (documentation function) body))) 702 ;; in case the compiled function has a reference
697 (fset function (cons 'lambda (cons (car contents) body))))))) 703 ;; to the .elc file.
704 (setq body (cons (documentation function) body)))
705 (setq defn (cons 'lambda (cons (car contents) body))))
706 (when macro (setq defn (cons 'macro defn)))
707 (fset function defn))))
698 708
699(defun debug-on-entry-1 (function flag) 709(defun debug-on-entry-1 (function flag)
700 (let* ((defn (symbol-function function)) 710 (let* ((defn (symbol-function function))
701 (tail defn)) 711 (tail defn))
702 (if (subrp tail) 712 (when (eq (car-safe tail) 'macro)
703 (error "%s is a built-in function" function) 713 (setq tail (cdr tail)))
704 (if (eq (car tail) 'macro) (setq tail (cdr tail))) 714 (if (not (eq (car-safe tail) 'lambda))
705 (if (eq (car tail) 'lambda) (setq tail (cdr tail)) 715 ;; Only signal an error when we try to set debug-on-entry.
706 (error "%s not user-defined Lisp function" function)) 716 ;; When we try to clear debug-on-entry, we are now done.
717 (when flag
718 (error "%s is not a user-defined Lisp function" function))
719 (setq tail (cdr tail))
707 ;; Skip the docstring. 720 ;; Skip the docstring.
708 (when (and (stringp (cadr tail)) (cddr tail)) 721 (when (and (stringp (cadr tail)) (cddr tail))
709 (setq tail (cdr tail))) 722 (setq tail (cdr tail)))
@@ -714,8 +727,8 @@ If argument is nil or an empty string, cancel for all functions."
714 ;; Add/remove debug statement as needed. 727 ;; Add/remove debug statement as needed.
715 (if flag 728 (if flag
716 (setcdr tail (cons '(implement-debug-on-entry) (cdr tail))) 729 (setcdr tail (cons '(implement-debug-on-entry) (cdr tail)))
717 (setcdr tail (cddr tail)))) 730 (setcdr tail (cddr tail)))))
718 defn))) 731 defn))
719 732
720(defun debugger-list-functions () 733(defun debugger-list-functions ()
721 "Display a list of all the functions now set to debug on entry." 734 "Display a list of all the functions now set to debug on entry."
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 2e829080c9c..8f4245cb9a1 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -91,6 +91,7 @@
91 '("defun" "defun*" "defsubst" "defmacro" 91 '("defun" "defun*" "defsubst" "defmacro"
92 "defadvice" "define-skeleton" 92 "defadvice" "define-skeleton"
93 "define-minor-mode" "define-derived-mode" 93 "define-minor-mode" "define-derived-mode"
94 "define-generic-mode"
94 "define-compiler-macro" "define-modify-macro" 95 "define-compiler-macro" "define-modify-macro"
95 "defsetf" "define-setf-expander" 96 "defsetf" "define-setf-expander"
96 "define-method-combination" 97 "define-method-combination"
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index d4a10104eea..49196f17ef0 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -1,6 +1,6 @@
1;;; rx.el --- sexp notation for regular expressions 1;;; rx.el --- sexp notation for regular expressions
2 2
3;; Copyright (C) 2001, 03, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Gerd Moellmann <gerd@gnu.org> 5;; Author: Gerd Moellmann <gerd@gnu.org>
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -169,6 +169,8 @@
169 (eow . word-end) ; SRE 169 (eow . word-end) ; SRE
170 (word-boundary . "\\b") 170 (word-boundary . "\\b")
171 (not-word-boundary . "\\B") ; sregex 171 (not-word-boundary . "\\B") ; sregex
172 (symbol-start . "\\_<")
173 (symbol-end . "\\_>")
172 (syntax . (rx-syntax 1 1)) 174 (syntax . (rx-syntax 1 1))
173 (not-syntax . (rx-not-syntax 1 1)) ; sregex 175 (not-syntax . (rx-not-syntax 1 1)) ; sregex
174 (category . (rx-category 1 1 rx-check-category)) 176 (category . (rx-category 1 1 rx-check-category))
@@ -969,5 +971,5 @@ enclosed in `(and ...)'.
969 971
970(provide 'rx) 972(provide 'rx)
971 973
972;;; arch-tag: 12d01a63-0008-42bb-ab8c-1c7d63be370b 974;; arch-tag: 12d01a63-0008-42bb-ab8c-1c7d63be370b
973;;; rx.el ends here 975;;; rx.el ends here
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index d72dc91ad2b..7b2ba5c6fb2 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -1016,7 +1016,7 @@ If ARG is the atom `-', scroll upward by nearly full screen."
1016 (scroll-down arg) 1016 (scroll-down arg)
1017 (beginning-of-buffer (goto-char (point-min))))))) 1017 (beginning-of-buffer (goto-char (point-min)))))))
1018 1018
1019(put 'cua-scroll-up 'CUA 'move) 1019(put 'cua-scroll-down 'CUA 'move)
1020 1020
1021;;; Cursor indications 1021;;; Cursor indications
1022 1022
diff --git a/lisp/emulation/vi.el b/lisp/emulation/vi.el
index 4e17644e66a..70a52617431 100644
--- a/lisp/emulation/vi.el
+++ b/lisp/emulation/vi.el
@@ -1,7 +1,7 @@
1;;; vi.el --- major mode for emulating "vi" editor under GNU Emacs 1;;; vi.el --- major mode for emulating "vi" editor under GNU Emacs
2 2
3; This file is in the public domain because the authors distributed it 3;; This file is in the public domain because the authors distributed it
4; without a copyright notice before the US signed the Bern Convention. 4;; without a copyright notice before the US signed the Bern Convention.
5 5
6;; This file is part of GNU Emacs. 6;; This file is part of GNU Emacs.
7 7
@@ -11,32 +11,32 @@
11 11
12;;; Commentary: 12;;; Commentary:
13 13
14; Originally written by : seismo!wucs!nz@rsch.wisc.edu (Neal Ziring) 14;; Originally written by : seismo!wucs!nz@rsch.wisc.edu (Neal Ziring)
15; Extensively redesigned and rewritten by wu@crys.wisc.edu (Felix S.T. Wu) 15;; Extensively redesigned and rewritten by wu@crys.wisc.edu (Felix S.T. Wu)
16; Last revision: 01/07/87 Wed (for GNU Emacs 18.33) 16;; Last revision: 01/07/87 Wed (for GNU Emacs 18.33)
17 17
18; INSTALLATION PROCEDURE: 18;; INSTALLATION PROCEDURE:
19; 1) Add a global key binding for command "vi-mode" (I use ESC ESC instead of 19;; 1) Add a global key binding for command "vi-mode" (I use ESC ESC instead of
20; the single ESC used in real "vi", so I can access other ESC prefixed emacs 20;; the single ESC used in real "vi", so I can access other ESC prefixed emacs
21; commands while I'm in "vi"), say, by putting the following line in your 21;; commands while I'm in "vi"), say, by putting the following line in your
22; ".emacs" file: 22;; ".emacs" file:
23; (define-key global-map "\e\e" 'vi-mode) ;quick switch into vi-mode 23;; (define-key global-map "\e\e" 'vi-mode) ;quick switch into vi-mode
24; 2) If you wish you can define "find-file-hooks" to enter "vi" automatically 24;; 2) If you wish you can define "find-file-hook" to enter "vi" automatically
25; after a file is loaded into the buffer. For example, I defined it as: 25;; after a file is loaded into the buffer. For example, I defined it as:
26; (setq find-file-hooks (list 26;; (setq find-file-hook (list
27; (function (lambda () 27;; (function (lambda ()
28; (if (not (or (eq major-mode 'Info-mode) 28;; (if (not (or (eq major-mode 'Info-mode)
29; (eq major-mode 'vi-mode))) 29;; (eq major-mode 'vi-mode)))
30; (vi-mode)))))) 30;; (vi-mode))))))
31; 3) In your .emacs file you can define the command "vi-mode" to be "autoload" 31;; 3) In your .emacs file you can define the command "vi-mode" to be "autoload"
32; or you can execute the "load" command to load "vi" directly. 32;; or you can execute the "load" command to load "vi" directly.
33; 4) Read the comments for command "vi-mode" before you start using it. 33;; 4) Read the comments for command "vi-mode" before you start using it.
34; 34
35; COULD DO 35;; COULD DO
36; 1). A general 'define-operator' function to replace current hack 36;; 1). A general 'define-operator' function to replace current hack
37; 2). In operator handling, should allow other point moving Emacs commands 37;; 2). In operator handling, should allow other point moving Emacs commands
38; (such as ESC <, ESC >) to be used as arguments. 38;; (such as ESC <, ESC >) to be used as arguments.
39; 39
40;;; Code: 40;;; Code:
41 41
42(defvar vi-mode-old-major-mode) 42(defvar vi-mode-old-major-mode)
@@ -1487,5 +1487,5 @@ With ARG, inserts that many newlines."
1487 1487
1488(provide 'vi) 1488(provide 'vi)
1489 1489
1490;;; arch-tag: ac9bdac3-8acb-4ddd-bdae-c6dd873153b3 1490;; arch-tag: ac9bdac3-8acb-4ddd-bdae-c6dd873153b3
1491;;; vi.el ends here 1491;;; vi.el ends here
diff --git a/lisp/emulation/vip.el b/lisp/emulation/vip.el
index cbb0aa55aa8..af878085ba8 100644
--- a/lisp/emulation/vip.el
+++ b/lisp/emulation/vip.el
@@ -1,6 +1,6 @@
1;;; vip.el --- a VI Package for GNU Emacs 1;;; vip.el --- a VI Package for GNU Emacs
2 2
3;; Copyright (C) 1986, 1987, 1988, 1992, 1993, 1998 3;; Copyright (C) 1986, 1987, 1988, 1992, 1993, 1998, 2005
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Masahiko Sato <ms@sail.stanford.edu> 6;; Author: Masahiko Sato <ms@sail.stanford.edu>
@@ -2253,7 +2253,7 @@ a token has type \(command, address, end-mark\) and value."
2253 (setq ex-token-type "end-mark") 2253 (setq ex-token-type "end-mark")
2254 (setq ex-token "goto")) 2254 (setq ex-token "goto"))
2255 (t 2255 (t
2256 (error "illegal token"))))) 2256 (error "invalid token")))))
2257 2257
2258(defun vip-ex (&optional string) 2258(defun vip-ex (&optional string)
2259 "ex commands within VIP." 2259 "ex commands within VIP."
@@ -2478,7 +2478,7 @@ a token has type \(command, address, end-mark\) and value."
2478 (setq ex-flag t) 2478 (setq ex-flag t)
2479 (forward-char 1))) 2479 (forward-char 1)))
2480 (if (not (looking-at "[\n|]")) 2480 (if (not (looking-at "[\n|]"))
2481 (error "Illegal extra characters")))) 2481 (error "Invalid extra characters"))))
2482 2482
2483(defun vip-get-ex-count () 2483(defun vip-get-ex-count ()
2484 (setq ex-variant nil 2484 (setq ex-variant nil
@@ -2503,7 +2503,7 @@ a token has type \(command, address, end-mark\) and value."
2503 (setq ex-flag t) 2503 (setq ex-flag t)
2504 (forward-char 1))) 2504 (forward-char 1)))
2505 (if (not (looking-at "[\n|]")) 2505 (if (not (looking-at "[\n|]"))
2506 (error "Illegal extra characters")))) 2506 (error "Invalid extra characters"))))
2507 2507
2508(defun vip-get-ex-file () 2508(defun vip-get-ex-file ()
2509 "get a file name and set ex-variant, ex-append and ex-offset if found" 2509 "get a file name and set ex-variant, ex-append and ex-offset if found"
diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el
index d832fa9cd03..6944770dbc9 100644
--- a/lisp/eshell/esh-io.el
+++ b/lisp/eshell/esh-io.el
@@ -1,6 +1,6 @@
1;;; esh-io.el --- I/O management 1;;; esh-io.el --- I/O management
2 2
3;; Copyright (C) 1999, 2000 Free Software Foundation 3;; Copyright (C) 1999, 2000, 2005 Free Software Foundation
4 4
5;; Author: John Wiegley <johnw@gnu.org> 5;; Author: John Wiegley <johnw@gnu.org>
6 6
@@ -377,7 +377,7 @@ it defaults to `insert'."
377 target) 377 target)
378 378
379 (t 379 (t
380 (error "Illegal redirection target: %s" 380 (error "Invalid redirection target: %s"
381 (eshell-stringify target))))) 381 (eshell-stringify target)))))
382 382
383(eval-when-compile 383(eval-when-compile
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index fabcf367088..9ff9c1898a2 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -1,6 +1,6 @@
1;;; esh-var.el --- handling of variables 1;;; esh-var.el --- handling of variables
2 2
3;; Copyright (C) 1999, 2000 Free Software Foundation 3;; Copyright (C) 1999, 2000, 2005 Free Software Foundation
4 4
5;; Author: John Wiegley <johnw@gnu.org> 5;; Author: John Wiegley <johnw@gnu.org>
6 6
@@ -568,7 +568,7 @@ For example, to retrieve the second element of a user's record in
568 (split-string value separator))))) 568 (split-string value separator)))))
569 (cond 569 (cond
570 ((< (length refs) 0) 570 ((< (length refs) 0)
571 (error "Illegal array variable index: %s" 571 (error "Invalid array variable index: %s"
572 (eshell-stringify refs))) 572 (eshell-stringify refs)))
573 ((= (length refs) 1) 573 ((= (length refs) 1)
574 (setq value (eshell-index-value value (car refs)))) 574 (setq value (eshell-index-value value (car refs))))
diff --git a/lisp/files.el b/lisp/files.el
index 1921c959bf9..15d6f794e16 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -928,20 +928,31 @@ documentation for additional customization information."
928(defvar find-file-default nil 928(defvar find-file-default nil
929 "Used within `find-file-read-args'.") 929 "Used within `find-file-read-args'.")
930 930
931(defmacro minibuffer-with-setup-hook (fun &rest body)
932 "Add FUN to `minibuffer-setup-hook' while executing BODY.
933BODY should use the minibuffer at most once.
934Recursive uses of the minibuffer will not be affected."
935 (declare (indent 1) (debug t))
936 (let ((hook (make-symbol "setup-hook")))
937 `(let ((,hook
938 (lambda ()
939 ;; Clear out this hook so it does not interfere
940 ;; with any recursive minibuffer usage.
941 (remove-hook 'minibuffer-setup-hook ,hook)
942 (,fun))))
943 (unwind-protect
944 (progn
945 (add-hook 'minibuffer-setup-hook ,hook)
946 ,@body)
947 (remove-hook 'minibuffer-setup-hook ,hook)))))
948
931(defun find-file-read-args (prompt mustmatch) 949(defun find-file-read-args (prompt mustmatch)
932 (list (let ((find-file-default 950 (list (let ((find-file-default
933 (and buffer-file-name 951 (and buffer-file-name
934 (abbreviate-file-name buffer-file-name))) 952 (abbreviate-file-name buffer-file-name))))
935 (munge-default-fun 953 (minibuffer-with-setup-hook
936 (lambda () 954 (lambda () (setq minibuffer-default find-file-default))
937 (setq minibuffer-default find-file-default) 955 (read-file-name prompt nil default-directory mustmatch)))
938 ;; Clear out this hook so it does not interfere
939 ;; with any recursive minibuffer usage.
940 (pop minibuffer-setup-hook)))
941 (minibuffer-setup-hook
942 minibuffer-setup-hook))
943 (add-hook 'minibuffer-setup-hook munge-default-fun)
944 (read-file-name prompt nil default-directory mustmatch))
945 t)) 956 t))
946 957
947(defun find-file (filename &optional wildcards) 958(defun find-file (filename &optional wildcards)
@@ -1777,8 +1788,8 @@ in that case, this function acts as if `enable-local-variables' were t."
1777 ("\\.tar\\'" . tar-mode) 1788 ("\\.tar\\'" . tar-mode)
1778 ;; The list of archive file extensions should be in sync with 1789 ;; The list of archive file extensions should be in sync with
1779 ;; `auto-coding-alist' with `no-conversion' coding system. 1790 ;; `auto-coding-alist' with `no-conversion' coding system.
1780 ("\\.\\(arc\\|zip\\|lzh\\|zoo\\|[jew]ar\\)\\'" . archive-mode) 1791 ("\\.\\(arc\\|zip\\|lzh\\|zoo\\|[jew]ar\\|xpi\\)\\'" . archive-mode)
1781 ("\\.\\(ARC\\|ZIP\\|LZH\\|ZOO\\|[JEW]AR\\)\\'" . archive-mode) 1792 ("\\.\\(ARC\\|ZIP\\|LZH\\|ZOO\\|[JEW]AR\\|XPI\\)\\'" . archive-mode)
1782 ("\\.sx[dmicw]\\'" . archive-mode) ; OpenOffice.org 1793 ("\\.sx[dmicw]\\'" . archive-mode) ; OpenOffice.org
1783 ;; Mailer puts message to be edited in 1794 ;; Mailer puts message to be edited in
1784 ;; /tmp/Re.... or Message 1795 ;; /tmp/Re.... or Message
@@ -3422,7 +3433,7 @@ This requires the external program `diff' to be in your `exec-path'."
3422 "Save some modified file-visiting buffers. Asks user about each one. 3433 "Save some modified file-visiting buffers. Asks user about each one.
3423You can answer `y' to save, `n' not to save, `C-r' to look at the 3434You can answer `y' to save, `n' not to save, `C-r' to look at the
3424buffer in question with `view-buffer' before deciding or `d' to 3435buffer in question with `view-buffer' before deciding or `d' to
3425view the differences using `diff-buffer-to-file'. 3436view the differences using `diff-buffer-with-file'.
3426 3437
3427Optional argument (the prefix) non-nil means save all with no questions. 3438Optional argument (the prefix) non-nil means save all with no questions.
3428Optional second argument PRED determines which buffers are considered: 3439Optional second argument PRED determines which buffers are considered:
diff --git a/lisp/filesets.el b/lisp/filesets.el
index dee662ee87d..13ddfa5a84d 100644
--- a/lisp/filesets.el
+++ b/lisp/filesets.el
@@ -1,6 +1,6 @@
1;;; filesets.el --- handle group of files 1;;; filesets.el --- handle group of files
2 2
3;; Copyright (C) 2002 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Thomas Link <t.link@gmx.at> 5;; Author: Thomas Link <t.link@gmx.at>
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -304,31 +304,26 @@ key is supported."
304 :type 'sexp 304 :type 'sexp
305 :group 'filesets) 305 :group 'filesets)
306 306
307(if filesets-running-xemacs 307(defcustom filesets-menu-path nil
308 (progn 308 "*The menu under which the filesets menu should be inserted.
309 (defcustom filesets-menu-path nil 309See `add-submenu' for documentation."
310 "*The menu under which the filesets menu should be inserted. 310 :set (function filesets-set-default)
311XEmacs specific; see `add-submenu' for documentation." 311 :type 'sexp
312 :set (function filesets-set-default) 312 :group 'filesets)
313 :type 'sexp 313
314 :group 'filesets) 314(defcustom filesets-menu-before "File"
315 315 "*The name of a menu before which this menu should be added.
316 (defcustom filesets-menu-before "File" 316See `add-submenu' for documentation."
317 "*The name of a menu before which this menu should be added. 317 :set (function filesets-set-default)
318XEmacs specific; see `add-submenu' for documentation." 318 :type 'sexp
319 :set (function filesets-set-default) 319 :group 'filesets)
320 :type 'sexp 320
321 :group 'filesets) 321(defcustom filesets-menu-in-menu nil
322 322 "*Use that instead of `current-menubar' as the menu to change.
323 (defcustom filesets-menu-in-menu nil 323See `add-submenu' for documentation."
324 "*Use that instead of `current-menubar' as the menu to change. 324 :set (function filesets-set-default)
325XEmacs specific; see `add-submenu' for documentation." 325 :type 'sexp
326 :set (function filesets-set-default) 326 :group 'filesets)
327 :type 'sexp
328 :group 'filesets))
329 (defvar filesets-menu-path nil)
330 (defvar filesets-menu-before nil)
331 (defvar filesets-menu-in-menu nil))
332 327
333(defcustom filesets-menu-shortcuts-flag t 328(defcustom filesets-menu-shortcuts-flag t
334 "*Non-nil means to prepend menus with hopefully unique shortcuts." 329 "*Non-nil means to prepend menus with hopefully unique shortcuts."
@@ -351,7 +346,7 @@ XEmacs specific; see `add-submenu' for documentation."
351(defcustom filesets-menu-cache-file 346(defcustom filesets-menu-cache-file
352 (if filesets-running-xemacs 347 (if filesets-running-xemacs
353 "~/.xemacs/filesets-cache.el" 348 "~/.xemacs/filesets-cache.el"
354 "~/.filesets-cache.el") 349 "~/.emacs.d/filesets-cache.el")
355 "*File to be used for saving the filesets menu between sessions. 350 "*File to be used for saving the filesets menu between sessions.
356Set this to \"\", to disable caching of menus. 351Set this to \"\", to disable caching of menus.
357Don't forget to check out `filesets-menu-ensure-use-cached'." 352Don't forget to check out `filesets-menu-ensure-use-cached'."
@@ -1070,9 +1065,7 @@ defined in `filesets-ingroup-patterns'."
1070;;; Emacs compatibility 1065;;; Emacs compatibility
1071(eval-and-compile 1066(eval-and-compile
1072 (if filesets-running-xemacs 1067 (if filesets-running-xemacs
1073 (progn 1068 (fset 'filesets-error 'error)
1074 (fset 'filesets-error 'error)
1075 (fset 'filesets-add-submenu 'add-submenu))
1076 1069
1077 (require 'easymenu) 1070 (require 'easymenu)
1078 1071
@@ -1080,12 +1073,6 @@ defined in `filesets-ingroup-patterns'."
1080 "`error' wrapper." 1073 "`error' wrapper."
1081 (error (mapconcat 'identity args " "))) 1074 (error (mapconcat 'identity args " ")))
1082 1075
1083 ;; This should work for 21.1 Emacs
1084 (defun filesets-add-submenu (menu-path submenu &optional
1085 before in-menu)
1086 "`easy-menu-define' wrapper."
1087 (easy-menu-define
1088 filesets-submenu global-map "Filesets menu" submenu))
1089 )) 1076 ))
1090 1077
1091(defun filesets-filter-dir-names (lst &optional negative) 1078(defun filesets-filter-dir-names (lst &optional negative)
@@ -2339,7 +2326,7 @@ bottom up, set `filesets-submenus' to nil, first.)"
2339 (filesets-menu-cache-file-save-maybe))) 2326 (filesets-menu-cache-file-save-maybe)))
2340 (let ((cb (current-buffer))) 2327 (let ((cb (current-buffer)))
2341 (when (not (member cb filesets-updated-buffers)) 2328 (when (not (member cb filesets-updated-buffers))
2342 (filesets-add-submenu 2329 (add-submenu
2343 filesets-menu-path 2330 filesets-menu-path
2344 `(,filesets-menu-name 2331 `(,filesets-menu-name
2345 ("# Filesets" 2332 ("# Filesets"
@@ -2496,6 +2483,7 @@ We apologize for the inconvenience."))
2496(defun filesets-exit () 2483(defun filesets-exit ()
2497 (filesets-menu-cache-file-save-maybe)) 2484 (filesets-menu-cache-file-save-maybe))
2498 2485
2486;;;###autoload
2499(defun filesets-init () 2487(defun filesets-init ()
2500 "Filesets initialization. 2488 "Filesets initialization.
2501Set up hooks, load the cache file -- if existing -- and build the menu." 2489Set up hooks, load the cache file -- if existing -- and build the menu."
diff --git a/lisp/follow.el b/lisp/follow.el
index 06857fc49e9..a01b0e77eb2 100644
--- a/lisp/follow.el
+++ b/lisp/follow.el
@@ -1,6 +1,7 @@
1;;; follow.el --- synchronize windows showing the same buffer 1;;; follow.el --- synchronize windows showing the same buffer
2 2
3;; Copyright (C) 1995, 1996, 1997, 1999, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 1996, 1997, 1999, 2001, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Anders Lindgren <andersl@andersl.com> 6;; Author: Anders Lindgren <andersl@andersl.com>
6;; Maintainer: Anders Lindgren <andersl@andersl.com> 7;; Maintainer: Anders Lindgren <andersl@andersl.com>
@@ -708,7 +709,7 @@ Keys specific to Follow mode:
708;; This will start follow-mode whenever a new file is loaded, if 709;; This will start follow-mode whenever a new file is loaded, if
709;; the variable `follow-auto' is non-nil. 710;; the variable `follow-auto' is non-nil.
710 711
711(add-hook 'find-file-hooks 'follow-find-file-hook t) 712(add-hook 'find-file-hook 'follow-find-file-hook t)
712 713
713(defun follow-find-file-hook () 714(defun follow-find-file-hook ()
714 "Find-file hook for Follow Mode. See the variable `follow-auto'." 715 "Find-file hook for Follow Mode. See the variable `follow-auto'."
@@ -2347,5 +2348,5 @@ This prevents `mouse-drag-region' from messing things up."
2347;; | save it". -- Douglas Adams, "Last Chance to See" | 2348;; | save it". -- Douglas Adams, "Last Chance to See" |
2348;; \------------------------------------------------------------------------/ 2349;; \------------------------------------------------------------------------/
2349 2350
2350;;; arch-tag: 7b16bb1a-808c-4991-a8cc-66d3822936d0 2351;; arch-tag: 7b16bb1a-808c-4991-a8cc-66d3822936d0
2351;;; follow.el ends here 2352;;; follow.el ends here
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index b688b5d61df..e030acbc6ed 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1097,7 +1097,7 @@ delimit the region to fontify."
1097 ((error quit) (message "Fontifying block...%s" error-data))))))) 1097 ((error quit) (message "Fontifying block...%s" error-data)))))))
1098 1098
1099(if (boundp 'facemenu-keymap) 1099(if (boundp 'facemenu-keymap)
1100 (define-key facemenu-keymap "\M-g" 'font-lock-fontify-block)) 1100 (define-key facemenu-keymap "\M-o" 'font-lock-fontify-block))
1101 1101
1102;;; End of Fontification functions. 1102;;; End of Fontification functions.
1103 1103
diff --git a/lisp/generic-x.el b/lisp/generic-x.el
index 7b038fd89ab..d39edbb7ef6 100644
--- a/lisp/generic-x.el
+++ b/lisp/generic-x.el
@@ -324,7 +324,7 @@ generic-x to enable the specified modes."
324 (generic-make-keywords-list 324 (generic-make-keywords-list
325 '("for" 325 '("for"
326 "if") 326 "if")
327 'font-lock-keyword-face "^[@ \t]*") 327 font-lock-keyword-face "^[@ \t]*")
328 ;; These keywords can be anywhere on a line 328 ;; These keywords can be anywhere on a line
329 ;; In `generic-bat-mode-setup-function' we make the keywords 329 ;; In `generic-bat-mode-setup-function' we make the keywords
330 ;; case-insensitive 330 ;; case-insensitive
@@ -334,7 +334,7 @@ generic-x to enable the specified modes."
334 "errorlevel" 334 "errorlevel"
335 "goto" 335 "goto"
336 "not") 336 "not")
337 'font-lock-keyword-face) 337 font-lock-keyword-face)
338 ;; These are built-in commands. Only frequently-used ones are listed. 338 ;; These are built-in commands. Only frequently-used ones are listed.
339 (generic-make-keywords-list 339 (generic-make-keywords-list
340 '("CALL" "call" "Call" 340 '("CALL" "call" "Call"
@@ -352,7 +352,7 @@ generic-x to enable the specified modes."
352 "SET" "set" "Set" 352 "SET" "set" "Set"
353 "START" "start" "Start" 353 "START" "start" "Start"
354 "SHIFT" "shift" "Shift") 354 "SHIFT" "shift" "Shift")
355 'font-lock-builtin-face "[ \t|\n]") 355 font-lock-builtin-face "[ \t|\n]")
356 '("^[ \t]*\\(:\\sw+\\)" 1 font-lock-function-name-face t) 356 '("^[ \t]*\\(:\\sw+\\)" 1 font-lock-function-name-face t)
357 '("\\(%\\sw+%\\)" 1 font-lock-variable-name-face t) 357 '("\\(%\\sw+%\\)" 1 font-lock-variable-name-face t)
358 '("\\(%[0-9]\\)" 1 font-lock-variable-name-face t) 358 '("\\(%[0-9]\\)" 1 font-lock-variable-name-face t)
@@ -410,11 +410,11 @@ generic-x to enable the specified modes."
410;; Make underscores count as words 410;; Make underscores count as words
411(unless bat-generic-mode-syntax-table 411(unless bat-generic-mode-syntax-table
412 (setq bat-generic-mode-syntax-table (make-syntax-table)) 412 (setq bat-generic-mode-syntax-table (make-syntax-table))
413 (modify-syntax-entry ?_ "w" bat-generic-mode-syntax-table)) 413 (modify-syntax-entry ?_ "w" bat-generic-mode-syntax-table))
414 414
415;; bat-generic-mode doesn't use the comment functionality of generic-mode 415;; bat-generic-mode doesn't use the comment functionality of
416;; because it has a three-letter comment-string, so we do it 416;; define-generic-mode because it has a three-letter comment-string,
417;; here manually instead 417;; so we do it here manually instead
418(defun generic-bat-mode-setup-function () 418(defun generic-bat-mode-setup-function ()
419 (make-local-variable 'parse-sexp-ignore-comments) 419 (make-local-variable 'parse-sexp-ignore-comments)
420 (make-local-variable 'comment-start) 420 (make-local-variable 'comment-start)
@@ -427,7 +427,7 @@ generic-x to enable the specified modes."
427 comment-start-skip "[Rr][Ee][Mm] *") 427 comment-start-skip "[Rr][Ee][Mm] *")
428 (set-syntax-table bat-generic-mode-syntax-table) 428 (set-syntax-table bat-generic-mode-syntax-table)
429 ;; Make keywords case-insensitive 429 ;; Make keywords case-insensitive
430 (setq font-lock-defaults '(generic-font-lock-defaults nil t)) 430 (setq font-lock-defaults '(generic-font-lock-keywords nil t))
431 (use-local-map bat-generic-mode-keymap))) 431 (use-local-map bat-generic-mode-keymap)))
432 432
433;;; Mailagent 433;;; Mailagent
@@ -441,13 +441,12 @@ generic-x to enable the specified modes."
441 '(("^\\(\\sw+\\)\\s-*=" 1 font-lock-variable-name-face) 441 '(("^\\(\\sw+\\)\\s-*=" 1 font-lock-variable-name-face)
442 ("\\s-/\\([^/]+\\)/[i, \t\n]" 1 font-lock-constant-face)) 442 ("\\s-/\\([^/]+\\)/[i, \t\n]" 1 font-lock-constant-face))
443 '("\\.rules\\'") 443 '("\\.rules\\'")
444 '(mailagent-rules-setup-function) 444 (list
445 "Mode for Mailagent rules files.") 445 (function
446 446 (lambda ()
447(defun mailagent-rules-setup-function () 447 (setq imenu-generic-expression
448 (make-local-variable 'imenu-generic-expression) 448 '((nil "\\s-/\\([^/]+\\)/[i, \t\n]" 1))))))
449 (setq imenu-generic-expression 449 "Mode for Mailagent rules files."))
450 '((nil "\\s-/\\([^/]+\\)/[i, \t\n]" 1)))))
451 450
452;; Solaris/Sys V prototype files 451;; Solaris/Sys V prototype files
453(when (memq 'prototype-generic-mode generic-extras-enable-list) 452(when (memq 'prototype-generic-mode generic-extras-enable-list)
@@ -752,13 +751,13 @@ generic-x to enable the specified modes."
752 "FILETYPE" 751 "FILETYPE"
753 "FILEVERSION" 752 "FILEVERSION"
754 "PRODUCTVERSION") 753 "PRODUCTVERSION")
755 'font-lock-type-face) 754 font-lock-type-face)
756 (generic-make-keywords-list 755 (generic-make-keywords-list
757 '("BEGIN" 756 '("BEGIN"
758 "BLOCK" 757 "BLOCK"
759 "END" 758 "END"
760 "VALUE") 759 "VALUE")
761 'font-lock-function-name-face) 760 font-lock-function-name-face)
762 '("^#[ \t]*include[ \t]+\\(<[^>\"\n]+>\\)" 1 font-lock-string-face) 761 '("^#[ \t]*include[ \t]+\\(<[^>\"\n]+>\\)" 1 font-lock-string-face)
763 '("^#[ \t]*define[ \t]+\\(\\sw+\\)(" 1 font-lock-function-name-face) 762 '("^#[ \t]*define[ \t]+\\(\\sw+\\)(" 1 font-lock-function-name-face)
764 '("^#[ \t]*\\(elif\\|if\\)\\>" 763 '("^#[ \t]*\\(elif\\|if\\)\\>"
@@ -1375,19 +1374,19 @@ generic-x to enable the specified modes."
1375 ;; system variables 1374 ;; system variables
1376 (generic-make-keywords-list 1375 (generic-make-keywords-list
1377 installshield-system-variables-list 1376 installshield-system-variables-list
1378 'font-lock-variable-name-face "[^_]" "[^_]") 1377 font-lock-variable-name-face "[^_]" "[^_]")
1379 ;; system functions 1378 ;; system functions
1380 (generic-make-keywords-list 1379 (generic-make-keywords-list
1381 installshield-system-functions-list 1380 installshield-system-functions-list
1382 'font-lock-function-name-face "[^_]" "[^_]") 1381 font-lock-function-name-face "[^_]" "[^_]")
1383 ;; type keywords 1382 ;; type keywords
1384 (generic-make-keywords-list 1383 (generic-make-keywords-list
1385 installshield-types-list 1384 installshield-types-list
1386 'font-lock-type-face "[^_]" "[^_]") 1385 font-lock-type-face "[^_]" "[^_]")
1387 ;; function argument constants 1386 ;; function argument constants
1388 (generic-make-keywords-list 1387 (generic-make-keywords-list
1389 installshield-funarg-constants-list 1388 installshield-funarg-constants-list
1390 'font-lock-variable-name-face "[^_]" "[^_]"))) ; is this face the best choice? 1389 font-lock-variable-name-face "[^_]" "[^_]"))) ; is this face the best choice?
1391 '("\\.[rR][uU][lL]$") 1390 '("\\.[rR][uU][lL]$")
1392 '(generic-rul-mode-setup-function) 1391 '(generic-rul-mode-setup-function)
1393 "Generic mode for InstallShield RUL files.") 1392 "Generic mode for InstallShield RUL files.")
@@ -1429,9 +1428,11 @@ generic-x to enable the specified modes."
1429 "source" 1428 "source"
1430 "unset") 1429 "unset")
1431 '(("^\\s-*\\(alias\\|group\\)\\s-+\\([-A-Za-z0-9_]+\\)\\s-+\\([^\n\r#]*\\)\\(#.*\\)?$" 1430 '(("^\\s-*\\(alias\\|group\\)\\s-+\\([-A-Za-z0-9_]+\\)\\s-+\\([^\n\r#]*\\)\\(#.*\\)?$"
1432 (2 font-lock-constant-face) (3 font-lock-variable-name-face)) 1431 (2 font-lock-constant-face)
1432 (3 font-lock-variable-name-face))
1433 ("^\\s-*\\(unset\\|set\\|ignore\\)\\s-+\\([-A-Za-z0-9_]+\\)=?\\([^\n\r#]*\\)\\(#.*\\)?$" 1433 ("^\\s-*\\(unset\\|set\\|ignore\\)\\s-+\\([-A-Za-z0-9_]+\\)=?\\([^\n\r#]*\\)\\(#.*\\)?$"
1434 (2 font-lock-constant-face) (3 font-lock-variable-name-face)) 1434 (2 font-lock-constant-face)
1435 (3 font-lock-variable-name-face))
1435 ("^\\s-*\\(source\\)\\s-+\\([^\n\r#]*\\)\\(#.*\\)?$" 1436 ("^\\s-*\\(source\\)\\s-+\\([^\n\r#]*\\)\\(#.*\\)?$"
1436 (2 font-lock-variable-name-face))) 1437 (2 font-lock-variable-name-face)))
1437 '("\\.mailrc\\'") 1438 '("\\.mailrc\\'")
@@ -1569,32 +1570,34 @@ generic-x to enable the specified modes."
1569 '((nil "^\\([/-A-Za-z0-9_]+\\)\\s-+" 1)))))))) 1570 '((nil "^\\([/-A-Za-z0-9_]+\\)\\s-+" 1))))))))
1570 1571
1571;; From Jacques Duthen <jacques.duthen@sncf.fr> 1572;; From Jacques Duthen <jacques.duthen@sncf.fr>
1572(defvar show-tabs-generic-mode-font-lock-defaults-1 1573(eval-when-compile
1574
1575(defconst show-tabs-generic-mode-font-lock-defaults-1
1573 '(;; trailing spaces must come before... 1576 '(;; trailing spaces must come before...
1574 ("[ \t]+$" . show-tabs-space-face) 1577 ("[ \t]+$" . 'show-tabs-space-face)
1575 ;; ...embedded tabs 1578 ;; ...embedded tabs
1576 ("[^\n\t]\\(\t+\\)" (1 show-tabs-tab-face)))) 1579 ("[^\n\t]\\(\t+\\)" (1 'show-tabs-tab-face))))
1577 1580
1578(defvar show-tabs-generic-mode-font-lock-defaults-2 1581(defconst show-tabs-generic-mode-font-lock-defaults-2
1579 '(;; trailing spaces must come before... 1582 '(;; trailing spaces must come before...
1580 ("[ \t]+$" . show-tabs-space-face) 1583 ("[ \t]+$" . 'show-tabs-space-face)
1581 ;; ...tabs 1584 ;; ...tabs
1582 ("\t+" . show-tabs-tab-face))) 1585 ("\t+" . 'show-tabs-tab-face))))
1583 1586
1584(defface show-tabs-tab-face 1587(defface show-tabs-tab-face
1585 '((((class grayscale) (background light)) (:foreground "LightGray" :weight bold)) 1588 '((((class grayscale) (background light)) (:background "DimGray" :weight bold))
1586 (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold)) 1589 (((class grayscale) (background dark)) (:background "LightGray" :weight bold))
1587 (((class color) (background light)) (:foreground "red")) 1590 (((class color) (background light)) (:background "red"))
1588 (((class color) (background dark)) (:foreground "red")) 1591 (((class color) (background dark)) (:background "red"))
1589 (t (:weight bold))) 1592 (t (:weight bold)))
1590 "Font Lock mode face used to highlight TABs." 1593 "Font Lock mode face used to highlight TABs."
1591 :group 'show-tabs) 1594 :group 'show-tabs)
1592 1595
1593(defface show-tabs-space-face 1596(defface show-tabs-space-face
1594 '((((class grayscale) (background light)) (:foreground "LightGray" :weight bold)) 1597 '((((class grayscale) (background light)) (:background "DimGray" :weight bold))
1595 (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold)) 1598 (((class grayscale) (background dark)) (:background "LightGray" :weight bold))
1596 (((class color) (background light)) (:foreground "yellow")) 1599 (((class color) (background light)) (:background "yellow"))
1597 (((class color) (background dark)) (:foreground "yellow")) 1600 (((class color) (background dark)) (:background "yellow"))
1598 (t (:weight bold))) 1601 (t (:weight bold)))
1599 "Font Lock mode face used to highlight spaces." 1602 "Font Lock mode face used to highlight spaces."
1600 :group 'show-tabs) 1603 :group 'show-tabs)
@@ -1602,7 +1605,7 @@ generic-x to enable the specified modes."
1602(define-generic-mode show-tabs-generic-mode 1605(define-generic-mode show-tabs-generic-mode
1603 nil ;; no comment char 1606 nil ;; no comment char
1604 nil ;; no keywords 1607 nil ;; no keywords
1605 show-tabs-generic-mode-font-lock-defaults-1 1608 (eval-when-compile show-tabs-generic-mode-font-lock-defaults-1)
1606 nil ;; no auto-mode-alist 1609 nil ;; no auto-mode-alist
1607 ;; '(show-tabs-generic-mode-hook-fun) 1610 ;; '(show-tabs-generic-mode-hook-fun)
1608 nil 1611 nil
@@ -1701,7 +1704,7 @@ generic-x to enable the specified modes."
1701 ;; Make keywords case-insensitive 1704 ;; Make keywords case-insensitive
1702 (function 1705 (function
1703 (lambda() 1706 (lambda()
1704 (setq font-lock-defaults '(generic-font-lock-defaults nil t))))) 1707 (setq font-lock-defaults '(generic-font-lock-keywords nil t)))))
1705 "Generic mode for SPICE circuit netlist files.") 1708 "Generic mode for SPICE circuit netlist files.")
1706 1709
1707(define-generic-mode ibis-generic-mode 1710(define-generic-mode ibis-generic-mode
@@ -1745,7 +1748,7 @@ generic-x to enable the specified modes."
1745 ;; Make keywords case-insensitive 1748 ;; Make keywords case-insensitive
1746 (function 1749 (function
1747 (lambda() 1750 (lambda()
1748 (setq font-lock-defaults '(generic-font-lock-defaults nil t))))) 1751 (setq font-lock-defaults '(generic-font-lock-keywords nil t)))))
1749 "Generic mode for ASTAP circuit netlist files.") 1752 "Generic mode for ASTAP circuit netlist files.")
1750 1753
1751(define-generic-mode etc-modules-conf-generic-mode 1754(define-generic-mode etc-modules-conf-generic-mode
diff --git a/lisp/generic.el b/lisp/generic.el
index 35f4e52bcee..014419edf34 100644
--- a/lisp/generic.el
+++ b/lisp/generic.el
@@ -125,9 +125,11 @@
125;; Internal Variables 125;; Internal Variables
126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
127 127
128(defvar generic-font-lock-defaults nil 128(defvar generic-font-lock-keywords nil
129 "Global defaults for font-lock in a generic mode.") 129 "Keywords for `font-lock-defaults' in a generic mode.")
130(make-variable-buffer-local 'generic-font-lock-defaults) 130(make-variable-buffer-local 'generic-font-lock-keywords)
131(defvaralias 'generic-font-lock-defaults 'generic-font-lock-keywords)
132(make-obsolete-variable 'generic-font-lock-defaults 'generic-font-lock-keywords "22.1")
131 133
132;;;###autoload 134;;;###autoload
133(defvar generic-mode-list nil 135(defvar generic-mode-list nil
@@ -253,13 +255,15 @@ See the file generic-x.el for some examples of `define-generic-mode'."
253 255
254 (generic-mode-set-comments comments) 256 (generic-mode-set-comments comments)
255 257
256 ;; Font-lock functionality 258 ;; Font-lock functionality.
257 ;; Font-lock-defaults are always set even if there are no keywords 259 ;; Font-lock-defaults is always set even if there are no keywords
258 ;; or font-lock expressions, so comments can be highlighted. 260 ;; or font-lock expressions, so comments can be highlighted.
259 (setq generic-font-lock-defaults nil) 261 (setq generic-font-lock-keywords
260 (generic-mode-set-font-lock keywords font-lock-list) 262 (append
261 (make-local-variable 'font-lock-defaults) 263 (when keywords
262 (setq font-lock-defaults (list 'generic-font-lock-defaults nil)) 264 (list (generic-make-keywords-list keywords font-lock-keyword-face)))
265 font-lock-list))
266 (setq font-lock-defaults '(generic-font-lock-keywords nil))
263 267
264 ;; Call a list of functions 268 ;; Call a list of functions
265 (mapcar 'funcall funs) 269 (mapcar 'funcall funs)
@@ -348,16 +352,8 @@ Some generic modes are defined in `generic-x.el'."
348 st)) 352 st))
349 (set-syntax-table st))) 353 (set-syntax-table st)))
350 354
351(defun generic-mode-set-font-lock (keywords font-lock-expressions)
352 "Set up font-lock functionality for generic mode."
353 (setq generic-font-lock-defaults
354 (append
355 (when keywords
356 (list (generic-make-keywords-list keywords font-lock-keyword-face)))
357 font-lock-expressions)))
358
359;; Support for [KEYWORD] constructs found in INF, INI and Samba files
360(defun generic-bracket-support () 355(defun generic-bracket-support ()
356 "Imenu support for [KEYWORD] constructs found in INF, INI and Samba files."
361 (setq imenu-generic-expression 357 (setq imenu-generic-expression
362 '((nil "^\\[\\(.*\\)\\]" 1)) 358 '((nil "^\\[\\(.*\\)\\]" 1))
363 imenu-case-fold-search t)) 359 imenu-case-fold-search t))
@@ -405,7 +401,7 @@ INI file. This hook is NOT installed by default."
405 (ini-generic-mode))))) 401 (ini-generic-mode)))))
406 402
407(and generic-use-find-file-hook 403(and generic-use-find-file-hook
408 (add-hook 'find-file-hooks 'generic-mode-find-file-hook)) 404 (add-hook 'find-file-hook 'generic-mode-find-file-hook))
409 405
410;;;###autoload 406;;;###autoload
411(defun generic-make-keywords-list (keywords-list face &optional prefix suffix) 407(defun generic-make-keywords-list (keywords-list face &optional prefix suffix)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index d581274b803..fe2fcab6643 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,98 @@
12005-03-25 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * message.el (message-resend): Bind rfc2047-encode-encoded-words.
4
5 * mm-util.el (mm-replace-in-string): New function.
6 (mm-xemacs-find-mime-charset-1): Ignore errors while loading
7 latin-unity, which cannot be used with XEmacs 21.1.
8
9 * rfc2047.el (rfc2047-encode-function-alist): Rename from
10 rfc2047-encoding-function-alist in order to avoid conflicting with
11 the old version.
12 (rfc2047-encode-message-header): Remove useless goto-char.
13 (rfc2047-encodable-p): Don't move point.
14 (rfc2047-syntax-table): Treat `(' and `)' as is.
15 (rfc2047-encode-region): Concatenate words containing non-ASCII
16 characters in structured fields; don't encode space-delimited
17 ASCII words even in unstructured fields; don't break words at
18 char-category boundaries; encode encoded words in structured
19 fields; treat text within parentheses as special; show the
20 original text when error has occurred; move point to the end of
21 the region after encoding, suggested by IRIE Tetsuya
22 <irie@t.email.ne.jp>; treat backslash-quoted characters as
23 non-special; check carefully whether to encode special characters;
24 fix some kind of misconfigured headers; signal a real error if
25 debug-on-quit or debug-on-error is non-nil; don't infloop,
26 suggested by Hiroshi Fujishima <pooh@nature.tsukuba.ac.jp>; assume
27 the close parenthesis may be included in the encoded word; encode
28 bogus delimiters.
29 (rfc2047-encode-string): Use mm-with-multibyte-buffer.
30 (rfc2047-encode-max-chars): New variable.
31 (rfc2047-encode-1): New function.
32 (rfc2047-encode): Use it; encode text so that it occupies the
33 maximum width within 76-column; work correctly on Q encoding for
34 iso-2022-* charsets; fold the line before encoding; don't append a
35 space if the encoded word includes close parenthesis.
36 (rfc2047-fold-region): Use existing whitespace for LWSP; make it
37 sure not to break a line just after the header name.
38 (rfc2047-b-encode-region): Remove.
39 (rfc2047-b-encode-string): New function.
40 (rfc2047-q-encode-region): Remove.
41 (rfc2047-q-encode-string): New function.
42 (rfc2047-encode-parameter): New function.
43 (rfc2047-encoded-word-regexp): Don't use shy group.
44 (rfc2047-decode-region): Follow rfc2047-encoded-word-regexp change.
45 (rfc2047-parse-and-decode): Ditto.
46 (rfc2047-decode): Treat the ascii coding-system as raw-text by
47 default.
48
492005-03-25 Lars Magne Ingebrigtsen <larsi@gnus.org>
50
51 * rfc2047.el (rfc2047-encode-encoded-words): New variable.
52 (rfc2047-field-value): Strip props.
53 (rfc2047-encode-message-header): Disabled header folding -- not
54 all headers can be folded, and this should be done by the message
55 composition mode. Probably. I think.
56 (rfc2047-encodable-p): Say that =? needs encoding.
57 (rfc2047-encode-region): Encode =? strings.
58
592005-03-25 Jesper Harder <harder@ifa.au.dk>
60
61 * rfc2047.el (rfc2047-encoded-word-regexp): Support RFC 2231
62 language tags; remove unnecessary '+'. Reported by Stefan Wiens
63 <s.wi@gmx.net>.
64 (rfc2047-decode-string): Don't cons a string unnecessarily.
65 (rfc2047-parse-and-decode, rfc2047-decode): Use a character for
66 the encoding to avoid consing a string.
67 (rfc2047-decode): Use mm-subst-char-in-string instead of
68 mm-replace-chars-in-string.
69
702005-03-25 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
71
72 * rfc2047.el (rfc2047-encode): Use uppercase letters to specify
73 encodings of MIME-encoded words, in order to improve
74 interoperability with several broken MUAs.
75
762005-03-21 Reiner Steib <Reiner.Steib@gmx.de>
77
78 * gnus-srvr.el (gnus-browse-select-group): Add NUMBER argument and
79 pass it to `gnus-browse-read-group'.
80 (gnus-browse-read-group): Add NUMBER argument and pass it to
81 `gnus-group-read-ephemeral-group'.
82
83 * gnus-group.el (gnus-group-read-ephemeral-group): Add NUMBER
84 argument and pass it to `gnus-group-read-group'.
85
862005-03-19 Aidan Kehoe <kehoea@parhasard.net>
87
88 * mm-util.el (mm-xemacs-find-mime-charset): Only call
89 mm-xemacs-find-mime-charset-1 if we have the mule feature
90 available at runtime.
91
922005-03-25 Werner Lemberg <wl@gnu.org>
93
94 * nnmaildir.el: Replace `illegal' with `invalid'.
95
12005-03-22 Stefan Monnier <monnier@iro.umontreal.ca> 962005-03-22 Stefan Monnier <monnier@iro.umontreal.ca>
2 97
3 * gnus-start.el (gnus-display-time-event-handler): 98 * gnus-start.el (gnus-display-time-event-handler):
@@ -614,7 +709,7 @@
614 unless plugged. Disable the agent so that an open failure causes 709 unless plugged. Disable the agent so that an open failure causes
615 an error. 710 an error.
616 711
6172004-10-18 Kevin Greiner <kevin.greiner@compsol.cc> for Reiner Steib <Reiner.Steib@gmx.de> 7122004-10-18 Reiner Steib <Reiner.Steib@gmx.de>
618 713
619 * gnus-agent.el (gnus-agent-fetched-hook): Add :version. 714 * gnus-agent.el (gnus-agent-fetched-hook): Add :version.
620 (gnus-agent-go-online): Change :version. 715 (gnus-agent-go-online): Change :version.
@@ -656,21 +751,21 @@
656 (gnus-convert-mark-converter-prompt) 751 (gnus-convert-mark-converter-prompt)
657 (gnus-convert-converter-needs-prompt): Fix use of property list. 752 (gnus-convert-converter-needs-prompt): Fix use of property list.
658 753
6592004-10-18 Kevin Greiner <kevin.greiner@compsol.cc> for Katsumi Yamaoka <yamaoka@jpl.org> 7542004-10-18 Katsumi Yamaoka <yamaoka@jpl.org>
660 755
661 * gnus-agent.el (gnus-agent-restore-gcc): Use ^ and regexp-quote. 756 * gnus-agent.el (gnus-agent-restore-gcc): Use ^ and regexp-quote.
662 757
6632004-10-18 Kevin Greiner <kevin.greiner@compsol.cc> for Lars Magne Ingebrigtsen <larsi@gnus.org> 7582004-10-18 Lars Magne Ingebrigtsen <larsi@gnus.org>
664 759
665 * gnus-start.el (gnus-get-unread-articles-in-group): Don't do 760 * gnus-start.el (gnus-get-unread-articles-in-group): Don't do
666 stuff for non-living groups. 761 stuff for non-living groups.
667 762
6682004-10-18 Kevin Greiner <kevin.greiner@compsol.cc> for Lars Magne Ingebrigtsen <larsi@gnus.org> 7632004-10-18 Lars Magne Ingebrigtsen <larsi@gnus.org>
669 764
670 * gnus-agent.el (gnus-agent-synchronize-flags): Default to nil. 765 * gnus-agent.el (gnus-agent-synchronize-flags): Default to nil.
671 (gnus-agent-regenerate-group): Using nil messages aren't valid. 766 (gnus-agent-regenerate-group): Using nil messages aren't valid.
672 767
6732004-10-18 Kevin Greiner <kevin.greiner@compsol.cc> for Lars Magne Ingebrigtsen <larsi@gnus.org> 7682004-10-18 Lars Magne Ingebrigtsen <larsi@gnus.org>
674 769
675 * gnus-agent.el (gnus-agent-read-agentview): 770 * gnus-agent.el (gnus-agent-read-agentview):
676 Inline gnus-uncompress-range. 771 Inline gnus-uncompress-range.
@@ -687,7 +782,7 @@
687 message-send-mail-function. The change makes the agent real-time 782 message-send-mail-function. The change makes the agent real-time
688 responsive to user changes to message-send-mail-function. 783 responsive to user changes to message-send-mail-function.
689 784
6902004-10-18 Kevin Greiner <kevin.greiner@compsol.cc> for Reiner Steib <Reiner.Steib@gmx.de> 7852004-10-18 Reiner Steib <Reiner.Steib@gmx.de>
691 786
692 * gnus-start.el (gnus-get-unread-articles): Fix last commit. 787 * gnus-start.el (gnus-get-unread-articles): Fix last commit.
693 788
@@ -728,12 +823,12 @@
728 823
729 * gnus-util.el (gnus-rename-file): New function. 824 * gnus-util.el (gnus-rename-file): New function.
730 825
7312004-10-18 Kevin Greiner <kevin.greiner@compsol.cc> for Katsumi Yamaoka <yamaoka@jpl.org> 8262004-10-18 Katsumi Yamaoka <yamaoka@jpl.org>
732 827
733 * gnus-agent.el (gnus-agent-regenerate-group): Activate the group 828 * gnus-agent.el (gnus-agent-regenerate-group): Activate the group
734 when the group's active is not available. 829 when the group's active is not available.
735 830
7362004-10-18 Kevin Greiner <kevin.greiner@compsol.cc> for Katsumi Yamaoka <yamaoka@jpl.org> 8312004-10-18 Katsumi Yamaoka <yamaoka@jpl.org>
737 832
738 * gnus-agent.el (gnus-agent-read-agentview): Add a missing arg to 833 * gnus-agent.el (gnus-agent-read-agentview): Add a missing arg to
739 error. 834 error.
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 767bdacb78e..6d38626998c 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -1984,7 +1984,8 @@ confirmation is required."
1984(defun gnus-group-read-ephemeral-group (group method &optional activate 1984(defun gnus-group-read-ephemeral-group (group method &optional activate
1985 quit-config request-only 1985 quit-config request-only
1986 select-articles 1986 select-articles
1987 parameters) 1987 parameters
1988 number)
1988 "Read GROUP from METHOD as an ephemeral group. 1989 "Read GROUP from METHOD as an ephemeral group.
1989If ACTIVATE, request the group first. 1990If ACTIVATE, request the group first.
1990If QUIT-CONFIG, use that window configuration when exiting from the 1991If QUIT-CONFIG, use that window configuration when exiting from the
@@ -1992,6 +1993,7 @@ ephemeral group.
1992If REQUEST-ONLY, don't actually read the group; just request it. 1993If REQUEST-ONLY, don't actually read the group; just request it.
1993If SELECT-ARTICLES, only select those articles. 1994If SELECT-ARTICLES, only select those articles.
1994If PARAMETERS, use those as the group parameters. 1995If PARAMETERS, use those as the group parameters.
1996If NUMBER, fetch this number of articles.
1995 1997
1996Return the name of the group if selection was successful." 1998Return the name of the group if selection was successful."
1997 (interactive 1999 (interactive
@@ -2039,7 +2041,7 @@ Return the name of the group if selection was successful."
2039 (when (let ((gnus-large-newsgroup gnus-large-ephemeral-newsgroup) 2041 (when (let ((gnus-large-newsgroup gnus-large-ephemeral-newsgroup)
2040 (gnus-fetch-old-headers 2042 (gnus-fetch-old-headers
2041 gnus-fetch-old-ephemeral-headers)) 2043 gnus-fetch-old-ephemeral-headers))
2042 (gnus-group-read-group t t group select-articles)) 2044 (gnus-group-read-group (or number t) t group select-articles))
2043 group) 2045 group)
2044 ;;(error nil) 2046 ;;(error nil)
2045 (quit 2047 (quit
diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el
index e8c7d354145..7b3c033fddb 100644
--- a/lisp/gnus/gnus-srvr.el
+++ b/lisp/gnus/gnus-srvr.el
@@ -851,23 +851,26 @@ buffer.
851 (setq buffer-read-only t) 851 (setq buffer-read-only t)
852 (gnus-run-hooks 'gnus-browse-mode-hook)) 852 (gnus-run-hooks 'gnus-browse-mode-hook))
853 853
854(defun gnus-browse-read-group (&optional no-article) 854(defun gnus-browse-read-group (&optional no-article number)
855 "Enter the group at the current line." 855 "Enter the group at the current line.
856 (interactive) 856If NUMBER, fetch this number of articles."
857 (interactive "P")
857 (let ((group (gnus-browse-group-name))) 858 (let ((group (gnus-browse-group-name)))
858 (if (or (not (gnus-get-info group)) 859 (if (or (not (gnus-get-info group))
859 (gnus-ephemeral-group-p group)) 860 (gnus-ephemeral-group-p group))
860 (unless (gnus-group-read-ephemeral-group 861 (unless (gnus-group-read-ephemeral-group
861 group gnus-browse-current-method nil 862 group gnus-browse-current-method nil
862 (cons (current-buffer) 'browse)) 863 (cons (current-buffer) 'browse)
864 nil nil nil number)
863 (error "Couldn't enter %s" group)) 865 (error "Couldn't enter %s" group))
864 (unless (gnus-group-read-group nil no-article group) 866 (unless (gnus-group-read-group nil no-article group)
865 (error "Couldn't enter %s" group))))) 867 (error "Couldn't enter %s" group)))))
866 868
867(defun gnus-browse-select-group () 869(defun gnus-browse-select-group (&optional number)
868 "Select the current group." 870 "Select the current group.
869 (interactive) 871If NUMBER, fetch this number of articles."
870 (gnus-browse-read-group 'no)) 872 (interactive "P")
873 (gnus-browse-read-group 'no number))
871 874
872(defun gnus-browse-next-group (n) 875(defun gnus-browse-next-group (n)
873 "Go to the next group." 876 "Go to the next group."
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 9171385fec0..072097b505b 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -6364,7 +6364,8 @@ Optional DIGEST will use digest to forward."
6364 (replace-match "X-From-Line: ")) 6364 (replace-match "X-From-Line: "))
6365 ;; Send it. 6365 ;; Send it.
6366 (let ((message-inhibit-body-encoding t) 6366 (let ((message-inhibit-body-encoding t)
6367 message-required-mail-headers) 6367 message-required-mail-headers
6368 rfc2047-encode-encoded-words)
6368 (message-send-mail)) 6369 (message-send-mail))
6369 (kill-buffer (current-buffer))) 6370 (kill-buffer (current-buffer)))
6370 (message "Resending message to %s...done" address))) 6371 (message "Resending message to %s...done" address)))
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el
index e874f23e6e6..2a689221f7e 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -86,6 +86,32 @@
86 (multibyte-char-to-unibyte . identity)))) 86 (multibyte-char-to-unibyte . identity))))
87 87
88(eval-and-compile 88(eval-and-compile
89 (cond
90 ((fboundp 'replace-in-string)
91 (defalias 'mm-replace-in-string 'replace-in-string))
92 ((fboundp 'replace-regexp-in-string)
93 (defun mm-replace-in-string (string regexp newtext &optional literal)
94 "Replace all matches for REGEXP with NEWTEXT in STRING.
95If LITERAL is non-nil, insert NEWTEXT literally. Return a new
96string containing the replacements.
97
98This is a compatibility function for different Emacsen."
99 (replace-regexp-in-string regexp newtext string nil literal)))
100 (t
101 (defun mm-replace-in-string (string regexp newtext &optional literal)
102 "Replace all matches for REGEXP with NEWTEXT in STRING.
103If LITERAL is non-nil, insert NEWTEXT literally. Return a new
104string containing the replacements.
105
106This is a compatibility function for different Emacsen."
107 (let ((start 0) tail)
108 (while (string-match regexp string start)
109 (setq tail (- (length string) (match-end 0)))
110 (setq string (replace-match newtext nil literal string))
111 (setq start (- (length string) tail))))
112 string))))
113
114(eval-and-compile
89 (defalias 'mm-char-or-char-int-p 115 (defalias 'mm-char-or-char-int-p
90 (cond 116 (cond
91 ((fboundp 'char-or-char-int-p) 'char-or-char-int-p) 117 ((fboundp 'char-or-char-int-p) 'char-or-char-int-p)
@@ -555,7 +581,7 @@ But this is very much a corner case, so don't worry about it."
555 581
556 ;; Load the Latin Unity library, if available. 582 ;; Load the Latin Unity library, if available.
557 (when (and (not (featurep 'latin-unity)) (locate-library "latin-unity")) 583 (when (and (not (featurep 'latin-unity)) (locate-library "latin-unity"))
558 (require 'latin-unity)) 584 (ignore-errors (require 'latin-unity)))
559 585
560 ;; Now, can we use it? 586 ;; Now, can we use it?
561 (if (featurep 'latin-unity) 587 (if (featurep 'latin-unity)
@@ -600,7 +626,7 @@ But this is very much a corner case, so don't worry about it."
600 626
601(defmacro mm-xemacs-find-mime-charset (begin end) 627(defmacro mm-xemacs-find-mime-charset (begin end)
602 (when (featurep 'xemacs) 628 (when (featurep 'xemacs)
603 `(mm-xemacs-find-mime-charset-1 ,begin ,end))) 629 `(and (featurep 'mule) (mm-xemacs-find-mime-charset-1 ,begin ,end))))
604 630
605(defun mm-find-mime-charset-region (b e &optional hack-charsets) 631(defun mm-find-mime-charset-region (b e &optional hack-charsets)
606 "Return the MIME charsets needed to encode the region between B and E. 632 "Return the MIME charsets needed to encode the region between B and E.
diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el
index 618418907e8..be94a57b5c7 100644
--- a/lisp/gnus/nnmaildir.el
+++ b/lisp/gnus/nnmaildir.el
@@ -978,7 +978,7 @@ by nnmaildir-request-article.")
978 (throw 'return nil)) 978 (throw 'return nil))
979 (when (save-match-data (string-match "[\0/\t]" gname)) 979 (when (save-match-data (string-match "[\0/\t]" gname))
980 (setf (nnmaildir--srv-error nnmaildir--cur-server) 980 (setf (nnmaildir--srv-error nnmaildir--cur-server)
981 (concat "Illegal characters (null, tab, or /) in group name: " 981 (concat "Invalid characters (null, tab, or /) in group name: "
982 gname)) 982 gname))
983 (throw 'return nil)) 983 (throw 'return nil))
984 (setq groups (nnmaildir--srv-groups nnmaildir--cur-server)) 984 (setq groups (nnmaildir--srv-groups nnmaildir--cur-server))
@@ -1023,7 +1023,7 @@ by nnmaildir-request-article.")
1023 (throw 'return nil)) 1023 (throw 'return nil))
1024 (when (save-match-data (string-match "[\0/\t]" new-name)) 1024 (when (save-match-data (string-match "[\0/\t]" new-name))
1025 (setf (nnmaildir--srv-error nnmaildir--cur-server) 1025 (setf (nnmaildir--srv-error nnmaildir--cur-server)
1026 (concat "Illegal characters (null, tab, or /) in group name: " 1026 (concat "Invalid characters (null, tab, or /) in group name: "
1027 new-name)) 1027 new-name))
1028 (throw 'return nil)) 1028 (throw 'return nil))
1029 (if (string-equal gname new-name) (throw 'return t)) 1029 (if (string-equal gname new-name) (throw 'return t))
diff --git a/lisp/gnus/rfc2047.el b/lisp/gnus/rfc2047.el
index ab00edb9128..0099e6d1bb7 100644
--- a/lisp/gnus/rfc2047.el
+++ b/lisp/gnus/rfc2047.el
@@ -119,12 +119,15 @@ The values can be:
119Valid encodings are nil, `Q' and `B'. These indicate binary (no) encoding, 119Valid encodings are nil, `Q' and `B'. These indicate binary (no) encoding,
120quoted-printable and base64 respectively.") 120quoted-printable and base64 respectively.")
121 121
122(defvar rfc2047-encoding-function-alist 122(defvar rfc2047-encode-function-alist
123 '((Q . rfc2047-q-encode-region) 123 '((Q . rfc2047-q-encode-string)
124 (B . rfc2047-b-encode-region) 124 (B . rfc2047-b-encode-string)
125 (nil . ignore)) 125 (nil . identity))
126 "Alist of RFC2047 encodings to encoding functions.") 126 "Alist of RFC2047 encodings to encoding functions.")
127 127
128(defvar rfc2047-encode-encoded-words t
129 "Whether encoded words should be encoded again.")
130
128;;; 131;;;
129;;; Functions for encoding RFC2047 messages 132;;; Functions for encoding RFC2047 messages
130;;; 133;;;
@@ -166,7 +169,7 @@ This is either `base64' or `quoted-printable'."
166 (save-restriction 169 (save-restriction
167 (rfc2047-narrow-to-field) 170 (rfc2047-narrow-to-field)
168 (re-search-forward ":[ \t\n]*" nil t) 171 (re-search-forward ":[ \t\n]*" nil t)
169 (buffer-substring (point) (point-max))))) 172 (buffer-substring-no-properties (point) (point-max)))))
170 173
171(defvar rfc2047-encoding-type 'address-mime 174(defvar rfc2047-encoding-type 'address-mime
172 "The type of encoding done by `rfc2047-encode-region'. 175 "The type of encoding done by `rfc2047-encode-region'.
@@ -186,24 +189,25 @@ Should be called narrowed to the head of the message."
186 (rfc2047-narrow-to-field) 189 (rfc2047-narrow-to-field)
187 (if (not (rfc2047-encodable-p)) 190 (if (not (rfc2047-encodable-p))
188 (prog1 191 (prog1
189 (if (and (eq (mm-body-7-or-8) '8bit) 192 (if (and (eq (mm-body-7-or-8) '8bit)
190 (mm-multibyte-p) 193 (mm-multibyte-p)
191 (mm-coding-system-p 194 (mm-coding-system-p
192 (car message-posting-charset))) 195 (car message-posting-charset)))
193 ;; 8 bit must be decoded. 196 ;; 8 bit must be decoded.
194 (mm-encode-coding-region 197 (mm-encode-coding-region
195 (point-min) (point-max) 198 (point-min) (point-max)
196 (mm-charset-to-coding-system 199 (mm-charset-to-coding-system
197 (car message-posting-charset)))) 200 (car message-posting-charset))))
198 ;; No encoding necessary, but folding is nice 201 ;; No encoding necessary, but folding is nice
199 (rfc2047-fold-region 202 (when nil
200 (save-excursion 203 (rfc2047-fold-region
201 (goto-char (point-min)) 204 (save-excursion
202 (skip-chars-forward "^:") 205 (goto-char (point-min))
203 (when (looking-at ": ") 206 (skip-chars-forward "^:")
204 (forward-char 2)) 207 (when (looking-at ": ")
205 (point)) 208 (forward-char 2))
206 (point-max))) 209 (point))
210 (point-max))))
207 ;; We found something that may perhaps be encoded. 211 ;; We found something that may perhaps be encoded.
208 (setq method nil 212 (setq method nil
209 alist rfc2047-header-encoding-alist) 213 alist rfc2047-header-encoding-alist)
@@ -213,7 +217,6 @@ Should be called narrowed to the head of the message."
213 (eq (car elem) t)) 217 (eq (car elem) t))
214 (setq alist nil 218 (setq alist nil
215 method (cdr elem)))) 219 method (cdr elem))))
216 (goto-char (point-min))
217 (re-search-forward "^[^:]+: *" nil t) 220 (re-search-forward "^[^:]+: *" nil t)
218 (cond 221 (cond
219 ((eq method 'address-mime) 222 ((eq method 'address-mime)
@@ -267,8 +270,13 @@ The buffer may be narrowed."
267 (require 'message) ; for message-posting-charset 270 (require 'message) ; for message-posting-charset
268 (let ((charsets 271 (let ((charsets
269 (mm-find-mime-charset-region (point-min) (point-max)))) 272 (mm-find-mime-charset-region (point-min) (point-max))))
270 (and charsets 273 (goto-char (point-min))
271 (not (equal charsets (list (car message-posting-charset))))))) 274 (or (and rfc2047-encode-encoded-words
275 (prog1
276 (search-forward "=?" nil t)
277 (goto-char (point-min))))
278 (and charsets
279 (not (equal charsets (list (car message-posting-charset))))))))
272 280
273;; Use this syntax table when parsing into regions that may need 281;; Use this syntax table when parsing into regions that may need
274;; encoding. Double quotes are string delimiters, backslash is 282;; encoding. Double quotes are string delimiters, backslash is
@@ -292,8 +300,8 @@ The buffer may be narrowed."
292 table)))) 300 table))))
293 (modify-syntax-entry ?\\ "\\" table) 301 (modify-syntax-entry ?\\ "\\" table)
294 (modify-syntax-entry ?\" "\"" table) 302 (modify-syntax-entry ?\" "\"" table)
295 (modify-syntax-entry ?\( "." table) 303 (modify-syntax-entry ?\( "(" table)
296 (modify-syntax-entry ?\) "." table) 304 (modify-syntax-entry ?\) ")" table)
297 (modify-syntax-entry ?\< "." table) 305 (modify-syntax-entry ?\< "." table)
298 (modify-syntax-entry ?\> "." table) 306 (modify-syntax-entry ?\> "." table)
299 (modify-syntax-entry ?\[ "." table) 307 (modify-syntax-entry ?\[ "." table)
@@ -310,183 +318,341 @@ By default, the region is treated as containing RFC2822 addresses.
310Dynamically bind `rfc2047-encoding-type' to change that." 318Dynamically bind `rfc2047-encoding-type' to change that."
311 (save-restriction 319 (save-restriction
312 (narrow-to-region b e) 320 (narrow-to-region b e)
313 (if (eq 'mime rfc2047-encoding-type) 321 (let ((encodable-regexp (if rfc2047-encode-encoded-words
314 ;; Simple case. Treat as single word after any initial ASCII 322 "[^\000-\177]+\\|=\\?"
315 ;; part and before any tailing ASCII part. The leading ASCII 323 "[^\000-\177]+"))
316 ;; is relevant for instance in Subject headers with `Re:' for 324 start ; start of current token
317 ;; interoperability with non-MIME clients, and we might as 325 end begin csyntax
318 ;; well avoid the tail too. 326 ;; Whether there's an encoded word before the current token,
319 (progn 327 ;; either immediately or separated by space.
320 (goto-char (point-min)) 328 last-encoded
321 ;; Does it need encoding? 329 (orig-text (buffer-substring-no-properties b e)))
322 (skip-chars-forward "\000-\177") 330 (if (eq 'mime rfc2047-encoding-type)
323 (unless (eobp) 331 ;; Simple case. Continuous words in which all those contain
324 (skip-chars-backward "^ \n") ; beginning of space-delimited word 332 ;; non-ASCII characters are encoded collectively. Encoding
325 (rfc2047-encode (point) (progn 333 ;; ASCII words, including `Re:' used in Subject headers, is
326 (goto-char e) 334 ;; avoided for interoperability with non-MIME clients and
327 (skip-chars-backward "\000-\177") 335 ;; for making it easy to find keywords.
328 (skip-chars-forward "^ \n") 336 (progn
329 ;; end of space-delimited word 337 (goto-char (point-min))
330 (point))))) 338 (while (progn (skip-chars-forward " \t\n")
331 ;; `address-mime' case -- take care of quoted words, comments. 339 (not (eobp)))
332 (with-syntax-table rfc2047-syntax-table 340 (setq start (point))
333 (let ((start) ; start of current token 341 (while (and (looking-at "[ \t\n]*\\([^ \t\n]+\\)")
334 end ; end of current token 342 (progn
335 ;; Whether there's an encoded word before the current 343 (setq end (match-end 0))
336 ;; token, either immediately or separated by space. 344 (re-search-forward encodable-regexp end t)))
337 last-encoded) 345 (goto-char end))
346 (if (> (point) start)
347 (rfc2047-encode start (point))
348 (goto-char end))))
349 ;; `address-mime' case -- take care of quoted words, comments.
350 (with-syntax-table rfc2047-syntax-table
338 (goto-char (point-min)) 351 (goto-char (point-min))
339 (condition-case nil ; in case of unbalanced quotes 352 (condition-case err ; in case of unbalanced quotes
340 ;; Look for rfc2822-style: sequences of atoms, quoted 353 ;; Look for rfc2822-style: sequences of atoms, quoted
341 ;; strings, specials, whitespace. (Specials mustn't be 354 ;; strings, specials, whitespace. (Specials mustn't be
342 ;; encoded.) 355 ;; encoded.)
343 (while (not (eobp)) 356 (while (not (eobp))
344 (setq start (point))
345 ;; Skip whitespace. 357 ;; Skip whitespace.
346 (unless (= 0 (skip-chars-forward " \t\n")) 358 (skip-chars-forward " \t\n")
347 (setq start (point))) 359 (setq start (point))
348 (cond 360 (cond
349 ((not (char-after))) ; eob 361 ((not (char-after))) ; eob
350 ;; else token start 362 ;; else token start
351 ((eq ?\" (char-syntax (char-after))) 363 ((eq ?\" (setq csyntax (char-syntax (char-after))))
352 ;; Quoted word. 364 ;; Quoted word.
353 (forward-sexp) 365 (forward-sexp)
354 (setq end (point)) 366 (setq end (point))
355 ;; Does it need encoding? 367 ;; Does it need encoding?
356 (goto-char start) 368 (goto-char start)
357 (skip-chars-forward "\000-\177" end) 369 (if (re-search-forward encodable-regexp end 'move)
358 (if (= end (point)) 370 ;; It needs encoding. Strip the quotes first,
359 (setq last-encoded nil) 371 ;; since encoded words can't occur in quotes.
360 ;; It needs encoding. Strip the quotes first, 372 (progn
361 ;; since encoded words can't occur in quotes. 373 (goto-char end)
362 (goto-char end) 374 (delete-backward-char 1)
363 (delete-backward-char 1) 375 (goto-char start)
364 (goto-char start) 376 (delete-char 1)
365 (delete-char 1) 377 (when last-encoded
366 (when last-encoded 378 ;; There was a preceding quoted word. We need
367 ;; There was a preceding quoted word. We need 379 ;; to include any separating whitespace in this
368 ;; to include any separating whitespace in this 380 ;; word to avoid it getting lost.
369 ;; word to avoid it getting lost. 381 (skip-chars-backward " \t")
370 (skip-chars-backward " \t") 382 ;; A space is needed between the encoded words.
371 ;; A space is needed between the encoded words. 383 (insert ? )
372 (insert ? ) 384 (setq start (point)
373 (setq start (point) 385 end (1+ end)))
374 end (1+ end))) 386 ;; Adjust the end position for the deleted quotes.
375 ;; Adjust the end position for the deleted quotes. 387 (rfc2047-encode start (- end 2))
376 (rfc2047-encode start (- end 2)) 388 (setq last-encoded t)) ; record that it was encoded
377 (setq last-encoded t))) ; record that it was encoded 389 (setq last-encoded nil)))
378 ((eq ?. (char-syntax (char-after))) 390 ((eq ?. csyntax)
379 ;; Skip other delimiters, but record that they've 391 ;; Skip other delimiters, but record that they've
380 ;; potentially separated quoted words. 392 ;; potentially separated quoted words.
381 (forward-char) 393 (forward-char)
382 (setq last-encoded nil)) 394 (setq last-encoded nil))
395 ((eq ?\) csyntax)
396 (error "Unbalanced parentheses"))
397 ((eq ?\( csyntax)
398 ;; Look for the end of parentheses.
399 (forward-list)
400 ;; Encode text as an unstructured field.
401 (let ((rfc2047-encoding-type 'mime))
402 (rfc2047-encode-region (1+ start) (1- (point))))
403 (skip-chars-forward ")"))
383 (t ; normal token/whitespace sequence 404 (t ; normal token/whitespace sequence
384 ;; Find the end. 405 ;; Find the end.
385 (forward-word 1) 406 ;; Skip one ASCII word, or encode continuous words
386 (skip-chars-backward " \t") 407 ;; in which all those contain non-ASCII characters.
408 (setq end nil)
409 (while (not (or end (eobp)))
410 (when (looking-at "[\000-\177]+")
411 (setq begin (point)
412 end (match-end 0))
413 (when (progn
414 (while (and (or (re-search-forward
415 "[ \t\n]\\|\\Sw" end 'move)
416 (setq end nil))
417 (eq ?\\ (char-syntax (char-before))))
418 ;; Skip backslash-quoted characters.
419 (forward-char))
420 end)
421 (setq end (match-beginning 0))
422 (if rfc2047-encode-encoded-words
423 (progn
424 (goto-char begin)
425 (when (search-forward "=?" end 'move)
426 (goto-char (match-beginning 0))
427 (setq end nil)))
428 (goto-char end))))
429 ;; Where the value nil of `end' means there may be
430 ;; text to have to be encoded following the point.
431 ;; Otherwise, the point reached to the end of ASCII
432 ;; words separated by whitespace or a special char.
433 (unless end
434 (when (looking-at encodable-regexp)
435 (goto-char (setq begin (match-end 0)))
436 (while (and (looking-at "[ \t\n]+\\([^ \t\n]+\\)")
437 (setq end (match-end 0))
438 (progn
439 (while (re-search-forward
440 encodable-regexp end t))
441 (< begin (point)))
442 (goto-char begin)
443 (or (not (re-search-forward "\\Sw" end t))
444 (progn
445 (goto-char (match-beginning 0))
446 nil)))
447 (goto-char end))
448 (when (looking-at "[^ \t\n]+")
449 (setq end (match-end 0))
450 (if (re-search-forward "\\Sw+" end t)
451 ;; There are special characters better
452 ;; to be encoded so that MTAs may parse
453 ;; them safely.
454 (cond ((= end (point)))
455 ((looking-at (concat "\\sw*\\("
456 encodable-regexp
457 "\\)"))
458 (setq end nil))
459 (t
460 (goto-char (1- (match-end 0)))
461 (unless (= (point) (match-beginning 0))
462 ;; Separate encodable text and
463 ;; delimiter.
464 (insert " "))))
465 (goto-char end)
466 (skip-chars-forward " \t\n")
467 (if (and (looking-at "[^ \t\n]+")
468 (string-match encodable-regexp
469 (match-string 0)))
470 (setq end nil)
471 (goto-char end)))))))
472 (skip-chars-backward " \t\n")
387 (setq end (point)) 473 (setq end (point))
388 ;; Deal with encoding and leading space as for
389 ;; quoted words.
390 (goto-char start) 474 (goto-char start)
391 (skip-chars-forward "\000-\177" end) 475 (if (re-search-forward encodable-regexp end 'move)
392 (if (= end (point)) 476 (progn
393 (setq last-encoded nil) 477 (unless (memq (char-before start) '(nil ?\t ? ))
394 (when last-encoded 478 (if (progn
395 (goto-char start) 479 (goto-char start)
396 (skip-chars-backward " \t") 480 (skip-chars-backward "^ \t\n")
397 (insert ? ) 481 (and (looking-at "\\Sw+")
398 (setq start (point) 482 (= (match-end 0) start)))
399 end (1+ end))) 483 ;; Also encode bogus delimiters.
400 (rfc2047-encode start end) 484 (setq start (point))
401 (setq last-encoded t))))) 485 ;; Separate encodable text and delimiter.
486 (goto-char start)
487 (insert " ")
488 (setq start (1+ start)
489 end (1+ end))))
490 (rfc2047-encode start end)
491 (setq last-encoded t))
492 (setq last-encoded nil)))))
402 (error 493 (error
403 (error "Invalid data for rfc2047 encoding: %s" 494 (if (or debug-on-quit debug-on-error)
404 (buffer-substring b e))))))) 495 (signal (car err) (cdr err))
405 (rfc2047-fold-region b (point)))) 496 (error "Invalid data for rfc2047 encoding: %s"
497 (mm-replace-in-string orig-text "[ \t\n]+" " "))))))))
498 (rfc2047-fold-region b (point))
499 (goto-char (point-max))))
406 500
407(defun rfc2047-encode-string (string) 501(defun rfc2047-encode-string (string)
408 "Encode words in STRING. 502 "Encode words in STRING.
409By default, the string is treated as containing addresses (see 503By default, the string is treated as containing addresses (see
410`rfc2047-encoding-type')." 504`rfc2047-encoding-type')."
411 (with-temp-buffer 505 (mm-with-multibyte-buffer
412 (insert string) 506 (insert string)
413 (rfc2047-encode-region (point-min) (point-max)) 507 (rfc2047-encode-region (point-min) (point-max))
414 (buffer-string))) 508 (buffer-string)))
415 509
510(defvar rfc2047-encode-max-chars 76
511 "Maximum characters of each header line that contain encoded-words.
512If it is nil, encoded-words will not be folded. Too small value may
513cause an error. Don't change this for no particular reason.")
514
515(defun rfc2047-encode-1 (column string cs encoder start crest tail
516 &optional eword)
517 "Subroutine used by `rfc2047-encode'."
518 (cond ((string-equal string "")
519 (or eword ""))
520 ((not rfc2047-encode-max-chars)
521 (concat start
522 (funcall encoder (if cs
523 (mm-encode-coding-string string cs)
524 string))
525 "?="))
526 ((>= column rfc2047-encode-max-chars)
527 (when eword
528 (cond ((string-match "\n[ \t]+\\'" eword)
529 ;; Reomove a superfluous empty line.
530 (setq eword (substring eword 0 (match-beginning 0))))
531 ((string-match "(+\\'" eword)
532 ;; Break the line before the open parenthesis.
533 (setq crest (concat crest (match-string 0 eword))
534 eword (substring eword 0 (match-beginning 0))))))
535 (rfc2047-encode-1 (length crest) string cs encoder start " " tail
536 (concat eword "\n" crest)))
537 (t
538 (let ((index 0)
539 (limit (1- (length string)))
540 (prev "")
541 next len)
542 (while (and prev
543 (<= index limit))
544 (setq next (concat start
545 (funcall encoder
546 (if cs
547 (mm-encode-coding-string
548 (substring string 0 (1+ index))
549 cs)
550 (substring string 0 (1+ index))))
551 "?=")
552 len (+ column (length next)))
553 (if (> len rfc2047-encode-max-chars)
554 (setq next prev
555 prev nil)
556 (if (or (< index limit)
557 (<= (+ len (or (string-match "\n" tail)
558 (length tail)))
559 rfc2047-encode-max-chars))
560 (setq prev next
561 index (1+ index))
562 (if (string-match "\\`)+" tail)
563 ;; Break the line after the close parenthesis.
564 (setq tail (concat (substring tail 0 (match-end 0))
565 "\n "
566 (substring tail (match-end 0)))
567 prev next
568 index (1+ index))
569 (setq next prev
570 prev nil)))))
571 (if (> index limit)
572 (concat eword next tail)
573 (if (= 0 index)
574 (if (and eword
575 (string-match "(+\\'" eword))
576 (setq crest (concat crest (match-string 0 eword))
577 eword (substring eword 0 (match-beginning 0)))
578 (setq eword (concat eword next)))
579 (setq crest " "
580 eword (concat eword next)))
581 (when (string-match "\n[ \t]+\\'" eword)
582 ;; Reomove a superfluous empty line.
583 (setq eword (substring eword 0 (match-beginning 0))))
584 (rfc2047-encode-1 (length crest) (substring string index)
585 cs encoder start " " tail
586 (concat eword "\n" crest)))))))
587
416(defun rfc2047-encode (b e) 588(defun rfc2047-encode (b e)
417 "Encode the word(s) in the region B to E. 589 "Encode the word(s) in the region B to E.
418By default, the region is treated as containing addresses (see 590Point moves to the end of the region."
419`rfc2047-encoding-type')." 591 (let ((mime-charset (or (mm-find-mime-charset-region b e) (list 'us-ascii)))
420 (let* ((mime-charset (mm-find-mime-charset-region b e)) 592 cs encoding tail crest eword)
421 (cs (if (> (length mime-charset) 1) 593 (cond ((> (length mime-charset) 1)
422 ;; Fixme: Instead of this, try to break region into 594 (error "Can't rfc2047-encode `%s'"
423 ;; parts that can be encoded separately. 595 (buffer-substring-no-properties b e)))
424 (error "Can't rfc2047-encode `%s'" 596 ((= (length mime-charset) 1)
425 (buffer-substring b e)) 597 (setq mime-charset (car mime-charset)
426 (setq mime-charset (car mime-charset)) 598 cs (mm-charset-to-coding-system mime-charset))
427 (mm-charset-to-coding-system mime-charset))) 599 (unless (and (mm-multibyte-p)
428 ;; Fixme: Better, calculate the number of non-ASCII 600 (mm-coding-system-p cs))
429 ;; characters, at least for 8-bit charsets. 601 (setq cs nil))
430 (encoding (or (cdr (assq mime-charset 602 (save-restriction
603 (narrow-to-region b e)
604 (setq encoding
605 (or (cdr (assq mime-charset
431 rfc2047-charset-encoding-alist)) 606 rfc2047-charset-encoding-alist))
432 ;; For the charsets that don't have a preferred 607 ;; For the charsets that don't have a preferred
433 ;; encoding, choose the one that's shorter. 608 ;; encoding, choose the one that's shorter.
434 (save-restriction 609 (if (eq (rfc2047-qp-or-base64) 'base64)
435 (narrow-to-region b e) 610 'B
436 (if (eq (rfc2047-qp-or-base64) 'base64) 611 'Q)))
437 'B 612 (widen)
438 'Q)))) 613 (goto-char e)
439 (start (concat 614 (skip-chars-forward "^ \t\n")
440 "=?" (downcase (symbol-name mime-charset)) "?" 615 ;; `tail' may contain a close parenthesis.
441 (downcase (symbol-name encoding)) "?")) 616 (setq tail (buffer-substring-no-properties e (point)))
442 (factor (case mime-charset 617 (goto-char b)
443 ((iso-8859-5 iso-8859-7 iso-8859-8 koi8-r) 1) 618 (setq b (point-marker)
444 ((big5 gb2312 euc-kr) 2) 619 e (set-marker (make-marker) e))
445 (utf-8 4) 620 (rfc2047-fold-region (rfc2047-point-at-bol) b)
446 (t 8))) 621 (goto-char b)
447 (pre (- b (save-restriction 622 (skip-chars-backward "^ \t\n")
448 (widen) 623 (unless (= 0 (skip-chars-backward " \t"))
449 (rfc2047-point-at-bol)))) 624 ;; `crest' may contain whitespace and an open parenthesis.
450 ;; encoded-words must not be longer than 75 characters, 625 (setq crest (buffer-substring-no-properties (point) b)))
451 ;; including charset, encoding etc. This leaves us with 626 (setq eword (rfc2047-encode-1
452 ;; 75 - (length start) - 2 - 2 characters. The last 2 is for 627 (- b (rfc2047-point-at-bol))
453 ;; possible base64 padding. In the worst case (iso-2022-*) 628 (mm-replace-in-string
454 ;; each character expands to 8 bytes which is expanded by a 629 (buffer-substring-no-properties b e)
455 ;; factor of 4/3 by base64 encoding. 630 "\n\\([ \t]?\\)" "\\1")
456 (length (floor (- 75 (length start) 4) (* factor (/ 4.0 3.0)))) 631 cs
457 ;; Limit line length to 76 characters. 632 (or (cdr (assq encoding
458 (length1 (max 1 (floor (- 76 (length start) 4 pre) 633 rfc2047-encode-function-alist))
459 (* factor (/ 4.0 3.0))))) 634 'identity)
460 (first t)) 635 (concat "=?" (downcase (symbol-name mime-charset))
461 (if mime-charset 636 "?" (upcase (symbol-name encoding)) "?")
462 (save-restriction 637 (or crest " ")
463 (narrow-to-region b e) 638 tail))
464 (when (eq encoding 'B) 639 (delete-region (if (eq (aref eword 0) ?\n)
465 ;; break into lines before encoding 640 (if (bolp)
466 (goto-char (point-min)) 641 ;; The line was folded before encoding.
467 (while (not (eobp)) 642 (1- (point))
468 (if first 643 (point))
469 (progn 644 (goto-char b))
470 (goto-char (min (point-max) (+ length1 (point)))) 645 (+ e (length tail)))
471 (setq first nil)) 646 ;; `eword' contains `crest' and `tail'.
472 (goto-char (min (point-max) (+ length (point))))) 647 (insert eword)
473 (unless (eobp) 648 (set-marker b nil)
474 (insert ?\n))) 649 (set-marker e nil)
475 (setq first t)) 650 (unless (or (/= 0 (length tail))
476 (if (and (mm-multibyte-p) 651 (eobp)
477 (mm-coding-system-p cs)) 652 (looking-at "[ \t\n)]"))
478 (mm-encode-coding-region (point-min) (point-max) cs)) 653 (insert " "))))
479 (funcall (cdr (assq encoding rfc2047-encoding-function-alist)) 654 (t
480 (point-min) (point-max)) 655 (goto-char e)))))
481 (goto-char (point-min))
482 (while (not (eobp))
483 (unless first
484 (insert ? ))
485 (setq first nil)
486 (insert start)
487 (end-of-line)
488 (insert "?=")
489 (forward-line 1))))))
490 656
491(defun rfc2047-fold-field () 657(defun rfc2047-fold-field ()
492 "Fold the current header field." 658 "Fold the current header field."
@@ -512,6 +678,7 @@ By default, the region is treated as containing addresses (see
512 (goto-char (or break qword-break)) 678 (goto-char (or break qword-break))
513 (setq break nil 679 (setq break nil
514 qword-break nil) 680 qword-break nil)
681 (skip-chars-backward " \t")
515 (if (looking-at "[ \t]") 682 (if (looking-at "[ \t]")
516 (insert ?\n) 683 (insert ?\n)
517 (insert "\n ")) 684 (insert "\n "))
@@ -533,10 +700,8 @@ By default, the region is treated as containing addresses (see
533 (forward-char 1)) 700 (forward-char 1))
534 ((memq (char-after) '(? ?\t)) 701 ((memq (char-after) '(? ?\t))
535 (skip-chars-forward " \t") 702 (skip-chars-forward " \t")
536 (if first 703 (unless first ;; Don't break just after the header name.
537 ;; Don't break just after the header name. 704 (setq break (point))))
538 (setq first nil)
539 (setq break (1- (point)))))
540 ((not break) 705 ((not break)
541 (if (not (looking-at "=\\?[^=]")) 706 (if (not (looking-at "=\\?[^=]"))
542 (if (eq (char-after) ?=) 707 (if (eq (char-after) ?=)
@@ -547,15 +712,17 @@ By default, the region is treated as containing addresses (see
547 (setq qword-break (point))) 712 (setq qword-break (point)))
548 (skip-chars-forward "^ \t\n\r"))) 713 (skip-chars-forward "^ \t\n\r")))
549 (t 714 (t
550 (skip-chars-forward "^ \t\n\r")))) 715 (skip-chars-forward "^ \t\n\r")))
716 (setq first nil))
551 (when (and (or break qword-break) 717 (when (and (or break qword-break)
552 (> (- (point) bol) 76)) 718 (> (- (point) bol) 76))
553 (goto-char (or break qword-break)) 719 (goto-char (or break qword-break))
554 (setq break nil 720 (setq break nil
555 qword-break nil) 721 qword-break nil)
556 (if (looking-at "[ \t]") 722 (if (or (> 0 (skip-chars-backward " \t"))
557 (insert ?\n) 723 (looking-at "[ \t]"))
558 (insert "\n ")) 724 (insert ?\n)
725 (insert "\n "))
559 (setq bol (1- (point))) 726 (setq bol (1- (point)))
560 ;; Don't break before the first non-LWSP characters. 727 ;; Don't break before the first non-LWSP characters.
561 (skip-chars-forward " \t") 728 (skip-chars-forward " \t")
@@ -590,48 +757,48 @@ By default, the region is treated as containing addresses (see
590 (setq eol (rfc2047-point-at-eol)) 757 (setq eol (rfc2047-point-at-eol))
591 (forward-line 1))))) 758 (forward-line 1)))))
592 759
593(defun rfc2047-b-encode-region (b e) 760(defun rfc2047-b-encode-string (string)
594 "Base64-encode the header contained in region B to E." 761 "Base64-encode the header contained in STRING."
595 (save-restriction 762 (base64-encode-string string t))
596 (narrow-to-region (goto-char b) e) 763
597 (while (not (eobp)) 764(defun rfc2047-q-encode-string (string)
598 (base64-encode-region (point) (progn (end-of-line) (point)) t) 765 "Quoted-printable-encode the header in STRING."
599 (if (and (bolp) (eolp)) 766 (mm-with-unibyte-buffer
600 (delete-backward-char 1)) 767 (insert string)
601 (forward-line)))) 768 (quoted-printable-encode-region
602 769 (point-min) (point-max) nil
603(defun rfc2047-q-encode-region (b e) 770 ;; = (\075), _ (\137), ? (\077) are used in the encoded word.
604 "Quoted-printable-encode the header in region B to E." 771 ;; Avoid using 8bit characters.
605 (save-excursion 772 ;; This list excludes `especials' (see the RFC2047 syntax),
606 (save-restriction 773 ;; meaning that some characters in non-structured fields will
607 (narrow-to-region (goto-char b) e) 774 ;; get encoded when they con't need to be. The following is
608 (let ((bol (save-restriction 775 ;; what it used to be.
609 (widen) 776 ;;; ;; Equivalent to "^\000-\007\011\013\015-\037\200-\377=_?"
610 (rfc2047-point-at-bol)))) 777 ;;; "\010\012\014\040-\074\076\100-\136\140-\177")
611 (quoted-printable-encode-region 778 "-\b\n\f !#-'*+0-9A-Z\\^`-~\d")
612 b e nil 779 (subst-char-in-region (point-min) (point-max) ? ?_)
613 ;; = (\075), _ (\137), ? (\077) are used in the encoded word. 780 (buffer-string)))
614 ;; Avoid using 8bit characters. 781
615 ;; This list excludes `especials' (see the RFC2047 syntax), 782(defun rfc2047-encode-parameter (param value)
616 ;; meaning that some characters in non-structured fields will 783 "Return and PARAM=VALUE string encoded in the RFC2047-like style.
617 ;; get encoded when they con't need to be. The following is 784This is a replacement for the `rfc2231-encode-string' function.
618 ;; what it used to be. 785
619;;; ;; Equivalent to "^\000-\007\011\013\015-\037\200-\377=_?" 786When attaching files as MIME parts, we should use the RFC2231 encoding
620;;; "\010\012\014\040-\074\076\100-\136\140-\177") 787to specify the file names containing non-ASCII characters. However,
621 "-\b\n\f !#-'*+0-9A-Z\\^`-~\d") 788many mail softwares don't support it in practice and recipients won't
622 (subst-char-in-region (point-min) (point-max) ? ?_) 789be able to extract files with correct names. Instead, the RFC2047-like
623 ;; The size of QP encapsulation is about 20, so set limit to 790encoding is acceptable generally. This function provides the very
624 ;; 56=76-20. 791RFC2047-like encoding, resigning to such a regrettable trend. To use
625 (unless (< (- (point-max) (point-min)) 56) 792it, put the following line in your ~/.gnus.el file:
626 ;; Don't break if it could fit in one line. 793
627 ;; Let rfc2047-encode-region break it later. 794\(defalias 'mail-header-encode-parameter 'rfc2047-encode-parameter)
628 (goto-char (1+ (point-min))) 795"
629 (while (and (not (bobp)) (not (eobp))) 796 (let* ((rfc2047-encoding-type 'mime)
630 (goto-char (min (point-max) (+ 56 bol))) 797 (rfc2047-encode-max-chars nil)
631 (search-backward "=" (- (point) 2) t) 798 (string (rfc2047-encode-string value)))
632 (unless (or (bobp) (eobp)) 799 (if (string-match (concat "[" ietf-drums-tspecials "]") string)
633 (insert ?\n) 800 (format "%s=%S" param string)
634 (setq bol (point))))))))) 801 (concat param "=" string))))
635 802
636;;; 803;;;
637;;; Functions for decoding RFC2047 messages 804;;; Functions for decoding RFC2047 messages
@@ -639,8 +806,8 @@ By default, the region is treated as containing addresses (see
639 806
640(eval-and-compile 807(eval-and-compile
641 (defconst rfc2047-encoded-word-regexp 808 (defconst rfc2047-encoded-word-regexp
642 "=\\?\\([^][\000-\040()<>@,\;:\\\"/?.=]+\\)\\?\\(B\\|Q\\)\ 809 "=\\?\\([^][\000-\040()<>@,\;:*\\\"/?.=]+\\)\\(\\*[^?]+\\)?\
643\\?\\([!->@-~ +]*\\)\\?=")) 810\\?\\(B\\|Q\\)\\?\\([!->@-~ ]*\\)\\?="))
644 811
645(defvar rfc2047-quote-decoded-words-containing-tspecials nil 812(defvar rfc2047-quote-decoded-words-containing-tspecials nil
646 "If non-nil, quote decoded words containing special characters.") 813 "If non-nil, quote decoded words containing special characters.")
@@ -671,7 +838,7 @@ By default, the region is treated as containing addresses (see
671 "\\(\n?[ \t]\\)+" 838 "\\(\n?[ \t]\\)+"
672 "\\(" rfc2047-encoded-word-regexp "\\)")) 839 "\\(" rfc2047-encoded-word-regexp "\\)"))
673 nil t) 840 nil t)
674 (delete-region (goto-char (match-end 1)) (match-beginning 6))) 841 (delete-region (goto-char (match-end 1)) (match-beginning 7)))
675 ;; Decode the encoded words. 842 ;; Decode the encoded words.
676 (setq b (goto-char (point-min))) 843 (setq b (goto-char (point-min)))
677 (while (re-search-forward rfc2047-encoded-word-regexp nil t) 844 (while (re-search-forward rfc2047-encoded-word-regexp nil t)
@@ -774,7 +941,20 @@ By default, the region is treated as containing addresses (see
774 mail-parse-charset 941 mail-parse-charset
775 (not (eq mail-parse-charset 'us-ascii)) 942 (not (eq mail-parse-charset 'us-ascii))
776 (not (eq mail-parse-charset 'gnus-decoded))) 943 (not (eq mail-parse-charset 'gnus-decoded)))
777 (mm-decode-coding-string string mail-parse-charset) 944 ;; `decode-coding-string' in Emacs offers a third optional
945 ;; arg NOCOPY to avoid consing a new string if the decoding
946 ;; is "trivial". Unfortunately it currently doesn't
947 ;; consider anything else than a `nil' coding system
948 ;; trivial.
949 ;; `rfc2047-decode-string' is called multiple times for each
950 ;; article during summary buffer generation, and we really
951 ;; want to avoid unnecessary consing. So we bypass
952 ;; `decode-coding-string' if the string is purely ASCII.
953 (if (and (fboundp 'detect-coding-string)
954 ;; string is purely ASCII
955 (eq (detect-coding-string string t) 'undecided))
956 string
957 (mm-decode-coding-string string mail-parse-charset))
778 (mm-string-as-multibyte string))))) 958 (mm-string-as-multibyte string)))))
779 959
780(defun rfc2047-parse-and-decode (word) 960(defun rfc2047-parse-and-decode (word)
@@ -787,8 +967,8 @@ decodable."
787 (condition-case nil 967 (condition-case nil
788 (rfc2047-decode 968 (rfc2047-decode
789 (match-string 1 word) 969 (match-string 1 word)
790 (upcase (match-string 2 word)) 970 (string-to-char (match-string 3 word))
791 (match-string 3 word)) 971 (match-string 4 word))
792 (error word)) 972 (error word))
793 word))) ; un-decodable 973 word))) ; un-decodable
794 974
@@ -809,7 +989,7 @@ decodable."
809 989
810(defun rfc2047-decode (charset encoding string) 990(defun rfc2047-decode (charset encoding string)
811 "Decode STRING from the given MIME CHARSET in the given ENCODING. 991 "Decode STRING from the given MIME CHARSET in the given ENCODING.
812Valid ENCODINGs are \"B\" and \"Q\". 992Valid ENCODINGs are the characters \"B\" and \"Q\".
813If your Emacs implementation can't decode CHARSET, return nil." 993If your Emacs implementation can't decode CHARSET, return nil."
814 (if (stringp charset) 994 (if (stringp charset)
815 (setq charset (intern (downcase charset)))) 995 (setq charset (intern (downcase charset))))
@@ -824,18 +1004,17 @@ If your Emacs implementation can't decode CHARSET, return nil."
824 (memq 'gnus-unknown mail-parse-ignored-charsets)) 1004 (memq 'gnus-unknown mail-parse-ignored-charsets))
825 (setq cs (mm-charset-to-coding-system mail-parse-charset))) 1005 (setq cs (mm-charset-to-coding-system mail-parse-charset)))
826 (when cs 1006 (when cs
827 (when (and (eq cs 'ascii) 1007 (when (eq cs 'ascii)
828 mail-parse-charset) 1008 (setq cs (or mail-parse-charset 'raw-text)))
829 (setq cs mail-parse-charset))
830 (mm-decode-coding-string 1009 (mm-decode-coding-string
831 (cond 1010 (cond
832 ((equal "B" encoding) 1011 ((char-equal ?B encoding)
833 (base64-decode-string 1012 (base64-decode-string
834 (rfc2047-pad-base64 string))) 1013 (rfc2047-pad-base64 string)))
835 ((equal "Q" encoding) 1014 ((char-equal ?Q encoding)
836 (quoted-printable-decode-string 1015 (quoted-printable-decode-string
837 (mm-replace-chars-in-string string ?_ ? ))) 1016 (mm-subst-char-in-string ?_ ? string t)))
838 (t (error "Invalid encoding: %s" encoding))) 1017 (t (error "Invalid encoding: %c" encoding)))
839 cs)))) 1018 cs))))
840 1019
841(provide 'rfc2047) 1020(provide 'rfc2047)
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 81c7296760f..431087087f1 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -1,6 +1,6 @@
1;;; hi-lock.el --- minor mode for interactive automatic highlighting 1;;; hi-lock.el --- minor mode for interactive automatic highlighting
2 2
3;; Copyright (C) 2000, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 2000, 2001, 2005 Free Software Foundation, Inc.
4 4
5;; Author: David M. Koppelman, koppel@ee.lsu.edu 5;; Author: David M. Koppelman, koppel@ee.lsu.edu
6;; Keywords: faces, minor-mode, matching, display 6;; Keywords: faces, minor-mode, matching, display
@@ -292,7 +292,7 @@ is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'."
292 (> (prefix-numeric-value arg) 0))) 292 (> (prefix-numeric-value arg) 0)))
293 ;; Turned on. 293 ;; Turned on.
294 (when (and (not hi-lock-mode-prev) hi-lock-mode) 294 (when (and (not hi-lock-mode-prev) hi-lock-mode)
295 (add-hook 'find-file-hooks 'hi-lock-find-file-hook) 295 (add-hook 'find-file-hook 'hi-lock-find-file-hook)
296 (add-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook) 296 (add-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook)
297 (when (eq nil font-lock-defaults) 297 (when (eq nil font-lock-defaults)
298 (setq font-lock-defaults '(nil))) 298 (setq font-lock-defaults '(nil)))
@@ -313,7 +313,7 @@ is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'."
313 hi-lock-file-patterns nil) 313 hi-lock-file-patterns nil)
314 (when font-lock-mode (hi-lock-refontify))))) 314 (when font-lock-mode (hi-lock-refontify)))))
315 (define-key-after menu-bar-edit-menu [hi-lock] nil) 315 (define-key-after menu-bar-edit-menu [hi-lock] nil)
316 (remove-hook 'find-file-hooks 'hi-lock-find-file-hook) 316 (remove-hook 'find-file-hook 'hi-lock-find-file-hook)
317 (remove-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook)))) 317 (remove-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook))))
318 318
319 319
@@ -568,5 +568,5 @@ Optional argument END is maximum excursion."
568 568
569(provide 'hi-lock) 569(provide 'hi-lock)
570 570
571;;; arch-tag: d2e8fd07-4cc9-4c6f-a200-1e729bc54066 571;; arch-tag: d2e8fd07-4cc9-4c6f-a200-1e729bc54066
572;;; hi-lock.el ends here 572;;; hi-lock.el ends here
diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el
index f670079e7d7..8e84bbf68e2 100644
--- a/lisp/hilit-chg.el
+++ b/lisp/hilit-chg.el
@@ -993,12 +993,12 @@ changes are made, so \\[highlight-changes-next-change] and
993 993
994;; Global Highlight Changes mode is modeled after Global Font-lock mode. 994;; Global Highlight Changes mode is modeled after Global Font-lock mode.
995;; Three hooks are used to gain control. When Global Changes Mode is 995;; Three hooks are used to gain control. When Global Changes Mode is
996;; enabled, `find-file-hooks' and `change-major-mode-hook' are set. 996;; enabled, `find-file-hook' and `change-major-mode-hook' are set.
997;; `find-file-hooks' is called when visiting a file, the new mode is 997;; `find-file-hook' is called when visiting a file, the new mode is
998;; known at this time. 998;; known at this time.
999;; `change-major-mode-hook' is called when a buffer is changing mode. 999;; `change-major-mode-hook' is called when a buffer is changing mode.
1000;; This could be because of finding a file in which case 1000;; This could be because of finding a file in which case
1001;; `find-file-hooks' has already been called and has done its work. 1001;; `find-file-hook' has already been called and has done its work.
1002;; However, it also catches the case where a new mode is being set by 1002;; However, it also catches the case where a new mode is being set by
1003;; the user. However, it is called from `kill-all-variables' and at 1003;; the user. However, it is called from `kill-all-variables' and at
1004;; this time the mode is the old mode, which is not what we want. 1004;; this time the mode is the old mode, which is not what we want.
@@ -1080,18 +1080,18 @@ variable `highlight-changes-global-changes-existing-buffers' is non-nil).
1080 (setq global-highlight-changes t) 1080 (setq global-highlight-changes t)
1081 (message "Turning ON Global Highlight Changes mode in %s state" 1081 (message "Turning ON Global Highlight Changes mode in %s state"
1082 highlight-changes-global-initial-state) 1082 highlight-changes-global-initial-state)
1083 (add-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook) 1083 ;; FIXME: Not sure what this was intended to do. --Stef
1084 (add-hook 'find-file-hooks 'hilit-chg-check-global) 1084 ;; (add-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
1085 (add-hook 'find-file-hook 'hilit-chg-check-global)
1085 (if highlight-changes-global-changes-existing-buffers 1086 (if highlight-changes-global-changes-existing-buffers
1086 (hilit-chg-update-all-buffers 1087 (hilit-chg-update-all-buffers
1087 highlight-changes-global-initial-state))) 1088 highlight-changes-global-initial-state)))
1088 1089
1089 (message "Turning OFF global Highlight Changes mode") 1090 (message "Turning OFF global Highlight Changes mode")
1090 (remove-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook) 1091 ;; FIXME: Not sure what this was intended to do. --Stef
1091 (remove-hook 'find-file-hooks 'hilit-chg-check-global) 1092 ;; (remove-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
1092 (remove-hook 'post-command-hook 1093 (remove-hook 'post-command-hook 'hilit-chg-post-command-hook)
1093 'hilit-chg-post-command-hook) 1094 (remove-hook 'find-file-hook 'hilit-chg-check-global)
1094 (remove-hook 'find-file-hooks 'hilit-chg-check-global)
1095 (if highlight-changes-global-changes-existing-buffers 1095 (if highlight-changes-global-changes-existing-buffers
1096 (hilit-chg-update-all-buffers nil)))) 1096 (hilit-chg-update-all-buffers nil))))
1097 1097
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 0d2b221ee8b..b29027fcf42 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -36,18 +36,12 @@
36 36
37(require 'image) 37(require 'image)
38 38
39;;;###autoload (push '("\\.jpg\\'" . image-mode) auto-mode-alist) 39;;;###autoload (push '("\\.jpe?g\\'" . image-mode) auto-mode-alist)
40;;;###autoload (push '("\\.jpeg\\'" . image-mode) auto-mode-alist) 40;;;###autoload (push '("\\.png\\'" . image-mode) auto-mode-alist)
41;;;###autoload (push '("\\.gif\\'" . image-mode) auto-mode-alist) 41;;;###autoload (push '("\\.gif\\'" . image-mode) auto-mode-alist)
42;;;###autoload (push '("\\.png\\'" . image-mode) auto-mode-alist) 42;;;###autoload (push '("\\.tiff?\\'" . image-mode) auto-mode-alist)
43;;;###autoload (push '("\\.tiff\\'" . image-mode) auto-mode-alist) 43;;;###autoload (push '("\\.p[bpgn]m\\'" . image-mode) auto-mode-alist)
44;;;###autoload (push '("\\.tif\\'" . image-mode) auto-mode-alist) 44;;;###autoload (push '("\\.x[bp]m\\'" . image-mode-maybe) auto-mode-alist)
45;;;###autoload (push '("\\.xbm\\'" . image-mode) auto-mode-alist)
46;;;###autoload (push '("\\.xpm\\'" . image-mode) auto-mode-alist)
47;;;###autoload (push '("\\.pbm\\'" . image-mode) auto-mode-alist)
48;;;###autoload (push '("\\.pgm\\'" . image-mode) auto-mode-alist)
49;;;###autoload (push '("\\.ppm\\'" . image-mode) auto-mode-alist)
50;;;###autoload (push '("\\.pnm\\'" . image-mode) auto-mode-alist)
51 45
52(defvar image-mode-map 46(defvar image-mode-map
53 (let ((map (make-sparse-keymap))) 47 (let ((map (make-sparse-keymap)))
@@ -65,9 +59,64 @@ to toggle between display as an image and display as text."
65 (setq mode-name "Image") 59 (setq mode-name "Image")
66 (setq major-mode 'image-mode) 60 (setq major-mode 'image-mode)
67 (use-local-map image-mode-map) 61 (use-local-map image-mode-map)
62 (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t)
63 (if (not (get-text-property (point-min) 'display))
64 (image-toggle-display)
65 ;; Set next vars when image is already displayed but local
66 ;; variables were cleared by kill-all-local-variables
67 (setq cursor-type nil truncate-lines t))
68 (run-mode-hooks 'image-mode-hook) 68 (run-mode-hooks 'image-mode-hook)
69 (message (substitute-command-keys 69 (message (concat (substitute-command-keys
70 "Type \\[image-toggle-display] to view the image as an image."))) 70 "Type \\[image-toggle-display] to view the image as ")
71 (if (get-text-property (point-min) 'display)
72 "text" "an image") ".")))
73
74;;;###autoload
75(define-minor-mode image-minor-mode
76 "Toggle Image minor mode.
77With arg, turn Image minor mode on if arg is positive, off otherwise.
78See the command `image-mode' for more information on this mode."
79 nil " Image" image-mode-map
80 :group 'image
81 :version "22.1"
82 (if (not image-minor-mode)
83 (image-toggle-display-text)
84 (if (get-text-property (point-min) 'display)
85 (setq cursor-type nil truncate-lines t))
86 (add-hook 'change-major-mode-hook (lambda () (image-minor-mode -1)) nil t)
87 (message (concat (substitute-command-keys
88 "Type \\[image-toggle-display] to view the image as ")
89 (if (get-text-property (point-min) 'display)
90 "text" "an image") "."))))
91
92;;;###autoload
93(defun image-mode-maybe ()
94 "Set major or minor mode for image files.
95Set Image major mode only when there are no other major modes
96associated with a filename in `auto-mode-alist'. When an image
97filename matches another major mode in `auto-mode-alist' then
98set that major mode and Image minor mode.
99
100See commands `image-mode' and `image-minor-mode' for more
101information on these modes."
102 (interactive)
103 (let* ((mode-alist
104 (delq nil (mapcar
105 (lambda (elt)
106 (unless (memq (or (car-safe (cdr elt)) (cdr elt))
107 '(image-mode image-mode-maybe))
108 elt))
109 auto-mode-alist))))
110 (if (assoc-default buffer-file-name mode-alist 'string-match)
111 (let ((auto-mode-alist mode-alist))
112 (set-auto-mode)
113 (image-minor-mode t))
114 (image-mode))))
115
116(defun image-toggle-display-text ()
117 "Showing the text of the image file."
118 (if (get-text-property (point-min) 'display)
119 (image-toggle-display)))
71 120
72(defun image-toggle-display () 121(defun image-toggle-display ()
73 "Start or stop displaying an image file as the actual image. 122 "Start or stop displaying an image file as the actual image.
@@ -84,7 +133,8 @@ and showing the image as an image."
84 (set-buffer-modified-p modified) 133 (set-buffer-modified-p modified)
85 (kill-local-variable 'cursor-type) 134 (kill-local-variable 'cursor-type)
86 (kill-local-variable 'truncate-lines) 135 (kill-local-variable 'truncate-lines)
87 (message "Repeat this command to go back to displaying the image")) 136 (if (called-interactively-p)
137 (message "Repeat this command to go back to displaying the image")))
88 ;; Turn the image data into a real image, but only if the whole file 138 ;; Turn the image data into a real image, but only if the whole file
89 ;; was inserted 139 ;; was inserted
90 (let* ((data 140 (let* ((data
@@ -100,6 +150,7 @@ and showing the image as an image."
100 ;; read-only when we're visiting the file (as 150 ;; read-only when we're visiting the file (as
101 ;; opposed to just inserting it). 151 ;; opposed to just inserting it).
102 read-only t front-sticky (read-only))) 152 read-only t front-sticky (read-only)))
153 (inhibit-read-only t)
103 (buffer-undo-list t) 154 (buffer-undo-list t)
104 (modified (buffer-modified-p))) 155 (modified (buffer-modified-p)))
105 (add-text-properties (point-min) (point-max) props) 156 (add-text-properties (point-min) (point-max) props)
@@ -110,7 +161,8 @@ and showing the image as an image."
110 ;; This just makes the arrow displayed in the right fringe 161 ;; This just makes the arrow displayed in the right fringe
111 ;; area look correct when the image is wider than the window. 162 ;; area look correct when the image is wider than the window.
112 (setq truncate-lines t) 163 (setq truncate-lines t)
113 (message "Repeat this command to go back to displaying the file as text")))) 164 (if (called-interactively-p)
165 (message "Repeat this command to go back to displaying the file as text")))))
114 166
115(provide 'image-mode) 167(provide 'image-mode)
116 168
diff --git a/lisp/info.el b/lisp/info.el
index 870e1ad89f6..cefe603a400 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -3026,12 +3026,12 @@ if point is in a menu item description, follow that menu item."
3026 :help "Go to menu of visited nodes"] 3026 :help "Go to menu of visited nodes"]
3027 ["Table of Contents" Info-toc 3027 ["Table of Contents" Info-toc
3028 :help "Go to table of contents"] 3028 :help "Go to table of contents"]
3029 ("Index..." 3029 ("Index"
3030 ["Lookup a String" Info-index 3030 ["Lookup a String..." Info-index
3031 :help "Look for a string in the index items"] 3031 :help "Look for a string in the index items"]
3032 ["Next Matching Item" Info-index-next 3032 ["Next Matching Item" Info-index-next :active Info-index-alternatives
3033 :help "Look for another occurrence of previous item"] 3033 :help "Look for another occurrence of previous item"]
3034 ["Lookup a string in all indices" info-apropos 3034 ["Lookup a string in all indices..." info-apropos
3035 :help "Look for a string in the indices of all manuals"]) 3035 :help "Look for a string in the indices of all manuals"])
3036 ["Edit" Info-edit :help "Edit contents of this node" 3036 ["Edit" Info-edit :help "Edit contents of this node"
3037 :active Info-enable-edit] 3037 :active Info-enable-edit]
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index f08305de180..8fc75054660 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -1681,7 +1681,7 @@ The default status is as follows:
1681 1681
1682(reset-language-environment) 1682(reset-language-environment)
1683 1683
1684(defun set-display-table-and-terminal-coding-system (language-name) 1684(defun set-display-table-and-terminal-coding-system (language-name &optional coding-system)
1685 "Set up the display table and terminal coding system for LANGUAGE-NAME." 1685 "Set up the display table and terminal coding system for LANGUAGE-NAME."
1686 (let ((coding (get-language-info language-name 'unibyte-display))) 1686 (let ((coding (get-language-info language-name 'unibyte-display)))
1687 (if coding 1687 (if coding
@@ -1695,7 +1695,7 @@ The default status is as follows:
1695 (dotimes (i 128) 1695 (dotimes (i 128)
1696 (aset standard-display-table (+ i 128) nil)))) 1696 (aset standard-display-table (+ i 128) nil))))
1697 (or (eq window-system 'pc) 1697 (or (eq window-system 'pc)
1698 (set-terminal-coding-system coding)))) 1698 (set-terminal-coding-system (or coding-system coding)))))
1699 1699
1700(defun set-language-environment (language-name) 1700(defun set-language-environment (language-name)
1701 "Set up multi-lingual environment for using LANGUAGE-NAME. 1701 "Set up multi-lingual environment for using LANGUAGE-NAME.
@@ -2415,7 +2415,8 @@ See also `locale-charset-language-names', `locale-language-names',
2415 ;; we are using single-byte characters, 2415 ;; we are using single-byte characters,
2416 ;; so the display table and terminal coding system are irrelevant. 2416 ;; so the display table and terminal coding system are irrelevant.
2417 (when default-enable-multibyte-characters 2417 (when default-enable-multibyte-characters
2418 (set-display-table-and-terminal-coding-system language-name)) 2418 (set-display-table-and-terminal-coding-system
2419 language-name coding-system))
2419 2420
2420 ;; Set the `keyboard-coding-system' if appropriate (tty 2421 ;; Set the `keyboard-coding-system' if appropriate (tty
2421 ;; only). At least X and MS Windows can generate 2422 ;; only). At least X and MS Windows can generate
@@ -2458,9 +2459,16 @@ system codeset `%s' for this locale." coding-system codeset))))))))
2458 (set-keyboard-coding-system code-page-coding) 2459 (set-keyboard-coding-system code-page-coding)
2459 (set-terminal-coding-system code-page-coding)))) 2460 (set-terminal-coding-system code-page-coding))))
2460 2461
2461 ;; On Darwin, file names are always encoded in utf-8, no matter the locale.
2462 (when (eq system-type 'darwin) 2462 (when (eq system-type 'darwin)
2463 (setq default-file-name-coding-system 'utf-8)) 2463 ;; On Darwin, file names are always encoded in utf-8, no matter
2464 ;; the locale.
2465 (setq default-file-name-coding-system 'utf-8)
2466 ;; Mac OS X's Terminal.app by default uses utf-8 regardless of
2467 ;; the locale.
2468 (when (and (null window-system)
2469 (equal (getenv "TERM_PROGRAM") "Apple_Terminal"))
2470 (set-terminal-coding-system 'utf-8)
2471 (set-keyboard-coding-system 'utf-8)))
2464 2472
2465 ;; Default to A4 paper if we're not in a C, POSIX or US locale. 2473 ;; Default to A4 paper if we're not in a C, POSIX or US locale.
2466 ;; (See comments in Flocale_info.) 2474 ;; (See comments in Flocale_info.)
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 08be907357a..8d5ca33881a 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -1508,10 +1508,11 @@ text, and convert it in the temporary buffer. Otherwise, convert in-place."
1508;;; FILE I/O 1508;;; FILE I/O
1509 1509
1510(defcustom auto-coding-alist 1510(defcustom auto-coding-alist
1511 '(("\\.\\(arc\\|zip\\|lzh\\|zoo\\|[jew]ar\\)\\'" . no-conversion) 1511 '(("\\.\\(arc\\|zip\\|lzh\\|zoo\\|[jew]ar\\|xpi\\)\\'" . no-conversion)
1512 ("\\.\\(ARC\\|ZIP\\|LZH\\|ZOO\\|[JEW]AR\\)\\'" . no-conversion) 1512 ("\\.\\(ARC\\|ZIP\\|LZH\\|ZOO\\|[JEW]AR\\|XPI\\)\\'" . no-conversion)
1513 ("\\.\\(sx[dmicw]\\|tar\\|tgz\\)\\'" . no-conversion) 1513 ("\\.\\(sx[dmicw]\\|tar\\|tgz\\)\\'" . no-conversion)
1514 ("\\.\\(gz\\|Z\\|bz\\|bz2\\|gpg\\)\\'" . no-conversion) 1514 ("\\.\\(gz\\|Z\\|bz\\|bz2\\|gpg\\)\\'" . no-conversion)
1515 ("\\.\\(jpe?g\\|png\\|gif\\|tiff?\\|p[bpgn]m\\)\\'" . no-conversion)
1515 ("/#[^/]+#\\'" . emacs-mule)) 1516 ("/#[^/]+#\\'" . emacs-mule))
1516 "Alist of filename patterns vs corresponding coding systems. 1517 "Alist of filename patterns vs corresponding coding systems.
1517Each element looks like (REGEXP . CODING-SYSTEM). 1518Each element looks like (REGEXP . CODING-SYSTEM).
diff --git a/lisp/kmacro.el b/lisp/kmacro.el
index c6a97bb3d34..20816fc7fea 100644
--- a/lisp/kmacro.el
+++ b/lisp/kmacro.el
@@ -614,10 +614,13 @@ With numeric arg, repeat macro now that many times,
614counting the definition just completed as the first repetition. 614counting the definition just completed as the first repetition.
615An argument of zero means repeat until error." 615An argument of zero means repeat until error."
616 (interactive "P") 616 (interactive "P")
617 (end-kbd-macro arg #'kmacro-loop-setup-function) 617 ;; Isearch may push the kmacro-end-macro key sequence onto the macro.
618 (when (and last-kbd-macro (= (length last-kbd-macro) 0)) 618 ;; Just ignore it when executing the macro.
619 (message "Ignore empty macro") 619 (unless executing-kbd-macro
620 (kmacro-pop-ring))) 620 (end-kbd-macro arg #'kmacro-loop-setup-function)
621 (when (and last-kbd-macro (= (length last-kbd-macro) 0))
622 (message "Ignore empty macro")
623 (kmacro-pop-ring))))
621 624
622 625
623;;;###autoload 626;;;###autoload
diff --git a/lisp/language/thai-util.el b/lisp/language/thai-util.el
index 0957748799d..cbfc82c9dc8 100644
--- a/lisp/language/thai-util.el
+++ b/lisp/language/thai-util.el
@@ -1,10 +1,9 @@
1;;; thai-util.el --- utilities for Thai -*- coding: iso-2022-7bit; -*- 1;;; thai-util.el --- utilities for Thai -*- coding: iso-2022-7bit; -*-
2 2
3;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. 3;; Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2005
4;; Licensed to the Free Software Foundation.
5;; Copyright (C) 2003
6;; National Institute of Advanced Industrial Science and Technology (AIST) 4;; National Institute of Advanced Industrial Science and Technology (AIST)
7;; Registration Number H13PRO009 5;; Registration Number H13PRO009
6;; Copyright (C) 2000, 2001 Free Software Foundation, Inc.
8 7
9;; Keywords: mule, multilingual, Thai, i18n 8;; Keywords: mule, multilingual, Thai, i18n
10 9
@@ -253,6 +252,42 @@ positions (integers or markers) specifying the region."
253 (prog1 (match-end 0) 252 (prog1 (match-end 0)
254 (thai-compose-syllable pos (match-end 0))))))))) 253 (thai-compose-syllable pos (match-end 0)))))))))
255 254
255;; Thai-word-mode requires functions in the feature `thai-word'.
256(require 'thai-word)
257
258(defvar thai-word-mode-map
259 (let ((map (make-sparse-keymap)))
260 (define-key map [remap forward-word] 'thai-forward-word)
261 (define-key map [remap backward-word] 'thai-backward-word)
262 (define-key map [remap kill-word] 'thai-kill-word)
263 (define-key map [remap backward-kill-word] 'thai-backward-kill-word)
264 (define-key map [remap transpose-words] 'thai-transpose-words)
265 map)
266 "Keymap for `thai-word-mode'.")
267
268(define-minor-mode thai-word-mode
269 "Minor mode to make word-oriented commands aware of Thai words.
270The commands affected are \\[forward-word], \\[backward-word], \\[kill-word], \\[backward-kill-word], \\[transpose-words], and \\[fill-paragraph]."
271 :global t
272 (cond (thai-word-mode
273 ;; This enables linebreak between Thai characters.
274 (modify-category-entry (make-char 'thai-tis620) ?|)
275 ;; This enables linebreak at a Thai word boundary.
276 (put-charset-property 'thai-tis620 'fill-find-break-point-function
277 'thai-fill-find-break-point))
278 (t
279 (modify-category-entry (make-char 'thai-tis620) ?| nil t)
280 (put-charset-property 'thai-tis620 'fill-find-break-point-function
281 nil))))
282
283;; Function to call on entering the Thai language environment.
284(defun setup-thai-language-environment-internal ()
285 (thai-word-mode 1))
286
287;; Function to call on exiting the Thai language environment.
288(defun exit-thai-language-environment-internal ()
289 (thai-word-mode -1))
290
256;; 291;;
257(provide 'thai-util) 292(provide 'thai-util)
258 293
diff --git a/lisp/language/thai-word.el b/lisp/language/thai-word.el
index 82f6fcdea6a..9c3ba81859e 100644
--- a/lisp/language/thai-word.el
+++ b/lisp/language/thai-word.el
@@ -1,7 +1,8 @@
1;;; thai-word.el -- find Thai word boundaries 1;;; thai-word.el -- find Thai word boundaries
2 2
3;; Copyright (C) 2000, 2001, 2002, 2003, 2004 3;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
4;; Electrotechnical Laboratory, JAPAN. 4;; National Institute of Advanced Industrial Science and Technology (AIST)
5;; Registration Number H14PRO021
5 6
6;; Author: Kenichi HANDA <handa@etl.go.jp> 7;; Author: Kenichi HANDA <handa@etl.go.jp>
7 8
@@ -72,13 +73,10 @@
72;; which means that you can easily index the list character by 73;; which means that you can easily index the list character by
73;; character. 74;; character.
74 75
75(defconst thai-word-table nil) 76(defvar thai-word-table
76 77 (let ((table (list 'thai-words)))
77 78 (dolist (elt
78;; Set up `thai-word-table'. 79 ;;; The following is indented as this to minimize this file size.
79
80(let
81 ((l
82 '("¡¡" 80 '("¡¡"
83 "¡¡Å" 81 "¡¡Å"
84 "¡¡Ø¸Àѳ±ì" 82 "¡¡Ø¸Àѳ±ì"
@@ -10732,11 +10730,10 @@
10732 "äÎâ¡ÃÁÔàµÍÃì" 10730 "äÎâ¡ÃÁÔàµÍÃì"
10733 "äÎâ´Ã¤ÒÃìºÍ¹" 10731 "äÎâ´Ã¤ÒÃìºÍ¹"
10734 "äÎâÅ" 10732 "äÎâÅ"
10735 ))) 10733 ))
10736 (setq thai-word-table (list 'thai-words)) 10734 (set-nested-alist elt 1 table))
10737 (while l 10735 table)
10738 (set-nested-alist (car l) 1 thai-word-table) 10736 "Nested alist of Thai words.")
10739 (setq l (cdr l))))
10740 10737
10741 10738
10742(defun thai-update-word-table (file &optional append) 10739(defun thai-update-word-table (file &optional append)
@@ -11042,6 +11039,33 @@ If COUNT is negative, move point forward (- COUNT) words."
11042 (thai-forward-word (- count))) 11039 (thai-forward-word (- count)))
11043 11040
11044 11041
11042(defun thai-kill-word (arg)
11043 "Like kill-word but pay attention to Thai word boundaries.
11044With argument, do this that many times."
11045 (interactive "p")
11046 (kill-region (point) (progn (thai-forward-word arg) (point))))
11047
11048
11049(defun thai-backward-kill-word (arg)
11050 "Like backward-kill-word but pay attention to Thai word boundaries."
11051 (interactive "p")
11052 (thai-kill-word (- arg)))
11053
11054
11055(defun thai-transpose-words (arg)
11056 "Like transpose-words but pay attention to Thai word boundaries."
11057 (interactive "*p")
11058 (transpose-subr 'thai-forward-word arg))
11059
11060(defun thai-fill-find-break-point (linebeg)
11061 "Go to a line breaking position near point considering Thai word boundaries."
11062 (let ((pos (point)))
11063 (thai-forward-word -1)
11064 (when (<= (point) linebeg)
11065 (goto-char pos)
11066 (thai-forward-word 1))
11067 (kinsoku linebeg)))
11068
11045(provide 'thai-word) 11069(provide 'thai-word)
11046 11070
11047 11071
diff --git a/lisp/language/thai.el b/lisp/language/thai.el
index 604eaf6384e..f9cd655635a 100644
--- a/lisp/language/thai.el
+++ b/lisp/language/thai.el
@@ -1,14 +1,12 @@
1;;; thai.el --- support for Thai -*- coding: iso-2022-7bit; no-byte-compile: t -*- 1;;; thai.el --- support for Thai -*- coding: iso-2022-7bit; no-byte-compile: t -*-
2 2
3;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. 3;; Copyright (C) 1995, 1997, 1998, 1999, 2000, 2002, 2005
4;; Licensed to the Free Software Foundation.
5;; Copyright (C) 2002 Free Software Foundation, Inc.
6;; Copyright (C) 2003
7;; National Institute of Advanced Industrial Science and Technology (AIST) 4;; National Institute of Advanced Industrial Science and Technology (AIST)
8;; Registration Number H13PRO009 5;; Registration Number H13PRO009
9;; Copyright (C) 2005 6;; Copyright (C) 2005
10;; National Institute of Advanced Industrial Science and Technology (AIST) 7;; National Institute of Advanced Industrial Science and Technology (AIST)
11;; Registration Number H14PRO021 8;; Registration Number H14PRO021
9;; Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
12 10
13;; Keywords: multilingual, Thai, i18n 11;; Keywords: multilingual, Thai, i18n
14 12
@@ -54,6 +52,8 @@
54 (input-method . "thai-kesmanee") 52 (input-method . "thai-kesmanee")
55 (unibyte-display . thai-tis620) 53 (unibyte-display . thai-tis620)
56 (features thai-util) 54 (features thai-util)
55 (setup-function . setup-thai-language-environment-internal)
56 (exit-function . exit-thai-language-environment-internal)
57 (sample-text 57 (sample-text
58 . (thai-compose-string 58 . (thai-compose-string
59 (copy-sequence "Thai (,T@RIRd7B(B) ,TJGQJ4U$CQ:(B, ,TJGQJ4U$hP(B"))) 59 (copy-sequence "Thai (,T@RIRd7B(B) ,TJGQJ4U$CQ:(B, ,TJGQJ4U$hP(B")))
diff --git a/lisp/longlines.el b/lisp/longlines.el
new file mode 100644
index 00000000000..8491a0b7960
--- /dev/null
+++ b/lisp/longlines.el
@@ -0,0 +1,393 @@
1;;; longlines.el --- automatically wrap long lines
2
3;; Copyright (C) 2000, 2001, 2004, 2005 by Free Software Foundation, Inc.
4
5;; Authors: Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
6;; Alex Schroeder <alex@gnu.org>
7;; Chong Yidong <cyd@stupidchicken.com>
8;; Maintainer: Chong Yidong <cyd@stupidchicken.com>
9;; Keywords: convenience
10
11;; This file is part of GNU Emacs.
12
13;; GNU Emacs is free software; you can redistribute it and/or modify
14;; it under the terms of the GNU General Public License as published by
15;; the Free Software Foundation; either version 2, or (at your option)
16;; any later version.
17
18;; GNU Emacs is distributed in the hope that it will be useful,
19;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;; GNU General Public License for more details.
22
23;; You should have received a copy of the GNU General Public License
24;; along with GNU Emacs; see the file COPYING. If not, write to the
25;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26;; Boston, MA 02111-1307, USA.
27
28;;; Commentary:
29
30;; Some text editors save text files with long lines, and they
31;; automatically break these lines at whitespace, without actually
32;; inserting any newline characters. When doing `M-q' in Emacs, you
33;; are inserting newline characters. Longlines mode provides a file
34;; format which wraps the long lines when reading a file and unwraps
35;; the lines when saving the file. It can also wrap and unwrap
36;; automatically as editing takes place.
37
38;; Special thanks to Rod Smith for many useful bug reports.
39
40;;; Code:
41
42(require 'easy-mmode)
43
44(defgroup longlines nil
45 "Automatic wrapping of long lines when loading files."
46 :group 'fill)
47
48(defcustom longlines-auto-wrap t
49 "*Non-nil means long lines are automatically wrapped after each command.
50Otherwise, you can perform filling using `fill-paragraph' or
51`auto-fill-mode'. In any case, the soft newlines will be removed
52when the file is saved to disk."
53 :group 'longlines
54 :type 'boolean)
55
56(defcustom longlines-wrap-follows-window-size nil
57 "*Non-nil means wrapping and filling happen at the edge of the window.
58Otherwise, `fill-column' is used, regardless of the window size. This
59does not work well when the buffer is displayed in multiple windows
60with differing widths."
61 :group 'longlines
62 :type 'boolean)
63
64(defcustom longlines-show-hard-newlines nil
65 "*Non-nil means each hard newline is marked with a symbol.
66You can also enable the display temporarily, using the command
67`longlines-show-hard-newlines'"
68 :group 'longlines
69 :type 'boolean)
70
71(defcustom longlines-show-effect (propertize "|\n" 'face 'escape-glyph)
72 "*A string to display when showing hard newlines.
73This is used when `longlines-show-hard-newlines' is on."
74 :group 'longlines
75 :type 'string)
76
77;; Internal variables
78
79(defvar longlines-wrap-beg nil)
80(defvar longlines-wrap-end nil)
81(defvar longlines-wrap-point nil)
82(defvar longlines-showing nil)
83
84(make-variable-buffer-local 'longlines-wrap-beg)
85(make-variable-buffer-local 'longlines-wrap-end)
86(make-variable-buffer-local 'longlines-wrap-point)
87(make-variable-buffer-local 'longlines-showing)
88
89;; Mode
90
91;;;###autoload
92(define-minor-mode longlines-mode
93 "Toggle Long Lines mode.
94In Long Lines mode, long lines are wrapped if they extend beyond
95`fill-column'. The soft newlines used for line wrapping will not
96show up when the text is yanked or saved to disk.
97
98If `longlines-auto-wrap' is non-nil, lines are automatically
99wrapped whenever the buffer is changed. You can always call
100`fill-paragraph' to fill individual paragraphs.
101
102If `longlines-show-hard-newlines' is non-nil, hard newlines will
103be marked by a symbol."
104 nil " ll" nil
105 (if longlines-mode
106 ;; Turn on longlines mode
107 (progn
108 (use-hard-newlines 1 'never)
109 (set (make-local-variable 'require-final-newline) nil)
110 (add-to-list 'buffer-file-format 'longlines)
111 (add-hook 'change-major-mode-hook 'longlines-mode-off nil t)
112 (make-local-variable 'buffer-substring-filters)
113 (add-to-list 'buffer-substring-filters 'longlines-encode-string)
114 (when longlines-wrap-follows-window-size
115 (set (make-local-variable 'fill-column)
116 (- (window-width) window-min-width))
117 (add-hook 'window-configuration-change-hook
118 'longlines-window-change-function nil t))
119 (let ((buffer-undo-list t)
120 (mod (buffer-modified-p)))
121 ;; Turning off undo is OK since (spaces + newlines) is
122 ;; conserved, except for a corner case in
123 ;; longlines-wrap-lines that we'll never encounter from here
124 (longlines-decode-region (point-min) (point-max))
125 (longlines-wrap-region (point-min) (point-max))
126 (set-buffer-modified-p mod))
127 (when (and longlines-show-hard-newlines
128 (not longlines-showing))
129 (longlines-show-hard-newlines))
130 (when longlines-auto-wrap
131 (auto-fill-mode 0)
132 (add-hook 'after-change-functions
133 'longlines-after-change-function nil t)
134 (add-hook 'post-command-hook
135 'longlines-post-command-function nil t)))
136 ;; Turn off longlines mode
137 (setq buffer-file-format (delete 'longlines buffer-file-format))
138 (if longlines-showing
139 (longlines-unshow-hard-newlines))
140 (let ((buffer-undo-list t))
141 (longlines-encode-region (point-min) (point-max)))
142 (remove-hook 'change-major-mode-hook 'longlines-mode-off t)
143 (remove-hook 'before-kill-functions 'longlines-encode-region t)
144 (remove-hook 'after-change-functions 'longlines-after-change-function t)
145 (remove-hook 'post-command-hook 'longlines-post-command-function t)
146 (remove-hook 'window-configuration-change-hook
147 'longlines-window-change-function t)
148 (kill-local-variable 'fill-column)))
149
150(defun longlines-mode-off ()
151 "Turn off longlines mode.
152This function exists to be called by `change-major-mode-hook' when the
153major mode changes."
154 (longlines-mode 0))
155
156;; Showing the effect of hard newlines in the buffer
157
158(defface longlines-visible-face
159 '((t (:background "red")))
160 "Face used to make hard newlines visible in `longlines-mode'.")
161
162(defun longlines-show-hard-newlines (&optional arg)
163 "Make hard newlines visible by adding a face.
164With optional argument ARG, make the hard newlines invisible again."
165 (interactive "P")
166 (let ((buffer-undo-list t)
167 (mod (buffer-modified-p)))
168 (if arg
169 (longlines-unshow-hard-newlines)
170 (setq longlines-showing t)
171 (longlines-show-region (point-min) (point-max)))
172 (set-buffer-modified-p mod)))
173
174(defun longlines-show-region (beg end)
175 "Make hard newlines between BEG and END visible."
176 (let* ((pmin (min beg end))
177 (pmax (max beg end))
178 (pos (text-property-any pmin pmax 'hard t)))
179 (while pos
180 (put-text-property pos (1+ pos) 'display
181 (copy-sequence longlines-show-effect))
182 (setq pos (text-property-any (1+ pos) pmax 'hard t)))))
183
184(defun longlines-unshow-hard-newlines ()
185 "Make hard newlines invisible again."
186 (interactive)
187 (setq longlines-showing nil)
188 (let ((pos (text-property-any (point-min) (point-max) 'hard t)))
189 (while pos
190 (remove-text-properties pos (1+ pos) '(display))
191 (setq pos (text-property-any (1+ pos) (point-max) 'hard t)))))
192
193;; Wrapping the paragraphs.
194
195(defun longlines-wrap-region (beg end)
196 "Wrap each successive line, starting with the line before BEG.
197Stop when we reach lines after END that don't need wrapping, or the
198end of the buffer."
199 (setq longlines-wrap-point (point))
200 (goto-char beg)
201 (forward-line -1)
202 ;; Two successful longlines-wrap-line's in a row mean successive
203 ;; lines don't need wrapping.
204 (while (null (and (longlines-wrap-line)
205 (or (eobp)
206 (and (>= (point) end)
207 (longlines-wrap-line))))))
208 (goto-char longlines-wrap-point))
209
210(defun longlines-wrap-line ()
211 "If the current line needs to be wrapped, wrap it and return nil.
212If wrapping is performed, point remains on the line. If the line does
213not need to be wrapped, move point to the next line and return t."
214 (if (longlines-set-breakpoint)
215 (progn (backward-char 1)
216 (delete-char 1)
217 (insert-char ?\n 1)
218 nil)
219 (if (longlines-merge-lines-p)
220 (progn (end-of-line)
221 (delete-char 1)
222 ;; After certain commands (e.g. kill-line), there may be two
223 ;; successive soft newlines in the buffer. In this case, we
224 ;; replace these two newlines by a single space. Unfortunately,
225 ;; this breaks the conservation of (spaces + newlines), so we
226 ;; have to fiddle with longlines-wrap-point.
227 (if (or (bolp) (eolp))
228 (if (> longlines-wrap-point (point))
229 (setq longlines-wrap-point
230 (1- longlines-wrap-point)))
231 (insert-char ? 1))
232 nil)
233 (forward-line 1)
234 t)))
235
236(defun longlines-set-breakpoint ()
237 "Place point where we should break the current line, and return t.
238If the line should not be broken, return nil; point remains on the
239line."
240 (move-to-column fill-column)
241 (if (and (re-search-forward "[^ ]" (line-end-position) 1)
242 (> (current-column) fill-column))
243 ;; This line is too long. Can we break it?
244 (or (longlines-find-break-backward)
245 (progn (move-to-column fill-column)
246 (longlines-find-break-forward)))))
247
248(defun longlines-find-break-backward ()
249 "Move point backward to the first available breakpoint and return t.
250If no breakpoint is found, return nil."
251 (and (search-backward " " (line-beginning-position) 1)
252 (save-excursion
253 (skip-chars-backward " " (line-beginning-position))
254 (null (bolp)))
255 (progn (forward-char 1)
256 (if (and fill-nobreak-predicate
257 (run-hook-with-args-until-success
258 'fill-nobreak-predicate))
259 (progn (skip-chars-backward " " (line-beginning-position))
260 (longlines-find-break-backward))
261 t))))
262
263(defun longlines-find-break-forward ()
264 "Move point forward to the first available breakpoint and return t.
265If no break point is found, return nil."
266 (and (search-forward " " (line-end-position) 1)
267 (progn (skip-chars-forward " " (line-end-position))
268 (null (eolp)))
269 (if (and fill-nobreak-predicate
270 (run-hook-with-args-until-success
271 'fill-nobreak-predicate))
272 (longlines-find-break-forward)
273 t)))
274
275(defun longlines-merge-lines-p ()
276 "Return t if part of the next line can fit onto the current line.
277Otherwise, return nil. Text cannot be moved across hard newlines."
278 (save-excursion
279 (end-of-line)
280 (and (null (eobp))
281 (null (get-text-property (point) 'hard))
282 (let ((space (- fill-column (current-column))))
283 (forward-line 1)
284 (if (eq (char-after) ? )
285 t ; We can always merge some spaces
286 (<= (if (search-forward " " (line-end-position) 1)
287 (current-column)
288 (1+ (current-column)))
289 space))))))
290
291(defun longlines-decode-region (beg end)
292 "Turn all newlines between BEG and END into hard newlines."
293 (save-excursion
294 (goto-char (min beg end))
295 (while (search-forward "\n" (max beg end) t)
296 (set-hard-newline-properties
297 (match-beginning 0) (match-end 0)))))
298
299(defun longlines-encode-region (beg end &optional buffer)
300 "Replace each soft newline between BEG and END with exactly one space.
301Hard newlines are left intact. The optional argument BUFFER exists for
302compatibility with `format-alist', and is ignored."
303 (save-excursion
304 (let ((mod (buffer-modified-p)))
305 (goto-char (min beg end))
306 (while (search-forward "\n" (max (max beg end)) t)
307 (unless (get-text-property (match-beginning 0) 'hard)
308 (replace-match " ")))
309 (set-buffer-modified-p mod)
310 end)))
311
312(defun longlines-encode-string (string)
313 "Return a copy of STRING with each soft newline replaced by a space.
314Hard newlines are left intact."
315 (let* ((str (copy-sequence string))
316 (pos (string-match "\n" str)))
317 (while pos
318 (if (null (get-text-property pos 'hard str))
319 (aset str pos ? ))
320 (setq pos (string-match "\n" str (1+ pos))))
321 str))
322
323;; Auto wrap
324
325(defun longlines-auto-wrap (&optional arg)
326 "Turn on automatic line wrapping, and wrap the entire buffer.
327With optional argument ARG, turn off line wrapping."
328 (interactive "P")
329 (remove-hook 'after-change-functions 'longlines-after-change-function t)
330 (remove-hook 'post-command-hook 'longlines-post-command-function t)
331 (if arg
332 (progn (setq longlines-auto-wrap nil)
333 (message "Auto wrap disabled."))
334 (setq longlines-auto-wrap t)
335 (add-hook 'after-change-functions
336 'longlines-after-change-function nil t)
337 (add-hook 'post-command-hook
338 'longlines-post-command-function nil t)
339 (let ((mod (buffer-modified-p)))
340 (longlines-wrap-region (point-min) (point-max))
341 (set-buffer-modified-p mod))
342 (message "Auto wrap enabled.")))
343
344(defun longlines-after-change-function (beg end len)
345 "Update `longlines-wrap-beg' and `longlines-wrap-end'.
346This is called by `after-change-functions' to keep track of the region
347that has changed."
348 (unless undo-in-progress
349 (setq longlines-wrap-beg
350 (if longlines-wrap-beg (min longlines-wrap-beg beg) beg))
351 (setq longlines-wrap-end
352 (if longlines-wrap-end (max longlines-wrap-end end) end))))
353
354(defun longlines-post-command-function ()
355 "Perform line wrapping on the parts of the buffer that have changed.
356This is called by `post-command-hook' after each command."
357 (when longlines-wrap-beg
358 (cond ((or (eq this-command 'yank)
359 (eq this-command 'yank-pop))
360 (longlines-decode-region (point) (mark t))
361 (if longlines-showing
362 (longlines-show-region (point) (mark t))))
363 ((and (eq this-command 'newline) longlines-showing)
364 (save-excursion
365 (if (search-backward "\n" nil t)
366 (longlines-show-region
367 (match-beginning 0) (match-end 0))))))
368 (unless (or (eq this-command 'fill-paragraph)
369 (eq this-command 'fill-region))
370 (longlines-wrap-region longlines-wrap-beg longlines-wrap-end))
371 (setq longlines-wrap-beg nil)
372 (setq longlines-wrap-end nil)))
373
374(defun longlines-window-change-function ()
375 "Re-wrap the buffer if the window width has changed.
376This is called by `window-size-change-functions'."
377 (when (/= fill-column (- (window-width) window-min-width))
378 (setq fill-column (- (window-width) window-min-width))
379 (let ((mod (buffer-modified-p)))
380 (longlines-wrap-region (point-min) (point-max))
381 (set-buffer-modified-p mod))))
382
383;; Loading and saving
384
385(add-to-list
386 'format-alist
387 (list 'longlines "Automatically wrap long lines." nil
388 'longlines-decode-region 'longlines-encode-region t nil))
389
390(provide 'longlines)
391
392;; arch-tag: 3489d225-5506-47b9-8659-d8807b77c624
393;;; longlines.el ends here
diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el
index 18f52e6434f..b520841db3d 100644
--- a/lisp/mail/mailalias.el
+++ b/lisp/mail/mailalias.el
@@ -111,9 +111,10 @@ entered so far."
111This value is used when the value of `mail-directory-function' 111This value is used when the value of `mail-directory-function'
112is `mail-directory-process'. The value should be a list 112is `mail-directory-process'. The value should be a list
113of the form (COMMAND ARG ...), where each of the list elements 113of the form (COMMAND ARG ...), where each of the list elements
114is evaluated. When `mail-directory-requery' is non-nil, during 114is evaluated. COMMAND should evaluate to a string. When
115evaluation of these elements, the variable `pattern' contains 115`mail-directory-requery' is non-nil, during evaluation of these
116the partial input being completed. 116elements, the variable `pattern' contains the partial input being
117completed. `pattern' is nil when `mail-directory-requery' is nil.
117 118
118The value might look like this: 119The value might look like this:
119 120
@@ -149,7 +150,7 @@ Three types of values are possible:
149 "Alist of local users, aliases and directory entries as available. 150 "Alist of local users, aliases and directory entries as available.
150Elements have the form (MAILNAME) or (MAILNAME . FULLNAME). 151Elements have the form (MAILNAME) or (MAILNAME . FULLNAME).
151If the value means t, it means the real value should be calculated 152If the value means t, it means the real value should be calculated
152for the next use. this is used in `mail-complete'.") 153for the next use. This is used in `mail-complete'.")
153 154
154(defvar mail-local-names t 155(defvar mail-local-names t
155 "Alist of local users. 156 "Alist of local users.
@@ -469,7 +470,9 @@ PATTERN is the string we want to complete."
469 mail-aliases)) 470 mail-aliases))
470 (if (consp mail-local-names) 471 (if (consp mail-local-names)
471 mail-local-names) 472 mail-local-names)
472 (or directory mail-directory-names)) 473 (or directory
474 (when (consp mail-directory-names)
475 mail-directory-names)))
473 (lambda (a b) 476 (lambda (a b)
474 ;; should cache downcased strings 477 ;; should cache downcased strings
475 (string< (downcase (car a)) 478 (string< (downcase (car a))
@@ -478,8 +481,10 @@ PATTERN is the string we want to complete."
478 481
479 482
480(defun mail-directory (pattern) 483(defun mail-directory (pattern)
481 "Call directory to get names matching PATTERN or all if nil. 484 "Use mail-directory facility to get user names matching PATTERN.
482Calls `mail-directory-function' and applies `mail-directory-parser' to output." 485If PATTERN is nil, get all the defined user names.
486This function calls `mail-directory-function' to query the directory,
487then uses `mail-directory-parser' to parse the output it returns."
483 (save-excursion 488 (save-excursion
484 (message "Querying directory...") 489 (message "Querying directory...")
485 (set-buffer (generate-new-buffer " *mail-directory*")) 490 (set-buffer (generate-new-buffer " *mail-directory*"))
@@ -509,8 +514,9 @@ Calls `mail-directory-function' and applies `mail-directory-parser' to output."
509(defun mail-directory-process (pattern) 514(defun mail-directory-process (pattern)
510 "Run a shell command to output names in directory. 515 "Run a shell command to output names in directory.
511See `mail-directory-process'." 516See `mail-directory-process'."
512 (apply 'call-process (eval (car mail-directory-process)) nil t nil 517 (when (consp mail-directory-process)
513 (mapcar 'eval (cdr mail-directory-process)))) 518 (apply 'call-process (eval (car mail-directory-process)) nil t nil
519 (mapcar 'eval (cdr mail-directory-process)))))
514 520
515;; This should handle a dialog. Currently expects port to spit out names. 521;; This should handle a dialog. Currently expects port to spit out names.
516(defun mail-directory-stream (pattern) 522(defun mail-directory-stream (pattern)
diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el
index 06282c430f0..371bb90b9cf 100644
--- a/lisp/mail/supercite.el
+++ b/lisp/mail/supercite.el
@@ -1,6 +1,6 @@
1;;; supercite.el --- minor mode for citing mail and news replies 1;;; supercite.el --- minor mode for citing mail and news replies
2 2
3;; Copyright (C) 1993, 1997, 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1993, 1997, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5;; Author: 1993 Barry A. Warsaw <bwarsaw@python.org> 5;; Author: 1993 Barry A. Warsaw <bwarsaw@python.org>
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -243,7 +243,7 @@ See the variable `sc-cite-frame-alist' for details."
243 243
244(defcustom sc-cite-region-limit t 244(defcustom sc-cite-region-limit t
245 "*This variable controls automatic citation of yanked text. 245 "*This variable controls automatic citation of yanked text.
246Legal values are: 246Valid values are:
247 247
248non-nil -- cite the entire region, regardless of its size 248non-nil -- cite the entire region, regardless of its size
249nil -- do not cite the region at all 249nil -- do not cite the region at all
@@ -347,7 +347,7 @@ Non-nil uses nested citations, nil uses non-nested citations."
347 347
348(defcustom sc-nuke-mail-headers 'all 348(defcustom sc-nuke-mail-headers 'all
349 "*Controls mail header nuking. 349 "*Controls mail header nuking.
350Used in conjunction with `sc-nuke-mail-header-list'. Legal values are: 350Used in conjunction with `sc-nuke-mail-header-list'. Valid values are:
351 351
352`all' -- nuke all mail headers 352`all' -- nuke all mail headers
353`none' -- don't nuke any mail headers 353`none' -- don't nuke any mail headers
@@ -796,7 +796,7 @@ The number of lines left is specified by `sc-blank-lines-after-headers'."
796 nonentry-func '(sc-mail-nuke-header-line))) 796 nonentry-func '(sc-mail-nuke-header-line)))
797 ;; we never get far enough to interpret a frame if s-n-m-h == 'none 797 ;; we never get far enough to interpret a frame if s-n-m-h == 'none
798 ((eq sc-nuke-mail-headers 'none)) 798 ((eq sc-nuke-mail-headers 'none))
799 (t (error "Illegal value for sc-nuke-mail-headers: %s" 799 (t (error "Invalid value for sc-nuke-mail-headers: %s"
800 sc-nuke-mail-headers)) 800 sc-nuke-mail-headers))
801 ) ; end-cond 801 ) ; end-cond
802 (append 802 (append
@@ -838,7 +838,7 @@ error occurs."
838 "Return the mail header field value associated with FIELD. 838 "Return the mail header field value associated with FIELD.
839If there was no mail header with FIELD as its key, return the value of 839If there was no mail header with FIELD as its key, return the value of
840`sc-mumble'. FIELD is case insensitive." 840`sc-mumble'. FIELD is case insensitive."
841 (or (cdr (assoc (downcase field) sc-mail-info)) sc-mumble)) 841 (or (cdr (assoc-string field sc-mail-info 'case-fold)) sc-mumble))
842 842
843(defun sc-mail-field-query (arg) 843(defun sc-mail-field-query (arg)
844 "View the value of a mail field. 844 "View the value of a mail field.
@@ -916,8 +916,8 @@ Match addresses of the style ``<name[stuff]>.''"
916 "Get the full email address path from FROM. 916 "Get the full email address path from FROM.
917AUTHOR is the author's name (which is removed from the address)." 917AUTHOR is the author's name (which is removed from the address)."
918 (let ((eos (length from))) 918 (let ((eos (length from)))
919 (if (string-match (concat "\\(^\\|^\"\\)" author 919 (if (string-match (concat "\\`\"?" (regexp-quote author)
920 "\\(\\s +\\|\"\\s +\\)") from 0) 920 "\"?\\s +") from 0)
921 (let ((address (substring from (match-end 0) eos))) 921 (let ((address (substring from (match-end 0) eos)))
922 (if (and (= (aref address 0) ?<) 922 (if (and (= (aref address 0) ?<)
923 (= (aref address (1- (length address))) ?>)) 923 (= (aref address (1- (length address))) ?>))
@@ -2054,5 +2054,5 @@ more information. Info node `(SC)Top'."
2054(provide 'supercite) 2054(provide 'supercite)
2055(run-hooks 'sc-load-hook) 2055(run-hooks 'sc-load-hook)
2056 2056
2057;;; arch-tag: a5d5bfa6-3bd5-4414-8c65-0afc83e45cd3 2057;; arch-tag: a5d5bfa6-3bd5-4414-8c65-0afc83e45cd3
2058;;; supercite.el ends here 2058;;; supercite.el ends here
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index d988cae1260..273d4739b4d 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -136,7 +136,7 @@ A large number or nil slows down menu responsiveness."
136 '(menu-item "--")) 136 '(menu-item "--"))
137 137
138(define-key menu-bar-file-menu [recover-session] 138(define-key menu-bar-file-menu [recover-session]
139 '(menu-item "Recover Crashed Session..." recover-session 139 '(menu-item "Recover Crashed Session" recover-session
140 :enable (and auto-save-list-file-prefix 140 :enable (and auto-save-list-file-prefix
141 (file-directory-p 141 (file-directory-p
142 (file-name-directory auto-save-list-file-prefix)) 142 (file-name-directory auto-save-list-file-prefix))
@@ -298,7 +298,7 @@ A large number or nil slows down menu responsiveness."
298 '(menu-item "Continue Tags Search" tags-loop-continue 298 '(menu-item "Continue Tags Search" tags-loop-continue
299 :help "Continue last tags search operation")) 299 :help "Continue last tags search operation"))
300(define-key menu-bar-search-menu [tags-srch] 300(define-key menu-bar-search-menu [tags-srch]
301 '(menu-item "Search tagged files" tags-search 301 '(menu-item "Search tagged files..." tags-search
302 :help "Search for a regexp in all tagged files")) 302 :help "Search for a regexp in all tagged files"))
303(define-key menu-bar-search-menu [separator-tag-search] 303(define-key menu-bar-search-menu [separator-tag-search]
304 '(menu-item "--")) 304 '(menu-item "--"))
@@ -342,7 +342,7 @@ A large number or nil slows down menu responsiveness."
342 '(menu-item "Continue Replace" tags-loop-continue 342 '(menu-item "Continue Replace" tags-loop-continue
343 :help "Continue last tags replace operation")) 343 :help "Continue last tags replace operation"))
344(define-key menu-bar-replace-menu [tags-repl] 344(define-key menu-bar-replace-menu [tags-repl]
345 '(menu-item "Replace in tagged files" tags-query-replace 345 '(menu-item "Replace in tagged files..." tags-query-replace
346 :help "Interactively replace a regexp in all tagged files")) 346 :help "Interactively replace a regexp in all tagged files"))
347(define-key menu-bar-replace-menu [separator-replace-tags] 347(define-key menu-bar-replace-menu [separator-replace-tags]
348 '(menu-item "--")) 348 '(menu-item "--"))
@@ -377,14 +377,14 @@ A large number or nil slows down menu responsiveness."
377(defvar menu-bar-goto-menu (make-sparse-keymap "Go To")) 377(defvar menu-bar-goto-menu (make-sparse-keymap "Go To"))
378 378
379(define-key menu-bar-goto-menu [set-tags-name] 379(define-key menu-bar-goto-menu [set-tags-name]
380 '(menu-item "Set Tags File Name" visit-tags-table 380 '(menu-item "Set Tags File Name..." visit-tags-table
381 :help "Tell Tags commands which tag table file to use")) 381 :help "Tell Tags commands which tag table file to use"))
382 382
383(define-key menu-bar-goto-menu [separator-tag-file] 383(define-key menu-bar-goto-menu [separator-tag-file]
384 '(menu-item "--")) 384 '(menu-item "--"))
385 385
386(define-key menu-bar-goto-menu [apropos-tags] 386(define-key menu-bar-goto-menu [apropos-tags]
387 '(menu-item "Tags Apropos" tags-apropos 387 '(menu-item "Tags Apropos..." tags-apropos
388 :help "Find function/variables whose names match regexp")) 388 :help "Find function/variables whose names match regexp"))
389(define-key menu-bar-goto-menu [next-tag-otherw] 389(define-key menu-bar-goto-menu [next-tag-otherw]
390 '(menu-item "Next Tag in Other Window" 390 '(menu-item "Next Tag in Other Window"
@@ -673,7 +673,7 @@ by \"Save Options\" in Custom buffers.")
673 '("--")) 673 '("--"))
674 674
675(define-key menu-bar-options-menu [mouse-set-font] 675(define-key menu-bar-options-menu [mouse-set-font]
676 '(menu-item "Set Font/Fontset" mouse-set-font 676 '(menu-item "Set Font/Fontset..." mouse-set-font
677 :visible (display-multi-font-p) 677 :visible (display-multi-font-p)
678 :help "Select a font from list of known fonts/fontsets")) 678 :help "Select a font from list of known fonts/fontsets"))
679 679
@@ -1332,10 +1332,10 @@ key (or menu-item)"))
1332(define-key menu-bar-manuals-menu [sep3] 1332(define-key menu-bar-manuals-menu [sep3]
1333 '("--")) 1333 '("--"))
1334(define-key menu-bar-manuals-menu [command] 1334(define-key menu-bar-manuals-menu [command]
1335 '(menu-item "Find Command in Manual" Info-goto-emacs-command-node 1335 '(menu-item "Find Command in Manual..." Info-goto-emacs-command-node
1336 :help "Display manual section that describes a command")) 1336 :help "Display manual section that describes a command"))
1337(define-key menu-bar-manuals-menu [key] 1337(define-key menu-bar-manuals-menu [key]
1338 '(menu-item "Find Key in Manual" Info-goto-emacs-key-command-node 1338 '(menu-item "Find Key in Manual..." Info-goto-emacs-key-command-node
1339 :help "Display manual section that describes a key")) 1339 :help "Display manual section that describes a key"))
1340 1340
1341(define-key menu-bar-help-menu [eliza] 1341(define-key menu-bar-help-menu [eliza]
@@ -1369,7 +1369,7 @@ key (or menu-item)"))
1369(define-key menu-bar-help-menu [sep2] 1369(define-key menu-bar-help-menu [sep2]
1370 '("--")) 1370 '("--"))
1371(define-key menu-bar-help-menu [finder-by-keyword] 1371(define-key menu-bar-help-menu [finder-by-keyword]
1372 '(menu-item "Find Emacs Packages..." finder-by-keyword 1372 '(menu-item "Find Emacs Packages" finder-by-keyword
1373 :help "Find packages and features by keyword")) 1373 :help "Find packages and features by keyword"))
1374(define-key menu-bar-help-menu [manuals] 1374(define-key menu-bar-help-menu [manuals]
1375 (list 'menu-item "More Manuals" menu-bar-manuals-menu 1375 (list 'menu-item "More Manuals" menu-bar-manuals-menu
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index e48186d8b3b..b6bcb3938b0 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,11 @@
12005-03-25 Werner Lemberg <wl@gnu.org>
2
3 * mh-e.el, mh-identity.el, mh-mime.el: Replace `legal' with `valid'.
4
52005-03-25 Werner Lemberg <wl@gnu.org>
6
7 * mh-e.el: Replace `illegal' with `invalid'.
8
12004-09-07 Stefan <monnier@iro.umontreal.ca> 92004-09-07 Stefan <monnier@iro.umontreal.ca>
2 10
3 * mh-inc.el (mh-inc-spool-list): Correctly declare the external var. 11 * mh-inc.el (mh-inc-spool-list): Correctly declare the external var.
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 2081d49b6cd..c2322624507 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -1,7 +1,7 @@
1;;; mh-e.el --- GNU Emacs interface to the MH mail system 1;;; mh-e.el --- GNU Emacs interface to the MH mail system
2 2
3;; Copyright (C) 1985, 86, 87, 88, 90, 92, 93, 94, 95, 97, 1999, 3;; Copyright (C) 1985, 86, 87, 88, 90, 92, 93, 94, 95, 97, 1999,
4;; 2000, 01, 02, 03, 2004 Free Software Foundation, Inc. 4;; 2000, 01, 02, 03, 2004, 2005 Free Software Foundation, Inc.
5 5
6;; Author: Bill Wohler <wohler@newt.com> 6;; Author: Bill Wohler <wohler@newt.com>
7;; Maintainer: Bill Wohler <wohler@newt.com> 7;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -1526,7 +1526,7 @@ Many commands that operate on individual messages, such as `mh-forward' or
1526ways. 1526ways.
1527 1527
1528If you provide the prefix argument (\\[universal-argument]) to these commands, 1528If you provide the prefix argument (\\[universal-argument]) to these commands,
1529then you will be prompted for the message range. This can be any legal MH 1529then you will be prompted for the message range. This can be any valid MH
1530range which can include messages, sequences, and the abbreviations (described 1530range which can include messages, sequences, and the abbreviations (described
1531in the mh(1) man page): 1531in the mh(1) man page):
1532 1532
@@ -2146,7 +2146,7 @@ to avoid exceeding system command line argument limits."
2146(defun mh-greaterp (msg1 msg2) 2146(defun mh-greaterp (msg1 msg2)
2147 "Return the greater of two message indicators MSG1 and MSG2. 2147 "Return the greater of two message indicators MSG1 and MSG2.
2148Strings are \"smaller\" than numbers. 2148Strings are \"smaller\" than numbers.
2149Legal values are things like \"cur\", \"last\", 1, and 1820." 2149Valid values are things like \"cur\", \"last\", 1, and 1820."
2150 (if (numberp msg1) 2150 (if (numberp msg1)
2151 (if (numberp msg2) 2151 (if (numberp msg2)
2152 (> msg1 msg2) 2152 (> msg1 msg2)
@@ -2158,7 +2158,7 @@ Legal values are things like \"cur\", \"last\", 1, and 1820."
2158(defun mh-lessp (msg1 msg2) 2158(defun mh-lessp (msg1 msg2)
2159 "Return the lesser of two message indicators MSG1 and MSG2. 2159 "Return the lesser of two message indicators MSG1 and MSG2.
2160Strings are \"smaller\" than numbers. 2160Strings are \"smaller\" than numbers.
2161Legal values are things like \"cur\", \"last\", 1, and 1820." 2161Valid values are things like \"cur\", \"last\", 1, and 1820."
2162 (not (mh-greaterp msg1 msg2))) 2162 (not (mh-greaterp msg1 msg2)))
2163 2163
2164 2164
@@ -2306,7 +2306,7 @@ If INTERNAL-FLAG is non-nil, then do not inform MH of the change."
2306(defun mh-define-sequence (seq msgs) 2306(defun mh-define-sequence (seq msgs)
2307 "Define the SEQ to contain the list of MSGS. 2307 "Define the SEQ to contain the list of MSGS.
2308Do not mark pseudo-sequences or empty sequences. 2308Do not mark pseudo-sequences or empty sequences.
2309Signals an error if SEQ is an illegal name." 2309Signals an error if SEQ is an invalid name."
2310 (if (and msgs 2310 (if (and msgs
2311 (mh-valid-seq-p seq) 2311 (mh-valid-seq-p seq)
2312 (not (mh-folder-name-p seq))) 2312 (not (mh-folder-name-p seq)))
diff --git a/lisp/mh-e/mh-identity.el b/lisp/mh-e/mh-identity.el
index be385ad09e6..4bb5f90cf18 100644
--- a/lisp/mh-e/mh-identity.el
+++ b/lisp/mh-e/mh-identity.el
@@ -1,6 +1,6 @@
1;;; mh-identity.el --- Multiple identify support for MH-E. 1;;; mh-identity.el --- Multiple identify support for MH-E.
2 2
3;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Peter S. Galbraith <psg@debian.org> 5;; Author: Peter S. Galbraith <psg@debian.org>
6;; Maintainer: Bill Wohler <wohler@newt.com> 6;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -122,7 +122,7 @@ Return t if anything is deleted."
122 "Return the handler for a FIELD or nil if none set. 122 "Return the handler for a FIELD or nil if none set.
123The field name is downcased. If the FIELD begins with the character 123The field name is downcased. If the FIELD begins with the character
124`:', then it must have a special handler defined in 124`:', then it must have a special handler defined in
125`mh-identity-handlers', else return an error since it is not a legal 125`mh-identity-handlers', else return an error since it is not a valid
126message header." 126message header."
127 (or (cdr (assoc (downcase field) mh-identity-handlers)) 127 (or (cdr (assoc (downcase field) mh-identity-handlers))
128 (and (eq (aref field 0) ?:) 128 (and (eq (aref field 0) ?:)
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index 72cb654dedd..bc870134779 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -1,6 +1,7 @@
1;;; mh-mime.el --- MH-E support for composing MIME messages 1;;; mh-mime.el --- MH-E support for composing MIME messages
2 2
3;; Copyright (C) 1993, 1995, 2001, 02, 03, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1993, 1995, 2001, 02, 03, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Bill Wohler <wohler@newt.com> 6;; Author: Bill Wohler <wohler@newt.com>
6;; Maintainer: Bill Wohler <wohler@newt.com> 7;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -197,7 +198,7 @@ Returns nil if file command not on system."
197 ("text/richtext") ("text/x-vcard") ("text/xml") 198 ("text/richtext") ("text/x-vcard") ("text/xml")
198 199
199 ("video/mpeg") ("video/quicktime")) 200 ("video/mpeg") ("video/quicktime"))
200 "Legal MIME content types. 201 "Valid MIME content types.
201See documentation for \\[mh-edit-mhn].") 202See documentation for \\[mh-edit-mhn].")
202 203
203;; RFC 2045 - Multipurpose Internet Mail Extensions (MIME) Part One: 204;; RFC 2045 - Multipurpose Internet Mail Extensions (MIME) Part One:
@@ -224,7 +225,7 @@ See documentation for \\[mh-edit-mhn].")
224 ("tftp") ; RFC2046 Trivial File Transfer Protocol 225 ("tftp") ; RFC2046 Trivial File Transfer Protocol
225 ("url") ; RFC2017 URL scheme MIME access-type Protocol 226 ("url") ; RFC2017 URL scheme MIME access-type Protocol
226 ("wais")) ; RFC1738 Wide Area Information Servers 227 ("wais")) ; RFC1738 Wide Area Information Servers
227 "Legal MIME access-type values.") 228 "Valid MIME access-type values.")
228 229
229;;;###mh-autoload 230;;;###mh-autoload
230(defun mh-mhn-compose-insertion (filename type description attributes) 231(defun mh-mhn-compose-insertion (filename type description attributes)
diff --git a/lisp/midnight.el b/lisp/midnight.el
index 37bdf065f51..a81ce37856a 100644
--- a/lisp/midnight.el
+++ b/lisp/midnight.el
@@ -1,6 +1,6 @@
1;;; midnight.el --- run something every midnight, e.g., kill old buffers 1;;; midnight.el --- run something every midnight, e.g., kill old buffers
2 2
3;;; Copyright (C) 1998, 2004 Free Software Foundation, Inc. 3;;; Copyright (C) 1998, 2004, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Sam Steingold <sds@usa.net> 5;; Author: Sam Steingold <sds@usa.net>
6;; Maintainer: Sam Steingold <sds@usa.net> 6;; Maintainer: Sam Steingold <sds@usa.net>
@@ -215,7 +215,7 @@ the time when it is run.")
215Sets the first argument SYMB (which must be symbol `midnight-delay') 215Sets the first argument SYMB (which must be symbol `midnight-delay')
216to its second argument TM." 216to its second argument TM."
217 (assert (eq symb 'midnight-delay) t 217 (assert (eq symb 'midnight-delay) t
218 "Illegal argument to `midnight-delay-set': `%s'") 218 "Invalid argument to `midnight-delay-set': `%s'")
219 (set symb tm) 219 (set symb tm)
220 (when (timerp midnight-timer) (cancel-timer midnight-timer)) 220 (when (timerp midnight-timer) (cancel-timer midnight-timer))
221 (setq midnight-timer 221 (setq midnight-timer
diff --git a/lisp/international/iso-acc.el b/lisp/obsolete/iso-acc.el
index 6c94f4aa562..740fa942c13 100644
--- a/lisp/international/iso-acc.el
+++ b/lisp/obsolete/iso-acc.el
@@ -1,6 +1,7 @@
1;;; iso-acc.el --- minor mode providing electric accent keys 1;;; iso-acc.el --- minor mode providing electric accent keys
2 2
3;; Copyright (C) 1993, 1994, 1996, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1993, 1994, 1996, 2001, 2002, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Johan Vromans 6;; Author: Johan Vromans
6;; Maintainer: FSF 7;; Maintainer: FSF
@@ -487,5 +488,5 @@ Noninteractively, this operates on text from START to END."
487 488
488(add-hook 'minibuffer-setup-hook 'iso-acc-minibuf-setup) 489(add-hook 'minibuffer-setup-hook 'iso-acc-minibuf-setup)
489 490
490;;; arch-tag: 149ff409-7c3e-4574-9b5d-ac038939c0a6 491;; arch-tag: 149ff409-7c3e-4574-9b5d-ac038939c0a6
491;;; iso-acc.el ends here 492;;; iso-acc.el ends here
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 457177d7c4c..bafc901d3d1 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1613,6 +1613,8 @@ and overlay is highlighted between MK and END-MK."
1613 (compilation-set-window-height w) 1613 (compilation-set-window-height w)
1614 1614
1615 (when highlight-regexp 1615 (when highlight-regexp
1616 (if (timerp next-error-highlight-timer)
1617 (cancel-timer next-error-highlight-timer))
1616 (unless compilation-highlight-overlay 1618 (unless compilation-highlight-overlay
1617 (setq compilation-highlight-overlay 1619 (setq compilation-highlight-overlay
1618 (make-overlay (point-min) (point-min))) 1620 (make-overlay (point-min) (point-min)))
@@ -1632,8 +1634,11 @@ and overlay is highlighted between MK and END-MK."
1632 (move-overlay compilation-highlight-overlay 1634 (move-overlay compilation-highlight-overlay
1633 (point) end (current-buffer))) 1635 (point) end (current-buffer)))
1634 (if (numberp next-error-highlight) 1636 (if (numberp next-error-highlight)
1635 (sit-for next-error-highlight)) 1637 (setq next-error-highlight-timer
1636 (if (not (eq next-error-highlight t)) 1638 (run-at-time next-error-highlight nil 'delete-overlay
1639 compilation-highlight-overlay)))
1640 (if (not (or (eq next-error-highlight t)
1641 (numberp next-error-highlight)))
1637 (delete-overlay compilation-highlight-overlay)))))) 1642 (delete-overlay compilation-highlight-overlay))))))
1638 (when (and (eq next-error-highlight 'fringe-arrow)) 1643 (when (and (eq next-error-highlight 'fringe-arrow))
1639 (set (make-local-variable 'overlay-arrow-position) 1644 (set (make-local-variable 'overlay-arrow-position)
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 64f039f54f9..700fa1c9efe 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -1,6 +1,6 @@
1;;; cperl-mode.el --- Perl code editing commands for Emacs 1;;; cperl-mode.el --- Perl code editing commands for Emacs
2 2
3;; Copyright (C) 1985,86,87,91,92,93,94,95,96,97,98,99,2000,03,2004 3;; Copyright (C) 1985,86,87,91,92,93,94,95,96,97,98,99,2000,03,2004,2005
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Ilya Zakharevich and Bob Olson 6;; Author: Ilya Zakharevich and Bob Olson
@@ -713,7 +713,7 @@ should work if the balance of delimiters is not broken by POD).
713 713
714The main trick (to make $ a \"backslash\") makes constructions like 714The main trick (to make $ a \"backslash\") makes constructions like
715${aaa} look like unbalanced braces. The only trick I can think of is 715${aaa} look like unbalanced braces. The only trick I can think of is
716to insert it as $ {aaa} (legal in perl5, not in perl4). 716to insert it as $ {aaa} (valid in perl5, not in perl4).
717 717
718Similar problems arise in regexps, when /(\\s|$)/ should be rewritten 718Similar problems arise in regexps, when /(\\s|$)/ should be rewritten
719as /($|\\s)/. Note that such a transposition is not always possible. 719as /($|\\s)/. Note that such a transposition is not always possible.
diff --git a/lisp/progmodes/ebnf-abn.el b/lisp/progmodes/ebnf-abn.el
index 35771a10f32..5bb0dd03913 100644
--- a/lisp/progmodes/ebnf-abn.el
+++ b/lisp/progmodes/ebnf-abn.el
@@ -1,6 +1,6 @@
1;;; ebnf-abn.el --- parser for ABNF (Augmented BNF) 1;;; ebnf-abn.el --- parser for ABNF (Augmented BNF)
2 2
3;; Copyright (C) 2004 Free Sofware Foundation, Inc. 3;; Copyright (C) 2004, 2005 Free Sofware Foundation, Inc.
4 4
5;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> 5;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
6;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> 6;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
@@ -518,7 +518,7 @@ See documentation for variable `ebnf-abn-lex'."
518 'end-of-input) 518 'end-of-input)
519 ;; error 519 ;; error
520 ((eq token 'error) 520 ((eq token 'error)
521 (error "Illegal character")) 521 (error "Invalid character"))
522 ;; end of rule 522 ;; end of rule
523 ((eq token 'end-of-rule) 523 ((eq token 'end-of-rule)
524 'end-of-rule) 524 'end-of-rule)
@@ -600,7 +600,7 @@ See documentation for variable `ebnf-abn-lex'."
600 ((= (following-char) ?\n) 600 ((= (following-char) ?\n)
601 t) 601 t)
602 (t 602 (t
603 (error "Illegal character")) 603 (error "Invalid character"))
604 )) 604 ))
605 605
606 606
diff --git a/lisp/progmodes/ebnf-bnf.el b/lisp/progmodes/ebnf-bnf.el
index d32ad5a77c9..09db8f8865d 100644
--- a/lisp/progmodes/ebnf-bnf.el
+++ b/lisp/progmodes/ebnf-bnf.el
@@ -1,6 +1,6 @@
1;;; ebnf-bnf.el --- parser for EBNF 1;;; ebnf-bnf.el --- parser for EBNF
2 2
3;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 3;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
4;; Free Sofware Foundation, Inc. 4;; Free Sofware Foundation, Inc.
5 5
6;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> 6;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
@@ -461,7 +461,7 @@ See documentation for variable `ebnf-bnf-lex'."
461 'end-of-input) 461 'end-of-input)
462 ;; error 462 ;; error
463 ((eq token 'error) 463 ((eq token 'error)
464 (error "Illegal character")) 464 (error "Invalid character"))
465 ;; default 465 ;; default
466 ((eq token 'default) 466 ((eq token 'default)
467 (forward-char) 467 (forward-char)
@@ -470,7 +470,7 @@ See documentation for variable `ebnf-bnf-lex'."
470 (prog1 470 (prog1
471 (ebnf-bnf-lex) 471 (ebnf-bnf-lex)
472 (setq ebnf-default-p t)) 472 (setq ebnf-default-p t))
473 (error "Illegal `default' element"))) 473 (error "Invalid `default' element")))
474 ;; integer 474 ;; integer
475 ((eq token 'integer) 475 ((eq token 'integer)
476 (setq ebnf-bnf-lex (ebnf-buffer-substring "0-9")) 476 (setq ebnf-bnf-lex (ebnf-buffer-substring "0-9"))
@@ -550,7 +550,7 @@ See documentation for variable `ebnf-bnf-lex'."
550 (forward-char) 550 (forward-char)
551 t) 551 t)
552 (t 552 (t
553 (error "Illegal character")) 553 (error "Invalid character"))
554 )) 554 ))
555 555
556 556
diff --git a/lisp/progmodes/ebnf-dtd.el b/lisp/progmodes/ebnf-dtd.el
index 9a99f222cc8..621cf424463 100644
--- a/lisp/progmodes/ebnf-dtd.el
+++ b/lisp/progmodes/ebnf-dtd.el
@@ -1,6 +1,6 @@
1;;; ebnf-dtd.el --- parser for DTD (Data Type Description for XML) 1;;; ebnf-dtd.el --- parser for DTD (Data Type Description for XML)
2 2
3;; Copyright (C) 2004 Free Sofware Foundation, Inc. 3;; Copyright (C) 2004, 2005 Free Sofware Foundation, Inc.
4 4
5;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> 5;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
6;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> 6;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
@@ -1181,7 +1181,7 @@ See documentation for variable `ebnf-dtd-lex'."
1181 'end-of-input) 1181 'end-of-input)
1182 ;; error 1182 ;; error
1183 ((eq token 'error) 1183 ((eq token 'error)
1184 (error "Illegal character")) 1184 (error "Invalid character"))
1185 ;; beginning of declaration: 1185 ;; beginning of declaration:
1186 ;; <?name, <!ATTLIST, <!DOCTYPE, <!ELEMENT, <!ENTITY, <!NOTATION 1186 ;; <?name, <!ATTLIST, <!DOCTYPE, <!ELEMENT, <!ENTITY, <!NOTATION
1187 ((eq token 'less-than) 1187 ((eq token 'less-than)
@@ -1322,7 +1322,7 @@ See documentation for variable `ebnf-dtd-lex'."
1322 (forward-char 3) 1322 (forward-char 3)
1323 t) 1323 t)
1324 (t 1324 (t
1325 (error "Illegal character")) 1325 (error "Invalid character"))
1326 )) 1326 ))
1327 1327
1328 1328
diff --git a/lisp/progmodes/ebnf-ebx.el b/lisp/progmodes/ebnf-ebx.el
index d7dfa7af89f..45ccb956af8 100644
--- a/lisp/progmodes/ebnf-ebx.el
+++ b/lisp/progmodes/ebnf-ebx.el
@@ -1,6 +1,6 @@
1;;; ebnf-ebx.el --- parser for EBNF used to specify XML (EBNFX) 1;;; ebnf-ebx.el --- parser for EBNF used to specify XML (EBNFX)
2 2
3;; Copyright (C) 2004 Free Sofware Foundation, Inc. 3;; Copyright (C) 2004, 2005 Free Sofware Foundation, Inc.
4 4
5;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> 5;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
6;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> 6;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
@@ -453,7 +453,7 @@ See documentation for variable `ebnf-ebx-lex'."
453 'end-of-input) 453 'end-of-input)
454 ;; error 454 ;; error
455 ((eq token 'error) 455 ((eq token 'error)
456 (error "Illegal character")) 456 (error "Invalid character"))
457 ;; end of rule 457 ;; end of rule
458 ((eq token 'end-of-rule) 458 ((eq token 'end-of-rule)
459 'end-of-rule) 459 'end-of-rule)
diff --git a/lisp/progmodes/ebnf-iso.el b/lisp/progmodes/ebnf-iso.el
index f36065bd558..ba28dfb5af9 100644
--- a/lisp/progmodes/ebnf-iso.el
+++ b/lisp/progmodes/ebnf-iso.el
@@ -1,6 +1,6 @@
1;;; ebnf-iso.el --- parser for ISO EBNF 1;;; ebnf-iso.el --- parser for ISO EBNF
2 2
3;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 3;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> 6;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
@@ -112,7 +112,7 @@
112;; 112;;
113;; ISO EBNF accepts the characters given by <character> production above, 113;; ISO EBNF accepts the characters given by <character> production above,
114;; HORIZONTAL TAB (^I), VERTICAL TAB (^K), NEWLINE (^J or ^M) and FORM FEED 114;; HORIZONTAL TAB (^I), VERTICAL TAB (^K), NEWLINE (^J or ^M) and FORM FEED
115;; (^L), any other characters are illegal. But ebnf2ps accepts also the 115;; (^L), any other characters are invalid. But ebnf2ps accepts also the
116;; european 8-bit accentuated characters (from \240 to \377) and underscore 116;; european 8-bit accentuated characters (from \240 to \377) and underscore
117;; (_). 117;; (_).
118;; 118;;
@@ -427,7 +427,7 @@ See documentation for variable `ebnf-iso-lex'."
427 'end-of-input) 427 'end-of-input)
428 ;; error 428 ;; error
429 ((eq token 'error) 429 ((eq token 'error)
430 (error "Illegal character")) 430 (error "Invalid character"))
431 ;; integer 431 ;; integer
432 ((eq token 'integer) 432 ((eq token 'integer)
433 (setq ebnf-iso-lex (ebnf-buffer-substring "0-9")) 433 (setq ebnf-iso-lex (ebnf-buffer-substring "0-9"))
@@ -527,7 +527,7 @@ See documentation for variable `ebnf-iso-lex'."
527 (forward-char) 527 (forward-char)
528 (setq pair (1+ pair)))) 528 (setq pair (1+ pair))))
529 (t 529 (t
530 (error "Illegal character")) 530 (error "Invalid character"))
531 )))) 531 ))))
532 532
533 533
diff --git a/lisp/progmodes/ebnf-yac.el b/lisp/progmodes/ebnf-yac.el
index c7bf0e31541..58f422b1714 100644
--- a/lisp/progmodes/ebnf-yac.el
+++ b/lisp/progmodes/ebnf-yac.el
@@ -1,6 +1,6 @@
1;;; ebnf-yac.el --- parser for Yacc/Bison 1;;; ebnf-yac.el --- parser for Yacc/Bison
2 2
3;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 3;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
4;; Free Sofware Foundation, Inc. 4;; Free Sofware Foundation, Inc.
5 5
6;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> 6;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
@@ -346,7 +346,7 @@ See documentation for variable `ebnf-yac-lex'."
346 'end-of-input) 346 'end-of-input)
347 ;; error 347 ;; error
348 ((eq token 'error) 348 ((eq token 'error)
349 (error "Illegal character")) 349 (error "Invalid character"))
350 ;; "string" 350 ;; "string"
351 ((eq token 'string) 351 ((eq token 'string)
352 (setq ebnf-yac-lex (ebnf-get-string)) 352 (setq ebnf-yac-lex (ebnf-get-string))
@@ -425,7 +425,7 @@ See documentation for variable `ebnf-yac-lex'."
425 ((= (following-char) ?\') 425 ((= (following-char) ?\')
426 (ebnf-string " -&(-~" ?\' "character")) 426 (ebnf-string " -&(-~" ?\' "character"))
427 (t 427 (t
428 (error "Illegal character")) 428 (error "Invalid character"))
429 ))) 429 )))
430 (ebnf-yac-skip-spaces)) 430 (ebnf-yac-skip-spaces))
431 431
@@ -476,7 +476,7 @@ See documentation for variable `ebnf-yac-lex'."
476 (forward-char) 476 (forward-char)
477 (setq not-end nil))) 477 (setq not-end nil)))
478 (t 478 (t
479 (error "Illegal character")) 479 (error "Invalid character"))
480 )))) 480 ))))
481 481
482 482
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el
index 1d2f8d630e1..1a680ffa077 100644
--- a/lisp/progmodes/ebnf2ps.el
+++ b/lisp/progmodes/ebnf2ps.el
@@ -1,6 +1,6 @@
1;;; ebnf2ps.el --- translate an EBNF to a syntactic chart on PostScript 1;;; ebnf2ps.el --- translate an EBNF to a syntactic chart on PostScript
2 2
3;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 3;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> 6;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
@@ -5499,7 +5499,7 @@ killed after process termination."
5499 ;;(skip-chars-forward (concat chars "\240-\377") ebnf-limit) 5499 ;;(skip-chars-forward (concat chars "\240-\377") ebnf-limit)
5500 (skip-chars-forward (concat chars ebnf-8-bit-chars) ebnf-limit) 5500 (skip-chars-forward (concat chars ebnf-8-bit-chars) ebnf-limit)
5501 (if (or (eobp) (/= (following-char) eos-char)) 5501 (if (or (eobp) (/= (following-char) eos-char))
5502 (error "Illegal %s: missing `%c'" kind eos-char) 5502 (error "Invalid %s: missing `%c'" kind eos-char)
5503 (forward-char) 5503 (forward-char)
5504 (1- (point)))))) 5504 (1- (point))))))
5505 5505
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index fdb7fffac6c..4c8b847b7cd 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -597,41 +597,32 @@ characters long.")
597 597
598;; Hideshow support. 598;; Hideshow support.
599(defconst f90-end-block-re 599(defconst f90-end-block-re
600 (concat "^[ \t0-9]*\\<end\\>[ \t]*" 600 (concat "^[ \t0-9]*\\<end[ \t]*"
601 (regexp-opt '("do" "if" "forall" "function" "interface" 601 (regexp-opt '("do" "if" "forall" "function" "interface"
602 "module" "program" "select" "subroutine" 602 "module" "program" "select" "subroutine"
603 "type" "where" ) t) 603 "type" "where" ) t)
604 "[ \t]*\\sw*") 604 "[ \t]*\\sw*")
605 "Regexp matching the end of a \"block\" of F90 code. 605 "Regexp matching the end of an F90 \"block\", from the line start.
606Used in the F90 entry in `hs-special-modes-alist'.") 606Used in the F90 entry in `hs-special-modes-alist'.")
607 607
608;; Ignore the fact that FUNCTION, SUBROUTINE, WHERE, FORALL have a 608;; Ignore the fact that FUNCTION, SUBROUTINE, WHERE, FORALL have a
609;; following "(". DO, CASE, IF can have labels; IF must be 609;; following "(". DO, CASE, IF can have labels.
610;; accompanied by THEN.
611;; A big problem is that many of these statements can be broken over
612;; lines, even with embedded comments. We only try to handle this for
613;; IF ... THEN statements, assuming and hoping it will be less common
614;; for other constructs. We match up to one new-line, provided ")
615;; THEN" appears on one line. Matching on just ") THEN" is no good,
616;; since that includes ELSE branches.
617;; For a fully accurate solution, hideshow would probably have to be
618;; modified to allow functions as well as regexps to be used to
619;; specify block start and end positions.
620(defconst f90-start-block-re 610(defconst f90-start-block-re
621 (concat 611 (concat
622 "^[ \t0-9]*" ; statement number 612 "^[ \t0-9]*" ; statement number
623 "\\(\\(" 613 "\\(\\("
624 "\\(\\sw+[ \t]*:[ \t]*\\)?" ; structure label 614 "\\(\\sw+[ \t]*:[ \t]*\\)?" ; structure label
625 "\\(do\\|select[ \t]*case\\|if[ \t]*(.*\n?.*)[ \t]*then\\|" 615 "\\(do\\|select[ \t]*case\\|"
616 ;; See comments in fortran-start-block-re for the problems of IF.
617 "if[ \t]*(\\(.*\\|"
618 ".*\n\\([^if]*\\([^i].\\|.[^f]\\|.\\>\\)\\)\\)\\<then\\|"
626 ;; Distinguish WHERE block from isolated WHERE. 619 ;; Distinguish WHERE block from isolated WHERE.
627 "\\(where\\|forall\\)[ \t]*(.*)[ \t]*\\(!\\|$\\)\\)\\)" 620 "\\(where\\|forall\\)[ \t]*(.*)[ \t]*\\(!\\|$\\)\\)\\)"
628 "\\|" 621 "\\|"
629 "program\\|interface\\|module\\|type\\|function\\|subroutine" 622 "program\\|interface\\|module\\|type\\|function\\|subroutine"
630 ;; ") THEN" at line end. Problem - also does ELSE.
631;;; "\\|.*)[ \t]*then[ \t]*\\($\\|!\\)"
632 "\\)" 623 "\\)"
633 "[ \t]*") 624 "[ \t]*")
634 "Regexp matching the start of a \"block\" of F90 code. 625 "Regexp matching the start of an F90 \"block\", from the line start.
635A simple regexp cannot do this in fully correct fashion, so this 626A simple regexp cannot do this in fully correct fashion, so this
636tries to strike a compromise between complexity and flexibility. 627tries to strike a compromise between complexity and flexibility.
637Used in the F90 entry in `hs-special-modes-alist'.") 628Used in the F90 entry in `hs-special-modes-alist'.")
@@ -1305,12 +1296,12 @@ Checks for consistency of block types and labels (if present).
1305Does not check the outermost block, because it may be incomplete. 1296Does not check the outermost block, because it may be incomplete.
1306Interactively, pushes mark before moving point." 1297Interactively, pushes mark before moving point."
1307 (interactive "p") 1298 (interactive "p")
1299 (if (interactive-p) (push-mark (point) t))
1308 (and num (< num 0) (f90-end-of-block (- num))) 1300 (and num (< num 0) (f90-end-of-block (- num)))
1309 (let ((case-fold-search t) 1301 (let ((case-fold-search t)
1310 (count (or num 1)) 1302 (count (or num 1))
1311 end-list end-this end-type end-label 1303 end-list end-this end-type end-label
1312 start-this start-type start-label) 1304 start-this start-type start-label)
1313 (if (interactive-p) (push-mark (point) t))
1314 (beginning-of-line) ; probably want this 1305 (beginning-of-line) ; probably want this
1315 (while (and (> count 0) (re-search-backward f90-blocks-re nil 'move)) 1306 (while (and (> count 0) (re-search-backward f90-blocks-re nil 'move))
1316 (beginning-of-line) 1307 (beginning-of-line)
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 3effb6e7d38..70150111a86 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -1,6 +1,6 @@
1;;; flymake.el -- a universal on-the-fly syntax checker 1;;; flymake.el -- a universal on-the-fly syntax checker
2 2
3;; Copyright (C) 2003 Free Software Foundation 3;; Copyright (C) 2003, 2005 Free Software Foundation
4 4
5;; Author: Pavel Kobiakov <pk_at_work@yahoo.com> 5;; Author: Pavel Kobiakov <pk_at_work@yahoo.com>
6;; Maintainer: Pavel Kobiakov <pk_at_work@yahoo.com> 6;; Maintainer: Pavel Kobiakov <pk_at_work@yahoo.com>
@@ -49,17 +49,17 @@
49 (if test (make-hash-table :test test) (make-hash-table)) 49 (if test (make-hash-table :test test) (make-hash-table))
50 (makehash test))) 50 (makehash test)))
51 51
52(defun flymake-float-time () 52(defalias 'flymake-float-time
53 (if (featurep 'xemacs) 53 (if (fboundp 'float-time)
54 (let ((tm (current-time))) 54 'float-time
55 (multiple-value-bind (s0 s1 s2) (current-time) 55 (lambda ()
56 (+ (* (float (ash 1 16)) s0) (float s1) (* 0.0000001 s2)))) 56 (multiple-value-bind (s0 s1 s2) (current-time)
57 (float-time))) 57 (+ (* (float (ash 1 16)) s0) (float s1) (* 0.0000001 s2))))))
58 58
59(defsubst flymake-replace-regexp-in-string (regexp rep str) 59(defsubst flymake-replace-regexp-in-string (regexp rep str)
60 (if (featurep 'xemacs) 60 (if (fboundp 'replace-regexp-in-string)
61 (replace-in-string str regexp rep) 61 (replace-regexp-in-string regexp rep str)
62 (replace-regexp-in-string regexp rep str))) 62 (replace-in-string str regexp rep)))
63 63
64(defun flymake-split-string (str pattern) 64(defun flymake-split-string (str pattern)
65 "Split, then remove first and/or last in case it's empty." 65 "Split, then remove first and/or last in case it's empty."
@@ -71,22 +71,22 @@
71 splitted)) 71 splitted))
72 72
73(defsubst flymake-get-temp-dir () 73(defsubst flymake-get-temp-dir ()
74 (if (featurep 'xemacs) 74 (if (fboundp 'temp-directory)
75 (temp-directory) 75 (temp-directory)
76 temporary-file-directory)) 76 temporary-file-directory))
77 77
78(defun flymake-line-beginning-position () 78(defalias 'flymake-line-beginning-position
79 (save-excursion 79 (if (fboundp 'line-beginning-position)
80 (beginning-of-line) 80 'line-beginning-position
81 (point))) 81 (lambda (&optional arg) (save-excursion (beginning-of-line arg) (point)))))
82 82
83(defun flymake-line-end-position () 83(defalias 'flymake-line-end-position
84 (save-excursion 84 (if (fboundp 'line-end-position)
85 (end-of-line) 85 'line-end-position
86 (point))) 86 (lambda (&optional arg) (save-excursion (end-of-line arg) (point)))))
87 87
88(defun flymake-popup-menu (pos menu-data) 88(defun flymake-popup-menu (pos menu-data)
89 (if (featurep 'xemacs) 89 (if (and (fboundp 'popup-menu) (fboundp 'make-event))
90 (let* ((x-pos (nth 0 (nth 0 pos))) 90 (let* ((x-pos (nth 0 (nth 0 pos)))
91 (y-pos (nth 1 (nth 0 pos))) 91 (y-pos (nth 1 (nth 0 pos)))
92 (fake-event-props '(button 1 x 1 y 1))) 92 (fake-event-props '(button 1 x 1 y 1)))
@@ -104,10 +104,10 @@
104 menu-items)) 104 menu-items))
105 (list menu-title (cons "" menu-commands)))) 105 (list menu-title (cons "" menu-commands))))
106 106
107(defun flymake-nop ())
108
109(if (featurep 'xemacs) (progn 107(if (featurep 'xemacs) (progn
110 108
109(defun flymake-nop ())
110
111(defun flymake-make-xemacs-menu (menu-data) 111(defun flymake-make-xemacs-menu (menu-data)
112 (let* ((menu-title (nth 0 menu-data)) 112 (let* ((menu-title (nth 0 menu-data))
113 (menu-items (nth 1 menu-data)) 113 (menu-items (nth 1 menu-data))
@@ -134,19 +134,19 @@
134 134
135(defun flymake-current-row () 135(defun flymake-current-row ()
136 "Return current row number in current frame." 136 "Return current row number in current frame."
137 (if (featurep 'xemacs) 137 (if (fboundp 'window-edges)
138 (count-lines (window-start) (point)) 138 (+ (car (cdr (window-edges))) (count-lines (window-start) (point)))
139 (+ (car (cdr (window-edges))) (count-lines (window-start) (point))))) 139 (count-lines (window-start) (point))))
140 140
141(defun flymake-selected-frame () 141(defun flymake-selected-frame ()
142 (if (featurep 'xemacs) 142 (if (fboundp 'window-edges)
143 (selected-window) 143 (selected-frame)
144 (selected-frame))) 144 (selected-window)))
145 145
146;;;; ]] 146;;;; ]]
147 147
148(defcustom flymake-log-level -1 148(defcustom flymake-log-level -1
149 "Logging level, only messages with level > flymake-log-level will not be logged 149 "Logging level, only messages with level lower or equal will be logged.
150-1 = NONE, 0 = ERROR, 1 = WARNING, 2 = INFO, 3 = DEBUG" 150-1 = NONE, 0 = ERROR, 1 = WARNING, 2 = INFO, 3 = DEBUG"
151 :group 'flymake 151 :group 'flymake
152 :type 'integer) 152 :type 'integer)
@@ -170,7 +170,7 @@
170 tmp)) 170 tmp))
171 171
172(defun flymake-set-at (list pos val) 172(defun flymake-set-at (list pos val)
173 "Set VAL at position POS in LIST" 173 "Set VAL at position POS in LIST."
174 (let ((tmp (copy-sequence list))) ; (???) 174 (let ((tmp (copy-sequence list))) ; (???)
175 (setcar (nthcdr pos tmp) val) 175 (setcar (nthcdr pos tmp) val)
176 tmp)) 176 tmp))
@@ -199,8 +199,7 @@
199 199
200 (if (eq buffer (current-buffer)) 200 (if (eq buffer (current-buffer))
201 (symbol-value var-name) 201 (symbol-value var-name)
202 (save-excursion 202 (with-current-buffer buffer
203 (set-buffer buffer)
204 (symbol-value var-name)))) 203 (symbol-value var-name))))
205 204
206(defun flymake-set-buffer-var (buffer var-name var-value) 205(defun flymake-set-buffer-var (buffer var-name var-value)
@@ -210,8 +209,7 @@
210 209
211 (if (eq buffer (current-buffer)) 210 (if (eq buffer (current-buffer))
212 (set var-name var-value) 211 (set var-name var-value)
213 (save-excursion 212 (with-current-buffer buffer
214 (set-buffer buffer)
215 (set var-name var-value)))) 213 (set var-name var-value))))
216 214
217(defvar flymake-buffer-data (flymake-makehash) 215(defvar flymake-buffer-data (flymake-makehash)
@@ -231,7 +229,7 @@
231(defun flymake-set-buffer-value (buffer name value) 229(defun flymake-set-buffer-value (buffer name value)
232 (puthash name value (flymake-get-buffer-data buffer))) 230 (puthash name value (flymake-get-buffer-data buffer)))
233 231
234(defvar flymake-output-residual nil "") 232(defvar flymake-output-residual nil)
235 233
236(make-variable-buffer-local 'flymake-output-residual) 234(make-variable-buffer-local 'flymake-output-residual)
237 235
@@ -253,31 +251,30 @@
253 (".+[0-9]+\\.tex$" flymake-master-tex-init flymake-master-cleanup flymake-get-real-file-name) 251 (".+[0-9]+\\.tex$" flymake-master-tex-init flymake-master-cleanup flymake-get-real-file-name)
254 (".+\\.tex$" flymake-simple-tex-init flymake-simple-cleanup flymake-get-real-file-name) 252 (".+\\.tex$" flymake-simple-tex-init flymake-simple-cleanup flymake-get-real-file-name)
255 (".+\\.idl$" flymake-simple-make-init flymake-simple-cleanup flymake-get-real-file-name) 253 (".+\\.idl$" flymake-simple-make-init flymake-simple-cleanup flymake-get-real-file-name)
256 ; (".+\\.cpp$" 1) 254 ;; (".+\\.cpp$" 1)
257 ; (".+\\.java$" 3) 255 ;; (".+\\.java$" 3)
258 ; (".+\\.h$" 2 (".+\\.cpp$" ".+\\.c$") 256 ;; (".+\\.h$" 2 (".+\\.cpp$" ".+\\.c$")
259 ; ("[ \t]*#[ \t]*include[ \t]*\"\\([\w0-9/\\_\.]*[/\\]*\\)\\(%s\\)\"" 1 2)) 257 ;; ("[ \t]*#[ \t]*include[ \t]*\"\\([\w0-9/\\_\.]*[/\\]*\\)\\(%s\\)\"" 1 2))
260 ; (".+\\.idl$" 1) 258 ;; (".+\\.idl$" 1)
261 ; (".+\\.odl$" 1) 259 ;; (".+\\.odl$" 1)
262 ; (".+[0-9]+\\.tex$" 2 (".+\\.tex$") 260 ;; (".+[0-9]+\\.tex$" 2 (".+\\.tex$")
263 ; ("[ \t]*\\input[ \t]*{\\(.*\\)\\(%s\\)}" 1 2 )) 261 ;; ("[ \t]*\\input[ \t]*{\\(.*\\)\\(%s\\)}" 1 2 ))
264 ; (".+\\.tex$" 1) 262 ;; (".+\\.tex$" 1)
265 ) 263 )
266 "*Files syntax checking is allowed for." 264 "*Files syntax checking is allowed for."
267 :group 'flymake 265 :group 'flymake
268 :type '(repeat (string symbol symbol symbol))) 266 :type '(repeat (string symbol symbol symbol)))
269 267
270(defun flymake-get-file-name-mode-and-masks (file-name) 268(defun flymake-get-file-name-mode-and-masks (file-name)
271 "Return the corresponding entry from 'flymake-allowed-file-name-masks'." 269 "Return the corresponding entry from `flymake-allowed-file-name-masks'."
272 (unless (stringp file-name) 270 (unless (stringp file-name)
273 (error "Invalid file-name")) 271 (error "Invalid file-name"))
274 (let ((count (length flymake-allowed-file-name-masks)) 272 (let ((fnm flymake-allowed-file-name-masks)
275 (idx 0)
276 (mode-and-masks nil)) 273 (mode-and-masks nil))
277 (while (and (not mode-and-masks) (< idx count)) 274 (while (and (not mode-and-masks) fnm)
278 (if (string-match (nth 0 (nth idx flymake-allowed-file-name-masks)) file-name) 275 (if (string-match (car (car fnm)) file-name)
279 (setq mode-and-masks (cdr (nth idx flymake-allowed-file-name-masks)))) 276 (setq mode-and-masks (cdr (car fnm))))
280 (setq idx (1+ idx))) 277 (setq fnm (cdr fnm)))
281 (flymake-log 3 "file %s, init=%s" file-name (car mode-and-masks)) 278 (flymake-log 3 "file %s, init=%s" file-name (car mode-and-masks))
282 mode-and-masks)) 279 mode-and-masks))
283 280
@@ -289,8 +286,8 @@ Return nil if we cannot, non-nil if we can."
289(defun flymake-get-init-function (file-name) 286(defun flymake-get-init-function (file-name)
290 "Return init function to be used for the file." 287 "Return init function to be used for the file."
291 (let* ((init-f (nth 0 (flymake-get-file-name-mode-and-masks file-name)))) 288 (let* ((init-f (nth 0 (flymake-get-file-name-mode-and-masks file-name))))
292 ;(flymake-log 0 "calling %s" init-f) 289 ;;(flymake-log 0 "calling %s" init-f)
293 ;(funcall init-f (current-buffer)) 290 ;;(funcall init-f (current-buffer))
294 init-f)) 291 init-f))
295 292
296(defun flymake-get-cleanup-function (file-name) 293(defun flymake-get-cleanup-function (file-name)
@@ -325,15 +322,13 @@ Return its file name if found, or nil if not found."
325 (flymake-get-buildfile-from-cache source-dir-name)) 322 (flymake-get-buildfile-from-cache source-dir-name))
326 (let* ((buildfile-dir nil) 323 (let* ((buildfile-dir nil)
327 (buildfile nil) 324 (buildfile nil)
328 (dir-count (length dirs))
329 (dir-idx 0)
330 (found nil)) 325 (found nil))
331 (while (and (not found) (< dir-idx dir-count)) 326 (while (and (not found) dirs)
332 (setq buildfile-dir (concat source-dir-name (nth dir-idx dirs))) 327 (setq buildfile-dir (concat source-dir-name (car dirs)))
333 (setq buildfile (concat buildfile-dir "/" buildfile-name)) 328 (setq buildfile (concat buildfile-dir "/" buildfile-name))
334 (when (file-exists-p buildfile) 329 (when (file-exists-p buildfile)
335 (setq found t)) 330 (setq found t))
336 (setq dir-idx (1+ dir-idx))) 331 (setq dirs (cdr dirs)))
337 (if found 332 (if found
338 (progn 333 (progn
339 (flymake-log 3 "found buildfile at %s/%s" buildfile-dir buildfile-name) 334 (flymake-log 3 "found buildfile at %s/%s" buildfile-dir buildfile-name)
@@ -359,39 +354,23 @@ Return t if so, nil if not."
359 (equal (flymake-fix-file-name file-name-one) 354 (equal (flymake-fix-file-name file-name-one)
360 (flymake-fix-file-name file-name-two))) 355 (flymake-fix-file-name file-name-two)))
361 356
362(defun flymake-ensure-ends-with-slash (filename)
363 ;; Should this really be file-name-as-directory?
364 (if (not (= (elt filename (1- (length filename))) (string-to-char "/")))
365 (concat filename "/")
366 filename))
367
368(defun flymake-get-common-file-prefix (string-one string-two) 357(defun flymake-get-common-file-prefix (string-one string-two)
369 "Return common prefix for two file names STRING-ONE and STRING-TWO." 358 "Return common prefix for two file names STRING-ONE and STRING-TWO."
370 (when (and string-one string-two) 359 (setq string-one (file-name-as-directory string-one))
371 (let* ((slash-pos-one -1) 360 (setq string-two (file-name-as-directory string-two))
372 (slash-pos-two -1) 361 (let ((n (compare-strings string-one nil nil string-two nil nil)))
373 (done nil) 362 (if (eq n t) string-one
374 (prefix nil)) 363 (setq n (abs (1+ n)))
375 (setq string-one (flymake-ensure-ends-with-slash string-one)) 364 (file-name-directory (substring string-one 0 n)))))
376 (setq string-two (flymake-ensure-ends-with-slash string-two))
377 (while (not done)
378 (setq slash-pos-one (string-match "/" string-one (1+ slash-pos-one)))
379 (setq slash-pos-two (string-match "/" string-two (1+ slash-pos-two)))
380 (if (and slash-pos-one slash-pos-two
381 (= slash-pos-one slash-pos-two)
382 (string= (substring string-one 0 slash-pos-one) (substring string-two 0 slash-pos-two)))
383 (progn
384 (setq prefix (substring string-one 0 (1+ slash-pos-one))))
385 (setq done t)))
386 prefix)))
387 365
388(defun flymake-build-relative-filename (from-dir to-dir) 366(defun flymake-build-relative-filename (from-dir to-dir)
389 "Return rel: FROM-DIR/rel == TO-DIR." 367 "Return rel: FROM-DIR/rel == TO-DIR."
368 ;; FIXME: Why not use `file-relative-name'?
390 (if (not (equal (elt from-dir 0) (elt to-dir 0))) 369 (if (not (equal (elt from-dir 0) (elt to-dir 0)))
391 (error "First chars in file names %s, %s must be equal (same drive)" 370 (error "First chars in file names %s, %s must be equal (same drive)"
392 from-dir to-dir) 371 from-dir to-dir)
393 (let* ((from (flymake-ensure-ends-with-slash (flymake-fix-file-name from-dir))) 372 (let* ((from (file-name-as-directory (flymake-fix-file-name from-dir)))
394 (to (flymake-ensure-ends-with-slash (flymake-fix-file-name to-dir))) 373 (to (file-name-as-directory (flymake-fix-file-name to-dir)))
395 (prefix (flymake-get-common-file-prefix from to)) 374 (prefix (flymake-get-common-file-prefix from to))
396 (from-suffix (substring from (length prefix))) 375 (from-suffix (substring from (length prefix)))
397 (up-count (length (flymake-split-string from-suffix "[/]"))) 376 (up-count (length (flymake-split-string from-suffix "[/]")))
@@ -413,7 +392,7 @@ Return t if so, nil if not."
413 (or rel "./")))) 392 (or rel "./"))))
414 393
415(defcustom flymake-master-file-dirs '("." "./src" "./UnitTest") 394(defcustom flymake-master-file-dirs '("." "./src" "./UnitTest")
416 "Dirs where to llok for master files." 395 "Dirs where to look for master files."
417 :group 'flymake 396 :group 'flymake
418 :type '(repeat (string))) 397 :type '(repeat (string)))
419 398
@@ -426,35 +405,33 @@ Return t if so, nil if not."
426(defvar flymake-included-file-name) 405(defvar flymake-included-file-name)
427 406
428(defun flymake-find-possible-master-files (file-name master-file-dirs masks) 407(defun flymake-find-possible-master-files (file-name master-file-dirs masks)
429 "Find (by name and location) all posible master files. 408 "Find (by name and location) all possible master files.
430Mater files are .cpp and .c for and .h. Files are searched for 409Master files are .cpp and .c for and .h. Files are searched for
431starting from the .h directory and max max-level parent dirs. 410starting from the .h directory and max max-level parent dirs.
432File contents are not checked." 411File contents are not checked."
433 (let* ((dir-idx 0) 412 (let* ((dirs master-file-dirs)
434 (dir-count (length master-file-dirs))
435 (files nil) 413 (files nil)
436 (done nil) 414 (done nil))
437 (masks-count (length masks))) 415
438 416 (while (and (not done) dirs)
439 (while (and (not done) (< dir-idx dir-count)) 417 (let* ((dir (concat (flymake-fix-file-name (file-name-directory file-name))
440 (let* ((dir (concat (flymake-fix-file-name (file-name-directory file-name)) "/" (nth dir-idx master-file-dirs))) 418 "/" (car dirs)))
441 (masks-idx 0)) 419 (masks masks))
442 (while (and (file-exists-p dir) (not done) (< masks-idx masks-count)) 420 (while (and (file-exists-p dir) (not done) masks)
443 (let* ((mask (nth masks-idx masks)) 421 (let* ((mask (car masks))
444 (dir-files (directory-files dir t mask)) 422 (dir-files (directory-files dir t mask)))
445 (file-count (length dir-files)) 423
446 (file-idx 0)) 424 (flymake-log 3 "dir %s, %d file(s) for mask %s"
447 425 dir (length dir-files) mask)
448 (flymake-log 3 "dir %s, %d file(s) for mask %s" dir file-count mask) 426 (while (and (not done) dir-files)
449 (while (and (not done) (< file-idx file-count)) 427 (when (not (file-directory-p (car dir-files)))
450 (when (not (file-directory-p (nth file-idx dir-files))) 428 (setq files (cons (car dir-files) files))
451 (setq files (cons (nth file-idx dir-files) files))
452 (when (>= (length files) flymake-master-file-count-limit) 429 (when (>= (length files) flymake-master-file-count-limit)
453 (flymake-log 3 "master file count limit (%d) reached" flymake-master-file-count-limit) 430 (flymake-log 3 "master file count limit (%d) reached" flymake-master-file-count-limit)
454 (setq done t))) 431 (setq done t)))
455 (setq file-idx (1+ file-idx)))) 432 (setq dir-files (cdr dir-files))))
456 (setq masks-idx (1+ masks-idx)))) 433 (setq masks (cdr masks))))
457 (setq dir-idx (1+ dir-idx))) 434 (setq dirs (cdr dirs)))
458 (when files 435 (when files
459 (let ((flymake-included-file-name (file-name-nondirectory file-name))) 436 (let ((flymake-included-file-name (file-name-nondirectory file-name)))
460 (setq files (sort files 'flymake-master-file-compare)))) 437 (setq files (sort files 'flymake-master-file-compare))))
@@ -512,32 +489,32 @@ instead of reading master file from disk."
512 (when (flymake-check-include source-file-name inc-path inc-name include-dirs) 489 (when (flymake-check-include source-file-name inc-path inc-name include-dirs)
513 (setq found t) 490 (setq found t)
514 ;; replace-match is not used here as it fails in 491 ;; replace-match is not used here as it fails in
515 ;; xemacs with 'last match not a buffer' error as 492 ;; XEmacs with 'last match not a buffer' error as
516 ;; check-includes calls replace-in-string 493 ;; check-includes calls replace-in-string
517 (flymake-replace-region (current-buffer) match-beg match-end 494 (flymake-replace-region match-beg match-end
518 (file-name-nondirectory patched-source-file-name)))) 495 (file-name-nondirectory patched-source-file-name))))
519 (forward-line 1))) 496 (forward-line 1)))
520 (when found 497 (when found
521 (flymake-save-buffer-in-file (current-buffer) patched-master-file-name))) 498 (flymake-save-buffer-in-file (current-buffer) patched-master-file-name)))
522 ;+(flymake-log 3 "killing buffer %s" (buffer-name master-file-temp-buffer)) 499 ;;+(flymake-log 3 "killing buffer %s" (buffer-name master-file-temp-buffer))
523 (kill-buffer master-file-temp-buffer))) 500 (kill-buffer master-file-temp-buffer)))
524 ;+(flymake-log 3 "check-patch master file %s: %s" master-file-name found) 501 ;;+(flymake-log 3 "check-patch master file %s: %s" master-file-name found)
525 (when found 502 (when found
526 (flymake-log 2 "found master file %s" master-file-name)) 503 (flymake-log 2 "found master file %s" master-file-name))
527 found)) 504 found))
528 505
529(defun flymake-replace-region (buffer beg end rep) 506(defun flymake-replace-region (beg end rep)
530 "Replace text in BUFFER in region (BEG END) with REP." 507 "Replace text in BUFFER in region (BEG END) with REP."
531 (save-excursion 508 (save-excursion
532 (delete-region beg end) 509 (goto-char end)
533 (goto-char beg) 510 ;; Insert before deleting, so as to better preserve markers's positions.
534 (insert rep))) 511 (insert rep)
512 (delete-region beg end)))
535 513
536(defun flymake-read-file-to-temp-buffer (file-name) 514(defun flymake-read-file-to-temp-buffer (file-name)
537 "Insert contents of FILE-NAME into newly created temp buffer." 515 "Insert contents of FILE-NAME into newly created temp buffer."
538 (let* ((temp-buffer (get-buffer-create (generate-new-buffer-name (concat "flymake:" (file-name-nondirectory file-name)))))) 516 (let* ((temp-buffer (get-buffer-create (generate-new-buffer-name (concat "flymake:" (file-name-nondirectory file-name))))))
539 (save-excursion 517 (with-current-buffer temp-buffer
540 (set-buffer temp-buffer)
541 (insert-file-contents file-name)) 518 (insert-file-contents file-name))
542 temp-buffer)) 519 temp-buffer))
543 520
@@ -545,8 +522,7 @@ instead of reading master file from disk."
545 "Copy contents of BUFFER into newly created temp buffer." 522 "Copy contents of BUFFER into newly created temp buffer."
546 (let ((contents nil) 523 (let ((contents nil)
547 (temp-buffer nil)) 524 (temp-buffer nil))
548 (save-excursion 525 (with-current-buffer buffer
549 (set-buffer buffer)
550 (setq contents (buffer-string)) 526 (setq contents (buffer-string))
551 527
552 (setq temp-buffer (get-buffer-create (generate-new-buffer-name (concat "flymake:" (buffer-name buffer))))) 528 (setq temp-buffer (get-buffer-create (generate-new-buffer-name (concat "flymake:" (buffer-name buffer)))))
@@ -559,18 +535,17 @@ instead of reading master file from disk."
559Return t if it can be found via include path using INC-PATH and INC-NAME." 535Return t if it can be found via include path using INC-PATH and INC-NAME."
560 (if (file-name-absolute-p inc-path) 536 (if (file-name-absolute-p inc-path)
561 (flymake-same-files source-file-name (concat inc-path "/" inc-name)) 537 (flymake-same-files source-file-name (concat inc-path "/" inc-name))
562 (let* ((count (length include-dirs)) 538 (let* ((file-name nil)
563 (idx 0)
564 (file-name nil)
565 (found nil)) 539 (found nil))
566 (while (and (not found) (< idx count)) 540 (while (and (not found) include-dirs)
567 (setq file-name (concat (file-name-directory source-file-name) "/" (nth idx include-dirs))) 541 (setq file-name (concat (file-name-directory source-file-name)
542 "/" (car include-dirs)))
568 (if (> (length inc-path) 0) 543 (if (> (length inc-path) 0)
569 (setq file-name (concat file-name "/" inc-path))) 544 (setq file-name (concat file-name "/" inc-path)))
570 (setq file-name (concat file-name "/" inc-name)) 545 (setq file-name (concat file-name "/" inc-name))
571 (when (flymake-same-files source-file-name file-name) 546 (when (flymake-same-files source-file-name file-name)
572 (setq found t)) 547 (setq found t))
573 (setq idx (1+ idx))) 548 (setq include-dirs (cdr include-dirs)))
574 found))) 549 found)))
575 550
576(defun flymake-find-buffer-for-file (file-name) 551(defun flymake-find-buffer-for-file (file-name)
@@ -617,9 +592,8 @@ Find master file, patch and save it."
617(defun flymake-save-buffer-in-file (buffer file-name) 592(defun flymake-save-buffer-in-file (buffer file-name)
618 (or buffer 593 (or buffer
619 (error "Invalid buffer")) 594 (error "Invalid buffer"))
620 (save-excursion 595 (with-current-buffer buffer
621 (save-restriction 596 (save-restriction
622 (set-buffer buffer)
623 (widen) 597 (widen)
624 (make-directory (file-name-directory file-name) 1) 598 (make-directory (file-name-directory file-name) 1)
625 (write-region (point-min) (point-max) file-name nil 566))) 599 (write-region (point-min) (point-max) file-name nil 566)))
@@ -664,8 +638,7 @@ It's flymake process filter."
664 (delete-process process) 638 (delete-process process)
665 639
666 (when source-buffer 640 (when source-buffer
667 (save-excursion 641 (with-current-buffer source-buffer
668 (set-buffer source-buffer)
669 642
670 (flymake-parse-residual source-buffer) 643 (flymake-parse-residual source-buffer)
671 (flymake-post-syntax-check source-buffer exit-status command) 644 (flymake-post-syntax-check source-buffer exit-status command)
@@ -705,8 +678,7 @@ It's flymake process filter."
705 678
706(defun flymake-parse-output-and-residual (source-buffer output) 679(defun flymake-parse-output-and-residual (source-buffer output)
707 "Split OUTPUT into lines, merge in residual if necessary." 680 "Split OUTPUT into lines, merge in residual if necessary."
708 (save-excursion 681 (with-current-buffer source-buffer
709 (set-buffer source-buffer)
710 (let* ((buffer-residual (flymake-get-buffer-output-residual source-buffer)) 682 (let* ((buffer-residual (flymake-get-buffer-output-residual source-buffer))
711 (total-output (if buffer-residual (concat buffer-residual output) output)) 683 (total-output (if buffer-residual (concat buffer-residual output) output))
712 (lines-and-residual (flymake-split-output total-output)) 684 (lines-and-residual (flymake-split-output total-output))
@@ -720,8 +692,7 @@ It's flymake process filter."
720 692
721(defun flymake-parse-residual (source-buffer) 693(defun flymake-parse-residual (source-buffer)
722 "Parse residual if it's non empty." 694 "Parse residual if it's non empty."
723 (save-excursion 695 (with-current-buffer source-buffer
724 (set-buffer source-buffer)
725 (when (flymake-get-buffer-output-residual source-buffer) 696 (when (flymake-get-buffer-output-residual source-buffer)
726 (flymake-set-buffer-new-err-info source-buffer (flymake-parse-err-lines 697 (flymake-set-buffer-new-err-info source-buffer (flymake-parse-err-lines
727 (flymake-get-buffer-new-err-info source-buffer) 698 (flymake-get-buffer-new-err-info source-buffer)
@@ -845,8 +816,7 @@ line number outside the file being compiled."
845 816
846(defun flymake-highlight-err-lines (buffer err-info-list) 817(defun flymake-highlight-err-lines (buffer err-info-list)
847 "Highlight error lines in BUFFER using info from ERR-INFO-LIST." 818 "Highlight error lines in BUFFER using info from ERR-INFO-LIST."
848 (save-excursion 819 (with-current-buffer buffer
849 (set-buffer buffer)
850 (let* ((idx 0) 820 (let* ((idx 0)
851 (count (length err-info-list))) 821 (count (length err-info-list)))
852 (while (< idx count) 822 (while (< idx count)
@@ -866,19 +836,18 @@ line number outside the file being compiled."
866 (overlay-put ov 'help-echo tooltip-text) 836 (overlay-put ov 'help-echo tooltip-text)
867 (overlay-put ov 'flymake-overlay t) 837 (overlay-put ov 'flymake-overlay t)
868 (overlay-put ov 'priority 100) 838 (overlay-put ov 'priority 100)
869 ;+(flymake-log 3 "created overlay %s" ov) 839 ;;+(flymake-log 3 "created overlay %s" ov)
870 ov) 840 ov)
871 (flymake-log 3 "created an overlay at (%d-%d)" beg end))) 841 (flymake-log 3 "created an overlay at (%d-%d)" beg end)))
872 842
873(defun flymake-delete-own-overlays (buffer) 843(defun flymake-delete-own-overlays (buffer)
874 "Delete all flymake overlays in BUFFER." 844 "Delete all flymake overlays in BUFFER."
875 (save-excursion 845 (with-current-buffer buffer
876 (set-buffer buffer)
877 (let ((ov (overlays-in (point-min) (point-max)))) 846 (let ((ov (overlays-in (point-min) (point-max))))
878 (while (consp ov) 847 (while (consp ov)
879 (when (flymake-overlay-p (car ov)) 848 (when (flymake-overlay-p (car ov))
880 (delete-overlay (car ov)) 849 (delete-overlay (car ov))
881 ;+(flymake-log 3 "deleted overlay %s" ov) 850 ;;+(flymake-log 3 "deleted overlay %s" ov)
882 ) 851 )
883 (setq ov (cdr ov)))))) 852 (setq ov (cdr ov))))))
884 853
@@ -890,11 +859,12 @@ Return t if it has at least one flymake overlay, nil if no overlay."
890 (while (consp ov) 859 (while (consp ov)
891 (when (flymake-overlay-p (car ov)) 860 (when (flymake-overlay-p (car ov))
892 (setq has-flymake-overlays t)) 861 (setq has-flymake-overlays t))
893 (setq ov (cdr ov))))) 862 (setq ov (cdr ov)))
863 has-flymake-overlays))
894 864
895(defface flymake-errline-face 865(defface flymake-errline-face
896 ;+ '((((class color)) (:foreground "OrangeRed" :bold t :underline t)) 866 ;;+ '((((class color)) (:foreground "OrangeRed" :bold t :underline t))
897 ;+ '((((class color)) (:underline "OrangeRed")) 867 ;;+ '((((class color)) (:underline "OrangeRed"))
898 '((((class color)) (:background "LightPink")) 868 '((((class color)) (:background "LightPink"))
899 (t (:bold t))) 869 (t (:bold t)))
900 "Face used for marking error lines." 870 "Face used for marking error lines."
@@ -970,7 +940,8 @@ Perhaps use text from LINE-ERR-INFO-ILST to enhance highlighting."
970 940
971(defun flymake-split-output (output) 941(defun flymake-split-output (output)
972 "Split OUTPUT into lines. 942 "Split OUTPUT into lines.
973Return last one as residual if it does not end with newline char. Returns ((lines) residual)." 943Return last one as residual if it does not end with newline char.
944Returns ((LINES) RESIDUAL)."
974 (when (and output (> (length output) 0)) 945 (when (and output (> (length output) 0))
975 (let* ((lines (flymake-split-string output "[\n\r]+")) 946 (let* ((lines (flymake-split-string output "[\n\r]+"))
976 (complete (equal "\n" (char-to-string (aref output (1- (length output)))))) 947 (complete (equal "\n" (char-to-string (aref output (1- (length output))))))
@@ -984,21 +955,18 @@ Return last one as residual if it does not end with newline char. Returns ((line
984 "Grab error line patterns from ORIGINAL-LIST in compile.el format. 955 "Grab error line patterns from ORIGINAL-LIST in compile.el format.
985Convert it to flymake internal format." 956Convert it to flymake internal format."
986 (let* ((converted-list '())) 957 (let* ((converted-list '()))
987 (mapcar 958 (dolist (item original-list)
988 (lambda (item) 959 (setq item (cdr item))
989 (setq item (cdr item)) 960 (let ((regexp (nth 0 item))
990 (let ((regexp (nth 0 item)) 961 (file (nth 1 item))
991 (file (nth 1 item)) 962 (line (nth 2 item))
992 (line (nth 2 item)) 963 (col (nth 3 item)))
993 (col (nth 3 item)) 964 (if (consp file) (setq file (car file)))
994 end-line) 965 (if (consp line) (setq line (car line)))
995 (if (consp file) (setq file (car file))) 966 (if (consp col) (setq col (car col)))
996 (if (consp line) (setq end-line (cdr line) line (car line))) 967
997 (if (consp col) (setq col (car col))) 968 (when (not (functionp line))
998 969 (setq converted-list (cons (list regexp file line col) converted-list)))))
999 (when (not (functionp line))
1000 (setq converted-list (cons (list regexp file line col) converted-list)))))
1001 original-list)
1002 converted-list)) 970 converted-list))
1003 971
1004(eval-when-compile 972(eval-when-compile
@@ -1007,40 +975,43 @@ Convert it to flymake internal format."
1007(defvar flymake-err-line-patterns ; regexp file-idx line-idx col-idx (optional) text-idx(optional), match-end to end of string is error text 975(defvar flymake-err-line-patterns ; regexp file-idx line-idx col-idx (optional) text-idx(optional), match-end to end of string is error text
1008 (append 976 (append
1009 '( 977 '(
1010 ; MS Visual C++ 6.0 978 ;; MS Visual C++ 6.0
1011 ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) \: \\(\\(error\\|warning\\|fatal error\\) \\(C[0-9]+\\):[ \t\n]*\\(.+\\)\\)" 979 ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) \: \\(\\(error\\|warning\\|fatal error\\) \\(C[0-9]+\\):[ \t\n]*\\(.+\\)\\)"
1012 1 3 nil 4) 980 1 3 nil 4)
1013 ; jikes 981 ;; jikes
1014 ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[0-9]+\:[0-9]+\:[0-9]+\: \\(\\(Error\\|Warning\\|Caution\\|Semantic Error\\):[ \t\n]*\\(.+\\)\\)" 982 ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[0-9]+\:[0-9]+\:[0-9]+\: \\(\\(Error\\|Warning\\|Caution\\|Semantic Error\\):[ \t\n]*\\(.+\\)\\)"
1015 1 3 nil 4) 983 1 3 nil 4)
1016 ; MS midl 984 ;; MS midl
1017 ("midl[ ]*:[ ]*\\(command line error .*\\)" 985 ("midl[ ]*:[ ]*\\(command line error .*\\)"
1018 nil nil nil 1) 986 nil nil nil 1)
1019 ; MS C# 987 ;; MS C#
1020 ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\),[0-9]+)\: \\(\\(error\\|warning\\|fatal error\\) \\(CS[0-9]+\\):[ \t\n]*\\(.+\\)\\)" 988 ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\),[0-9]+)\: \\(\\(error\\|warning\\|fatal error\\) \\(CS[0-9]+\\):[ \t\n]*\\(.+\\)\\)"
1021 1 3 nil 4) 989 1 3 nil 4)
1022 ; perl 990 ;; perl
1023 ("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]" 2 3 nil 1) 991 ("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]" 2 3 nil 1)
1024 ; LaTeX warnings (fileless) ("\\(LaTeX \\(Warning\\|Error\\): .*\\) on input line \\([0-9]+\\)" 20 3 nil 1) 992 ;; LaTeX warnings (fileless) ("\\(LaTeX \\(Warning\\|Error\\): .*\\) on input line \\([0-9]+\\)" 20 3 nil 1)
1025 ; ant/javac 993 ;; ant/javac
1026 (" *\\(\\[javac\\]\\)? *\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)" 994 (" *\\(\\[javac\\]\\)? *\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)"
1027 2 4 nil 5)) 995 2 4 nil 5))
1028 ;; compilation-error-regexp-alist) 996 ;; compilation-error-regexp-alist)
1029 (flymake-reformat-err-line-patterns-from-compile-el compilation-error-regexp-alist-alist)) 997 (flymake-reformat-err-line-patterns-from-compile-el compilation-error-regexp-alist-alist))
1030 "patterns for matching error/warning lines, (regexp file-idx line-idx err-text-idx). Use flymake-reformat-err-line-patterns-from-compile-el to add patterns from compile.el") 998 "Patterns for matching error/warning lines.
1031 999\(REGEXP FILE-IDX LINE-IDX ERR-TEXT-IDX).
1032 ;(defcustom flymake-err-line-patterns 1000Use `flymake-reformat-err-line-patterns-from-compile-el' to add patterns
1033 ; '( 1001from compile.el")
1034 ; ; MS Visual C++ 6.0 1002
1035 ; ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) \: \\(\\(error\\|warning\\|fatal error\\) \\(C[0-9]+\\):[ \t\n]*\\(.+\\)\\)" 1003;;(defcustom flymake-err-line-patterns
1036 ; 1 3 4) 1004;; '(
1037 ; ; jikes 1005;; ; MS Visual C++ 6.0
1038 ; ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[0-9]+\:[0-9]+\:[0-9]+\: \\(\\(Error\\|Warning\\|Caution\\):[ \t\n]*\\(.+\\)\\)" 1006;; ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) \: \\(\\(error\\|warning\\|fatal error\\) \\(C[0-9]+\\):[ \t\n]*\\(.+\\)\\)"
1039 ; 1 3 4)) 1007;; 1 3 4)
1040 ; "patterns for matching error/warning lines, (regexp file-idx line-idx err-text-idx)" 1008;; ; jikes
1041 ; :group 'flymake 1009;; ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[0-9]+\:[0-9]+\:[0-9]+\: \\(\\(Error\\|Warning\\|Caution\\):[ \t\n]*\\(.+\\)\\)"
1042 ; :type '(repeat (string number number number)) 1010;; 1 3 4))
1043 ;) 1011;; "patterns for matching error/warning lines, (regexp file-idx line-idx err-text-idx)"
1012;; :group 'flymake
1013;; :type '(repeat (string number number number))
1014;;)
1044 1015
1045(defun flymake-parse-line (line) 1016(defun flymake-parse-line (line)
1046 "Parse LINE to see if it is an error of warning. 1017 "Parse LINE to see if it is an error of warning.
@@ -1049,18 +1020,17 @@ Return its components if so, nil if no."
1049 (line-no 0) 1020 (line-no 0)
1050 (err-type "e") 1021 (err-type "e")
1051 (err-text nil) 1022 (err-text nil)
1052 (count (length flymake-err-line-patterns)) 1023 (patterns flymake-err-line-patterns)
1053 (idx 0)
1054 (matched nil)) 1024 (matched nil))
1055 (while (and (< idx count) (not matched)) 1025 (while (and patterns (not matched))
1056 (when (string-match (car (nth idx flymake-err-line-patterns)) line) 1026 (when (string-match (car (car patterns)) line)
1057 (let* ((file-idx (nth 1 (nth idx flymake-err-line-patterns))) 1027 (let* ((file-idx (nth 1 (car patterns)))
1058 (line-idx (nth 2 (nth idx flymake-err-line-patterns)))) 1028 (line-idx (nth 2 (car patterns))))
1059 1029
1060 (setq raw-file-name (if file-idx (match-string file-idx line) nil)) 1030 (setq raw-file-name (if file-idx (match-string file-idx line) nil))
1061 (setq line-no (if line-idx (string-to-int (match-string line-idx line)) 0)) 1031 (setq line-no (if line-idx (string-to-int (match-string line-idx line)) 0))
1062 (setq err-text (if (> (length (nth idx flymake-err-line-patterns)) 4) 1032 (setq err-text (if (> (length (car patterns)) 4)
1063 (match-string (nth 4 (nth idx flymake-err-line-patterns)) line) 1033 (match-string (nth 4 (car patterns)) line)
1064 (flymake-patch-err-text (substring line (match-end 0))))) 1034 (flymake-patch-err-text (substring line (match-end 0)))))
1065 (or err-text (setq err-text "<no error text>")) 1035 (or err-text (setq err-text "<no error text>"))
1066 (if (and err-text (string-match "^[wW]arning" err-text)) 1036 (if (and err-text (string-match "^[wW]arning" err-text))
@@ -1069,7 +1039,7 @@ Return its components if so, nil if no."
1069 (flymake-log 3 "parse line: file-idx=%s line-idx=%s file=%s line=%s text=%s" file-idx line-idx 1039 (flymake-log 3 "parse line: file-idx=%s line-idx=%s file=%s line=%s text=%s" file-idx line-idx
1070 raw-file-name line-no err-text) 1040 raw-file-name line-no err-text)
1071 (setq matched t))) 1041 (setq matched t)))
1072 (setq idx (1+ idx))) 1042 (setq patterns (cdr patterns)))
1073 (if matched 1043 (if matched
1074 (flymake-ler-make-ler raw-file-name line-no err-type err-text) 1044 (flymake-ler-make-ler raw-file-name line-no err-type err-text)
1075 ()))) 1045 ())))
@@ -1110,8 +1080,7 @@ Return its components if so, nil if no."
1110 1080
1111(defun flymake-add-err-info (err-info-list line-err-info) 1081(defun flymake-add-err-info (err-info-list line-err-info)
1112 "Add error info (file line type text) to err info list preserving sort order." 1082 "Add error info (file line type text) to err info list preserving sort order."
1113 (let* ((count (length err-info-list)) 1083 (let* ((line-no (if (flymake-ler-get-file line-err-info) 1 (flymake-ler-get-line line-err-info)))
1114 (line-no (if (flymake-ler-get-file line-err-info) 1 (flymake-ler-get-line line-err-info)))
1115 (info-and-pos (flymake-find-err-info err-info-list line-no)) 1084 (info-and-pos (flymake-find-err-info err-info-list line-no))
1116 (exists (car info-and-pos)) 1085 (exists (car info-and-pos))
1117 (pos (nth 1 info-and-pos)) 1086 (pos (nth 1 info-and-pos))
@@ -1133,7 +1102,7 @@ Return its components if so, nil if no."
1133 (if (flymake-get-project-include-dirs-from-cache basedir) 1102 (if (flymake-get-project-include-dirs-from-cache basedir)
1134 (progn 1103 (progn
1135 (flymake-get-project-include-dirs-from-cache basedir)) 1104 (flymake-get-project-include-dirs-from-cache basedir))
1136 ;else 1105 ;;else
1137 (let* ((command-line (concat "make -C\"" basedir "\" DUMPVARS=INCLUDE_DIRS dumpvars")) 1106 (let* ((command-line (concat "make -C\"" basedir "\" DUMPVARS=INCLUDE_DIRS dumpvars"))
1138 (output (shell-command-to-string command-line)) 1107 (output (shell-command-to-string command-line))
1139 (lines (flymake-split-string output "\n")) 1108 (lines (flymake-split-string output "\n"))
@@ -1206,9 +1175,8 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1206(defun flymake-get-program-dir (buffer) 1175(defun flymake-get-program-dir (buffer)
1207 "Get dir to start program in." 1176 "Get dir to start program in."
1208 (unless (bufferp buffer) 1177 (unless (bufferp buffer)
1209 (error "Invlid buffer")) 1178 (error "Invalid buffer"))
1210 (save-excursion 1179 (with-current-buffer buffer
1211 (set-buffer buffer)
1212 default-directory)) 1180 default-directory))
1213 1181
1214(defun flymake-safe-delete-file (file-name) 1182(defun flymake-safe-delete-file (file-name)
@@ -1233,8 +1201,7 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1233 "Start syntax checking for buffer BUFFER." 1201 "Start syntax checking for buffer BUFFER."
1234 (unless (bufferp buffer) 1202 (unless (bufferp buffer)
1235 (error "Expected a buffer")) 1203 (error "Expected a buffer"))
1236 (save-excursion 1204 (with-current-buffer buffer
1237 (set-buffer buffer)
1238 (flymake-log 3 "flymake is running: %s" (flymake-get-buffer-is-running buffer)) 1205 (flymake-log 3 "flymake is running: %s" (flymake-get-buffer-is-running buffer))
1239 (when (and (not (flymake-get-buffer-is-running buffer)) 1206 (when (and (not (flymake-get-buffer-is-running buffer))
1240 (flymake-can-syntax-check-file (buffer-file-name buffer))) 1207 (flymake-can-syntax-check-file (buffer-file-name buffer)))
@@ -1317,7 +1284,7 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1317 (call-interactively 'compile)) 1284 (call-interactively 'compile))
1318 1285
1319(defvar flymake-is-running nil 1286(defvar flymake-is-running nil
1320 "If t, flymake syntax check process is running for the current buffer") 1287 "If t, flymake syntax check process is running for the current buffer.")
1321 1288
1322(make-variable-buffer-local 'flymake-is-running) 1289(make-variable-buffer-local 'flymake-is-running)
1323 1290
@@ -1361,7 +1328,7 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1361 (flymake-set-buffer-var buffer 'flymake-check-start-time check-start-time)) 1328 (flymake-set-buffer-var buffer 'flymake-check-start-time check-start-time))
1362 1329
1363(defvar flymake-check-was-interrupted nil 1330(defvar flymake-check-was-interrupted nil
1364 "t if syntax check was killed by flymake-compile") 1331 "Non-nil if syntax check was killed by `flymake-compile'.")
1365 1332
1366(make-variable-buffer-local 'flymake-check-was-interrupted) 1333(make-variable-buffer-local 'flymake-check-was-interrupted)
1367 1334
@@ -1378,10 +1345,9 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1378 1345
1379(defun flymake-on-timer-event (buffer) 1346(defun flymake-on-timer-event (buffer)
1380 "Start a syntax check for buffer BUFFER if necessary." 1347 "Start a syntax check for buffer BUFFER if necessary."
1381 ;+(flymake-log 3 "timer: running=%s, time=%s, cur-time=%s" (flymake-get-buffer-is-running buffer) (flymake-get-buffer-last-change-time buffer) (flymake-float-time)) 1348 ;;+(flymake-log 3 "timer: running=%s, time=%s, cur-time=%s" (flymake-get-buffer-is-running buffer) (flymake-get-buffer-last-change-time buffer) (flymake-float-time))
1382 (when (and (bufferp buffer) (not (flymake-get-buffer-is-running buffer))) 1349 (when (and (bufferp buffer) (not (flymake-get-buffer-is-running buffer)))
1383 (save-excursion 1350 (with-current-buffer buffer
1384 (set-buffer buffer)
1385 (when (and (flymake-get-buffer-last-change-time buffer) 1351 (when (and (flymake-get-buffer-last-change-time buffer)
1386 (> (flymake-float-time) (+ flymake-no-changes-timeout (flymake-get-buffer-last-change-time buffer)))) 1352 (> (flymake-float-time) (+ flymake-no-changes-timeout (flymake-get-buffer-last-change-time buffer))))
1387 (flymake-set-buffer-last-change-time buffer nil) 1353 (flymake-set-buffer-last-change-time buffer nil)
@@ -1400,18 +1366,9 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1400 (end (if (= (point) (point-max)) (point) (1+ (point))))) 1366 (end (if (= (point) (point-max)) (point) (1+ (point)))))
1401 (count-lines beg end))) 1367 (count-lines beg end)))
1402 1368
1403(defun flymake-get-line-count (buffer)
1404 "Return number of lines in buffer BUFFER."
1405 (unless (bufferp buffer)
1406 (error "Invalid buffer"))
1407 (save-excursion
1408 (set-buffer buffer)
1409 (count-lines (point-min) (point-max))))
1410
1411(defun flymake-count-lines (buffer) 1369(defun flymake-count-lines (buffer)
1412 "Return number of lines in buffer BUFFER." 1370 "Return number of lines in buffer BUFFER."
1413 (save-excursion 1371 (with-current-buffer buffer
1414 (set-buffer buffer)
1415 (count-lines (point-min) (point-max)))) 1372 (count-lines (point-min) (point-max))))
1416 1373
1417(defun flymake-get-point-pixel-pos () 1374(defun flymake-get-point-pixel-pos ()
@@ -1438,7 +1395,6 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1438 (menu-data (flymake-make-err-menu-data line-no line-err-info-list)) 1395 (menu-data (flymake-make-err-menu-data line-no line-err-info-list))
1439 (choice nil) 1396 (choice nil)
1440 (mouse-pos (flymake-get-point-pixel-pos)) 1397 (mouse-pos (flymake-get-point-pixel-pos))
1441 (moved-mouse-pos (list (car mouse-pos) (+ 10 (car (cdr mouse-pos)))))
1442 (menu-pos (list (flymake-get-point-pixel-pos) (selected-window)))) 1398 (menu-pos (list (flymake-get-point-pixel-pos) (selected-window))))
1443 (if menu-data 1399 (if menu-data
1444 (progn 1400 (progn
@@ -1474,7 +1430,7 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1474 nil))) 1430 nil)))
1475 1431
1476(defun flymake-goto-file-and-line (file line) 1432(defun flymake-goto-file-and-line (file line)
1477 "Try to get buffer for file and goto line line in it" 1433 "Try to get buffer for FILE and goto line LINE in it."
1478 (if (not (file-exists-p file)) 1434 (if (not (file-exists-p file))
1479 (flymake-log 1 "file %s does not exists" file) 1435 (flymake-log 1 "file %s does not exists" file)
1480 (progn 1436 (progn
@@ -1482,12 +1438,7 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1482 (goto-line line)))) 1438 (goto-line line))))
1483 1439
1484;; flymake minor mode declarations 1440;; flymake minor mode declarations
1485(defvar flymake-mode nil) 1441(defvar flymake-mode-line nil)
1486
1487(make-variable-buffer-local 'flymake-mode)
1488
1489(defvar flymake-mode-line nil
1490 "")
1491 1442
1492(make-variable-buffer-local 'flymake-mode-line) 1443(make-variable-buffer-local 'flymake-mode-line)
1493 1444
@@ -1520,8 +1471,7 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1520(defun flymake-report-status (buffer e-w &optional status) 1471(defun flymake-report-status (buffer e-w &optional status)
1521 "Show status in mode line." 1472 "Show status in mode line."
1522 (when (bufferp buffer) 1473 (when (bufferp buffer)
1523 (save-excursion 1474 (with-current-buffer buffer
1524 (set-buffer buffer)
1525 (when e-w 1475 (when e-w
1526 (flymake-set-buffer-mode-line-e-w buffer e-w) 1476 (flymake-set-buffer-mode-line-e-w buffer e-w)
1527 ) 1477 )
@@ -1548,30 +1498,22 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1548 (when flymake-gui-warnings-enabled 1498 (when flymake-gui-warnings-enabled
1549 (flymake-display-warning (format "Flymake: %s. Flymake will be switched OFF" warning)) 1499 (flymake-display-warning (format "Flymake: %s. Flymake will be switched OFF" warning))
1550 ) 1500 )
1551 (save-excursion 1501 (with-current-buffer buffer
1552 (set-buffer buffer)
1553 (flymake-mode 0) 1502 (flymake-mode 0)
1554 (flymake-log 0 "switched OFF Flymake mode for buffer %s due to fatal status %s, warning %s" 1503 (flymake-log 0 "switched OFF Flymake mode for buffer %s due to fatal status %s, warning %s"
1555 (buffer-name buffer) status warning))) 1504 (buffer-name buffer) status warning)))
1556 1505
1557(defun flymake-mode (&optional arg) 1506;;;###autoload
1558 "Toggle flymake mode on/off." 1507(define-minor-mode flymake-mode
1559 (interactive) 1508 "Minor mode to do on-the-fly syntax checking.
1560 (let ((old-flymake-mode flymake-mode) 1509When called interactively, toggles the minor mode.
1561 (turn-on nil)) 1510With arg, turn Flymake mode on if and only if arg is positive."
1562 1511 :lighter flymake-mode-line
1563 (setq turn-on 1512 (if flymake-mode
1564 (if (null arg) 1513 (if (flymake-can-syntax-check-file (buffer-file-name))
1565 (not flymake-mode) 1514 (flymake-mode-on)
1566 ;else 1515 (flymake-log 2 "flymake cannot check syntax in buffer %s" (buffer-name)))
1567 (> (prefix-numeric-value arg) 0))) 1516 (flymake-mode-off)))
1568
1569 (if turn-on
1570 (if (flymake-can-syntax-check-file (buffer-file-name))
1571 (flymake-mode-on)
1572 (flymake-log 2 "flymake cannot check syntax in buffer %s" (buffer-name)))
1573 (flymake-mode-off))
1574 (force-mode-line-update)))
1575 1517
1576(defcustom flymake-start-syntax-check-on-find-file t 1518(defcustom flymake-start-syntax-check-on-find-file t
1577 "Start syntax check on find file." 1519 "Start syntax check on find file."
@@ -1579,10 +1521,6 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1579 :type 'boolean) 1521 :type 'boolean)
1580 1522
1581;;;###autoload 1523;;;###autoload
1582(unless (assq 'flymake-mode minor-mode-alist)
1583 (setq minor-mode-alist (cons '(flymake-mode flymake-mode-line) minor-mode-alist)))
1584
1585;;;###autoload
1586(defun flymake-mode-on () 1524(defun flymake-mode-on ()
1587 "Turn flymake mode on." 1525 "Turn flymake mode on."
1588 (when (not flymake-mode) 1526 (when (not flymake-mode)
@@ -1590,7 +1528,7 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1590 (setq after-change-functions (cons 'flymake-after-change-function after-change-functions)) 1528 (setq after-change-functions (cons 'flymake-after-change-function after-change-functions))
1591 (add-hook 'after-save-hook 'flymake-after-save-hook) 1529 (add-hook 'after-save-hook 'flymake-after-save-hook)
1592 (add-hook 'kill-buffer-hook 'flymake-kill-buffer-hook) 1530 (add-hook 'kill-buffer-hook 'flymake-kill-buffer-hook)
1593 ;+(add-hook 'find-file-hooks 'flymake-find-file-hook) 1531 ;;+(add-hook 'find-file-hook 'flymake-find-file-hook)
1594 1532
1595 (flymake-report-status (current-buffer) "" "") 1533 (flymake-report-status (current-buffer) "" "")
1596 1534
@@ -1608,7 +1546,7 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1608 (setq after-change-functions (delq 'flymake-after-change-function after-change-functions)) 1546 (setq after-change-functions (delq 'flymake-after-change-function after-change-functions))
1609 (remove-hook 'after-save-hook (function flymake-after-save-hook) t) 1547 (remove-hook 'after-save-hook (function flymake-after-save-hook) t)
1610 (remove-hook 'kill-buffer-hook (function flymake-kill-buffer-hook) t) 1548 (remove-hook 'kill-buffer-hook (function flymake-kill-buffer-hook) t)
1611 ;+(remove-hook 'find-file-hooks (function flymake-find-file-hook) t) 1549 ;;+(remove-hook 'find-file-hook (function flymake-find-file-hook) t)
1612 1550
1613 (flymake-delete-own-overlays (current-buffer)) 1551 (flymake-delete-own-overlays (current-buffer))
1614 1552
@@ -1627,8 +1565,8 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1627 :type 'boolean) 1565 :type 'boolean)
1628 1566
1629(defun flymake-after-change-function (start stop len) 1567(defun flymake-after-change-function (start stop len)
1630 "Start syntax check for current buffer if it isn't already running" 1568 "Start syntax check for current buffer if it isn't already running."
1631 ;+(flymake-log 0 "setting change time to %s" (flymake-float-time)) 1569 ;;+(flymake-log 0 "setting change time to %s" (flymake-float-time))
1632 (let((new-text (buffer-substring start stop))) 1570 (let((new-text (buffer-substring start stop)))
1633 (when (and flymake-start-syntax-check-on-newline (equal new-text "\n")) 1571 (when (and flymake-start-syntax-check-on-newline (equal new-text "\n"))
1634 (flymake-log 3 "starting syntax check as new-line has been seen") 1572 (flymake-log 3 "starting syntax check as new-line has been seen")
@@ -1647,10 +1585,10 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1647 (flymake-set-buffer-timer (current-buffer) nil))) 1585 (flymake-set-buffer-timer (current-buffer) nil)))
1648 1586
1649(defun flymake-find-file-hook () 1587(defun flymake-find-file-hook ()
1650 ;+(when flymake-start-syntax-check-on-find-file 1588 ;;+(when flymake-start-syntax-check-on-find-file
1651 ;+ (flymake-log 3 "starting syntax check on file open") 1589 ;;+ (flymake-log 3 "starting syntax check on file open")
1652 ;+ (flymake-start-syntax-check-for-current-buffer) 1590 ;;+ (flymake-start-syntax-check-for-current-buffer)
1653 ;+) 1591 ;;+)
1654 (when (and (not (local-variable-p 'flymake-mode (current-buffer))) 1592 (when (and (not (local-variable-p 'flymake-mode (current-buffer)))
1655 (flymake-can-syntax-check-file (buffer-file-name (current-buffer)))) 1593 (flymake-can-syntax-check-file (buffer-file-name (current-buffer))))
1656 (flymake-mode) 1594 (flymake-mode)
@@ -1691,12 +1629,12 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1691 (forward-char))) 1629 (forward-char)))
1692 1630
1693(defun flymake-goto-line (line-no) 1631(defun flymake-goto-line (line-no)
1694 "goto-line, then skip whitespace" 1632 "Go to line LINE-NO, then skip whitespace."
1695 (goto-line line-no) 1633 (goto-line line-no)
1696 (flymake-skip-whitespace)) 1634 (flymake-skip-whitespace))
1697 1635
1698(defun flymake-goto-next-error () 1636(defun flymake-goto-next-error ()
1699 "go to next error in err ring" 1637 "Go to next error in err ring."
1700 (interactive) 1638 (interactive)
1701 (let ((line-no (flymake-get-next-err-line-no (flymake-get-buffer-err-info (current-buffer)) (flymake-current-line-no)))) 1639 (let ((line-no (flymake-get-next-err-line-no (flymake-get-buffer-err-info (current-buffer)) (flymake-current-line-no))))
1702 (when (not line-no) 1640 (when (not line-no)
@@ -1707,7 +1645,7 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1707 (flymake-log 1 "no errors in current buffer")))) 1645 (flymake-log 1 "no errors in current buffer"))))
1708 1646
1709(defun flymake-goto-prev-error () 1647(defun flymake-goto-prev-error ()
1710 "go to prev error in err ring" 1648 "Go to prev error in err ring."
1711 (interactive) 1649 (interactive)
1712 (let ((line-no (flymake-get-prev-err-line-no (flymake-get-buffer-err-info (current-buffer)) (flymake-current-line-no)))) 1650 (let ((line-no (flymake-get-prev-err-line-no (flymake-get-buffer-err-info (current-buffer)) (flymake-current-line-no))))
1713 (when (not line-no) 1651 (when (not line-no)
@@ -1741,9 +1679,9 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1741 1679
1742 (let* ((dir (file-name-directory file-name)) 1680 (let* ((dir (file-name-directory file-name))
1743 (slash-pos (string-match "/" dir)) 1681 (slash-pos (string-match "/" dir))
1744 (temp-dir (concat (flymake-ensure-ends-with-slash (flymake-get-temp-dir)) (substring dir (1+ slash-pos))))) 1682 (temp-dir (concat (file-name-as-directory (flymake-get-temp-dir)) (substring dir (1+ slash-pos)))))
1745 1683
1746 (file-truename (concat (flymake-ensure-ends-with-slash temp-dir) 1684 (file-truename (concat (file-name-as-directory temp-dir)
1747 (file-name-nondirectory file-name))))) 1685 (file-name-nondirectory file-name)))))
1748 1686
1749(defun flymake-strrchr (str ch) 1687(defun flymake-strrchr (str ch)
@@ -1756,14 +1694,14 @@ Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if
1756 pos)) 1694 pos))
1757 1695
1758(defun flymake-delete-temp-directory (dir-name) 1696(defun flymake-delete-temp-directory (dir-name)
1759 "attempt to delete temp dir created by flymake-create-temp-with-folder-structure, do not fail on error." 1697 "Attempt to delete temp dir created by `flymake-create-temp-with-folder-structure', do not fail on error."
1760 (let* ((temp-dir (flymake-get-temp-dir)) 1698 (let* ((temp-dir (flymake-get-temp-dir))
1761 (suffix (substring dir-name (1+ (length temp-dir)))) 1699 (suffix (substring dir-name (1+ (length temp-dir))))
1762 (slash-pos nil)) 1700 (slash-pos nil))
1763 1701
1764 (while (> (length suffix) 0) 1702 (while (> (length suffix) 0)
1765 ;+(flymake-log 0 "suffix=%s" suffix) 1703 ;;+(flymake-log 0 "suffix=%s" suffix)
1766 (flymake-safe-delete-directory (file-truename (concat (flymake-ensure-ends-with-slash temp-dir) suffix))) 1704 (flymake-safe-delete-directory (file-truename (concat (file-name-as-directory temp-dir) suffix)))
1767 (setq slash-pos (flymake-strrchr suffix (string-to-char "/"))) 1705 (setq slash-pos (flymake-strrchr suffix (string-to-char "/")))
1768 (if slash-pos 1706 (if slash-pos
1769 (setq suffix (substring suffix 0 slash-pos)) 1707 (setq suffix (substring suffix 0 slash-pos))
@@ -1786,8 +1724,8 @@ Delete temp file."
1786 (flymake-set-buffer-last-change-time buffer nil))) 1724 (flymake-set-buffer-last-change-time buffer nil)))
1787 1725
1788(defun flymake-get-real-file-name (buffer file-name-from-err-msg) 1726(defun flymake-get-real-file-name (buffer file-name-from-err-msg)
1789 "Translate file name from error message to `real' file name. 1727 "Translate file name from error message to \"real\" file name.
1790Return full-name. Names are real, not patched." 1728Return full-name. Names are real, not patched."
1791 (let* ((real-name nil) 1729 (let* ((real-name nil)
1792 (source-file-name (buffer-file-name buffer)) 1730 (source-file-name (buffer-file-name buffer))
1793 (master-file-name (flymake-get-buffer-value buffer "master-file-name")) 1731 (master-file-name (flymake-get-buffer-value buffer "master-file-name"))
@@ -1805,7 +1743,7 @@ Return full-name. Names are real, not patched."
1805 (setq file-name-from-err-msg source-file-name)) 1743 (setq file-name-from-err-msg source-file-name))
1806 1744
1807 (setq real-name (flymake-get-full-patched-file-name file-name-from-err-msg base-dirs files)) 1745 (setq real-name (flymake-get-full-patched-file-name file-name-from-err-msg base-dirs files))
1808 ; if real-name is nil, than file name from err msg is none of the files we've patched 1746 ;; if real-name is nil, than file name from err msg is none of the files we've patched
1809 (if (not real-name) 1747 (if (not real-name)
1810 (setq real-name (flymake-get-full-nonpatched-file-name file-name-from-err-msg base-dirs))) 1748 (setq real-name (flymake-get-full-nonpatched-file-name file-name-from-err-msg base-dirs)))
1811 (if (not real-name) 1749 (if (not real-name)
@@ -1825,7 +1763,7 @@ Return full-name. Names are real, not patched."
1825 (let* ((this-dir (nth (1- base-dirs-count) base-dirs)) 1763 (let* ((this-dir (nth (1- base-dirs-count) base-dirs))
1826 (this-file (nth 0 (nth (1- file-count) files))) 1764 (this-file (nth 0 (nth (1- file-count) files)))
1827 (this-real-name (nth 1 (nth (1- file-count) files)))) 1765 (this-real-name (nth 1 (nth (1- file-count) files))))
1828 ;+(flymake-log 0 "this-dir=%s this-file=%s this-real=%s msg-file=%s" this-dir this-file this-real-name file-name-from-err-msg) 1766 ;;+(flymake-log 0 "this-dir=%s this-file=%s this-real=%s msg-file=%s" this-dir this-file this-real-name file-name-from-err-msg)
1829 (when (and this-dir this-file (flymake-same-files 1767 (when (and this-dir this-file (flymake-same-files
1830 (flymake-get-absolute-file-name-basedir file-name-from-err-msg this-dir) 1768 (flymake-get-absolute-file-name-basedir file-name-from-err-msg this-dir)
1831 this-file)) 1769 this-file))
@@ -1941,7 +1879,7 @@ Use CREATE-TEMP-F for creating temp copy."
1941 (flymake-simple-make-init-impl buffer 'flymake-create-temp-inplace t t "Makefile" 'flymake-get-make-cmdline)) 1879 (flymake-simple-make-init-impl buffer 'flymake-create-temp-inplace t t "Makefile" 'flymake-get-make-cmdline))
1942 1880
1943(defun flymake-master-make-init (buffer get-incl-dirs-f master-file-masks include-regexp-list) 1881(defun flymake-master-make-init (buffer get-incl-dirs-f master-file-masks include-regexp-list)
1944 "create make command line for a source file checked via master file compilation" 1882 "Create make command line for a source file checked via master file compilation."
1945 (let* ((make-args nil) 1883 (let* ((make-args nil)
1946 (temp-master-file-name (flymake-init-create-temp-source-and-master-buffer-copy 1884 (temp-master-file-name (flymake-init-create-temp-source-and-master-buffer-copy
1947 buffer get-incl-dirs-f 'flymake-create-temp-inplace 1885 buffer get-incl-dirs-f 'flymake-create-temp-inplace
@@ -1971,7 +1909,7 @@ Use CREATE-TEMP-F for creating temp copy."
1971 (flymake-simple-make-init-impl buffer 'flymake-create-temp-with-folder-structure nil nil "build.xml" 'flymake-get-ant-cmdline)) 1909 (flymake-simple-make-init-impl buffer 'flymake-create-temp-with-folder-structure nil nil "build.xml" 'flymake-get-ant-cmdline))
1972 1910
1973(defun flymake-simple-java-cleanup (buffer) 1911(defun flymake-simple-java-cleanup (buffer)
1974 "cleanup after flymake-simple-make-java-init -- delete temp file and dirs" 1912 "Cleanup after `flymake-simple-make-java-init' -- delete temp file and dirs."
1975 (let* ((temp-source-file-name (flymake-get-buffer-value buffer "temp-source-file-name"))) 1913 (let* ((temp-source-file-name (flymake-get-buffer-value buffer "temp-source-file-name")))
1976 (flymake-safe-delete-file temp-source-file-name) 1914 (flymake-safe-delete-file temp-source-file-name)
1977 (when temp-source-file-name 1915 (when temp-source-file-name
@@ -1979,15 +1917,17 @@ Use CREATE-TEMP-F for creating temp copy."
1979 1917
1980;;;; perl-specific init-cleanup routines 1918;;;; perl-specific init-cleanup routines
1981(defun flymake-perl-init (buffer) 1919(defun flymake-perl-init (buffer)
1982 (let* ((temp-file (flymake-init-create-temp-buffer-copy buffer 'flymake-create-temp-inplace)) 1920 (let* ((temp-file (flymake-init-create-temp-buffer-copy
1983 (local-file (concat (flymake-build-relative-filename (file-name-directory (buffer-file-name (current-buffer))) 1921 buffer 'flymake-create-temp-inplace))
1984 (file-name-directory temp-file)) 1922 (local-file (concat (flymake-build-relative-filename
1923 (file-name-directory buffer-file-name)
1924 (file-name-directory temp-file))
1985 (file-name-nondirectory temp-file)))) 1925 (file-name-nondirectory temp-file))))
1986 (list "perl" (list "-wc " local-file)))) 1926 (list "perl" (list "-wc " local-file))))
1987 1927
1988;;;; tex-specific init-cleanup routines 1928;;;; tex-specific init-cleanup routines
1989(defun flymake-get-tex-args (file-name) 1929(defun flymake-get-tex-args (file-name)
1990 ;(list "latex" (list "-c-style-errors" file-name)) 1930 ;;(list "latex" (list "-c-style-errors" file-name))
1991 (list "texify" (list "--pdf" "--tex-option=-c-style-errors" file-name))) 1931 (list "texify" (list "--pdf" "--tex-option=-c-style-errors" file-name)))
1992 1932
1993(defun flymake-simple-tex-init (buffer) 1933(defun flymake-simple-tex-init (buffer)
@@ -2005,10 +1945,10 @@ Use CREATE-TEMP-F for creating temp copy."
2005 '(".")) 1945 '("."))
2006 1946
2007;;;; xml-specific init-cleanup routines 1947;;;; xml-specific init-cleanup routines
2008(defun flymake-xml-init(buffer) 1948(defun flymake-xml-init (buffer)
2009 (list "xml" (list "val" (flymake-init-create-temp-buffer-copy buffer 'flymake-create-temp-inplace)))) 1949 (list "xml" (list "val" (flymake-init-create-temp-buffer-copy buffer 'flymake-create-temp-inplace))))
2010 1950
2011(provide 'flymake) 1951(provide 'flymake)
2012 1952
2013;;; arch-tag: 8f0d6090-061d-4cac-8862-7c151c4a02dd 1953;; arch-tag: 8f0d6090-061d-4cac-8862-7c151c4a02dd
2014;;; flymake.el ends here 1954;;; flymake.el ends here
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el
index 768012c736c..30e1977d28d 100644
--- a/lisp/progmodes/fortran.el
+++ b/lisp/progmodes/fortran.el
@@ -1,7 +1,7 @@
1;;; fortran.el --- Fortran mode for GNU Emacs 1;;; fortran.el --- Fortran mode for GNU Emacs
2 2
3;; Copyright (c) 1986, 93, 94, 95, 97, 98, 99, 2000, 01, 03, 04 3;; Copyright (C) 1986, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
4;; Free Software Foundation, Inc. 4;; 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6;; Author: Michael D. Prange <prange@erl.mit.edu> 6;; Author: Michael D. Prange <prange@erl.mit.edu>
7;; Maintainer: Glenn Morris <gmorris@ast.cam.ac.uk> 7;; Maintainer: Glenn Morris <gmorris@ast.cam.ac.uk>
@@ -95,7 +95,7 @@ with a character in column 6."
95 :group 'fortran-indent) 95 :group 'fortran-indent)
96 96
97(defcustom fortran-if-indent 3 97(defcustom fortran-if-indent 3
98 "*Extra indentation applied to IF blocks." 98 "*Extra indentation applied to IF, SELECT CASE and WHERE blocks."
99 :type 'integer 99 :type 'integer
100 :group 'fortran-indent) 100 :group 'fortran-indent)
101 101
@@ -321,7 +321,8 @@ program\\|subroutine\\)\\>[ \t]*\\(\\sw+\\)?"
321 "while" "inquire" "stop" "return" 321 "while" "inquire" "stop" "return"
322 "include" "open" "close" "read" 322 "include" "open" "close" "read"
323 "write" "format" "print" "select" "case" 323 "write" "format" "print" "select" "case"
324 "cycle" "exit" "rewind" "backspace") 324 "cycle" "exit" "rewind" "backspace"
325 "where" "elsewhere")
325 'paren) "\\>") 326 'paren) "\\>")
326 ;; Builtin operators. 327 ;; Builtin operators.
327 (concat "\\." (regexp-opt 328 (concat "\\." (regexp-opt
@@ -370,6 +371,29 @@ program\\|subroutine\\)\\>[ \t]*\\(\\sw+\\)?"
370 fortran-font-lock-keywords-2))) 371 fortran-font-lock-keywords-2)))
371 "Gaudy level highlighting for Fortran mode.") 372 "Gaudy level highlighting for Fortran mode.")
372 373
374(defvar fortran-font-lock-keywords-4
375 (append fortran-font-lock-keywords-3
376 (list (list
377 (concat "\\<"
378 (regexp-opt
379 '("int" "ifix" "idint" "real" "float" "sngl"
380 "dble" "cmplx" "ichar" "char" "aint" "dint"
381 "anint" "dnint" "nint" "idnint" "iabs" "abs"
382 "dabs" "cabs" "mod" "amod" "dmod" "isign"
383 "sign" "dsign" "idim" "dim" "ddim" "dprod"
384 "max" "max0" "amax1" "dmax1" "amax0" "max1"
385 "min0" "amin1" "dmin1" "amin0" "min1" "len"
386 "index" "lge" "lgt" "lle" "llt" "aimag"
387 "conjg" "sqrt" "dsqrt" "csqrt" "exp" "dexp"
388 "cexp" "log" "alog" "dlog" "clog" "log10"
389 "alog10" "dlog10" "sin" "dsin" "csin" "cos"
390 "dcos" "ccos" "tan" "dtan" "asin" "dasin"
391 "acos" "dacos" "atan" "datan" "atan2" "datan2"
392 "sinh" "dsinh" "cosh" "dcosh" "tanh" "dtanh")
393 'paren) "[ \t]*(") '(1 font-lock-builtin-face))))
394 "Maximum highlighting for Fortran mode.
395Consists of level 3 plus all other intrinsics not already highlighted.")
396
373;; Comments are real pain in Fortran because there is no way to 397;; Comments are real pain in Fortran because there is no way to
374;; represent the standard comment syntax in an Emacs syntax table. 398;; represent the standard comment syntax in an Emacs syntax table.
375;; (We can do so for F90-style). Therefore an unmatched quote in a 399;; (We can do so for F90-style). Therefore an unmatched quote in a
@@ -409,6 +433,64 @@ These get fixed-format comments fontified.")
409 "Value for `imenu-generic-expression' in Fortran mode.") 433 "Value for `imenu-generic-expression' in Fortran mode.")
410 434
411 435
436;; Hideshow support.
437(defconst fortran-blocks-re
438 (concat "block[ \t]*data\\|select[ \t]*case\\|"
439 (regexp-opt '("do" "if" "interface" "function" "map" "program"
440 "structure" "subroutine" "union" "where")))
441 "Regexp potentially indicating the start or end of a Fortran \"block\".
442Omits naked END statements, and DO-loops closed by anything other
443than ENDDO.")
444
445(defconst fortran-end-block-re
446 ;; Do-loops terminated by things other than ENDDO cannot be handled
447 ;; with a regexp. This omission does not seem to matter to hideshow...
448 (concat "^[ \t0-9]*\\<end[ \t]*\\("
449 fortran-blocks-re
450 ;; Naked END statement.
451 "\\|!\\|$\\)")
452 "Regexp matching the end of a Fortran \"block\", from the line start.
453Note that only ENDDO is handled for the end of a DO-loop. Used
454in the Fortran entry in `hs-special-modes-alist'.")
455
456(defconst fortran-start-block-re
457 (concat
458 "^[ \t0-9]*\\(" ; statement number
459 ;; Structure label for DO, IF, SELECT, WHERE.
460 "\\(\\(\\sw+[ \t]*:[ \t]*\\)?"
461 ;; IF blocks are a nuisance:
462 ;; IF ( ... ) foo is not a block, but a single statement.
463 ;; IF ( ... ) THEN can be split over multiple lines.
464 ;; [So can, eg, a DO WHILE (... ), but that is less common, I hope.]
465 ;; The regexp below allows for it to be split over at most 2 lines.
466 ;; That leads to the problem of not matching two consecutive IF
467 ;; statements as one, eg:
468 ;; IF ( ... ) foo
469 ;; IF ( ... ) THEN
470 ;; It simply is not possible to do this in a 100% correct fashion
471 ;; using a regexp - see the functions fortran-end-if,
472 ;; fortran-beginning-if for the hoops we have to go through.
473 ;; An alternative is to match on THEN at a line end, eg:
474 ;; ".*)[ \t]*then[ \t]*\\($\\|!\\)"
475 ;; This would also match ELSE branches, though. This does not seem
476 ;; right to me, because then one has neighbouring blocks that are
477 ;; not nested in each other.
478 "\\(if[ \t]*(\\(.*\\|"
479 ".*\n\\([^if]*\\([^i].\\|.[^f]\\|.\\>\\)\\)\\)\\<then\\|"
480 "do\\|select[ \t]*case\\|where\\)\\)\\|"
481 (regexp-opt '("interface" "function" "map" "program"
482 "structure" "subroutine" "union"))
483 "\\|block[ \t]*data\\)[ \t]*")
484 "Regexp matching the start of a Fortran \"block\", from the line start.
485A simple regexp cannot do this in fully correct fashion, so this
486tries to strike a compromise between complexity and flexibility.
487Used in the Fortran entry in `hs-special-modes-alist'.")
488
489(add-to-list 'hs-special-modes-alist
490 `(fortran-mode ,fortran-start-block-re ,fortran-end-block-re
491 "^[cC*!]" fortran-end-of-block nil))
492
493
412(defvar fortran-mode-syntax-table 494(defvar fortran-mode-syntax-table
413 (let ((table (make-syntax-table))) 495 (let ((table (make-syntax-table)))
414 ;; We might like `;' to be punctuation (g77 multi-statement 496 ;; We might like `;' to be punctuation (g77 multi-statement
@@ -422,7 +504,8 @@ These get fixed-format comments fontified.")
422 (modify-syntax-entry ?/ "." table) 504 (modify-syntax-entry ?/ "." table)
423 (modify-syntax-entry ?\' "\"" table) 505 (modify-syntax-entry ?\' "\"" table)
424 (modify-syntax-entry ?\" "\"" table) 506 (modify-syntax-entry ?\" "\"" table)
425 ;; Consistent with GNU Fortran -- see the manual. 507 ;; Consistent with GNU Fortran's default -- see the manual.
508 ;; The F77 standard imposes no rule on this issue.
426 (modify-syntax-entry ?\\ "\\" table) 509 (modify-syntax-entry ?\\ "\\" table)
427 ;; This might be better as punctuation, as for C, but this way you 510 ;; This might be better as punctuation, as for C, but this way you
428 ;; can treat floating-point numbers as symbols. 511 ;; can treat floating-point numbers as symbols.
@@ -446,6 +529,8 @@ These get fixed-format comments fontified.")
446 (define-key map "\C-c;" 'fortran-comment-region) 529 (define-key map "\C-c;" 'fortran-comment-region)
447 (define-key map "\M-;" 'fortran-indent-comment) 530 (define-key map "\M-;" 'fortran-indent-comment)
448 (define-key map "\M-\n" 'fortran-split-line) 531 (define-key map "\M-\n" 'fortran-split-line)
532 (define-key map "\M-\C-n" 'fortran-end-of-block)
533 (define-key map "\M-\C-p" 'fortran-beginning-of-block)
449 (define-key map "\M-\C-q" 'fortran-indent-subprogram) 534 (define-key map "\M-\C-q" 'fortran-indent-subprogram)
450 (define-key map "\C-c\C-w" 'fortran-window-create-momentarily) 535 (define-key map "\C-c\C-w" 'fortran-window-create-momentarily)
451 (define-key map "\C-c\C-r" 'fortran-column-ruler) 536 (define-key map "\C-c\C-r" 'fortran-column-ruler)
@@ -606,7 +691,7 @@ Key definitions:
606 691
607Variables controlling indentation style and extra features: 692Variables controlling indentation style and extra features:
608 693
609`comment-start' 694`fortran-comment-line-start'
610 To use comments starting with `!', set this to the string \"!\". 695 To use comments starting with `!', set this to the string \"!\".
611`fortran-do-indent' 696`fortran-do-indent'
612 Extra indentation within DO blocks (default 3). 697 Extra indentation within DO blocks (default 3).
@@ -696,7 +781,8 @@ with no args, if that value is non-nil."
696 '((fortran-font-lock-keywords 781 '((fortran-font-lock-keywords
697 fortran-font-lock-keywords-1 782 fortran-font-lock-keywords-1
698 fortran-font-lock-keywords-2 783 fortran-font-lock-keywords-2
699 fortran-font-lock-keywords-3) 784 fortran-font-lock-keywords-3
785 fortran-font-lock-keywords-4)
700 nil t ((?/ . "$/") ("_$" . "w")) 786 nil t ((?/ . "$/") ("_$" . "w"))
701 fortran-beginning-of-subprogram)) 787 fortran-beginning-of-subprogram))
702 (set (make-local-variable 'font-lock-syntactic-keywords) 788 (set (make-local-variable 'font-lock-syntactic-keywords)
@@ -1059,6 +1145,84 @@ Directive lines are treated as comments."
1059 (if (not not-last-statement) 1145 (if (not not-last-statement)
1060 'last-statement))) 1146 'last-statement)))
1061 1147
1148(defun fortran-looking-at-if-then ()
1149 "Return non-nil if at the start of a line with an IF ... THEN statement."
1150 ;; cf f90-looking-at-if-then.
1151 (let ((p (point))
1152 (i (fortran-beginning-if)))
1153 (if i
1154 (save-excursion
1155 (goto-char i)
1156 (beginning-of-line)
1157 (= (point) p)))))
1158
1159;; Used in hs-special-modes-alist.
1160(defun fortran-end-of-block (&optional num)
1161 "Move point forward to the end of the current code block.
1162With optional argument NUM, go forward that many balanced blocks.
1163If NUM is negative, go backward to the start of a block. Does
1164not check for consistency of block types. Interactively, pushes
1165mark before moving point."
1166 (interactive "p")
1167 (if (interactive-p) (push-mark (point) t))
1168 (and num (< num 0) (fortran-beginning-of-block (- num)))
1169 (let ((case-fold-search t)
1170 (count (or num 1)))
1171 (end-of-line)
1172 (while (and (> count 0)
1173 (re-search-forward
1174 (concat "\\(" fortran-blocks-re
1175 (if fortran-check-all-num-for-matching-do
1176 "\\|^[ \t]*[0-9]+" "")
1177 "\\|continue\\|end\\)\\>")
1178 nil 'move))
1179 (beginning-of-line)
1180 (if (if (looking-at (concat "^[0-9 \t]*" fortran-if-start-re))
1181 (fortran-looking-at-if-then)
1182 (looking-at fortran-start-block-re))
1183 (setq count (1+ count))
1184 (if (or (looking-at fortran-end-block-re)
1185 (and (or (looking-at "^[0-9 \t]*continue")
1186 (and fortran-check-all-num-for-matching-do
1187 (looking-at "[ \t]*[0-9]+")))
1188 (fortran-check-for-matching-do)))
1189 (setq count (1- count))))
1190 (end-of-line))
1191 (if (> count 0) (error "Missing block end"))))
1192
1193(defun fortran-beginning-of-block (&optional num)
1194 "Move point backwards to the start of the current code block.
1195With optional argument NUM, go backward that many balanced
1196blocks. If NUM is negative, go forward to the end of a block.
1197Does not check for consistency of block types. Interactively,
1198pushes mark before moving point."
1199 (interactive "p")
1200 (if (interactive-p) (push-mark (point) t))
1201 (and num (< num 0) (fortran-end-of-block (- num)))
1202 (let ((case-fold-search t)
1203 (count (or num 1)))
1204 (beginning-of-line)
1205 (while (and (> count 0)
1206 (re-search-backward
1207 (concat "\\(" fortran-blocks-re
1208 (if fortran-check-all-num-for-matching-do
1209 "\\|^[ \t]*[0-9]+" "")
1210 "\\|continue\\|end\\)\\>")
1211 nil 'move))
1212 (beginning-of-line)
1213 (if (if (looking-at (concat "^[0-9 \t]*" fortran-if-start-re))
1214 (fortran-looking-at-if-then)
1215 (looking-at fortran-start-block-re))
1216 (setq count (1- count))
1217 (if (or (looking-at fortran-end-block-re)
1218 (and (or (looking-at "^[0-9 \t]*continue")
1219 (and fortran-check-all-num-for-matching-do
1220 (looking-at "[ \t]*[0-9]+")))
1221 (fortran-check-for-matching-do)))
1222 (setq count (1+ count)))))
1223 ;; Includes an un-named main program block.
1224 (if (> count 0) (error "Missing block start"))))
1225
1062 1226
1063(defun fortran-blink-match (regex keyword find-begin) 1227(defun fortran-blink-match (regex keyword find-begin)
1064 "From a line matching REGEX, blink matching KEYWORD statement line. 1228 "From a line matching REGEX, blink matching KEYWORD statement line.
@@ -1679,8 +1843,9 @@ If ALL is nil, only match comments that start in column > 0."
1679 (1+ (point))))) 1843 (1+ (point)))))
1680 (if (re-search-forward "\\S\"\\s\"\\S\"" eol t) 1844 (if (re-search-forward "\\S\"\\s\"\\S\"" eol t)
1681 (backward-char 2)) 1845 (backward-char 2))
1682 ;; If the current string is longer than 72 - 6 chars, 1846 ;; If the current string is longer than (fill-column
1683 ;; break it at the fill column (else infinite loop). 1847 ;; - 6) chars, break it at the fill column (else
1848 ;; infinite loop).
1684 (if (> (- (point) start) 1849 (if (> (- (point) start)
1685 (- fill-column 6 fortran-continuation-indent)) 1850 (- fill-column 6 fortran-continuation-indent))
1686 fcpoint 1851 fcpoint
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index cb58a53a0d3..3e4796436f1 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -1299,10 +1299,10 @@ static char *magick[] = {
1299(defvar gdb-breakpoints-mode-map 1299(defvar gdb-breakpoints-mode-map
1300 (let ((map (make-sparse-keymap)) 1300 (let ((map (make-sparse-keymap))
1301 (menu (make-sparse-keymap "Breakpoints"))) 1301 (menu (make-sparse-keymap "Breakpoints")))
1302 (define-key menu [toggle] '("Toggle" . gdb-toggle-breakpoint)) 1302 (define-key menu [quit] '("Quit" . kill-this-buffer))
1303 (define-key menu [delete] '("Delete" . gdb-delete-breakpoint))
1304 (define-key menu [goto] '("Goto" . gdb-goto-breakpoint)) 1303 (define-key menu [goto] '("Goto" . gdb-goto-breakpoint))
1305 1304 (define-key menu [delete] '("Delete" . gdb-delete-breakpoint))
1305 (define-key menu [toggle] '("Toggle" . gdb-toggle-breakpoint))
1306 (suppress-keymap map) 1306 (suppress-keymap map)
1307 (define-key map [menu-bar breakpoints] (cons "Breakpoints" menu)) 1307 (define-key map [menu-bar breakpoints] (cons "Breakpoints" menu))
1308 (define-key map " " 'gdb-toggle-breakpoint) 1308 (define-key map " " 'gdb-toggle-breakpoint)
@@ -1310,6 +1310,7 @@ static char *magick[] = {
1310 (define-key map "q" 'kill-this-buffer) 1310 (define-key map "q" 'kill-this-buffer)
1311 (define-key map "\r" 'gdb-goto-breakpoint) 1311 (define-key map "\r" 'gdb-goto-breakpoint)
1312 (define-key map [mouse-2] 'gdb-goto-breakpoint) 1312 (define-key map [mouse-2] 'gdb-goto-breakpoint)
1313 (define-key map [follow-link] 'mouse-face)
1313 map)) 1314 map))
1314 1315
1315(defun gdb-breakpoints-mode () 1316(defun gdb-breakpoints-mode ()
@@ -1435,6 +1436,7 @@ static char *magick[] = {
1435 (define-key map "q" 'kill-this-buffer) 1436 (define-key map "q" 'kill-this-buffer)
1436 (define-key map "\r" 'gdb-frames-select) 1437 (define-key map "\r" 'gdb-frames-select)
1437 (define-key map [mouse-2] 'gdb-frames-select) 1438 (define-key map [mouse-2] 'gdb-frames-select)
1439 (define-key map [follow-link] 'mouse-face)
1438 map)) 1440 map))
1439 1441
1440(defun gdb-frames-mode () 1442(defun gdb-frames-mode ()
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 0988599ed54..1f9284db9cb 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -531,6 +531,9 @@ off the specialized speedbar mode."
531 531
532(defvar gdb-first-prompt t) 532(defvar gdb-first-prompt t)
533 533
534(defvar gud-filter-pending-text nil
535 "Non-nil means this is text that has been saved for later in `gud-filter'.")
536
534;;;###autoload 537;;;###autoload
535(defun gdb (command-line) 538(defun gdb (command-line)
536 "Run gdb on program FILE in buffer *gud-FILE*. 539 "Run gdb on program FILE in buffer *gud-FILE*.
@@ -562,6 +565,7 @@ and source-file directory for your debugger."
562 (setq comint-prompt-regexp "^(.*gdb[+]?) *") 565 (setq comint-prompt-regexp "^(.*gdb[+]?) *")
563 (setq paragraph-start comint-prompt-regexp) 566 (setq paragraph-start comint-prompt-regexp)
564 (setq gdb-first-prompt t) 567 (setq gdb-first-prompt t)
568 (setq gud-filter-pending-text nil)
565 (run-hooks 'gdb-mode-hook)) 569 (run-hooks 'gdb-mode-hook))
566 570
567;; One of the nice features of GDB is its impressive support for 571;; One of the nice features of GDB is its impressive support for
@@ -2445,9 +2449,6 @@ comint mode, which see."
2445 "Non-nil means don't process anything from the debugger right now. 2449 "Non-nil means don't process anything from the debugger right now.
2446It is saved for when this flag is not set.") 2450It is saved for when this flag is not set.")
2447 2451
2448(defvar gud-filter-pending-text nil
2449 "Non-nil means this is text that has been saved for later in `gud-filter'.")
2450
2451;; These functions are responsible for inserting output from your debugger 2452;; These functions are responsible for inserting output from your debugger
2452;; into the buffer. The hard work is done by the method that is 2453;; into the buffer. The hard work is done by the method that is
2453;; the value of gud-marker-filter. 2454;; the value of gud-marker-filter.
@@ -2516,19 +2517,22 @@ It is saved for when this flag is not set.")
2516 (gud-filter proc "")))))) 2517 (gud-filter proc ""))))))
2517 2518
2518(defvar gud-minor-mode-type nil) 2519(defvar gud-minor-mode-type nil)
2520(defvar gud-overlay-arrow-position nil)
2521(put 'gud-overlay-arrow-position 'overlay-arrow-string "=>")
2522(add-to-list 'overlay-arrow-variable-list 'gud-overlay-arrow-position)
2519 2523
2520(defun gud-sentinel (proc msg) 2524(defun gud-sentinel (proc msg)
2521 (cond ((null (buffer-name (process-buffer proc))) 2525 (cond ((null (buffer-name (process-buffer proc)))
2522 ;; buffer killed 2526 ;; buffer killed
2523 ;; Stop displaying an arrow in a source file. 2527 ;; Stop displaying an arrow in a source file.
2524 (setq overlay-arrow-position nil) 2528 (setq gud-overlay-arrow-position nil)
2525 (set-process-buffer proc nil) 2529 (set-process-buffer proc nil)
2526 (if (memq gud-minor-mode-type '(gdbmi gdba)) 2530 (if (memq gud-minor-mode-type '(gdbmi gdba))
2527 (gdb-reset) 2531 (gdb-reset)
2528 (gud-reset))) 2532 (gud-reset)))
2529 ((memq (process-status proc) '(signal exit)) 2533 ((memq (process-status proc) '(signal exit))
2530 ;; Stop displaying an arrow in a source file. 2534 ;; Stop displaying an arrow in a source file.
2531 (setq overlay-arrow-position nil) 2535 (setq gud-overlay-arrow-position nil)
2532 (with-current-buffer gud-comint-buffer 2536 (with-current-buffer gud-comint-buffer
2533 (if (memq gud-minor-mode-type '(gdbmi gdba)) 2537 (if (memq gud-minor-mode-type '(gdbmi gdba))
2534 (gdb-reset) 2538 (gdb-reset)
@@ -2611,13 +2615,13 @@ Obeying it means displaying in another window the specified file and line."
2611 (goto-line line) 2615 (goto-line line)
2612 (setq pos (point)) 2616 (setq pos (point))
2613 (setq overlay-arrow-string "=>") 2617 (setq overlay-arrow-string "=>")
2614 (or overlay-arrow-position 2618 (or gud-overlay-arrow-position
2615 (setq overlay-arrow-position (make-marker))) 2619 (setq gud-overlay-arrow-position (make-marker)))
2616 (set-marker overlay-arrow-position (point) (current-buffer))) 2620 (set-marker gud-overlay-arrow-position (point) (current-buffer)))
2617 (cond ((or (< pos (point-min)) (> pos (point-max))) 2621 (cond ((or (< pos (point-min)) (> pos (point-max)))
2618 (widen) 2622 (widen)
2619 (goto-char pos)))) 2623 (goto-char pos))))
2620 (if window (set-window-point window overlay-arrow-position)))))) 2624 (if window (set-window-point window gud-overlay-arrow-position))))))
2621 2625
2622;; The gud-call function must do the right thing whether its invoking 2626;; The gud-call function must do the right thing whether its invoking
2623;; keystroke is from the GUD buffer itself (via major-mode binding) 2627;; keystroke is from the GUD buffer itself (via major-mode binding)
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el
index 44675470b67..221a6f4aebb 100644
--- a/lisp/progmodes/idlw-shell.el
+++ b/lisp/progmodes/idlw-shell.el
@@ -1,5 +1,5 @@
1;; idlw-shell.el --- run IDL as an inferior process of Emacs. 1;; idlw-shell.el --- run IDL as an inferior process of Emacs.
2;; Copyright (c) 1999,2000,2001,2002,2003,2004 Free Software Foundation 2;; Copyright (c) 1999,2000,2001,2002,2003,2004,2005 Free Software Foundation
3 3
4;; Authors: J.D. Smith <jdsmith@as.arizona.edu> 4;; Authors: J.D. Smith <jdsmith@as.arizona.edu>
5;; Carsten Dominik <dominik@astro.uva.nl> 5;; Carsten Dominik <dominik@astro.uva.nl>
@@ -437,7 +437,7 @@ end"
437 437
438(defcustom idlwave-shell-mark-stop-line t 438(defcustom idlwave-shell-mark-stop-line t
439 "*Non-nil means, mark the source code line where IDL is currently stopped. 439 "*Non-nil means, mark the source code line where IDL is currently stopped.
440Value decides about the method which is used to mark the line. Legal values 440Value decides about the method which is used to mark the line. Valid values
441are: 441are:
442 442
443nil Do not mark the line 443nil Do not mark the line
@@ -494,7 +494,7 @@ where IDL is stopped, when in Electric Debug Mode."
494 494
495(defcustom idlwave-shell-mark-breakpoints t 495(defcustom idlwave-shell-mark-breakpoints t
496 "*Non-nil means, mark breakpoints in the source files. 496 "*Non-nil means, mark breakpoints in the source files.
497Legal values are: 497Valid values are:
498nil Do not mark breakpoints. 498nil Do not mark breakpoints.
499'face Highlight line with `idlwave-shell-breakpoint-face'. 499'face Highlight line with `idlwave-shell-breakpoint-face'.
500'glyph Red dot at the beginning of line. If the display does not 500'glyph Red dot at the beginning of line. If the display does not
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index 8eba3847308..35e4b68c9b8 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -1,5 +1,6 @@
1;; idlwave.el --- IDL editing mode for GNU Emacs 1;; idlwave.el --- IDL editing mode for GNU Emacs
2;; Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation 2;; Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005
3;; Free Software Foundation
3 4
4;; Authors: J.D. Smith <jdsmith@as.arizona.edu> 5;; Authors: J.D. Smith <jdsmith@as.arizona.edu>
5;; Carsten Dominik <dominik@science.uva.nl> 6;; Carsten Dominik <dominik@science.uva.nl>
@@ -584,7 +585,7 @@ for which to assume this can be set here."
584(defcustom idlwave-completion-show-classes 1 585(defcustom idlwave-completion-show-classes 1
585 "*Number of classes to show when completing object methods and keywords. 586 "*Number of classes to show when completing object methods and keywords.
586When completing methods or keywords for an object with unknown class, 587When completing methods or keywords for an object with unknown class,
587the *Completions* buffer will show the legal classes for each completion 588the *Completions* buffer will show the valid classes for each completion
588like this: 589like this:
589 590
590MyMethod <Class1,Class2,Class3> 591MyMethod <Class1,Class2,Class3>
@@ -5337,7 +5338,7 @@ end
5337 5338
5338(defun idlwave-complete (&optional arg module class) 5339(defun idlwave-complete (&optional arg module class)
5339 "Complete a function, procedure or keyword name at point. 5340 "Complete a function, procedure or keyword name at point.
5340This function is smart and figures out what can be legally completed 5341This function is smart and figures out what can be completed
5341at this point. 5342at this point.
5342- At the beginning of a statement it completes procedure names. 5343- At the beginning of a statement it completes procedure names.
5343- In the middle of a statement it completes function names. 5344- In the middle of a statement it completes function names.
@@ -5587,7 +5588,7 @@ other completions will be tried.")
5587 (symbolp what) 5588 (symbolp what)
5588 (assoc (symbol-name what) what-list)) 5589 (assoc (symbol-name what) what-list))
5589 what) 5590 what)
5590 (t (error "Illegal WHAT")))) 5591 (t (error "Invalid WHAT"))))
5591 (nil-list '(nil nil nil nil)) 5592 (nil-list '(nil nil nil nil))
5592 (class-list (list nil nil (or class t) nil))) 5593 (class-list (list nil nil (or class t) nil)))
5593 5594
@@ -5656,7 +5657,7 @@ other completions will be tried.")
5656 ((eq what 'class) 5657 ((eq what 'class)
5657 (list nil-list nil-list 'class nil-list nil)) 5658 (list nil-list nil-list 'class nil-list nil))
5658 5659
5659 (t (error "Illegal value for WHAT"))))) 5660 (t (error "Invalid value for WHAT")))))
5660 5661
5661(defun idlwave-completing-read (&rest args) 5662(defun idlwave-completing-read (&rest args)
5662 ;; Completing read, case insensitive 5663 ;; Completing read, case insensitive
@@ -7728,7 +7729,7 @@ from all classes if class equals t."
7728 keywords)) 7729 keywords))
7729 7730
7730(defun idlwave-expand-keyword (keyword module) 7731(defun idlwave-expand-keyword (keyword module)
7731 "Expand KEYWORD to one of the legal keyword parameters of MODULE. 7732 "Expand KEYWORD to one of the valid keyword parameters of MODULE.
7732KEYWORD may be an exact match or an abbreviation of a keyword. 7733KEYWORD may be an exact match or an abbreviation of a keyword.
7733If the match is exact, KEYWORD itself is returned, even if there may be other 7734If the match is exact, KEYWORD itself is returned, even if there may be other
7734keywords of which KEYWORD is an abbreviation. This is necessary because some 7735keywords of which KEYWORD is an abbreviation. This is necessary because some
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 745bc57a9b0..5073f2bc23a 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1,6 +1,6 @@
1;;; python.el --- silly walks for Python 1;;; python.el --- silly walks for Python
2 2
3;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Dave Love <fx@gnu.org> 5;; Author: Dave Love <fx@gnu.org>
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -336,14 +336,14 @@ keyword `raise', `break', `continue' or `pass'."
336 (unless bos (python-beginning-of-statement)) 336 (unless bos (python-beginning-of-statement))
337 (back-to-indentation) 337 (back-to-indentation)
338 (looking-at (rx (and (or "return" "raise" "break" "continue" "pass") 338 (looking-at (rx (and (or "return" "raise" "break" "continue" "pass")
339 word-end))))) 339 symbol-end)))))
340 340
341(defun python-outdent-p () 341(defun python-outdent-p ()
342 "Return non-nil if current line should outdent a level." 342 "Return non-nil if current line should outdent a level."
343 (save-excursion 343 (save-excursion
344 (back-to-indentation) 344 (back-to-indentation)
345 (and (looking-at (rx (and (or (and (or "else" "finally") word-end) 345 (and (looking-at (rx (and (or (and (or "else" "finally") symbol-end)
346 (and (or "except" "elif") word-end 346 (and (or "except" "elif") symbol-end
347 (1+ (not (any ?:))))) 347 (1+ (not (any ?:)))))
348 (optional space) ":" (optional space) 348 (optional space) ":" (optional space)
349 (or (syntax comment-start) line-end)))) 349 (or (syntax comment-start) line-end))))
@@ -355,8 +355,8 @@ keyword `raise', `break', `continue' or `pass'."
355 ;; Fixme: check this 355 ;; Fixme: check this
356 (not (looking-at (rx (and (or (and (or "if" "elif" "except" 356 (not (looking-at (rx (and (or (and (or "if" "elif" "except"
357 "for" "while") 357 "for" "while")
358 word-end (1+ (not (any ?:)))) 358 symbol-end (1+ (not (any ?:))))
359 (and "try" word-end)) 359 (and "try" symbol-end))
360 (optional space) ":" (optional space) 360 (optional space) ":" (optional space)
361 (or (syntax comment-start) line-end))))) 361 (or (syntax comment-start) line-end)))))
362 (progn (end-of-line) 362 (progn (end-of-line)
@@ -1098,28 +1098,40 @@ Don't save anything for STR matching `inferior-python-filter-regexp'."
1098(defvar python-preoutput-continuation nil 1098(defvar python-preoutput-continuation nil
1099 "If non-nil, funcall this when `python-preoutput-filter' sees `_emacs_ok'.") 1099 "If non-nil, funcall this when `python-preoutput-filter' sees `_emacs_ok'.")
1100 1100
1101(defvar python-preoutput-leftover nil)
1102
1101;; Using this stops us getting lines in the buffer like 1103;; Using this stops us getting lines in the buffer like
1102;; >>> ... ... >>> 1104;; >>> ... ... >>>
1103;; Also look for (and delete) an `_emacs_ok' string and call 1105;; Also look for (and delete) an `_emacs_ok' string and call
1104;; `python-preoutput-continuation' if we get it. 1106;; `python-preoutput-continuation' if we get it.
1105(defun python-preoutput-filter (s) 1107(defun python-preoutput-filter (s)
1106 "`comint-preoutput-filter-functions' function: ignore prompts not at bol." 1108 "`comint-preoutput-filter-functions' function: ignore prompts not at bol."
1109 (when python-preoutput-leftover
1110 (setq s (concat python-preoutput-leftover s))
1111 (setq python-preoutput-leftover nil))
1107 (cond ((and (string-match (rx (and string-start (repeat 3 (any ".>")) 1112 (cond ((and (string-match (rx (and string-start (repeat 3 (any ".>"))
1108 " " string-end)) 1113 " " string-end))
1109 s) 1114 s)
1110 (/= (let ((inhibit-field-text-motion t)) 1115 (/= (let ((inhibit-field-text-motion t))
1111 (line-beginning-position)) 1116 (line-beginning-position))
1112 (point))) 1117 (point)))
1113 "") 1118 "")
1114 ((string= s "_emacs_ok\n") 1119 ((string= s "_emacs_ok\n")
1115 (when python-preoutput-continuation 1120 (when python-preoutput-continuation
1116 (funcall python-preoutput-continuation) 1121 (funcall python-preoutput-continuation)
1117 (setq python-preoutput-continuation nil)) 1122 (setq python-preoutput-continuation nil))
1118 "") 1123 "")
1119 ((string-match "_emacs_out \\(.*\\)\n" s) 1124 ((string-match "_emacs_out \\(.*\\)\n" s)
1120 (setq python-preoutput-result (match-string 1 s)) 1125 (setq python-preoutput-result (match-string 1 s))
1126 "")
1127 ((string-match ".*\n" s)
1128 s)
1129 ((or (eq t (compare-strings s nil nil "_emacs_ok\n" nil (length s)))
1130 (let ((end (min (length "_emacs_out ") (length s))))
1131 (eq t (compare-strings s nil end "_emacs_out " nil end))))
1132 (setq python-preoutput-leftover s)
1121 "") 1133 "")
1122 (t s))) 1134 (t s)))
1123 1135
1124;;;###autoload 1136;;;###autoload
1125(defun run-python (&optional cmd noshow) 1137(defun run-python (&optional cmd noshow)
@@ -1359,7 +1371,9 @@ The result is what follows `_emacs_out' in the output (or nil)."
1359 (let ((proc (python-proc))) 1371 (let ((proc (python-proc)))
1360 (python-send-string string) 1372 (python-send-string string)
1361 (setq python-preoutput-result nil) 1373 (setq python-preoutput-result nil)
1362 (accept-process-output proc 5) 1374 (while (progn
1375 (accept-process-output proc 5)
1376 python-preoutput-leftover))
1363 python-preoutput-result)) 1377 python-preoutput-result))
1364 1378
1365;; Fixme: try to make it work with point in the arglist. Also, is 1379;; Fixme: try to make it work with point in the arglist. Also, is
@@ -1562,7 +1576,8 @@ of current line."
1562 (beginning-of-defun) 1576 (beginning-of-defun)
1563 (if (looking-at (rx (and (0+ space) (or "def" "class") (1+ space) 1577 (if (looking-at (rx (and (0+ space) (or "def" "class") (1+ space)
1564 (group (1+ (or word (syntax symbol)))) 1578 (group (1+ (or word (syntax symbol))))
1565 word-end))) 1579 ;; Greediness makes this unnecessary? --Stef
1580 symbol-end)))
1566 (push (match-string 1) accum))) 1581 (push (match-string 1) accum)))
1567 (if accum (mapconcat 'identity accum "."))))) 1582 (if accum (mapconcat 'identity accum ".")))))
1568 1583
@@ -1702,9 +1717,9 @@ lines count as headers.
1702 '(python-font-lock-keywords nil nil ((?_ . "w")) nil 1717 '(python-font-lock-keywords nil nil ((?_ . "w")) nil
1703 (font-lock-syntactic-keywords 1718 (font-lock-syntactic-keywords
1704 . python-font-lock-syntactic-keywords) 1719 . python-font-lock-syntactic-keywords)
1705;;; This probably isn't worth it. 1720 ;; This probably isn't worth it.
1706;;; (font-lock-syntactic-face-function 1721 ;; (font-lock-syntactic-face-function
1707;;; . python-font-lock-syntactic-face-function) 1722 ;; . python-font-lock-syntactic-face-function)
1708 )) 1723 ))
1709 (set (make-local-variable 'parse-sexp-lookup-properties) t) 1724 (set (make-local-variable 'parse-sexp-lookup-properties) t)
1710 (set (make-local-variable 'comment-start) "# ") 1725 (set (make-local-variable 'comment-start) "# ")
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index d08af6e8531..6e8062deb34 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -2388,7 +2388,7 @@ Optional parameter DEPTH (usually 1) says how many to look for."
2388(defun sh-var-value (var &optional ignore-error) 2388(defun sh-var-value (var &optional ignore-error)
2389 "Return the value of variable VAR, interpreting symbols. 2389 "Return the value of variable VAR, interpreting symbols.
2390It can also return t or nil. 2390It can also return t or nil.
2391If an illegal value is found, throw an error unless Optional argument 2391If an invalid value is found, throw an error unless Optional argument
2392IGNORE-ERROR is non-nil." 2392IGNORE-ERROR is non-nil."
2393 (let ((val (symbol-value var))) 2393 (let ((val (symbol-value var)))
2394 (cond 2394 (cond
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index ab7fa42e252..7e30a816e15 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -1,6 +1,6 @@
1;;; vhdl-mode.el --- major mode for editing VHDL code 1;;; vhdl-mode.el --- major mode for editing VHDL code
2 2
3;; Copyright (C) 1992-2003 Free Software Foundation, Inc. 3;; Copyright (C) 1992-2003, 2005 Free Software Foundation, Inc.
4 4
5;; Authors: Reto Zimmermann <reto@gnu.org> 5;; Authors: Reto Zimmermann <reto@gnu.org>
6;; Rodney J. Whitby <software.vhdl-mode@rwhitby.net> 6;; Rodney J. Whitby <software.vhdl-mode@rwhitby.net>
@@ -5065,7 +5065,7 @@ Try to increase performance by using this macro."
5065 5065
5066(defun vhdl-read-offset (langelem) 5066(defun vhdl-read-offset (langelem)
5067 "Read new offset value for LANGELEM from minibuffer. 5067 "Read new offset value for LANGELEM from minibuffer.
5068Return a legal value only." 5068Return a valid value only."
5069 (let ((oldoff (format "%s" (cdr-safe (assq langelem vhdl-offsets-alist)))) 5069 (let ((oldoff (format "%s" (cdr-safe (assq langelem vhdl-offsets-alist))))
5070 (errmsg "Offset must be int, func, var, or one of +, -, ++, --: ") 5070 (errmsg "Offset must be int, func, var, or one of +, -, ++, --: ")
5071 (prompt "Offset: ") 5071 (prompt "Offset: ")
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el
index dae5722d430..d329e234025 100644
--- a/lisp/progmodes/which-func.el
+++ b/lisp/progmodes/which-func.el
@@ -1,6 +1,7 @@
1;;; which-func.el --- print current function in mode line 1;;; which-func.el --- print current function in mode line
2 2
3;; Copyright (C) 1994, 1997, 1998, 2001, 2003 Free Software Foundation, Inc. 3;; Copyright (C) 1994, 1997, 1998, 2001, 2003, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Alex Rezinsky <alexr@msil.sps.mot.com> 6;; Author: Alex Rezinsky <alexr@msil.sps.mot.com>
6;; (doesn't seem to be responsive any more) 7;; (doesn't seem to be responsive any more)
@@ -251,7 +252,7 @@ If no function name is found, return nil."
251 (when (and (null name) 252 (when (and (null name)
252 (boundp 'imenu--index-alist) (null imenu--index-alist) 253 (boundp 'imenu--index-alist) (null imenu--index-alist)
253 (null which-function-imenu-failed)) 254 (null which-function-imenu-failed))
254 (imenu--make-index-alist) 255 (imenu--make-index-alist t)
255 (unless imenu--index-alist 256 (unless imenu--index-alist
256 (make-local-variable 'which-function-imenu-failed) 257 (make-local-variable 'which-function-imenu-failed)
257 (setq which-function-imenu-failed t))) 258 (setq which-function-imenu-failed t)))
@@ -291,5 +292,5 @@ If no function name is found, return nil."
291 292
292(provide 'which-func) 293(provide 'which-func)
293 294
294;;; arch-tag: fa8a55c7-bfe3-4ffc-95ab-01bf21796827 295;; arch-tag: fa8a55c7-bfe3-4ffc-95ab-01bf21796827
295;;; which-func.el ends here 296;;; which-func.el ends here
diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el
index 609c7db1e2a..bf1279da8a0 100644
--- a/lisp/progmodes/xscheme.el
+++ b/lisp/progmodes/xscheme.el
@@ -1,6 +1,7 @@
1;;; xscheme.el --- run MIT Scheme under Emacs 1;;; xscheme.el --- run MIT Scheme under Emacs
2 2
3;; Copyright (C) 1986, 1987, 1989, 1990, 2001, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1986, 1987, 1989, 1990, 2001, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Maintainer: FSF 6;; Maintainer: FSF
6;; Keywords: languages, lisp 7;; Keywords: languages, lisp
@@ -408,7 +409,7 @@ characters perform useful functions.
408 409
409Commands: 410Commands:
410\\{scheme-debugger-mode-map}" 411\\{scheme-debugger-mode-map}"
411 (error "Illegal entry to scheme-debugger-mode")) 412 (error "Invalid entry to scheme-debugger-mode"))
412 413
413(defun scheme-debugger-mode-initialize () 414(defun scheme-debugger-mode-initialize ()
414 (use-local-map scheme-debugger-mode-map) 415 (use-local-map scheme-debugger-mode-map)
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 95af5910989..0b2a33f27c0 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -6114,6 +6114,19 @@ XSTART YSTART are the relative position for the first page in a sheet.")
6114 6114
6115(defvar ps-current-effect 0) 6115(defvar ps-current-effect 0)
6116 6116
6117(defvar ps-print-translation-table
6118 (let ((tbl (make-char-table 'translation-table nil)))
6119 (if (and (boundp 'ucs-mule-8859-to-mule-unicode)
6120 (char-table-p ucs-mule-8859-to-mule-unicode))
6121 (map-char-table
6122 #'(lambda (k v)
6123 (if (and v (eq (char-charset v) 'latin-iso8859-1) (/= k v))
6124 (aset tbl k v)))
6125 ucs-mule-8859-to-mule-unicode))
6126 tbl)
6127 "Translation table for PostScript printing.
6128The default value is a table that translates non-Latin-1 Latin characters
6129to the equivalent Latin-1 characters.")
6117 6130
6118(defun ps-plot-region (from to font &optional fg-color bg-color effects) 6131(defun ps-plot-region (from to font &optional fg-color bg-color effects)
6119 (or (equal font ps-current-font) 6132 (or (equal font ps-current-font)
diff --git a/lisp/register.el b/lisp/register.el
index 253207c3140..eaa53446c56 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -277,7 +277,7 @@ Interactively, second arg is non-nil if prefix arg is supplied."
277Called from program, takes four args: REGISTER, START, END and DELETE-FLAG. 277Called from program, takes four args: REGISTER, START, END and DELETE-FLAG.
278START and END are buffer positions indicating what to copy." 278START and END are buffer positions indicating what to copy."
279 (interactive "cCopy to register: \nr\nP") 279 (interactive "cCopy to register: \nr\nP")
280 (set-register register (buffer-substring start end)) 280 (set-register register (filter-buffer-substring start end))
281 (if delete-flag (delete-region start end))) 281 (if delete-flag (delete-region start end)))
282 282
283(defun append-to-register (register start end &optional delete-flag) 283(defun append-to-register (register start end &optional delete-flag)
@@ -289,7 +289,7 @@ START and END are buffer positions indicating what to append."
289 (or (stringp (get-register register)) 289 (or (stringp (get-register register))
290 (error "Register does not contain text")) 290 (error "Register does not contain text"))
291 (set-register register (concat (get-register register) 291 (set-register register (concat (get-register register)
292 (buffer-substring start end))) 292 (filter-buffer-substring start end)))
293 (if delete-flag (delete-region start end))) 293 (if delete-flag (delete-region start end)))
294 294
295(defun prepend-to-register (register start end &optional delete-flag) 295(defun prepend-to-register (register start end &optional delete-flag)
@@ -300,7 +300,7 @@ START and END are buffer positions indicating what to prepend."
300 (interactive "cPrepend to register: \nr\nP") 300 (interactive "cPrepend to register: \nr\nP")
301 (or (stringp (get-register register)) 301 (or (stringp (get-register register))
302 (error "Register does not contain text")) 302 (error "Register does not contain text"))
303 (set-register register (concat (buffer-substring start end) 303 (set-register register (concat (filter-buffer-substring start end)
304 (get-register register))) 304 (get-register register)))
305 (if delete-flag (delete-region start end))) 305 (if delete-flag (delete-region start end)))
306 306
diff --git a/lisp/reveal.el b/lisp/reveal.el
index eb6b4519f38..787c4d20791 100644
--- a/lisp/reveal.el
+++ b/lisp/reveal.el
@@ -163,8 +163,8 @@
163 (let ((map (make-sparse-keymap))) 163 (let ((map (make-sparse-keymap)))
164 ;; Override the default move-beginning-of-line and move-end-of-line 164 ;; Override the default move-beginning-of-line and move-end-of-line
165 ;; which skips valuable invisible text. 165 ;; which skips valuable invisible text.
166 (define-key map [?\C-a] 'beginning-of-line) 166 (define-key map [remap move-beginning-of-line] 'beginning-of-line)
167 (define-key map [?\C-e] 'end-of-line) 167 (define-key map [remap move-end-of-line] 'end-of-line)
168 map)) 168 map))
169 169
170;;;###autoload 170;;;###autoload
diff --git a/lisp/simple.el b/lisp/simple.el
index 76cd990ba03..a6aa4daf04e 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -35,6 +35,13 @@
35 (autoload 'widget-convert "wid-edit") 35 (autoload 'widget-convert "wid-edit")
36 (autoload 'shell-mode "shell")) 36 (autoload 'shell-mode "shell"))
37 37
38(defcustom idle-update-delay 0.5
39 "*Idle time delay before updating various things on the screen.
40Various Emacs features that update auxiliary information when point moves
41wait this many seconds after Emacs becomes idle before doing an update."
42 :type 'number
43 :group 'display
44 :version "22.1")
38 45
39(defgroup killing nil 46(defgroup killing nil
40 "Killing and yanking commands." 47 "Killing and yanking commands."
@@ -105,6 +112,8 @@ If `fringe-arrow', indicate the locus by the fringe arrow."
105 :group 'next-error 112 :group 'next-error
106 :version "22.1") 113 :version "22.1")
107 114
115(defvar next-error-highlight-timer nil)
116
108(defvar next-error-last-buffer nil 117(defvar next-error-last-buffer nil
109 "The most recent next-error buffer. 118 "The most recent next-error buffer.
110A buffer becomes most recent when its compilation, grep, or 119A buffer becomes most recent when its compilation, grep, or
@@ -2216,6 +2225,42 @@ These commands include \\[set-mark-command] and \\[start-kbd-macro]."
2216 (reset-this-command-lengths) 2225 (reset-this-command-lengths)
2217 (restore-overriding-map)) 2226 (restore-overriding-map))
2218 2227
2228(defvar buffer-substring-filters nil
2229 "List of filter functions for `filter-buffer-substring'.
2230Each function must accept a single argument, a string, and return
2231a string. The buffer substring is passed to the first function
2232in the list, and the return value of each function is passed to
2233the next. The return value of the last function is used as the
2234return value of `filter-buffer-substring'.
2235
2236If this variable is nil, no filtering is performed.")
2237
2238(defun filter-buffer-substring (beg end &optional delete)
2239 "Return the buffer substring between BEG and END, after filtering.
2240The buffer substring is passed through each of the filter
2241functions in `buffer-substring-filters', and the value from the
2242last filter function is returned. If `buffer-substring-filters'
2243is nil, the buffer substring is returned unaltered.
2244
2245If DELETE is non-nil, the text between BEG and END is deleted
2246from the buffer.
2247
2248Point is temporarily set to BEG before caling
2249`buffer-substring-filters', in case the functions need to know
2250where the text came from.
2251
2252This function should be used instead of `buffer-substring' or
2253`delete-and-extract-region' when you want to allow filtering to
2254take place. For example, major or minor modes can use
2255`buffer-substring-filters' to extract characters that are special
2256to a buffer, and should not be copied into other buffers."
2257 (save-excursion
2258 (goto-char beg)
2259 (let ((string (if delete (delete-and-extract-region beg end)
2260 (buffer-substring beg end))))
2261 (dolist (filter buffer-substring-filters string)
2262 (setq string (funcall filter string))))))
2263
2219;;;; Window system cut and paste hooks. 2264;;;; Window system cut and paste hooks.
2220 2265
2221(defvar interprogram-cut-function nil 2266(defvar interprogram-cut-function nil
@@ -2392,7 +2437,7 @@ specifies the yank-handler text property to be set on the killed
2392text. See `insert-for-yank'." 2437text. See `insert-for-yank'."
2393 (interactive "r") 2438 (interactive "r")
2394 (condition-case nil 2439 (condition-case nil
2395 (let ((string (delete-and-extract-region beg end))) 2440 (let ((string (filter-buffer-substring beg end t)))
2396 (when string ;STRING is nil if BEG = END 2441 (when string ;STRING is nil if BEG = END
2397 ;; Add that string to the kill ring, one way or another. 2442 ;; Add that string to the kill ring, one way or another.
2398 (if (eq last-command 'kill-region) 2443 (if (eq last-command 'kill-region)
@@ -2428,8 +2473,8 @@ If `interprogram-cut-function' is non-nil, also save the text for a window
2428system cut and paste." 2473system cut and paste."
2429 (interactive "r") 2474 (interactive "r")
2430 (if (eq last-command 'kill-region) 2475 (if (eq last-command 'kill-region)
2431 (kill-append (buffer-substring beg end) (< end beg)) 2476 (kill-append (filter-buffer-substring beg end) (< end beg))
2432 (kill-new (buffer-substring beg end))) 2477 (kill-new (filter-buffer-substring beg end)))
2433 (if transient-mark-mode 2478 (if transient-mark-mode
2434 (setq deactivate-mark t)) 2479 (setq deactivate-mark t))
2435 nil) 2480 nil)
@@ -2954,7 +2999,7 @@ the user to see that the mark has moved, and you want the previous
2954mark position to be lost. 2999mark position to be lost.
2955 3000
2956Normally, when a new mark is set, the old one should go on the stack. 3001Normally, when a new mark is set, the old one should go on the stack.
2957This is why most applications should use push-mark, not set-mark. 3002This is why most applications should use `push-mark', not `set-mark'.
2958 3003
2959Novice Emacs Lisp programmers often try to use the mark for the wrong 3004Novice Emacs Lisp programmers often try to use the mark for the wrong
2960purposes. The mark saves a location for the user's convenience. 3005purposes. The mark saves a location for the user's convenience.
@@ -5182,14 +5227,6 @@ See also `normal-erase-is-backspace'."
5182 (message "Delete key deletes %s" 5227 (message "Delete key deletes %s"
5183 (if normal-erase-is-backspace "forward" "backward")))) 5228 (if normal-erase-is-backspace "forward" "backward"))))
5184 5229
5185(defcustom idle-update-delay 0.5
5186 "*Idle time delay before updating various things on the screen.
5187Various Emacs features that update auxiliary information when point moves
5188wait this many seconds after Emacs becomes idle before doing an update."
5189 :type 'number
5190 :group 'display
5191 :version "22.1")
5192
5193(defvar vis-mode-saved-buffer-invisibility-spec nil 5230(defvar vis-mode-saved-buffer-invisibility-spec nil
5194 "Saved value of `buffer-invisibility-spec' when Visible mode is on.") 5231 "Saved value of `buffer-invisibility-spec' when Visible mode is on.")
5195 5232
diff --git a/lisp/term.el b/lisp/term.el
index 32e249024d9..eb3ae342359 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -2571,7 +2571,16 @@ See `term-prompt-regexp'."
2571 2571
2572(defun term-move-columns (delta) 2572(defun term-move-columns (delta)
2573 (setq term-current-column (max 0 (+ (term-current-column) delta))) 2573 (setq term-current-column (max 0 (+ (term-current-column) delta)))
2574 (move-to-column term-current-column t)) 2574 (let (point-at-eol)
2575 (save-excursion
2576 (end-of-line)
2577 (setq point-at-eol (point)))
2578 (move-to-column term-current-column t)
2579 ;; If move-to-column extends the current line it will use the face
2580 ;; from the last character on the line, set the face for the chars
2581 ;; to default.
2582 (when (> (point) point-at-eol)
2583 (put-text-property point-at-eol (point) 'face 'default))))
2575 2584
2576;; Insert COUNT copies of CHAR in the default face. 2585;; Insert COUNT copies of CHAR in the default face.
2577(defun term-insert-char (char count) 2586(defun term-insert-char (char count)
@@ -3026,7 +3035,7 @@ See `term-prompt-regexp'."
3026;;; default one. 3035;;; default one.
3027(defun term-reset-terminal () 3036(defun term-reset-terminal ()
3028 (erase-buffer) 3037 (erase-buffer)
3029 (setq term-current-row 1) 3038 (setq term-current-row 0)
3030 (setq term-current-column 1) 3039 (setq term-current-column 1)
3031 (setq term-insert-mode nil) 3040 (setq term-insert-mode nil)
3032 (setq term-current-face nil) 3041 (setq term-current-face nil)
@@ -3035,7 +3044,7 @@ See `term-prompt-regexp'."
3035 (setq term-ansi-current-reverse 0) 3044 (setq term-ansi-current-reverse 0)
3036 (setq term-ansi-current-color 0) 3045 (setq term-ansi-current-color 0)
3037 (setq term-ansi-current-invisible 0) 3046 (setq term-ansi-current-invisible 0)
3038 (setq term-ansi-face-already-done 1) 3047 (setq term-ansi-face-already-done 0)
3039 (setq term-ansi-current-bg-color 0)) 3048 (setq term-ansi-current-bg-color 0))
3040 3049
3041;;; New function to deal with ansi colorized output, as you can see you can 3050;;; New function to deal with ansi colorized output, as you can see you can
@@ -3683,12 +3692,20 @@ Should only be called when point is at the start of a screen line."
3683;;; at teh end of this screen line to make room. 3692;;; at teh end of this screen line to make room.
3684 3693
3685(defun term-insert-spaces (count) 3694(defun term-insert-spaces (count)
3686 (let ((save-point (point)) (save-eol)) 3695 (let ((save-point (point)) (save-eol) (point-at-eol))
3687 (term-vertical-motion 1) 3696 (term-vertical-motion 1)
3688 (if (bolp) 3697 (if (bolp)
3689 (backward-char)) 3698 (backward-char))
3690 (setq save-eol (point)) 3699 (setq save-eol (point))
3700 (save-excursion
3701 (end-of-line)
3702 (setq point-at-eol (point)))
3691 (move-to-column (+ (term-start-line-column) (- term-width count)) t) 3703 (move-to-column (+ (term-start-line-column) (- term-width count)) t)
3704 ;; If move-to-column extends the current line it will use the face
3705 ;; from the last character on the line, set the face for the chars
3706 ;; to default.
3707 (when (> (point) (point-at-eol))
3708 (put-text-property point-at-eol (point) 'face 'default))
3692 (if (> save-eol (point)) 3709 (if (> save-eol (point))
3693 (delete-region (point) save-eol)) 3710 (delete-region (point) save-eol))
3694 (goto-char save-point) 3711 (goto-char save-point)
diff --git a/lisp/term/bobcat.el b/lisp/term/bobcat.el
index 85f816570ee..b11a4ff8309 100644
--- a/lisp/term/bobcat.el
+++ b/lisp/term/bobcat.el
@@ -1,6 +1,7 @@
1;; -*- no-byte-compile: t -*- 1;; -*- no-byte-compile: t -*-
2;;; HP terminals usually encourage using ^H as the rubout character 2;;; HP terminals usually encourage using ^H as the rubout character
3(load "term/keyswap" nil t) 3(keyboard-translate ?\177 ?\^h)
4(keyboard-translate ?\^h ?\177)
4 5
5;;; arch-tag: 754e4520-0a3e-4e6e-8ca5-9481b1f85cf7 6;;; arch-tag: 754e4520-0a3e-4e6e-8ca5-9481b1f85cf7
6;;; bobcat.el ends here 7;;; bobcat.el ends here
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 234280a3c3f..5c210974f72 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -1,6 +1,6 @@
1;;; xterm.el --- define function key sequences and standard colors for xterm 1;;; xterm.el --- define function key sequences and standard colors for xterm
2 2
3;; Copyright (C) 1995, 2002, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 2002, 2004, 2005 Free Software Foundation, Inc.
4 4
5;; Author: FSF 5;; Author: FSF
6;; Keywords: terminals 6;; Keywords: terminals
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index ccd7f21f502..c41145befc8 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -539,6 +539,17 @@ The break position will be always after LINEBEG and generally before point."
539 ;; Make sure we take SOMETHING after the fill prefix if any. 539 ;; Make sure we take SOMETHING after the fill prefix if any.
540 (fill-find-break-point linebeg))))) 540 (fill-find-break-point linebeg)))))
541 541
542;; Like text-properties-at but don't include `composition' property.
543(defun fill-text-properties-at (pos)
544 (let ((l (text-properties-at pos))
545 prop-list)
546 (while l
547 (unless (eq (car l) 'composition)
548 (setq prop-list
549 (cons (car l) (cons (cadr l) prop-list))))
550 (setq l (cddr l)))
551 prop-list))
552
542(defun fill-newline () 553(defun fill-newline ()
543 ;; Replace whitespace here with one newline, then 554 ;; Replace whitespace here with one newline, then
544 ;; indent to left margin. 555 ;; indent to left margin.
@@ -546,7 +557,7 @@ The break position will be always after LINEBEG and generally before point."
546 (insert ?\n) 557 (insert ?\n)
547 ;; Give newline the properties of the space(s) it replaces 558 ;; Give newline the properties of the space(s) it replaces
548 (set-text-properties (1- (point)) (point) 559 (set-text-properties (1- (point)) (point)
549 (text-properties-at (point))) 560 (fill-text-properties-at (point)))
550 (and (looking-at "\\( [ \t]*\\)\\(\\c|\\)?") 561 (and (looking-at "\\( [ \t]*\\)\\(\\c|\\)?")
551 (or (aref (char-category-set (or (char-before (1- (point))) ?\000)) ?|) 562 (or (aref (char-category-set (or (char-before (1- (point))) ?\000)) ?|)
552 (match-end 2)) 563 (match-end 2))
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 3717db6d4c5..4c8b0dafb29 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -645,6 +645,10 @@ re-start emacs."
645 "[A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]" 645 "[A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]"
646 "[^A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]" 646 "[^A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]"
647 "" nil ("-B") nil iso-8859-2) 647 "" nil ("-B") nil iso-8859-2)
648 ("slovenian" ; Slovenian
649 "[A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]"
650 "[^A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]"
651 "" nil ("-B" "-d" "slovenian") nil iso-8859-2)
648 ("svenska" ; Swedish mode 652 ("svenska" ; Swedish mode
649 "[A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]" 653 "[A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]"
650 "[^A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]" 654 "[^A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]"
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el
index 1ff21ea1ce0..86406d37475 100644
--- a/lisp/textmodes/org.el
+++ b/lisp/textmodes/org.el
@@ -1,14 +1,14 @@
1;; org.el --- Outline-based notes management and organizer 1;; org.el --- Outline-based notes management and organizer
2;; Carstens outline-mode for keeping track of everything. 2;; Carstens outline-mode for keeping track of everything.
3;; Copyright (c) 2003, 2004 Free Software Foundation 3;; Copyright (c) 2004, 2005 Free Software Foundation
4 4;;
5;; Author: Carsten Dominik <dominik at science dot uva dot nl> 5;; Author: Carsten Dominik <dominik at science dot uva dot nl>
6;; Keywords: outlines, hypermedia, calendar 6;; Keywords: outlines, hypermedia, calendar
7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ 7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
8;; Version: 3.04 8;; Version: 3.05
9 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11 11;;
12;; GNU Emacs is free software; you can redistribute it and/or modify 12;; GNU Emacs is free software; you can redistribute it and/or modify
13;; it under the terms of the GNU General Public License as published by 13;; it under the terms of the GNU General Public License as published by
14;; the Free Software Foundation; either version 2, or (at your option) 14;; the Free Software Foundation; either version 2, or (at your option)
@@ -75,10 +75,18 @@
75;; ------------- 75;; -------------
76;; The documentation of Org-mode can be found in the TeXInfo file. 76;; The documentation of Org-mode can be found in the TeXInfo file.
77;; This distribution also contains a PDF version of it. At the homepage 77;; This distribution also contains a PDF version of it. At the homepage
78;; of Org-mode, you can find and read online the same text as HTML. 78;; of Org-mode, you can read online the same text online as HTML.
79;; 79;;
80;; Changes: 80;; Changes:
81;; ------- 81;; -------
82;; Version 3.05
83;; - Agenda entries from the diary are linked to the diary file, so
84;; adding and editing diary entries can be done directly from the agenda.
85;; - Many calendar/diary commands available directly from agenda.
86;; - Field copying in tables with S-RET does increment.
87;; - C-c C-x C-v extracts the visible part of the buffer for printing.
88;; - Moving subtrees up and down preserves the whitespace at the tree end.
89;;
82;; Version 3.04 90;; Version 3.04
83;; - Table editor optimized to need fewer realignments, and to keep 91;; - Table editor optimized to need fewer realignments, and to keep
84;; table shape when typing in fields. 92;; table shape when typing in fields.
@@ -213,7 +221,7 @@
213 221
214;;; Customization variables 222;;; Customization variables
215 223
216(defvar org-version "3.04" 224(defvar org-version "3.05"
217 "The version number of the file org.el.") 225 "The version number of the file org.el.")
218(defun org-version () 226(defun org-version ()
219 (interactive) 227 (interactive)
@@ -241,7 +249,13 @@
241 :group 'org) 249 :group 'org)
242 250
243(defcustom org-startup-folded t 251(defcustom org-startup-folded t
244 "Non-nil means, entering Org-mode will switch to OVERVIEW." 252 "Non-nil means, entering Org-mode will switch to OVERVIEW.
253This can also be configured on a per-file basis by adding one of
254the following lines anywhere in the buffer:
255
256 #+STARTUP: fold
257 #+STARTUP: nofold
258"
245 :group 'org-startup 259 :group 'org-startup
246 :type 'boolean) 260 :type 'boolean)
247 261
@@ -255,7 +269,13 @@ uninteresting. Also tables look terrible when wrapped."
255(defcustom org-startup-with-deadline-check nil 269(defcustom org-startup-with-deadline-check nil
256 "Non-nil means, entering Org-mode will run the deadline check. 270 "Non-nil means, entering Org-mode will run the deadline check.
257This means, if you start editing an org file, you will get an 271This means, if you start editing an org file, you will get an
258immediate reminder of any due deadlines." 272immediate reminder of any due deadlines.
273This can also be configured on a per-file basis by adding one of
274the following lines anywhere in the buffer:
275
276 #+STARTUP: dlcheck
277 #+STARTUP: nodlcheck
278"
259 :group 'org-startup 279 :group 'org-startup
260 :type 'boolean) 280 :type 'boolean)
261 281
@@ -534,6 +554,11 @@ When nil, cursor will remain in the current window."
534 :group 'org-agenda 554 :group 'org-agenda
535 :type 'boolean) 555 :type 'boolean)
536 556
557(defcustom org-fit-agenda-window t
558 "Non-nil means, change windo size of agenda to fit content."
559 :group 'org-agenda
560 :type 'boolean)
561
537(defcustom org-agenda-show-all-dates t 562(defcustom org-agenda-show-all-dates t
538 "Non-nil means, `org-agenda' shows every day in the selected range. 563 "Non-nil means, `org-agenda' shows every day in the selected range.
539When nil, only the days which actually have entries are shown." 564When nil, only the days which actually have entries are shown."
@@ -892,7 +917,7 @@ slight (in fact: unnoticable) speed impact for normal typing. Org-mode is
892very good at guessing when a re-align will be necessary, but you can always 917very good at guessing when a re-align will be necessary, but you can always
893force one with `C-c C-c'. 918force one with `C-c C-c'.
894 919
895I you would like to use the optimized version in Org-mode, but the un-optimized 920If you would like to use the optimized version in Org-mode, but the un-optimized
896version in OrgTbl-mode, see the variable `orgtbl-optimized'. 921version in OrgTbl-mode, see the variable `orgtbl-optimized'.
897 922
898This variable can be used to turn on and off the table editor during a session, 923This variable can be used to turn on and off the table editor during a session,
@@ -971,6 +996,11 @@ line will be formatted with <th> tags."
971 :group 'org-table 996 :group 'org-table
972 :type 'boolean) 997 :type 'boolean)
973 998
999(defcustom org-table-copy-increment t
1000 "Non-nil means, increment when copying current field with \\[org-table-copy-down]."
1001 :group 'org-table
1002 :type 'boolean)
1003
974(defcustom org-table-tab-recognizes-table.el t 1004(defcustom org-table-tab-recognizes-table.el t
975 "Non-nil means, TAB will automatically notice a table.el table. 1005 "Non-nil means, TAB will automatically notice a table.el table.
976When it sees such a table, it moves point into it and - if necessary - 1006When it sees such a table, it moves point into it and - if necessary -
@@ -1260,7 +1290,7 @@ Otherwise, the buffer will just be saved to a file and stay hidden."
1260 "Face used for level 7 headlines." 1290 "Face used for level 7 headlines."
1261 :group 'org-faces) 1291 :group 'org-faces)
1262 1292
1263(defface org-level-8-face ;;font-lock-string-face 1293(defface org-level-8-face ;; font-lock-string-face
1264 '((((type tty) (class color)) (:foreground "green")) 1294 '((((type tty) (class color)) (:foreground "green"))
1265 (((class color) (background light)) (:foreground "RosyBrown")) 1295 (((class color) (background light)) (:foreground "RosyBrown"))
1266 (((class color) (background dark)) (:foreground "LightSalmon")) 1296 (((class color) (background dark)) (:foreground "LightSalmon"))
@@ -1276,8 +1306,24 @@ Otherwise, the buffer will just be saved to a file and stay hidden."
1276 "Face for deadlines and TODO keyords." 1306 "Face for deadlines and TODO keyords."
1277 :group 'org-faces) 1307 :group 'org-faces)
1278 1308
1279;; Inheritance does not work for xemacs, unfortunately. 1309(defcustom org-fontify-done-headline nil
1280;; We just copy the definitions and waste some space.... 1310 "Non-nil means, change the face of a headline if it is marked DONE.
1311Normally, only the TODO/DONE keyword indicates the state of a headline.
1312When this is non-nil, the headline after the keyword is set to the
1313`org-headline-done-face' as an additional indication."
1314 :group 'org-faces
1315 :type 'boolean)
1316
1317(defface org-headline-done-face ;; font-lock-string-face
1318 '((((type tty) (class color)) (:foreground "green"))
1319 (((class color) (background light)) (:foreground "RosyBrown"))
1320 (((class color) (background dark)) (:foreground "LightSalmon"))
1321 (t (:italic t)))
1322 "Face used to indicate that a headline is DONE. See also the variable
1323`org-fontify-done-headline'."
1324 :group 'org-faces)
1325
1326;; Inheritance does not yet work for xemacs. So we just copy...
1281 1327
1282(defface org-deadline-announce-face 1328(defface org-deadline-announce-face
1283 '((((type tty) (class color)) (:foreground "blue" :weight bold)) 1329 '((((type tty) (class color)) (:foreground "blue" :weight bold))
@@ -1341,11 +1387,11 @@ Otherwise, the buffer will just be saved to a file and stay hidden."
1341 )) 1387 ))
1342(defvar org-n-levels (length org-level-faces)) 1388(defvar org-n-levels (length org-level-faces))
1343 1389
1344
1345;; Tell the compiler about dynamically scoped variables, 1390;; Tell the compiler about dynamically scoped variables,
1346;; and variables from other packages 1391;; and variables from other packages
1347(eval-when-compile 1392(eval-when-compile
1348 (defvar zmacs-regions) 1393 (defvar zmacs-regions)
1394 (defvar original-date)
1349 (defvar org-transient-mark-mode) 1395 (defvar org-transient-mark-mode)
1350 (defvar org-old-auto-fill-inhibit-regexp) 1396 (defvar org-old-auto-fill-inhibit-regexp)
1351 (defvar orgtbl-mode-menu) 1397 (defvar orgtbl-mode-menu)
@@ -1521,8 +1567,11 @@ The following commands are available:
1521 (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string "\\)\\>") 1567 (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string "\\)\\>")
1522 '(1 'org-warning-face t)) 1568 '(1 'org-warning-face t))
1523 '("^#.*" (0 'font-lock-comment-face t)) 1569 '("^#.*" (0 'font-lock-comment-face t))
1524 (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\>") 1570 (if org-fontify-done-headline
1525 '(1 'org-done-face t)) 1571 (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\(.*\\)\\>")
1572 '(1 'org-done-face t) '(2 'org-headline-done-face t))
1573 (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\>")
1574 '(1 'org-done-face t)))
1526 '("^[ \t]*\\(\\(|\\|\\+-[-+]\\).*\\S-\\)" 1575 '("^[ \t]*\\(\\(|\\|\\+-[-+]\\).*\\S-\\)"
1527 (1 'org-table-face t)) 1576 (1 'org-table-face t))
1528 '("^[ \t]*\\(:.*\\)" (1 'org-table-face t))))) 1577 '("^[ \t]*\\(:.*\\)" (1 'org-table-face t)))))
@@ -1563,7 +1612,7 @@ The following commands are available:
1563(defvar org-cycle-global-status nil) 1612(defvar org-cycle-global-status nil)
1564(defvar org-cycle-subtree-status nil) 1613(defvar org-cycle-subtree-status nil)
1565(defun org-cycle (&optional arg) 1614(defun org-cycle (&optional arg)
1566 "Visibility cycling for org-mode. 1615 "Visibility cycling for Org-mode.
1567 1616
1568- When this function is called with a prefix argument, rotate the entire 1617- When this function is called with a prefix argument, rotate the entire
1569 buffer through 3 states (global cycling) 1618 buffer through 3 states (global cycling)
@@ -1579,6 +1628,9 @@ The following commands are available:
1579 zoom in further. 1628 zoom in further.
1580 3. SUBTREE: Show the entire subtree, including body text. 1629 3. SUBTREE: Show the entire subtree, including body text.
1581 1630
1631- When there is a numeric prefix, go ARG levels up and do a `show-subtree',
1632 keeping cursor position.
1633
1582- When point is not at the beginning of a headline, execute 1634- When point is not at the beginning of a headline, execute
1583 `indent-relative', like TAB normally does. See the option 1635 `indent-relative', like TAB normally does. See the option
1584 `org-cycle-emulate-tab' for details. 1636 `org-cycle-emulate-tab' for details.
@@ -1587,8 +1639,9 @@ The following commands are available:
1587 no headline in line 1, this function will act as if called with prefix arg." 1639 no headline in line 1, this function will act as if called with prefix arg."
1588 (interactive "P") 1640 (interactive "P")
1589 1641
1590 (if (and (bobp) (not (looking-at outline-regexp))) 1642 (if (or (and (bobp) (not (looking-at outline-regexp)))
1591 ; special case: use global cycling 1643 (equal arg '(4)))
1644 ;; special case: use global cycling
1592 (setq arg t)) 1645 (setq arg t))
1593 1646
1594 (cond 1647 (cond
@@ -1600,7 +1653,7 @@ The following commands are available:
1600 (org-table-justify-field-maybe) 1653 (org-table-justify-field-maybe)
1601 (org-table-next-field)))) 1654 (org-table-next-field))))
1602 1655
1603 (arg ;; Global cycling 1656 ((eq arg t) ;; Global cycling
1604 1657
1605 (cond 1658 (cond
1606 ((and (eq last-command this-command) 1659 ((and (eq last-command this-command)
@@ -1621,18 +1674,27 @@ The following commands are available:
1621 (if (bobp) (throw 'exit nil)))) 1674 (if (bobp) (throw 'exit nil))))
1622 (message "CONTENTS...done")) 1675 (message "CONTENTS...done"))
1623 (setq org-cycle-global-status 'contents)) 1676 (setq org-cycle-global-status 'contents))
1677
1624 ((and (eq last-command this-command) 1678 ((and (eq last-command this-command)
1625 (eq org-cycle-global-status 'contents)) 1679 (eq org-cycle-global-status 'contents))
1626 ;; We just showed the table of contents - now show everything 1680 ;; We just showed the table of contents - now show everything
1627 (show-all) 1681 (show-all)
1628 (message "SHOW ALL") 1682 (message "SHOW ALL")
1629 (setq org-cycle-global-status 'all)) 1683 (setq org-cycle-global-status 'all))
1684
1630 (t 1685 (t
1631 ;; Default action: go to overview 1686 ;; Default action: go to overview
1632 (hide-sublevels 1) 1687 (hide-sublevels 1)
1633 (message "OVERVIEW") 1688 (message "OVERVIEW")
1634 (setq org-cycle-global-status 'overview)))) 1689 (setq org-cycle-global-status 'overview))))
1635 1690
1691 ((integerp arg)
1692 ;; Show-subtree, ARG levels up from here.
1693 (save-excursion
1694 (org-back-to-heading)
1695 (outline-up-heading arg)
1696 (show-subtree)))
1697
1636 ((save-excursion (beginning-of-line 1) (looking-at outline-regexp)) 1698 ((save-excursion (beginning-of-line 1) (looking-at outline-regexp))
1637 ;; At a heading: rotate between three different views 1699 ;; At a heading: rotate between three different views
1638 (org-back-to-heading) 1700 (org-back-to-heading)
@@ -1970,7 +2032,7 @@ is changed at all."
1970 (save-excursion (outline-end-of-heading) 2032 (save-excursion (outline-end-of-heading)
1971 (setq folded (org-invisible-p))) 2033 (setq folded (org-invisible-p)))
1972 (outline-end-of-subtree)) 2034 (outline-end-of-subtree))
1973 (if (equal (char-after) ?\n) (forward-char 1)) 2035 (outline-next-heading)
1974 (setq end (point)) 2036 (setq end (point))
1975 ;; Find insertion point, with error handling 2037 ;; Find insertion point, with error handling
1976 (goto-char beg) 2038 (goto-char beg)
@@ -1982,7 +2044,10 @@ is changed at all."
1982 (if (> arg 0) 2044 (if (> arg 0)
1983 ;; Moving forward - still need to move over subtree 2045 ;; Moving forward - still need to move over subtree
1984 (progn (outline-end-of-subtree) 2046 (progn (outline-end-of-subtree)
1985 (if (equal (char-after) ?\n) (forward-char 1)))) 2047 (outline-next-heading)
2048 (if (not (or (looking-at (concat "^" outline-regexp))
2049 (bolp)))
2050 (newline))))
1986 (move-marker ins-point (point)) 2051 (move-marker ins-point (point))
1987 (setq txt (buffer-substring beg end)) 2052 (setq txt (buffer-substring beg end))
1988 (delete-region beg end) 2053 (delete-region beg end)
@@ -1993,7 +2058,7 @@ is changed at all."
1993 2058
1994(defvar org-subtree-clip "" 2059(defvar org-subtree-clip ""
1995 "Clipboard for cut and paste of subtrees. 2060 "Clipboard for cut and paste of subtrees.
1996This is actually only a cpoy of the kill, because we use the normal kill 2061This is actually only a copy of the kill, because we use the normal kill
1997ring. We need it to check if the kill was created by `org-copy-subtree'.") 2062ring. We need it to check if the kill was created by `org-copy-subtree'.")
1998 2063
1999(defvar org-subtree-clip-folded nil 2064(defvar org-subtree-clip-folded nil
@@ -2380,7 +2445,7 @@ ACTION can be set, up, or down."
2380 (setq new (1- current))) 2445 (setq new (1- current)))
2381 ((eq action 'down) 2446 ((eq action 'down)
2382 (setq new (1+ current))) 2447 (setq new (1+ current)))
2383 (t (error "Illegal ection"))) 2448 (t (error "Invalid action")))
2384 (setq new (min (max ?A (upcase new)) org-lowest-priority)) 2449 (setq new (min (max ?A (upcase new)) org-lowest-priority))
2385 (setq news (format "%c" new)) 2450 (setq news (format "%c" new))
2386 (if have 2451 (if have
@@ -2906,6 +2971,14 @@ The following commands are available:
2906(define-key org-agenda-mode-map "p" 'org-agenda-priority) 2971(define-key org-agenda-mode-map "p" 'org-agenda-priority)
2907(define-key org-agenda-mode-map "," 'org-agenda-priority) 2972(define-key org-agenda-mode-map "," 'org-agenda-priority)
2908(define-key org-agenda-mode-map "i" 'org-agenda-diary-entry) 2973(define-key org-agenda-mode-map "i" 'org-agenda-diary-entry)
2974(define-key org-agenda-mode-map "c" 'org-agenda-goto-calendar)
2975(define-key org-agenda-mode-map "C" 'org-agenda-convert-date)
2976(define-key org-agenda-mode-map "m" 'org-agenda-phases-of-moon)
2977(define-key org-agenda-mode-map "M" 'org-agenda-phases-of-moon)
2978(define-key org-agenda-mode-map "s" 'org-agenda-sunrise-sunset)
2979(define-key org-agenda-mode-map "S" 'org-agenda-sunrise-sunset)
2980(define-key org-agenda-mode-map "h" 'org-agenda-holidays)
2981(define-key org-agenda-mode-map "H" 'org-agenda-holidays)
2909(define-key org-agenda-mode-map "+" 'org-agenda-priority-up) 2982(define-key org-agenda-mode-map "+" 'org-agenda-priority-up)
2910(define-key org-agenda-mode-map "-" 'org-agenda-priority-down) 2983(define-key org-agenda-mode-map "-" 'org-agenda-priority-down)
2911(define-key org-agenda-mode-map [(right)] 'org-agenda-later) 2984(define-key org-agenda-mode-map [(right)] 'org-agenda-later)
@@ -2951,6 +3024,12 @@ The following commands are available:
2951 :style toggle :selected org-agenda-include-diary :active t] 3024 :style toggle :selected org-agenda-include-diary :active t]
2952 "--" 3025 "--"
2953 ["New Diary Entry" org-agenda-diary-entry t] 3026 ["New Diary Entry" org-agenda-diary-entry t]
3027 ("Calendar commands"
3028 ["Goto calendar" org-agenda-goto-calendar t]
3029 ["Phases of the Moon" org-agenda-phases-of-moon t]
3030 ["Sunrise/Sunset" org-agenda-sunrise-sunset t]
3031 ["Holidays" org-agenda-holidays t]
3032 ["Convert" org-agenda-convert-date t])
2954 "--" 3033 "--"
2955 ["Quit" org-agenda-quit t] 3034 ["Quit" org-agenda-quit t]
2956 ["Exit and Release Buffers" org-agenda-exit t] 3035 ["Exit and Release Buffers" org-agenda-exit t]
@@ -3110,7 +3189,7 @@ NDAYS defaults to `org-agenda-ndays'."
3110 (d (- nt n1))) 3189 (d (- nt n1)))
3111 (- sd (+ (if (< d 0) 7 0) d))))) 3190 (- sd (+ (if (< d 0) 7 0) d)))))
3112 (day-numbers (list start)) 3191 (day-numbers (list start))
3113 s e rtn rtnall file date d start-pos) 3192 s e rtn rtnall file date d start-pos end-pos)
3114 (setq org-agenda-redo-command 3193 (setq org-agenda-redo-command
3115 (list 'org-agenda include-all start-day ndays)) 3194 (list 'org-agenda include-all start-day ndays))
3116 ;; Make the list of days 3195 ;; Make the list of days
@@ -3146,7 +3225,9 @@ NDAYS defaults to `org-agenda-ndays'."
3146 s (point)) 3225 s (point))
3147 (if (or (= d today) 3226 (if (or (= d today)
3148 (and (not start-pos) (= d sd))) 3227 (and (not start-pos) (= d sd)))
3149 (setq start-pos (point))) 3228 (setq start-pos (point))
3229 (if (and start-pos (not end-pos))
3230 (setq end-pos (point))))
3150 (setq files org-agenda-files 3231 (setq files org-agenda-files
3151 rtnall nil) 3232 rtnall nil)
3152 (while (setq file (pop files)) 3233 (while (setq file (pop files))
@@ -3173,6 +3254,17 @@ NDAYS defaults to `org-agenda-ndays'."
3173 (put-text-property s (1- (point)) 'day d)))) 3254 (put-text-property s (1- (point)) 'day d))))
3174 (goto-char (point-min)) 3255 (goto-char (point-min))
3175 (setq buffer-read-only t) 3256 (setq buffer-read-only t)
3257 (if org-fit-agenda-window
3258 (fit-window-to-buffer nil (/ (* (frame-height) 3) 4)
3259 (/ (frame-height) 2)))
3260 (unless (and (pos-visible-in-window-p (point-min))
3261 (pos-visible-in-window-p (point-max)))
3262 (goto-char (1- (point-max)))
3263 (recenter -1)
3264 (if (not (pos-visible-in-window-p (or start-pos 1)))
3265 (progn
3266 (goto-char (or start-pos 1))
3267 (recenter 1))))
3176 (goto-char (or start-pos 1)) 3268 (goto-char (or start-pos 1))
3177 (if (not org-select-agenda-window) (select-window win)) 3269 (if (not org-select-agenda-window) (select-window win))
3178 (message ""))) 3270 (message "")))
@@ -3285,10 +3377,10 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
3285 "Set the mode name to indicate all the small mode seetings." 3377 "Set the mode name to indicate all the small mode seetings."
3286 (setq mode-name 3378 (setq mode-name
3287 (concat "Org-Agenda" 3379 (concat "Org-Agenda"
3288 (if (equal org-agenda-ndays 1) " Day" "") 3380 (if (equal org-agenda-ndays 1) " Day" "")
3289 (if (equal org-agenda-ndays 7) " Week" "") 3381 (if (equal org-agenda-ndays 7) " Week" "")
3290 (if org-agenda-follow-mode " Follow" "") 3382 (if org-agenda-follow-mode " Follow" "")
3291 (if org-agenda-include-diary " Diary" ""))) 3383 (if org-agenda-include-diary " Diary" "")))
3292 (force-mode-line-update)) 3384 (force-mode-line-update))
3293 3385
3294(defun org-agenda-post-command-hook () 3386(defun org-agenda-post-command-hook ()
@@ -3299,26 +3391,33 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
3299(defun org-get-entries-from-diary (date) 3391(defun org-get-entries-from-diary (date)
3300 "Get the (emacs calendar) diary entries for DATE." 3392 "Get the (emacs calendar) diary entries for DATE."
3301 (let* ((fancy-diary-buffer "*temporary-fancy-diary-buffer*") 3393 (let* ((fancy-diary-buffer "*temporary-fancy-diary-buffer*")
3302 (diary-display-hook '(sort-diary-entries fancy-diary-display)) 3394 (diary-display-hook '(fancy-diary-display))
3395 (list-diary-entries-hook
3396 (cons 'org-diary-default-entry list-diary-entries-hook))
3303 entries 3397 entries
3304 (disable-org-agenda t)) 3398 (disable-org-diary t))
3305 (save-excursion 3399 (save-excursion
3306 (save-window-excursion 3400 (save-window-excursion
3307 (list-diary-entries date 1))) 3401 (list-diary-entries date 1)))
3308 (if (not (get-buffer fancy-diary-buffer)) 3402 (if (not (get-buffer fancy-diary-buffer))
3309 (setq entries nil) 3403 (setq entries nil)
3310 (save-excursion 3404 (save-excursion
3311 (set-buffer fancy-diary-buffer) 3405 (switch-to-buffer fancy-diary-buffer)
3312 (setq buffer-read-only nil) 3406 (setq buffer-read-only nil)
3313 (if (= (point-max) 1) 3407 (if (= (point-max) 1)
3314 ;; No entries 3408 ;; No entries
3315 (setq entries nil) 3409 (setq entries nil)
3316 ;; Omit the date 3410 ;; Omit the date and other unnecessary stuff
3317 (beginning-of-line 3) 3411 (org-agenda-cleanup-fancy-diary)
3318 (delete-region (point-min) (point)) 3412 ;; Add prefix to each line and extend the text properties
3413 (goto-char (point-min))
3319 (while (and (re-search-forward "^" nil t) (not (eobp))) 3414 (while (and (re-search-forward "^" nil t) (not (eobp)))
3320 (replace-match " Diary: ")) 3415 (replace-match " Diary: ")
3321 (setq entries (buffer-substring (point-min) (- (point-max) 1)))) 3416 (add-text-properties (point-at-bol) (point)
3417 (text-properties-at (point))))
3418 (if (= (point-max) 1)
3419 (setq entries nil)
3420 (setq entries (buffer-substring (point-min) (- (point-max) 1)))))
3322 (set-buffer-modified-p nil) 3421 (set-buffer-modified-p nil)
3323 (kill-buffer fancy-diary-buffer))) 3422 (kill-buffer fancy-diary-buffer)))
3324 (when entries 3423 (when entries
@@ -3337,6 +3436,49 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
3337 x) 3436 x)
3338 entries))))) 3437 entries)))))
3339 3438
3439(defun org-agenda-cleanup-fancy-diary ()
3440 "Remove unwanted stuff in buffer created by fancy-diary-display.
3441This gets rid of the date, the underline under the date, and
3442the dummy entry installed by org-mode to ensure non-empty diary for each
3443date."
3444 (goto-char (point-min))
3445 (if (looking-at ".*?:[ \t]*")
3446 (progn
3447 (replace-match "")
3448 (re-search-forward "\n=+$" nil t)
3449 (replace-match "")
3450 (while (re-search-backward "^ +" nil t) (replace-match "")))
3451 (re-search-forward "\n=+$" nil t)
3452 (delete-region (point-min) (min (point-max) (1+ (match-end 0)))))
3453 (if (re-search-forward "^Org-mode dummy\n?" nil t)
3454 (replace-match "")))
3455
3456;; Advise the add-to-diary-list function to allow org to jump to
3457;; diary entires. Wrapped into eval-after-load to avoid loading
3458;; advice unnecessarily
3459(eval-after-load "diary-lib"
3460 '(defadvice add-to-diary-list (before org-mark-diary-entry activate)
3461 "Make the position visible."
3462 (if (and (boundp 'disable-org-diary) ;; called from org-agenda
3463 (stringp string)
3464 (buffer-file-name))
3465 (add-text-properties
3466 0 (length string)
3467 (list 'mouse-face 'highlight
3468 'keymap org-agenda-keymap
3469 'help-echo
3470 (format
3471 "mouse-2 or RET jump to diary file %s"
3472 (abbreviate-file-name (buffer-file-name)))
3473 'org-agenda-diary-link t
3474 'org-marker (org-agenda-new-marker (point-at-bol)))
3475 string))))
3476
3477(defun org-diary-default-entry ()
3478 "Add a dummy entry to the diary.
3479Needed to avoid empty dates which mess up holiday display."
3480 (add-to-diary-list original-date "Org-mode dummy" ""))
3481
3340(defun org-add-file (&optional file) 3482(defun org-add-file (&optional file)
3341 "Add current file to the list of files in variable `org-agenda-files'. 3483 "Add current file to the list of files in variable `org-agenda-files'.
3342These are the files which are being checked for agenda entries. 3484These are the files which are being checked for agenda entries.
@@ -3468,7 +3610,7 @@ function from a program - use `org-agenda-get-day-entries' instead."
3468 file rtn results) 3610 file rtn results)
3469 ;; If this is called during org-agenda, don't return any entries to 3611 ;; If this is called during org-agenda, don't return any entries to
3470 ;; the calendar. Org Agenda will list these entries itself. 3612 ;; the calendar. Org Agenda will list these entries itself.
3471 (if (boundp 'disable-org-agenda) (setq files nil)) 3613 (if (boundp 'disable-org-diary) (setq files nil))
3472 (while (setq file (pop files)) 3614 (while (setq file (pop files))
3473 (setq rtn (apply 'org-agenda-get-day-entries file date args)) 3615 (setq rtn (apply 'org-agenda-get-day-entries file date args))
3474 (setq results (append results rtn))) 3616 (setq results (append results rtn)))
@@ -3864,7 +4006,6 @@ and by additional input from the age of a schedules or deadline entry."
3864 (let* ((pri (get-text-property (point-at-bol) 'priority))) 4006 (let* ((pri (get-text-property (point-at-bol) 'priority)))
3865 (message "Priority is %d" (if pri pri -1000)))) 4007 (message "Priority is %d" (if pri pri -1000))))
3866 4008
3867
3868(defun org-agenda-goto () 4009(defun org-agenda-goto ()
3869 "Go to the Org-mode file which contains the item at point." 4010 "Go to the Org-mode file which contains the item at point."
3870 (interactive) 4011 (interactive)
@@ -3875,10 +4016,11 @@ and by additional input from the age of a schedules or deadline entry."
3875 (switch-to-buffer-other-window buffer) 4016 (switch-to-buffer-other-window buffer)
3876 (widen) 4017 (widen)
3877 (goto-char pos) 4018 (goto-char pos)
3878 (org-show-hidden-entry) 4019 (when (eq major-mode 'org-mode)
3879 (save-excursion 4020 (org-show-hidden-entry)
3880 (and (outline-next-heading) 4021 (save-excursion
3881 (org-flag-heading nil))))) ; show the next heading 4022 (and (outline-next-heading)
4023 (org-flag-heading nil)))))) ; show the next heading
3882 4024
3883(defun org-agenda-switch-to () 4025(defun org-agenda-switch-to ()
3884 "Go to the Org-mode file which contains the item at point." 4026 "Go to the Org-mode file which contains the item at point."
@@ -3891,10 +4033,11 @@ and by additional input from the age of a schedules or deadline entry."
3891 (delete-other-windows) 4033 (delete-other-windows)
3892 (widen) 4034 (widen)
3893 (goto-char pos) 4035 (goto-char pos)
3894 (org-show-hidden-entry) 4036 (when (eq major-mode 'org-mode)
3895 (save-excursion 4037 (org-show-hidden-entry)
3896 (and (outline-next-heading) 4038 (save-excursion
3897 (org-flag-heading nil))))) ; show the next heading 4039 (and (outline-next-heading)
4040 (org-flag-heading nil)))))) ; show the next heading
3898 4041
3899(defun org-agenda-goto-mouse (ev) 4042(defun org-agenda-goto-mouse (ev)
3900 "Go to the Org-mode file which contains the deadline at the mouse click." 4043 "Go to the Org-mode file which contains the deadline at the mouse click."
@@ -3923,12 +4066,18 @@ and by additional input from the age of a schedules or deadline entry."
3923 (mouse-set-point ev) 4066 (mouse-set-point ev)
3924 (org-agenda-show)) 4067 (org-agenda-show))
3925 4068
4069(defun org-agenda-check-no-diary ()
4070 "Check if the entry is a diary link and abort if yes."
4071 (if (get-text-property (point) 'org-agenda-diary-link)
4072 (org-agenda-error)))
4073
3926(defun org-agenda-error () 4074(defun org-agenda-error ()
3927 (error "Command not allowed in this line.")) 4075 (error "Command not allowed in this line."))
3928 4076
3929(defun org-agenda-todo () 4077(defun org-agenda-todo ()
3930 "Cycle TODO state of line at point, also in Org-mode file." 4078 "Cycle TODO state of line at point, also in Org-mode file."
3931 (interactive) 4079 (interactive)
4080 (org-agenda-check-no-diary)
3932 (let* ((props (text-properties-at (point))) 4081 (let* ((props (text-properties-at (point)))
3933 (col (current-column)) 4082 (col (current-column))
3934 (marker (or (get-text-property (point) 'org-marker) 4083 (marker (or (get-text-property (point) 'org-marker)
@@ -3971,6 +4120,7 @@ and by additional input from the age of a schedules or deadline entry."
3971(defun org-agenda-priority (&optional force-direction) 4120(defun org-agenda-priority (&optional force-direction)
3972 "Set the priority of line at point, also in Org-mode file." 4121 "Set the priority of line at point, also in Org-mode file."
3973 (interactive) 4122 (interactive)
4123 (org-agenda-check-no-diary)
3974 (let* ((props (text-properties-at (point))) 4124 (let* ((props (text-properties-at (point)))
3975 (col (current-column)) 4125 (col (current-column))
3976 (marker (or (get-text-property (point) 'org-marker) 4126 (marker (or (get-text-property (point) 'org-marker)
@@ -4003,6 +4153,7 @@ and by additional input from the age of a schedules or deadline entry."
4003(defun org-agenda-date-later (arg &optional what) 4153(defun org-agenda-date-later (arg &optional what)
4004 "Change the date of this item to one day later." 4154 "Change the date of this item to one day later."
4005 (interactive "p") 4155 (interactive "p")
4156 (org-agenda-check-no-diary)
4006 (let* ((marker (or (get-text-property (point) 'org-marker) 4157 (let* ((marker (or (get-text-property (point) 'org-marker)
4007 (org-agenda-error))) 4158 (org-agenda-error)))
4008 (buffer (marker-buffer marker)) 4159 (buffer (marker-buffer marker))
@@ -4022,8 +4173,9 @@ and by additional input from the age of a schedules or deadline entry."
4022 (org-agenda-date-later (- arg) what)) 4173 (org-agenda-date-later (- arg) what))
4023 4174
4024(defun org-agenda-date-today (arg) 4175(defun org-agenda-date-today (arg)
4025 "Change the date of this item to one day later." 4176 "Change the date of this item to today."
4026 (interactive "p") 4177 (interactive "p")
4178 (org-agenda-check-no-diary)
4027 (let* ((marker (or (get-text-property (point) 'org-marker) 4179 (let* ((marker (or (get-text-property (point) 'org-marker)
4028 (org-agenda-error))) 4180 (org-agenda-error)))
4029 (buffer (marker-buffer marker)) 4181 (buffer (marker-buffer marker))
@@ -4084,7 +4236,91 @@ All the standard commands work: block, weekly etc"
4084 (get-text-property point 'day)))) 4236 (get-text-property point 'day))))
4085 (call-interactively cmd)) 4237 (call-interactively cmd))
4086 (fset 'calendar-cursor-to-date oldf))))) 4238 (fset 'calendar-cursor-to-date oldf)))))
4087 4239
4240
4241(defun org-agenda-execute-calendar-command (cmd)
4242 "Execute a calendar command from the agenda, with the date associated to
4243the cursor position."
4244 (require 'diary-lib)
4245 (unless (get-text-property (point) 'day)
4246 (error "Don't know which date to use for calendar command"))
4247 (let* ((oldf (symbol-function 'calendar-cursor-to-date))
4248 (point (point))
4249 (mark (or (mark t) (point)))
4250 (date (calendar-gregorian-from-absolute
4251 (get-text-property point 'day)))
4252 (displayed-day (extract-calendar-day date))
4253 (displayed-month (extract-calendar-month date))
4254 (displayed-year (extract-calendar-year date)))
4255 (unwind-protect
4256 (progn
4257 (fset 'calendar-cursor-to-date
4258 (lambda (&optional error)
4259 (calendar-gregorian-from-absolute
4260 (get-text-property point 'day))))
4261 (call-interactively cmd))
4262 (fset 'calendar-cursor-to-date oldf))))
4263
4264(defun org-agenda-phases-of-moon ()
4265 "Display the phases of the moon for 3 month around cursor date."
4266 (interactive)
4267 (org-agenda-execute-calendar-command 'calendar-phases-of-moon))
4268
4269(defun org-agenda-holidays ()
4270 "Display the holidays for 3 month around cursor date."
4271 (interactive)
4272 (org-agenda-execute-calendar-command 'list-calendar-holidays))
4273
4274(defun org-agenda-sunrise-sunset (arg)
4275 "Display sunrise and sunset for the cursor date.
4276Latitude and longitude can be specified with the variables
4277`calendar-latitude' and `calendar-longitude'. When called with prefix
4278argument, location will be prompted for."
4279 (interactive "P")
4280 (let ((calendar-longitude (if arg nil calendar-longitude))
4281 (calendar-latitude (if arg nil calendar-latitude))
4282 (calendar-location-name nil))
4283 (org-agenda-execute-calendar-command 'calendar-sunrise-sunset)))
4284
4285(defun org-agenda-goto-calendar ()
4286 "Open the Emacs calendar with the date at the cursor."
4287 (interactive)
4288 (let* ((day (or (get-text-property (point) 'day)
4289 (error "Don't know which date to open in calendar")))
4290 (date (calendar-gregorian-from-absolute day)))
4291 (calendar)
4292 (calendar-goto-date date)))
4293
4294(defun org-agenda-convert-date ()
4295 (interactive)
4296 (let ((day (get-text-property (point) 'day))
4297 date s)
4298 (unless day
4299 (error "Don't know which date to convert"))
4300 (setq date (calendar-gregorian-from-absolute day))
4301 (require 'cal-julian)
4302 (require 'cal-hebrew)
4303 (require 'cal-islam)
4304 (require 'cal-french)
4305 (require 'cal-mayan)
4306 (require 'cal-coptic)
4307 (require 'cal-persia)
4308 (require 'cal-china)
4309 (setq s (concat
4310 "Gregorian: " (calendar-date-string date) "\n"
4311 "Julian: " (calendar-julian-date-string date) "\n"
4312 "Astronomic: " (calendar-astro-date-string date) " (at noon UTC)\n"
4313 "Hebrew: " (calendar-hebrew-date-string date) "\n"
4314 "Islamic: " (calendar-islamic-date-string date) "\n"
4315 "French: " (calendar-french-date-string date) "\n"
4316 "Maya: " (calendar-mayan-date-string date) "\n"
4317 "Coptic: " (calendar-coptic-date-string date) "\n"
4318 "Persian: " (calendar-persian-date-string date) "\n"
4319 "Chineese: " (calendar-chinese-date-string date) "\n"))
4320 (with-output-to-temp-buffer "*Dates*"
4321 (princ s))
4322 (fit-window-to-buffer (get-buffer-window "*Dates*"))))
4323
4088;;; Link Stuff 4324;;; Link Stuff
4089 4325
4090(defun org-find-file-at-mouse (ev) 4326(defun org-find-file-at-mouse (ev)
@@ -5087,14 +5323,23 @@ Before doing so, re-align the table if necessary."
5087 (skip-chars-backward "^|\n\r") 5323 (skip-chars-backward "^|\n\r")
5088 (if (looking-at " ") (forward-char 1))))) 5324 (if (looking-at " ") (forward-char 1)))))
5089 5325
5090(defun org-table-copy-from-above (n) 5326(defun org-table-copy-down (n)
5091 "Copy into the current column the nearest non-empty field from above. 5327 "Copy a field down in the current column.
5092With prefix argument N, take the Nth non-empty field." 5328If the field at the cursor is empty, copy into it the content of the nearest
5329non-empty field above. With argument N, use the Nth non-empty field.
5330If the current fields is not empty, it is copied down to the next row, and
5331the cursor is moved with it. Therefore, repeating this command causes the
5332column to be filled row-by-row.
5333If the variable `org-table-copy-increment' is non-nil and the field is an
5334integer, it will be incremented while copying."
5093 (interactive "p") 5335 (interactive "p")
5094 (let ((colpos (org-table-current-column)) 5336 (let* ((colpos (org-table-current-column))
5095 (beg (org-table-begin)) 5337 (field (org-table-get-field))
5096 txt) 5338 (non-empty (string-match "[^ \t]" field))
5339 (beg (org-table-begin))
5340 txt)
5097 (org-table-check-inside-data-field) 5341 (org-table-check-inside-data-field)
5342 (if non-empty (progn (org-table-next-row) (org-table-blank-field)))
5098 (if (save-excursion 5343 (if (save-excursion
5099 (setq txt 5344 (setq txt
5100 (catch 'exit 5345 (catch 'exit
@@ -5103,10 +5348,13 @@ With prefix argument N, take the Nth non-empty field."
5103 beg t)) 5348 beg t))
5104 (org-table-goto-column colpos t) 5349 (org-table-goto-column colpos t)
5105 (if (and (looking-at 5350 (if (and (looking-at
5106 "|[ \t]*\\([^| \t][^|]*[^| \t]\\)[ \t]*|") 5351 "|[ \t]*\\([^| \t][^|]*?\\)[ \t]*|")
5107 (= (setq n (1- n)) 0)) 5352 (= (setq n (1- n)) 0))
5108 (throw 'exit (match-string 1))))))) 5353 (throw 'exit (match-string 1)))))))
5109 (progn 5354 (progn
5355 (if (and org-table-copy-increment
5356 (string-match "^[0-9]+$" txt))
5357 (setq txt (format "%d" (+ (string-to-int txt) 1))))
5110 (insert txt) 5358 (insert txt)
5111 (org-table-align)) 5359 (org-table-align))
5112 (error "No non-empty field found")))) 5360 (error "No non-empty field found"))))
@@ -5902,13 +6150,13 @@ separator line)."
5902 (string-to-int (match-string 1 form)) 6150 (string-to-int (match-string 1 form))
5903 n0) 6151 n0)
5904 x (nth n fields)) 6152 x (nth n fields))
5905 (unless x (error "Illegal field specifier \"%s\"" 6153 (unless x (error "Invalid field specifier \"%s\""
5906 (match-string 0 form))) 6154 (match-string 0 form)))
5907 (if (equal (string-to-number x) 0) (setq x "0")) 6155 (if (equal (string-to-number x) 0) (setq x "0"))
5908 (setq form (replace-match x t t form))) 6156 (setq form (replace-match x t t form)))
5909 (setq ev (calc-eval (list form) 'num)) 6157 (setq ev (calc-eval (list form) 'num))
5910 (if (listp ev) 6158 (if (listp ev)
5911 (error "Illegal expression: %s (%s at %d)" form (nth 1 ev) (car ev))) 6159 (error "Invalid expression: %s (%s at %d)" form (nth 1 ev) (car ev)))
5912 (org-table-blank-field) 6160 (org-table-blank-field)
5913 (if fmt 6161 (if fmt
5914 (insert (format fmt (string-to-number ev))) 6162 (insert (format fmt (string-to-number ev)))
@@ -6039,7 +6287,7 @@ table editor iin arbitrary modes.")
6039 ([(shift tab)] org-table-previous-field) 6287 ([(shift tab)] org-table-previous-field)
6040 ("\C-c\C-c" org-table-align) 6288 ("\C-c\C-c" org-table-align)
6041 ([(return)] org-table-next-row) 6289 ([(return)] org-table-next-row)
6042 ([(shift return)] org-table-copy-from-above) 6290 ([(shift return)] org-table-copy-down)
6043 ([(meta return)] org-table-wrap-region) 6291 ([(meta return)] org-table-wrap-region)
6044 ("\C-c\C-q" org-table-wrap-region) 6292 ("\C-c\C-q" org-table-wrap-region)
6045 ("\C-c?" org-table-current-column) 6293 ("\C-c?" org-table-current-column)
@@ -6157,7 +6405,7 @@ a reduced column width."
6157 "--" 6405 "--"
6158 ["Blank field" org-table-blank-field :active (org-at-table-p) :keys "C-c SPC"] 6406 ["Blank field" org-table-blank-field :active (org-at-table-p) :keys "C-c SPC"]
6159 ["Copy field from above" 6407 ["Copy field from above"
6160 org-table-copy-from-above :active (org-at-table-p) :keys "S-RET"] 6408 org-table-copy-down :active (org-at-table-p) :keys "S-RET"]
6161 "--" 6409 "--"
6162 ("Column" 6410 ("Column"
6163 ["Move column left" org-metaleft :active (org-at-table-p) :keys "M-<left>"] 6411 ["Move column left" org-metaleft :active (org-at-table-p) :keys "M-<left>"]
@@ -6678,7 +6926,57 @@ underlined headlines. The default is 3."
6678 (setq char (nth (- umax level) (reverse org-ascii-underline))) 6926 (setq char (nth (- umax level) (reverse org-ascii-underline)))
6679 (if org-export-with-section-numbers 6927 (if org-export-with-section-numbers
6680 (setq title (concat (org-section-number level) " " title))) 6928 (setq title (concat (org-section-number level) " " title)))
6681 (insert title "\n" (make-string (length title) char) "\n")))) 6929 (insert title "\n" (make-string (string-width title) char) "\n"))))
6930
6931(defun org-export-copy-visible (&optional arg)
6932 "Copy the visible part of the buffer to another buffer, for printing.
6933Also removes the first line of the buffer it is specifies a mode,
6934and all options lines."
6935 (interactive "P")
6936 (let* ((filename (concat (file-name-sans-extension (buffer-file-name))
6937 ".txt"))
6938 (buffer (find-file-noselect filename))
6939 (ore (concat
6940 (org-make-options-regexp
6941 '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO" "STARTUP"
6942 "TITLE" "AUTHOR" "EMAIL" "TEXT" "OPTIONS" "LANGUAGE"))
6943 (if org-noutline-p "\\(\n\\|$\\)" "")))
6944 s e)
6945 (save-excursion
6946 (set-buffer buffer)
6947 (erase-buffer)
6948 (text-mode))
6949 (save-excursion
6950 (setq s (goto-char (point-min)))
6951 (while (not (= (point) (point-max)))
6952 (goto-char (org-find-invisible))
6953 (append-to-buffer buffer s (point))
6954 (setq s (goto-char (org-find-visible)))))
6955 (switch-to-buffer-other-window buffer)
6956 (newline)
6957 (goto-char (point-min))
6958 (if (looking-at ".*-\\*- mode:.*\n")
6959 (replace-match ""))
6960 (while (re-search-forward ore nil t)
6961 (replace-match ""))
6962 (goto-char (point-min))))
6963
6964(defun org-find-visible ()
6965 (if (featurep 'noutline)
6966 (let ((s (point)))
6967 (while (and (not (= (point-max) (setq s (next-overlay-change s))))
6968 (get-char-property s 'invisible)))
6969 s)
6970 (skip-chars-forward "^\n")
6971 (point)))
6972(defun org-find-invisible ()
6973 (if (featurep 'noutline)
6974 (let ((s (point)))
6975 (while (and (not (= (point-max) (setq s (next-overlay-change s))))
6976 (not (get-char-property s 'invisible))))
6977 s)
6978 (skip-chars-forward "^\r")
6979 (point)))
6682 6980
6683;; HTML 6981;; HTML
6684 6982
@@ -7423,7 +7721,7 @@ When LEVEL is non-nil, increase section numbers on that level."
7423(define-key org-mode-map [(shift tab)] 'org-shifttab) 7721(define-key org-mode-map [(shift tab)] 'org-shifttab)
7424(define-key org-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c) 7722(define-key org-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c)
7425(define-key org-mode-map [(return)] 'org-return) 7723(define-key org-mode-map [(return)] 'org-return)
7426(define-key org-mode-map [(shift return)] 'org-table-copy-from-above) 7724(define-key org-mode-map [(shift return)] 'org-table-copy-down)
7427(define-key org-mode-map [(meta return)] 'org-meta-return) 7725(define-key org-mode-map [(meta return)] 'org-meta-return)
7428(define-key org-mode-map [(control up)] 'org-move-line-up) 7726(define-key org-mode-map [(control up)] 'org-move-line-up)
7429(define-key org-mode-map [(control down)] 'org-move-line-down) 7727(define-key org-mode-map [(control down)] 'org-move-line-down)
@@ -7436,6 +7734,10 @@ When LEVEL is non-nil, increase section numbers on that level."
7436(define-key org-mode-map "\C-c\C-q" 'org-table-wrap-region) 7734(define-key org-mode-map "\C-c\C-q" 'org-table-wrap-region)
7437(define-key org-mode-map "\C-c\C-xa" 'org-export-as-ascii) 7735(define-key org-mode-map "\C-c\C-xa" 'org-export-as-ascii)
7438(define-key org-mode-map "\C-c\C-x\C-a" 'org-export-as-ascii) 7736(define-key org-mode-map "\C-c\C-x\C-a" 'org-export-as-ascii)
7737(define-key org-mode-map "\C-c\C-xv" 'org-export-copy-visible)
7738(define-key org-mode-map "\C-c\C-x\C-v" 'org-export-copy-visible)
7739(define-key org-mode-map "\C-c\C-xo" 'org-export-as-opml)
7740(define-key org-mode-map "\C-c\C-x\C-o" 'org-export-as-opml)
7439(define-key org-mode-map "\C-c\C-xt" 'org-insert-export-options-template) 7741(define-key org-mode-map "\C-c\C-xt" 'org-insert-export-options-template)
7440(define-key org-mode-map "\C-c:" 'org-toggle-fixed-width-section) 7742(define-key org-mode-map "\C-c:" 'org-toggle-fixed-width-section)
7441(define-key org-mode-map "\C-c\C-xh" 'org-export-as-html) 7743(define-key org-mode-map "\C-c\C-xh" 'org-export-as-html)
@@ -7444,7 +7746,7 @@ When LEVEL is non-nil, increase section numbers on that level."
7444 7746
7445;; FIXME: Do we really need to save match data in these commands? 7747;; FIXME: Do we really need to save match data in these commands?
7446;; I would like to remove it in order to minimize impact. 7748;; I would like to remove it in order to minimize impact.
7447;; Self-insert already does not preserve it. How much resources does this take??? 7749;; Self-insert already does not preserve it. How much resources used by this???
7448 7750
7449(defsubst org-table-p () 7751(defsubst org-table-p ()
7450 (if (and (eq major-mode 'org-mode) font-lock-mode) 7752 (if (and (eq major-mode 'org-mode) font-lock-mode)
@@ -7469,28 +7771,7 @@ overwritten, and the table is not marked as requiring realignment."
7469 7771
7470;; FIXME: 7772;; FIXME:
7471;; The following two functions might still be optimized to trigger 7773;; The following two functions might still be optimized to trigger
7472;; re-alignment less frequently. Right now they raise the flag each time 7774;; re-alignment less frequently.
7473;; (through before-change-functions). Here is how this could be minimized:
7474;; Basically, check if the non-white field width before deletion is
7475;; equal to the column width. If yes, the delete should trigger a
7476;; re-align. I have not implemented this so far because it is not so
7477;; easy, requires grabbing the field etc. So it may finally have some
7478;; impact on typing performance which we don't want.
7479
7480;; The defsubst is only a draft, untested...
7481
7482;; Maybe it is not so important to get rid of realigns - maybe the most
7483;; important aspect is to keep the table look noce as long as possible,
7484;; which is already achieved...
7485
7486;(defsubst org-check-delete-triggers-realign ()
7487; (let ((pos (point)))
7488; (skip-chars-backward "^|\n")
7489; (and (looking-at " *\\(.*?\\) *|")
7490; (= (nth (1- (org-table-current-column))
7491; org-table-last-column-widths)
7492; (- (match-end 1) (match-beginning 1)))
7493; (setq org-table-may-need-update t))))
7494 7775
7495(defun org-delete-backward-char (N) 7776(defun org-delete-backward-char (N)
7496 "Like `delete-backward-char', insert whitespace at field end in tables. 7777 "Like `delete-backward-char', insert whitespace at field end in tables.
@@ -7769,7 +8050,7 @@ the automatic table editor has been turned off."
7769 ["Next row" org-return (org-at-table-p)] 8050 ["Next row" org-return (org-at-table-p)]
7770 "--" 8051 "--"
7771 ["Blank field" org-table-blank-field (org-at-table-p)] 8052 ["Blank field" org-table-blank-field (org-at-table-p)]
7772 ["Copy field from above" org-table-copy-from-above (org-at-table-p)] 8053 ["Copy field from above" org-table-copy-down (org-at-table-p)]
7773 "--" 8054 "--"
7774 ("Column" 8055 ("Column"
7775 ["Move column left" org-metaleft (org-at-table-p)] 8056 ["Move column left" org-metaleft (org-at-table-p)]
@@ -7807,8 +8088,10 @@ the automatic table editor has been turned off."
7807 "--" 8088 "--"
7808 ("Export" 8089 ("Export"
7809 ["ASCII" org-export-as-ascii t] 8090 ["ASCII" org-export-as-ascii t]
8091 ["Extract visible text" org-export-copy-visible t]
7810 ["HTML" org-export-as-html t] 8092 ["HTML" org-export-as-html t]
7811 ["HTML, and open" org-export-as-html-and-open t] 8093 ["HTML, and open" org-export-as-html-and-open t]
8094 ["OPML" org-export-as-opml nil]
7812 "--" 8095 "--"
7813 ["Option template" org-insert-export-options-template t] 8096 ["Option template" org-insert-export-options-template t]
7814 ["Toggle fixed width" org-toggle-fixed-width-section t]) 8097 ["Toggle fixed width" org-toggle-fixed-width-section t])
@@ -8098,3 +8381,5 @@ When ENTRY is non-nil, show the entire entry."
8098 8381
8099;;; org.el ends here 8382;;; org.el ends here
8100 8383
8384
8385
diff --git a/lisp/textmodes/refbib.el b/lisp/textmodes/refbib.el
index 5c9e6c1c6dc..dedad3b1aa9 100644
--- a/lisp/textmodes/refbib.el
+++ b/lisp/textmodes/refbib.el
@@ -1,6 +1,6 @@
1;;; refbib.el --- convert refer-style references to ones usable by Latex bib 1;;; refbib.el --- convert refer-style references to ones usable by Latex bib
2 2
3;; Copyright (C) 1989 Free Software Foundation, Inc. 3;; Copyright (C) 1989, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Henry Kautz <kautz@research.att.com> 5;; Author: Henry Kautz <kautz@research.att.com>
6;; Keywords: bib, tex 6;; Keywords: bib, tex
@@ -35,7 +35,7 @@
35;; 9/88, created H.Kautz 35;; 9/88, created H.Kautz
36;; modified 1/19/89, allow books with editor but no author; 36;; modified 1/19/89, allow books with editor but no author;
37;; added %O ordering field; 37;; added %O ordering field;
38;; appended illegal multiple fields, instead of 38;; appended invalid multiple fields, instead of
39;; discarding; 39;; discarding;
40;; added rule, a tech report whose %R number 40;; added rule, a tech report whose %R number
41;; contains "ISBN" is really a book 41;; contains "ISBN" is really a book
@@ -292,7 +292,7 @@ title if CAPITALIZE is true. Returns value of VAR."
292 (setq val item) 292 (setq val item)
293 (if unique 293 (if unique
294 (progn 294 (progn
295 (r2b-warning "*Illegal multiple field %s %s" field item) 295 (r2b-warning "*Invalid multiple field %s %s" field item)
296 (setq val (concat val "\n" item)) 296 (setq val (concat val "\n" item))
297 ) 297 )
298 (setq val (concat val "\n\t\tand " item)) 298 (setq val (concat val "\n\t\tand " item))
diff --git a/lisp/textmodes/refer.el b/lisp/textmodes/refer.el
index 1c77a8f4b36..2e26e2d3da6 100644
--- a/lisp/textmodes/refer.el
+++ b/lisp/textmodes/refer.el
@@ -1,6 +1,6 @@
1;;; refer.el --- look up references in bibliography files 1;;; refer.el --- look up references in bibliography files
2 2
3;; Copyright (C) 1992, 1996, 2001, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1992, 1996, 2001, 2004, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Ashwin Ram <ashwin@cc.gatech.edu> 5;; Author: Ashwin Ram <ashwin@cc.gatech.edu>
6;; Maintainer: Gernot Heiser <gernot@acm.org> 6;; Maintainer: Gernot Heiser <gernot@acm.org>
@@ -388,7 +388,7 @@ found on the last refer-find-entry or refer-find-next-entry."
388 (eq refer-bib-directory 'bibinputs))) 388 (eq refer-bib-directory 'bibinputs)))
389 (refer-expand-files refer-bib-files dir-list)) 389 (refer-expand-files refer-bib-files dir-list))
390 ((listp refer-bib-files) refer-bib-files) 390 ((listp refer-bib-files) refer-bib-files)
391 (t (error "Illegal value for refer-bib-files: %s" 391 (t (error "Invalid value for refer-bib-files: %s"
392 refer-bib-files))))) 392 refer-bib-files)))))
393 (if (or (eq refer-bib-directory 'texinputs) 393 (if (or (eq refer-bib-directory 'texinputs)
394 (eq refer-bib-directory 'bibinputs)) 394 (eq refer-bib-directory 'bibinputs))
diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el
index bfe2cd8282b..f12d01716fe 100644
--- a/lisp/textmodes/reftex-cite.el
+++ b/lisp/textmodes/reftex-cite.el
@@ -1,5 +1,6 @@
1;;; reftex-cite.el --- creating citations with RefTeX 1;;; reftex-cite.el --- creating citations with RefTeX
2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
3;; Free Software Foundation, Inc.
3 4
4;; Author: Carsten Dominik <dominik@science.uva.nl> 5;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.26 6;; Version: 4.26
@@ -982,7 +983,7 @@ While entering the regexp, completion on knows citation keys is possible.
982 983
983 (if (and reftex-comment-citations 984 (if (and reftex-comment-citations
984 (string-match "%l" reftex-cite-comment-format)) 985 (string-match "%l" reftex-cite-comment-format))
985 (error "reftex-cite-comment-format contains illegal %%l")) 986 (error "reftex-cite-comment-format contains invalid %%l"))
986 987
987 (while (string-match 988 (while (string-match
988 "\\(\\`\\|[^%]\\)\\(\\(%\\([0-9]*\\)\\([a-zA-Z]\\)\\)[.,;: ]*\\)" 989 "\\(\\`\\|[^%]\\)\\(\\(%\\([0-9]*\\)\\([a-zA-Z]\\)\\)[.,;: ]*\\)"
diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el
index cb02f2e056f..8fada9c4930 100644
--- a/lisp/textmodes/reftex-index.el
+++ b/lisp/textmodes/reftex-index.el
@@ -1,5 +1,6 @@
1;;; reftex-index.el --- index support with RefTeX 1;;; reftex-index.el --- index support with RefTeX
2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
3;; Free Software Foundation, Inc.
3 4
4;; Author: Carsten Dominik <dominik@science.uva.nl> 5;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.26 6;; Version: 4.26
@@ -928,7 +929,7 @@ When index is restricted, select the previous section as restriction criterion."
928 (error "Not changed")) 929 (error "Not changed"))
929 ((string= npart "") 930 ((string= npart "")
930 (if dont-allow-empty 931 (if dont-allow-empty
931 (error "Illegal value") 932 (error "Invalid value")
932 (setf (nth n analyze) npart))) 933 (setf (nth n analyze) npart)))
933 (t (setf (nth n analyze) (concat initial npart)))) 934 (t (setf (nth n analyze) (concat initial npart))))
934 (setq new (apply 'concat analyze)) 935 (setq new (apply 'concat analyze))
@@ -1385,7 +1386,7 @@ match, the user will be asked to confirm the replacement."
1385 (file-regular-p reftex-index-phrases-restrict-file)) 1386 (file-regular-p reftex-index-phrases-restrict-file))
1386 (list reftex-index-phrases-restrict-file)) 1387 (list reftex-index-phrases-restrict-file))
1387 ((stringp reftex-index-phrases-restrict-file) 1388 ((stringp reftex-index-phrases-restrict-file)
1388 (error "Illegal restriction file %s" 1389 (error "Invalid restriction file %s"
1389 reftex-index-phrases-restrict-file)) 1390 reftex-index-phrases-restrict-file))
1390 (t reftex-index-phrases-files))) 1391 (t reftex-index-phrases-files)))
1391 (as-words reftex-index-phrases-search-whole-words)) 1392 (as-words reftex-index-phrases-search-whole-words))
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el
index 630c7101725..ce1e3d77d72 100644
--- a/lisp/textmodes/reftex-parse.el
+++ b/lisp/textmodes/reftex-parse.el
@@ -1,5 +1,6 @@
1;;; reftex-parse.el --- parser functions for RefTeX 1;;; reftex-parse.el --- parser functions for RefTeX
2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
3;; Free Software Foundation, Inc.
3 4
4;; Author: Carsten Dominik <dominik@science.uva.nl> 5;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.26 6;; Version: 4.26
@@ -544,7 +545,7 @@ of master file."
544 (funcall parse env) 545 (funcall parse env)
545 (error (format "HOOK ERROR: %s" (cdr error-var)))))) 546 (error (format "HOOK ERROR: %s" (cdr error-var))))))
546 (t 547 (t
547 "ILLEGAL VALUE OF PARSE")))) 548 "INVALID VALUE OF PARSE"))))
548 549
549(defun reftex-where-am-I () 550(defun reftex-where-am-I ()
550 ;; Return the docstruct entry above point. Actually returns a cons 551 ;; Return the docstruct entry above point. Actually returns a cons
diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el
index 43095e2d684..6afbb77767c 100644
--- a/lisp/textmodes/reftex-ref.el
+++ b/lisp/textmodes/reftex-ref.el
@@ -1,5 +1,6 @@
1;;; reftex-ref.el --- code to create labels and references with RefTeX 1;;; reftex-ref.el --- code to create labels and references with RefTeX
2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
3;; Free Software Foundation, Inc.
3 4
4;; Author: Carsten Dominik <dominik@science.uva.nl> 5;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.26 6;; Version: 4.26
@@ -172,7 +173,7 @@ This function is controlled by the settings of reftex-insert-label-flags."
172 (nth 2 (reftex-label-info " " nil nil t)))) 173 (nth 2 (reftex-label-info " " nil nil t))))
173 ;; Catch the cases where the is actually no context available. 174 ;; Catch the cases where the is actually no context available.
174 (if (or (string-match "NO MATCH FOR CONTEXT REGEXP" default) 175 (if (or (string-match "NO MATCH FOR CONTEXT REGEXP" default)
175 (string-match "ILLEGAL VALUE OF PARSE" default) 176 (string-match "INVALID VALUE OF PARSE" default)
176 (string-match "SECTION HEADING NOT FOUND" default) 177 (string-match "SECTION HEADING NOT FOUND" default)
177 (string-match "HOOK ERROR" default) 178 (string-match "HOOK ERROR" default)
178 (string-match "^[ \t]*$" default)) 179 (string-match "^[ \t]*$" default))
@@ -217,7 +218,7 @@ This function is controlled by the settings of reftex-insert-label-flags."
217 218
218 ;; Test if label contains strange characters 219 ;; Test if label contains strange characters
219 ((string-match reftex-label-illegal-re label) 220 ((string-match reftex-label-illegal-re label)
220 (message "Label \"%s\" contains illegal characters" label) 221 (message "Label \"%s\" contains invalid characters" label)
221 (ding) 222 (ding)
222 (sit-for 2)) 223 (sit-for 2))
223 224
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index a7c0cb1c1ad..b2ca7bed250 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -1,5 +1,6 @@
1;;; reftex-vars.el --- configuration variables for RefTeX 1;;; reftex-vars.el --- configuration variables for RefTeX
2;; Copyright (c) 1997, 1998, 1999, 2003, 2004 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2003, 2004, 2005
3;; Free Software Foundation, Inc.
3 4
4;; Author: Carsten Dominik <dominik@science.uva.nl> 5;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.26 6;; Version: 4.26
@@ -747,7 +748,7 @@ And here is the setup for RefTeX:
747 748
748If DERIVE is t, RefTeX will try to derive a sensible label from context. 749If DERIVE is t, RefTeX will try to derive a sensible label from context.
749A section label for example will be derived from the section heading. 750A section label for example will be derived from the section heading.
750The conversion of the context to a legal label is governed by the 751The conversion of the context to a valid label is governed by the
751specifications given in `reftex-derive-label-parameters'. 752specifications given in `reftex-derive-label-parameters'.
752If RefTeX fails to derive a label, it will prompt the user. 753If RefTeX fails to derive a label, it will prompt the user.
753If DERIVE is nil, the label generated will consist of the prefix and a 754If DERIVE is nil, the label generated will consist of the prefix and a
@@ -790,7 +791,7 @@ e (equation), n (footnote), N (endnote), plus any definitions in
790 (string :tag "selected label types" "")))) 791 (string :tag "selected label types" ""))))
791 792
792(defcustom reftex-string-to-label-function 'reftex-string-to-label 793(defcustom reftex-string-to-label-function 'reftex-string-to-label
793 "Function to turn an arbitrary string into a legal label. 794 "Function to turn an arbitrary string into a valid label.
794RefTeX's default function uses the variable `reftex-derive-label-parameters'." 795RefTeX's default function uses the variable `reftex-derive-label-parameters'."
795 :group 'reftex-making-and-inserting-labels 796 :group 'reftex-making-and-inserting-labels
796 :type 'symbol) 797 :type 'symbol)
@@ -798,7 +799,7 @@ RefTeX's default function uses the variable `reftex-derive-label-parameters'."
798(defcustom reftex-translate-to-ascii-function 'reftex-latin1-to-ascii 799(defcustom reftex-translate-to-ascii-function 'reftex-latin1-to-ascii
799 "Filter function which will process a context string before it is used 800 "Filter function which will process a context string before it is used
800to derive a label from it. The intended application is to convert ISO or 801to derive a label from it. The intended application is to convert ISO or
801Mule characters into something legal in labels. The default function 802Mule characters into something valid in labels. The default function
802removes the accents from Latin-1 characters. X-Symbol (>=2.6) sets this 803removes the accents from Latin-1 characters. X-Symbol (>=2.6) sets this
803variable to the much more general `x-symbol-translate-to-ascii'." 804variable to the much more general `x-symbol-translate-to-ascii'."
804 :group 'reftex-making-and-inserting-labels 805 :group 'reftex-making-and-inserting-labels
@@ -811,8 +812,8 @@ This variable is a list of the following items.
811 812
812NWORDS Number of words to use. 813NWORDS Number of words to use.
813MAXCHAR Maximum number of characters in a label string. 814MAXCHAR Maximum number of characters in a label string.
814ILLEGAL nil: Throw away any words containing characters illegal in labels. 815INVALID nil: Throw away any words containing characters invalid in labels.
815 t: Throw away only the illegal characters, not the whole word. 816 t: Throw away only the invalid characters, not the whole word.
816ABBREV nil: Never abbreviate words. 817ABBREV nil: Never abbreviate words.
817 t: Always abbreviate words (see `reftex-abbrev-parameters'). 818 t: Always abbreviate words (see `reftex-abbrev-parameters').
818 not t and not nil: Abbreviate words if necessary to shorten 819 not t and not nil: Abbreviate words if necessary to shorten
@@ -823,7 +824,7 @@ DOWNCASE t: Downcase words before using them."
823 :group 'reftex-making-and-inserting-labels 824 :group 'reftex-making-and-inserting-labels
824 :type '(list (integer :tag "Number of words " 3) 825 :type '(list (integer :tag "Number of words " 3)
825 (integer :tag "Maximum label length " 20) 826 (integer :tag "Maximum label length " 20)
826 (choice :tag "Illegal characters in words" 827 (choice :tag "Invalid characters in words"
827 (const :tag "throw away entire word" nil) 828 (const :tag "throw away entire word" nil)
828 (const :tag "throw away single chars" t)) 829 (const :tag "throw away single chars" t))
829 (choice :tag "Abbreviate words " 830 (choice :tag "Abbreviate words "
@@ -837,7 +838,7 @@ DOWNCASE t: Downcase words before using them."
837 (option (boolean :tag "Downcase words ")))) 838 (option (boolean :tag "Downcase words "))))
838 839
839(defcustom reftex-label-illegal-re "[^-a-zA-Z0-9_+=:;,.]" 840(defcustom reftex-label-illegal-re "[^-a-zA-Z0-9_+=:;,.]"
840 "Regexp matching characters not legal in labels." 841 "Regexp matching characters not valid in labels."
841 :group 'reftex-making-and-inserting-labels 842 :group 'reftex-making-and-inserting-labels
842 :type '(regexp :tag "Regular Expression")) 843 :type '(regexp :tag "Regular Expression"))
843 844
@@ -1226,7 +1227,7 @@ phrase buffer.
1226 1227
1227The final entry may also be a symbol if this entry has a association 1228The final entry may also be a symbol if this entry has a association
1228in the variable `reftex-index-macros-builtin' to specify the main 1229in the variable `reftex-index-macros-builtin' to specify the main
1229indexing package you are using. Legal values are currently 1230indexing package you are using. Valid values are currently
1230default The LaTeX default - unnecessary to specify this one 1231default The LaTeX default - unnecessary to specify this one
1231multind The multind.sty package 1232multind The multind.sty package
1232index The index.sty package 1233index The index.sty package
@@ -1281,7 +1282,7 @@ DEFAULT-TAG: This is the tag to be used if the macro requires a TAG argument.
1281When working with multiple indexes, RefTeX queries for an index tag when 1282When working with multiple indexes, RefTeX queries for an index tag when
1282creating index entries or displaying a specific index. This variable controls 1283creating index entries or displaying a specific index. This variable controls
1283the default offered for these queries. The default can be selected with RET 1284the default offered for these queries. The default can be selected with RET
1284during selection or completion. Legal values of this variable are: 1285during selection or completion. Valid values of this variable are:
1285 1286
1286nil Do not provide a default index 1287nil Do not provide a default index
1287\"tag\" The default index tag given as a string, e.g. \"idx\". 1288\"tag\" The default index tag given as a string, e.g. \"idx\".
@@ -1526,9 +1527,9 @@ This is a list of items, each item is like: (TYPE . (DEF-EXT OTHER-EXT ...))
1526 1527
1527TYPE: File type like \"bib\" or \"tex\". 1528TYPE: File type like \"bib\" or \"tex\".
1528DEF-EXT: The default extension for that file type, like \".tex\" or \".bib\". 1529DEF-EXT: The default extension for that file type, like \".tex\" or \".bib\".
1529OTHER-EXT: Any number of other legal extensions for this file type. 1530OTHER-EXT: Any number of other valid extensions for this file type.
1530 1531
1531When a files is searched and it does not have any of the legal extensions, 1532When a files is searched and it does not have any of the valid extensions,
1532we try the default extension first, and then the naked file name. 1533we try the default extension first, and then the naked file name.
1533 1534
1534If you are using AUCTeX, you also need to add new extensions to 1535If you are using AUCTeX, you also need to add new extensions to
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 49485c24725..865217dab08 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -1,5 +1,6 @@
1;;; reftex.el --- minor mode for doing \label, \ref, \cite, \index in LaTeX 1;;; reftex.el --- minor mode for doing \label, \ref, \cite, \index in LaTeX
2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
3;; Free Software Foundation, Inc.
3 4
4;; Author: Carsten Dominik <dominik@science.uva.nl> 5;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.26 6;; Version: 4.26
@@ -1416,7 +1417,7 @@ Valid actions are: readable, restore, read, kill, write."
1416 ((= key ?\C-i) 1417 ((= key ?\C-i)
1417 (setq prefix (completing-read "Prefix: " xr-alist nil t)) 1418 (setq prefix (completing-read "Prefix: " xr-alist nil t))
1418 (- len (length (memq (assoc prefix xr-alist) xr-alist)))) 1419 (- len (length (memq (assoc prefix xr-alist) xr-alist))))
1419 (t (error "Illegal document selection [%c]" key))))))))) 1420 (t (error "Invalid document selection [%c]" key)))))))))
1420 1421
1421;;; ========================================================================= 1422;;; =========================================================================
1422;;; 1423;;;
@@ -1424,7 +1425,7 @@ Valid actions are: readable, restore, read, kill, write."
1424 1425
1425(defun reftex-locate-file (file type master-dir &optional die) 1426(defun reftex-locate-file (file type master-dir &optional die)
1426 "Find FILE of type TYPE in MASTER-DIR or on the path associcted with TYPE. 1427 "Find FILE of type TYPE in MASTER-DIR or on the path associcted with TYPE.
1427If the file does not have any of the legal extensions for TYPE, 1428If the file does not have any of the valid extensions for TYPE,
1428try first the default extension and only then the naked file name. 1429try first the default extension and only then the naked file name.
1429When DIE is non-nil, throw an error if file not found." 1430When DIE is non-nil, throw an error if file not found."
1430 (let* ((rec-values (if reftex-search-unrecursed-path-first '(nil t) '(t))) 1431 (let* ((rec-values (if reftex-search-unrecursed-path-first '(nil t) '(t)))
@@ -2167,17 +2168,17 @@ Works on both Emacs and XEmacs."
2167 (reftex-convert-string string "[-~ \t\n\r,;]" nil t t 2168 (reftex-convert-string string "[-~ \t\n\r,;]" nil t t
2168 5 40 nil 1 " " (nth 5 reftex-derive-label-parameters))) 2169 5 40 nil 1 " " (nth 5 reftex-derive-label-parameters)))
2169 2170
2170(defun reftex-convert-string (string split-re illegal-re dot keep-fp 2171(defun reftex-convert-string (string split-re invalid-re dot keep-fp
2171 nwords maxchar illegal abbrev sep 2172 nwords maxchar invalid abbrev sep
2172 ignore-words &optional downcase) 2173 ignore-words &optional downcase)
2173 "Convert a string (a sentence) to something shorter. 2174 "Convert a string (a sentence) to something shorter.
2174SPLIT-RE is the regular expression used to split the string into words. 2175SPLIT-RE is the regular expression used to split the string into words.
2175ILLEGAL-RE matches characters which are illegal in the final string. 2176INVALID-RE matches characters which are invalid in the final string.
2176DOT t means add dots to abbreviated words. 2177DOT t means add dots to abbreviated words.
2177KEEP-FP t means to keep a final punctuation when applicable. 2178KEEP-FP t means to keep a final punctuation when applicable.
2178NWORDS Number of words to use. 2179NWORDS Number of words to use.
2179MAXCHAR Maximum number of characters in the final string. 2180MAXCHAR Maximum number of characters in the final string.
2180ILLEGAL nil: Throw away any words containing stuff matched with ILLEGAL-RE. 2181INVALID nil: Throw away any words containing stuff matched with INVALID-RE.
2181 t: Throw away only the matched part, not the whole word. 2182 t: Throw away only the matched part, not the whole word.
2182ABBREV nil: Never abbreviate words. 2183ABBREV nil: Never abbreviate words.
2183 t: Always abbreviate words (see `reftex-abbrev-parameters'). 2184 t: Always abbreviate words (see `reftex-abbrev-parameters').
@@ -2187,7 +2188,7 @@ SEP String separating different words in the output string.
2187IGNORE-WORDS List of words which should be removed from the string." 2188IGNORE-WORDS List of words which should be removed from the string."
2188 2189
2189 (let* ((words0 (split-string string (or split-re "[ \t\n\r]"))) 2190 (let* ((words0 (split-string string (or split-re "[ \t\n\r]")))
2190 (reftex-label-illegal-re (or illegal-re "\000")) 2191 (reftex-label-illegal-re (or invalid-re "\000"))
2191 (abbrev-re (concat 2192 (abbrev-re (concat
2192 "\\`\\(" 2193 "\\`\\("
2193 (make-string (nth 0 reftex-abbrev-parameters) ?.) 2194 (make-string (nth 0 reftex-abbrev-parameters) ?.)
@@ -2203,7 +2204,7 @@ IGNORE-WORDS List of words which should be removed from the string."
2203 (cond 2204 (cond
2204 ((member (downcase word) ignore-words)) 2205 ((member (downcase word) ignore-words))
2205 ((string-match reftex-label-illegal-re word) 2206 ((string-match reftex-label-illegal-re word)
2206 (when illegal 2207 (when invalid
2207 (while (string-match reftex-label-illegal-re word) 2208 (while (string-match reftex-label-illegal-re word)
2208 (setq word (replace-match "" nil nil word))) 2209 (setq word (replace-match "" nil nil word)))
2209 (push word words))) 2210 (push word words)))
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index b97b400895d..34d39807d2d 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -1802,7 +1802,7 @@ have <h1>Very Major Headlines</h1> through <h6>Very Minor Headlines</h6>
1802 1802
1803<p>Paragraphs only need an opening tag. Line breaks and multiple spaces are 1803<p>Paragraphs only need an opening tag. Line breaks and multiple spaces are
1804ignored unless the text is <pre>preformatted.</pre> Text can be marked as 1804ignored unless the text is <pre>preformatted.</pre> Text can be marked as
1805<b>bold</b>, <i>italic</i> or <u>underlined</u> using the normal M-g or 1805<b>bold</b>, <i>italic</i> or <u>underlined</u> using the normal M-o or
1806Edit/Text Properties/Face commands. 1806Edit/Text Properties/Face commands.
1807 1807
1808Pages can have <a name=\"SOMENAME\">named points</a> and can link other points 1808Pages can have <a name=\"SOMENAME\">named points</a> and can link other points
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index cf8d642a43e..0c83406318a 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -1562,8 +1562,9 @@ Return the process in which TeX is running."
1562 (concat 1562 (concat
1563 (if file 1563 (if file
1564 (if star (concat (substring cmd 0 star) 1564 (if star (concat (substring cmd 0 star)
1565 file (substring cmd (1+ star))) 1565 (shell-quote-argument file)
1566 (concat cmd " " file)) 1566 (substring cmd (1+ star)))
1567 (concat cmd " " (shell-quote-argument file)))
1567 cmd) 1568 cmd)
1568 (if background "&" "")))) 1569 (if background "&" ""))))
1569 ;; Switch to buffer before checking for subproc output in it. 1570 ;; Switch to buffer before checking for subproc output in it.
@@ -1886,8 +1887,8 @@ FILE is typically the output DVI or PDF file."
1886 (prog1 (file-name-directory (expand-file-name file)) 1887 (prog1 (file-name-directory (expand-file-name file))
1887 (setq file (file-name-nondirectory file)))) 1888 (setq file (file-name-nondirectory file))))
1888 (root (file-name-sans-extension file)) 1889 (root (file-name-sans-extension file))
1889 (fspec (list (cons ?r (comint-quote-filename root)) 1890 (fspec (list (cons ?r (shell-quote-argument root))
1890 (cons ?f (comint-quote-filename file)))) 1891 (cons ?f (shell-quote-argument file))))
1891 (default (tex-compile-default fspec))) 1892 (default (tex-compile-default fspec)))
1892 (list default-directory 1893 (list default-directory
1893 (completing-read 1894 (completing-read
@@ -1908,14 +1909,14 @@ FILE is typically the output DVI or PDF file."
1908 (compile-command 1909 (compile-command
1909 (if star 1910 (if star
1910 (concat (substring command 0 star) 1911 (concat (substring command 0 star)
1911 (comint-quote-filename file) 1912 (shell-quote-argument file)
1912 (substring command (1+ star))) 1913 (substring command (1+ star)))
1913 (concat command " " 1914 (concat command " "
1914 tex-start-options 1915 tex-start-options
1915 (if (< 0 (length tex-start-commands)) 1916 (if (< 0 (length tex-start-commands))
1916 (concat 1917 (concat
1917 (shell-quote-argument tex-start-commands) " ")) 1918 (shell-quote-argument tex-start-commands) " "))
1918 (comint-quote-filename file))))) 1919 (shell-quote-argument file)))))
1919 (tex-send-tex-command compile-command dir))) 1920 (tex-send-tex-command compile-command dir)))
1920 1921
1921(defun tex-send-tex-command (cmd &optional dir) 1922(defun tex-send-tex-command (cmd &optional dir)
diff --git a/lisp/thumbs.el b/lisp/thumbs.el
index 5ceb4f2c148..fd3cb13de98 100644
--- a/lisp/thumbs.el
+++ b/lisp/thumbs.el
@@ -1,6 +1,6 @@
1;;; thumbs.el --- Thumbnails previewer for images files 1;;; thumbs.el --- Thumbnails previewer for images files
2 2
3;; Copyright 2004 Free Software Foundation, Inc 3;; Copyright 2004, 2005 Free Software Foundation, Inc
4 4
5;; Author: Jean-Philippe Theberge <jphiltheberge@videotron.ca> 5;; Author: Jean-Philippe Theberge <jphiltheberge@videotron.ca>
6;; Keywords: Multimedia 6;; Keywords: Multimedia
@@ -630,7 +630,7 @@ Open another window."
630 630
631(defun thumbs-modify-image (action &optional arg) 631(defun thumbs-modify-image (action &optional arg)
632 "Call convert to do ACTION on image with argument ARG. 632 "Call convert to do ACTION on image with argument ARG.
633ACTION and ARG should be legal convert command." 633ACTION and ARG should be a valid convert command."
634 (interactive "sAction: \nsValue: ") 634 (interactive "sAction: \nsValue: ")
635 ;; cleaning of old temp file 635 ;; cleaning of old temp file
636 (mapc 'delete-file 636 (mapc 'delete-file
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index 6ed93a0e99e..e6a85439166 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -130,7 +130,7 @@ position to pop up the tooltip."
130 130
131(defcustom tooltip-gud-display 131(defcustom tooltip-gud-display
132 '((eq (tooltip-event-buffer tooltip-gud-event) 132 '((eq (tooltip-event-buffer tooltip-gud-event)
133 (marker-buffer overlay-arrow-position))) 133 (marker-buffer gud-overlay-arrow-position)))
134 "List of forms determining where GUD tooltips are displayed. 134 "List of forms determining where GUD tooltips are displayed.
135 135
136Forms in the list are combined with AND. The default is to display 136Forms in the list are combined with AND. The default is to display
diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el
index ec24282702b..1136ce565a8 100644
--- a/lisp/vc-cvs.el
+++ b/lisp/vc-cvs.el
@@ -1,6 +1,7 @@
1;;; vc-cvs.el --- non-resident support for CVS version-control 1;;; vc-cvs.el --- non-resident support for CVS version-control
2 2
3;; Copyright (C) 1995,98,99,2000,2001,02,2003 Free Software Foundation, Inc. 3;; Copyright (C) 1995,98,99,2000,2001,02,2003, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: FSF (see vc.el for full credits) 6;; Author: FSF (see vc.el for full credits)
6;; Maintainer: Andre Spiegel <spiegel@gnu.org> 7;; Maintainer: Andre Spiegel <spiegel@gnu.org>
@@ -745,7 +746,7 @@ is `local'.
745The default METHOD for a CVS root of the form 746The default METHOD for a CVS root of the form
746 [USER@]HOSTNAME:/path/to/repository 747 [USER@]HOSTNAME:/path/to/repository
747is `ext'. 748is `ext'.
748For an empty string, nil is returned (illegal CVS root)." 749For an empty string, nil is returned (invalid CVS root)."
749 ;; Split CVS root into colon separated fields (0-4). 750 ;; Split CVS root into colon separated fields (0-4).
750 ;; The `x:' makes sure, that leading colons are not lost; 751 ;; The `x:' makes sure, that leading colons are not lost;
751 ;; `HOST:/PATH' is then different from `:METHOD:/PATH'. 752 ;; `HOST:/PATH' is then different from `:METHOD:/PATH'.
diff --git a/lisp/vc.el b/lisp/vc.el
index 2e241e67f48..ce4cb2d36c8 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -1,7 +1,7 @@
1;;; vc.el --- drive a version-control system from within Emacs 1;;; vc.el --- drive a version-control system from within Emacs
2 2
3;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 3;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
4;; 2000, 2001, 2003, 2004 Free Software Foundation, Inc. 4;; 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6;; Author: FSF (see below for full credits) 6;; Author: FSF (see below for full credits)
7;; Maintainer: Andre Spiegel <spiegel@gnu.org> 7;; Maintainer: Andre Spiegel <spiegel@gnu.org>
@@ -962,8 +962,10 @@ that is inserted into the command line before the filename."
962 ;; start-process does not support remote execution 962 ;; start-process does not support remote execution
963 (setq okstatus nil)) 963 (setq okstatus nil))
964 (if (eq okstatus 'async) 964 (if (eq okstatus 'async)
965 (let ((proc (apply 'start-process command (current-buffer) command 965 (let ((proc
966 squeezed))) 966 (let ((process-connection-type nil))
967 (apply 'start-process command (current-buffer) command
968 squeezed))))
967 (unless (active-minibuffer-window) 969 (unless (active-minibuffer-window)
968 (message "Running %s in the background..." command)) 970 (message "Running %s in the background..." command))
969 ;;(set-process-sentinel proc (lambda (p msg) (delete-process p))) 971 ;;(set-process-sentinel proc (lambda (p msg) (delete-process p)))
diff --git a/lisp/wdired.el b/lisp/wdired.el
index 92d7a81627a..a4119343600 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -330,7 +330,8 @@ See `wdired-mode'."
330 (set-buffer-modified-p nil) 330 (set-buffer-modified-p nil)
331 (setq buffer-undo-list nil) 331 (setq buffer-undo-list nil)
332 (run-hooks 'wdired-mode-hook) 332 (run-hooks 'wdired-mode-hook)
333 (message (substitute-command-keys "Press \\[wdired-finish-edit] when finished"))) 333 (message (substitute-command-keys "Press \\[wdired-finish-edit] when finished \
334or \\[wdired-abort-changes] to abort changes")))
334 335
335 336
336;; Protect the buffer so only the filenames can be changed, and put 337;; Protect the buffer so only the filenames can be changed, and put
diff --git a/lisp/window.el b/lisp/window.el
index 5768436eaae..b4fd664a43c 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -397,20 +397,13 @@ lines than are actually needed in the case where some error may be present."
397 397
398(defun window-buffer-height (window) 398(defun window-buffer-height (window)
399 "Return the height (in screen lines) of the buffer that WINDOW is displaying." 399 "Return the height (in screen lines) of the buffer that WINDOW is displaying."
400 (save-excursion 400 (with-current-buffer (window-buffer window)
401 (set-buffer (window-buffer window)) 401 (max 1
402 (goto-char (point-min)) 402 (count-screen-lines (point-min) (point-max)
403 (let ((ignore-final-newline 403 ;; If buffer ends with a newline, ignore it when
404 ;; If buffer ends with a newline, ignore it when counting height 404 ;; counting height unless point is after it.
405 ;; unless point is after it. 405 (eobp)
406 (and (not (eobp)) (eq ?\n (char-after (1- (point-max))))))) 406 window))))
407 (+ 1 (nth 2 (compute-motion (point-min)
408 '(0 . 0)
409 (- (point-max) (if ignore-final-newline 1 0))
410 (cons 0 100000000)
411 nil
412 nil
413 window))))))
414 407
415(defun count-screen-lines (&optional beg end count-final-newline window) 408(defun count-screen-lines (&optional beg end count-final-newline window)
416 "Return the number of screen lines in the region. 409 "Return the number of screen lines in the region.