aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMiles Bader2005-09-25 22:07:01 +0000
committerMiles Bader2005-09-25 22:07:01 +0000
commit7b9dc9afcc06c9d5c3e3f75f3bb420d57cd1de12 (patch)
tree27ba66e7b5ca9a56ca0c0a76169249ee48337e6c /lisp
parent2f022b888f8e37778c13736539bd4434cc882eb2 (diff)
parent5fae1caef32374fffc256f7f92952398d226fff2 (diff)
downloademacs-7b9dc9afcc06c9d5c3e3f75f3bb420d57cd1de12.tar.gz
emacs-7b9dc9afcc06c9d5c3e3f75f3bb420d57cd1de12.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-85
Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 556-561) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 122-124) - Update from CVS: lisp/mm-url.el (mm-url-decode-entities): Fix regexp. - Update from CVS
Diffstat (limited to 'lisp')
-rw-r--r--lisp/.gitignore2
-rw-r--r--lisp/ChangeLog433
-rw-r--r--lisp/calc/calc-prog.el4
-rw-r--r--lisp/calc/calc-store.el4
-rw-r--r--lisp/calc/calcalg3.el2
-rw-r--r--lisp/calendar/calendar.el81
-rw-r--r--lisp/calendar/diary-lib.el4
-rw-r--r--lisp/calendar/timeclock.el2
-rw-r--r--lisp/completion.el2
-rw-r--r--lisp/cus-edit.el6
-rw-r--r--lisp/diff.el8
-rw-r--r--lisp/dired-aux.el6
-rw-r--r--lisp/dired.el2
-rw-r--r--lisp/ediff-mult.el2
-rw-r--r--lisp/ediff-ptch.el143
-rw-r--r--lisp/ediff-util.el16
-rw-r--r--lisp/ediff-vers.el5
-rw-r--r--lisp/ediff.el18
-rw-r--r--lisp/emacs-lisp/advice.el38
-rw-r--r--lisp/emacs-lisp/checkdoc.el2
-rw-r--r--lisp/emacs-lisp/debug.el2
-rw-r--r--lisp/emulation/vip.el2
-rw-r--r--lisp/emulation/viper-cmd.el14
-rw-r--r--lisp/emulation/viper-init.el5
-rw-r--r--lisp/emulation/viper-macs.el8
-rw-r--r--lisp/emulation/viper-util.el8
-rw-r--r--lisp/emulation/viper.el9
-rw-r--r--lisp/font-lock.el15
-rw-r--r--lisp/format.el4
-rw-r--r--lisp/forms.el2
-rw-r--r--lisp/gnus/ChangeLog43
-rw-r--r--lisp/gnus/gnus-agent.el6
-rw-r--r--lisp/gnus/gnus-art.el16
-rw-r--r--lisp/gnus/gnus-score.el2
-rw-r--r--lisp/gnus/gnus-start.el2
-rw-r--r--lisp/gnus/gnus-sum.el8
-rw-r--r--lisp/gnus/gnus-util.el4
-rw-r--r--lisp/gnus/gnus-uu.el2
-rw-r--r--lisp/gnus/message.el2
-rw-r--r--lisp/gnus/mm-url.el2
-rw-r--r--lisp/gnus/mm-view.el7
-rw-r--r--lisp/gnus/smime.el13
-rw-r--r--lisp/gnus/spam-report.el2
-rw-r--r--lisp/ido.el4
-rw-r--r--lisp/info.el16
-rw-r--r--lisp/international/mule-cmds.el12
-rw-r--r--lisp/international/mule-diag.el6
-rw-r--r--lisp/international/mule.el12
-rw-r--r--lisp/international/quail.el2
-rw-r--r--lisp/locate.el2
-rw-r--r--lisp/log-edit.el2
-rw-r--r--lisp/mail/mailabbrev.el4
-rw-r--r--lisp/mail/mailclient.el174
-rw-r--r--lisp/mail/rmail.el26
-rw-r--r--lisp/mail/rmailout.el8
-rw-r--r--lisp/mail/rmailsum.el26
-rw-r--r--lisp/man.el10
-rw-r--r--lisp/mh-e/ChangeLog7
-rw-r--r--lisp/mh-e/mh-comp.el6
-rw-r--r--lisp/mh-e/mh-mime.el12
-rw-r--r--lisp/mh-e/mh-utils.el6
-rw-r--r--lisp/mouse.el313
-rw-r--r--lisp/net/eudcb-ldap.el2
-rw-r--r--lisp/net/newsticker.el5
-rw-r--r--lisp/net/rcompile.el2
-rw-r--r--lisp/play/animate.el2
-rw-r--r--lisp/play/gomoku.el36
-rw-r--r--lisp/play/landmark.el26
-rw-r--r--lisp/play/mpuz.el6
-rw-r--r--lisp/printing.el2
-rw-r--r--lisp/progmodes/cc-mode.el1
-rw-r--r--lisp/progmodes/compile.el2
-rw-r--r--lisp/progmodes/ebrowse.el2
-rw-r--r--lisp/progmodes/etags.el4
-rw-r--r--lisp/progmodes/idlw-shell.el2
-rw-r--r--lisp/progmodes/pascal.el2
-rw-r--r--lisp/progmodes/python.el6
-rw-r--r--lisp/ps-print.el2
-rw-r--r--lisp/rect.el4
-rw-r--r--lisp/replace.el2
-rw-r--r--lisp/ses.el2
-rw-r--r--lisp/shadowfile.el4
-rw-r--r--lisp/smerge-mode.el12
-rw-r--r--lisp/subr.el18
-rw-r--r--lisp/term/rxvt.el74
-rw-r--r--lisp/term/xterm.el2
-rw-r--r--lisp/terminal.el2
-rw-r--r--lisp/textmodes/artist.el4
-rw-r--r--lisp/textmodes/flyspell.el20
-rw-r--r--lisp/textmodes/ispell.el19
-rw-r--r--lisp/textmodes/org.el348
-rw-r--r--lisp/textmodes/refer.el2
-rw-r--r--lisp/textmodes/reftex-auc.el12
-rw-r--r--lisp/textmodes/reftex-cite.el4
-rw-r--r--lisp/textmodes/reftex-dcr.el4
-rw-r--r--lisp/textmodes/reftex-global.el4
-rw-r--r--lisp/textmodes/reftex-index.el27
-rw-r--r--lisp/textmodes/reftex-parse.el4
-rw-r--r--lisp/textmodes/reftex-ref.el4
-rw-r--r--lisp/textmodes/reftex-sel.el4
-rw-r--r--lisp/textmodes/reftex-toc.el4
-rw-r--r--lisp/textmodes/reftex-vars.el4
-rw-r--r--lisp/textmodes/reftex.el4
-rw-r--r--lisp/textmodes/tex-mode.el10
-rw-r--r--lisp/tree-widget.el8
-rw-r--r--lisp/vc-mcvs.el2
-rw-r--r--lisp/vc.el20
-rw-r--r--lisp/w32-fns.el2
-rw-r--r--lisp/wid-edit.el8
-rw-r--r--lisp/woman.el2
110 files changed, 1544 insertions, 804 deletions
diff --git a/lisp/.gitignore b/lisp/.gitignore
index 48c6dafa2e6..00add3a5726 100644
--- a/lisp/.gitignore
+++ b/lisp/.gitignore
@@ -1,6 +1,8 @@
1*.elc 1*.elc
2MANIFEST 2MANIFEST
3Makefile 3Makefile
4Makefile.unix
5makefile
4elc.tar.gz 6elc.tar.gz
5cus-load.el 7cus-load.el
6finder-inf.el 8finder-inf.el
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 39cd7f0835c..efd66d87d3a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,192 +1,397 @@
12005-09-19 Miles Bader <miles@gnu.org> 12005-09-24 Andreas Schwab <schwab@suse.de>
2 2
3 * net/newsticker.el: Get rid of CVS keyword. 3 * term/rxvt.el (rxvt-register-default-colors): Delete redundant
4 condition.
5
62005-09-25 Romain Francoise <romain@orebokech.com>
4 7
52005-09-19 Johan Bockg,Ae(Brd <bojohan+sf@dd.chalmers.se> 8 * dired-aux.el (dired-copy-file-recursive):
9 * dired.el (dired-delete-file):
10 * ediff-mult.el (ediff-dir-diff-copy-file):
11 * ediff-util.el (ediff-test-save-region):
12 * forms.el (forms-mode):
13 * ido.el (ido-file-internal, ido-delete-file-at-head):
14 * log-edit.el (log-edit-done):
15 * ses.el (ses-yank-resize):
16 * play/gomoku.el (gomoku-human-plays, gomoku)
17 (gomoku-human-resigns, gomoku-prompt-for-other-game)
18 (gomoku-offer-a-draw):
19 * play/landmark.el (lm-human-resigns, lm):
20 * net/eudcb-ldap.el (eudc-ldap-check-base):
21 * play/mpuz.el (mpuz-offer-abort, mpuz-try-letter, mpuz-close-game):
22 * progmodes/ebrowse.el (ebrowse-find-pattern):
23 * progmodes/idlw-shell.el (idlwave-shell-set-bp-check):
24 * textmodes/reftex-index.el (reftex-index-initialize-phrases-buffer):
25 End `yes-or-no-p' and `y-or-n-p' prompts with question mark and
26 space.
27
28 * vc.el (vc-delete-file):
29 * play/gomoku.el (gomoku-terminate-game, gomoku)
30 (gomoku-prompt-for-move, gomoku-human-takes-back):
31 * play/landmark.el (lm-human-takes-back, lm-prompt-for-move)
32 (lm-start-robot, lm-human-plays): Remove extraneous spaces in
33 messages.
6 34
7 * dired-aux.el (dired-handle-overwrite): Don't use `format' here. 352005-09-24 Dan Nicolaescu <dann@ics.uci.edu>
8 The prompt is formatted later.
9 36
102005-09-19 David Ponce <david@dponce.com> 37 * term/rxvt.el (rxvt-register-default-colors): Add support for 255
38 color rxvt terminals by using the code xterm.el used to use before
39 2005-04-09 in order to match the colors used by rxvt.
11 40
12 * tree-widget.el (tree-widget-value-create): Save the converted 412005-09-24 Emanuele Giaquinta <emanuele.giaquinta@gmail.com> (tiny change)
13 tree :node widget.
14 42
152005-09-19 Juanma Barranquero <lekktu@gmail.com> 43 * term/rxvt.el (rxvt-register-default-colors): Add support for 88
44 colors rxvt-unicode terminals by using the same code as xterm.el.
16 45
17 * progmodes/sh-script.el (sh-blink): Fix spurious reference to 462005-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
18 variable `message'.
19 47
202005-09-18 Michael Albinus <michael.albinus@gmx.de> 48 * textmodes/tex-mode.el (tex-font-lock-append-prop)
49 (tex-font-lock-suscript, tex-insert-quote, latex-indent): Adjust to the
50 new symbol used for the tex-verbatim face.
21 51
22 * net/tramp.el (tramp-login-prompt-regexp): Expand regexp in order 522005-09-24 Emilio C. Lopes <eclig@gmx.net>
23 to cover prompts like "login as:". Reported by Slawomir Nowaczyk
24 <slawomir.nowaczyk.847@student.lu.se>.
25 53
262005-09-18 Chong Yidong <cyd@stupidchicken.com> 54 * woman.el (woman-file-name):
55 * wid-edit.el (widget-file-prompt-value)
56 (widget-coding-system-prompt-value):
57 * w32-fns.el (set-w32-system-coding-system):
58 * vc.el (vc-version-diff, vc-annotate):
59 * textmodes/reftex-auc.el (reftex-arg-cite)
60 (reftex-arg-index-tag):
61 * textmodes/refer.el (refer-get-bib-files):
62 * textmodes/artist.el (artist-figlet-choose-font):
63 * terminal.el (terminal-emulator):
64 * replace.el (occur-read-primary-args):
65 * rect.el (string-rectangle, string-insert-rectangle):
66 * ps-print.el (ps-print-preprint):
67 * progmodes/pascal.el (pascal-goto-defun):
68 * progmodes/etags.el (visit-tags-table, visit-tags-table-buffer):
69 * progmodes/compile.el (compilation-find-file):
70 * printing.el (pr-interactive-n-up):
71 * play/animate.el (animate-birthday-present):
72 * net/rcompile.el (remote-compile):
73 * man.el (man, Man-goto-section, Man-follow-manual-reference):
74 * mail/rmailsum.el (rmail-summary-search-backward)
75 (rmail-summary-search):
76 * mail/rmailout.el (rmail-output-read-rmail-file-name)
77 (rmail-output-read-file-name):
78 * mail/rmail.el (rmail-search, rmail-search-backwards):
79 * mail/mailabbrev.el (merge-mail-abbrevs, rebuild-mail-abbrevs):
80 * locate.el (locate):
81 * international/quail.el (quail-show-keyboard-layout):
82 * international/mule.el (set-buffer-file-coding-system)
83 (revert-buffer-with-coding-system, set-file-name-coding-system)
84 (set-terminal-coding-system, set-keyboard-coding-system)
85 (set-next-selection-coding-system):
86 * international/mule-diag.el (describe-coding-system)
87 (describe-font, describe-fontset):
88 * international/mule-cmds.el (universal-coding-system-argument)
89 (search-unencodable-char, describe-input-method)
90 (set-language-environment, describe-language-environment):
91 * international/codepage.el (codepage-setup):
92 * international/code-pages.el (codepage-setup):
93 * info.el (Info-search, Info-follow-reference)
94 (Info-search-backward):
95 * emacs-lisp/advice.el (ad-read-advised-function)
96 (ad-read-advice-class, ad-clear-cache, ad-activate)
97 (ad-deactivate, ad-update, ad-unadvise, ad-read-advice-name)
98 (ad-enable-advice, ad-disable-advice, ad-remove-advice)
99 (ad-read-regexp):
100 * ediff-util.el (ediff-toggle-regexp-match):
101 * ediff-ptch.el (ediff-prompt-for-patch-file):
102 * dired-aux.el (dired-diff):
103 * diff.el (diff):
104 * cus-edit.el (custom-variable-prompt):
105 * calendar/timeclock.el (timeclock-ask-for-project):
106 * calc/calcalg3.el (calc-get-fit-variables):
107 * calc/calc-store.el (calc-edit-variable)
108 (calc-permanent-variable):
109 * vc-mcvs.el (vc-mcvs-register):
110 * shadowfile.el (shadow-define-literal-group):
111 * woman.el (woman-file-name):
112 * vc.el (vc-version-diff, vc-merge):
113 * textmodes/reftex-index.el (reftex-index-complete-tag):
114 * format.el (format-decode-buffer, format-decode-region):
115 * emulation/viper-cmd.el (viper-read-string-with-history):
116 * emacs-lisp/debug.el (cancel-debug-on-entry):
117 * emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
118 * ediff.el (ediff-merge-revisions)
119 (ediff-merge-revisions-with-ancestor, ediff-revision):
120 * completion.el (interactive-completion-string-reader):
121 * calc/calc-prog.el (calc-user-define-formula):
122 Follow convention for reading with the minibuffer.
27 123
28 * image.el (image-load-path): Use symbol `data-directory' instead 1242005-09-24 Steven Huwig <steven_h@acm.org> (tiny change)
29 of its value, for backward compatibility with packages that bind
30 it during `find-image'. Suggested by Katsumi Yamaoka.
31 (image-search-load-path): Handle symbols whose values are strings.
32 125
332005-09-18 Romain Francoise <romain@orebokech.com> 126 * progmodes/python.el (python-describe-symbol): Add globals() and
127 locals() to the arguments of emacs.ehelp.
34 128
35 * calendar/diary-lib.el (mark-diary-entries): Rearrange to wrap 1292005-09-24 Magnus Henoch <mange@freemail.hu>
36 with-current-buffer form in save-excursion.
37 130
382005-09-18 D Goel <deego@gnufans.org> 131 * textmodes/ispell.el (ispell-maybe-find-aspell-dictionaries):
132 New function, code extracted from ispell-valid-dictionary-list.
133 (ispell-valid-dictionary-list, ispell-accept-buffer-local-defs):
134 Call it.
39 135
40 * apropos.el (apropos-command): Fix `message' call: first arg 1362005-09-24 Eli Zaretskii <eliz@gnu.org>
41 should be a format spec. In this and all other cases that appear
42 below and elsewhere in the source code, I made a change only when
43 two conditions were satisfied: [1] I can think of a possibility
44 that the arguments would cause an error, for example, the code in
45 question relies on external variables such as filenames. [2] I
46 was sure that the arg to `message' could not have been nil in the
47 code.
48 137
49 * textmodes/tildify.el (tildify-region): Ditto. 138 * subr.el (version-regexp-alist): Extend valid syntax for version
139 strings: allow any of the characters -,_,+ to separate the
140 alpha/beta/rc part from the version part. Doc fix.
141 (version-to-list): Doc fix. Bind case-fold-search to t, as advertised.
50 142
51 * textmodes/reftex-index.el (reftex-index-change-entry) 1432005-09-23 David Reitter <david.reitter@gmail.com>
52 (reftex-index-phrase-selection-or-word)
53 (reftex-query-index-phrase): Ditto.
54 144
55 * textmodes/reftex-dcr.el (reftex-echo-ref, reftex-echo-cite): Ditto. 145 * mail/mailclient.el: New file.
56 146
57 * textmodes/org.el (org-complete, org-deadline, org-schedule) 1472005-09-23 Richard M. Stallman <rms@gnu.org>
58 (org-priority, org-table-sum): Ditto.
59 148
60 * textmodes/ispell.el (ispell-check-version) 149 * textmodes/flyspell.el (flyspell-highlight-incorrect-region)
61 (ispell-parse-output): Ditto. 150 (flyspell-incorrect-hook, flyspell-highlight-duplicate-region):
151 Doc fixes.
62 152
63 * textmodes/flyspell.el (flyspell-mode-on) 153 * progmodes/cc-mode.el (c-font-lock-init):
64 (flyspell-notify-misspell, flyspell-word) 154 Specify font-lock-lines-before.
65 (flyspell-display-next-corrections): Ditto.
66 155
67 * textmodes/bibtex.el (bibtex-print-help-message): Ditto. 1562005-09-23 Stefan Monnier <monnier@iro.umontreal.ca>
68 157
69 * textmodes/artist.el (artist-key-set-point-poly): Ditto. 158 * smerge-mode.el (smerge-remove-props): Cause re-highlighting of the
159 whole conflict.
70 160
71 * term/mac-win.el (mac-services-insert-text): Ditto. 1612005-09-23 Carsten Dominik <dominik@science.uva.nl>
72 162
73 * progmodes/vhdl-mode.el (vhdl-warning, vhdl-print-warnings) 163 * textmodes/org.el (org-mode-map, orgtbl-mode-map):
74 (vhdl-hooked-abbrev, vhdl-template-insert-fun) 164 Move keybindings with `C-c C-h' prefix to `C-c C-x' prefix. Make use
75 (vhdl-port-paste-testbench, vhdl-compose-new-component) 165 of `remap' feature when available. Additional key bindings for
76 (vhdl-compose-configuration): Ditto. 166 better tty support.
167 (org-mode-restart, org-force-self-insert): New commands.
168 (org-time-stamp-inactive): New command.
169 (org-remap): New function.
170 (org-table-auto-blank-field, org-level-color-stars-only): New options.
171 (org-enable-fixed-width-editor): Move to `org-structure'
172 customization group.
173 (org-self-insert-command, orgtbl-self-insert-command): Modify to
174 blank field after field motion commands.
77 175
78 * progmodes/sh-script.el (sh-blink, sh-show-indent) 1762005-09-23 Kenichi Handa <handa@m17n.org>
79 (sh-set-indent, sh-learn-line-indent): Ditto.
80 177
81 * progmodes/ps-mode.el (ps-mode-target-column): Ditto. 178 * international/mule-cmds.el (set-language-environment):
179 Don't check utf-translate-cjk-lang-env is nil or not on deciding if we
180 have to call utf-translate-cjk-load-tables.
82 181
83 * progmodes/idlwave.el (idlwave-make-tags) 1822005-09-22 Stefan Monnier <monnier@iro.umontreal.ca>
84 (idlwave-scan-library-catalogs): Ditto.
85 183
86 * progmodes/idlw-shell.el (idlwave-shell-parse-stack-and-display): Ditto. 184 * mouse.el (mouse-move-drag-overlay): Fix last change.
87 185
88 * progmodes/gud.el (gud-jdb-analyze-source): Ditto. 1862005-09-22 David Ponce <david@dponce.com>
89 187
90 * progmodes/flymake.el (flymake-log): Ditto. 188 * tree-widget.el (tree-widget-value-create): Fix previous change.
91 189
92 * progmodes/ebnf2ps.el (ebnf-generate-region): Ditto. 1902005-09-21 Dan Nicolaescu <dann@ics.uci.edu>
93 191
94 * progmodes/cmacexp.el (c-macro-expansion): Ditto. 192 * term/xterm.el (terminal-init-xterm): Fix loading rxvt at run time.
95 193
96 * progmodes/ada-xref.el (ada-treat-cmd-string): Ditto. 1942005-09-21 Stefan Monnier <monnier@iro.umontreal.ca>
97 195
98 * progmodes/ada-mode.el (ada-create-case-exception-substring) 196 * mouse.el (mouse-move-drag-overlay): New function.
99 (ada-justified-indent-current, ada-batch-reformat): Ditto. 197 (mouse-drag-region-1): Use it.
198 Try to simplify a bit the state handling. Handle clicks on links
199 inside intangible areas.
200 (mouse-save-then-kill): Minor simplification.
201 (mouse-secondary-overlay): Make it always non-nil instead of
202 recreating it each time.
203 (mouse-start-secondary, mouse-set-secondary, mouse-drag-secondary)
204 (mouse-kill-secondary, mouse-secondary-save-then-kill):
205 Simplify accordingly.
100 206
101 * play/zone.el (zone): Ditto. 2072005-09-21 Dan Nicolaescu <dann@ics.uci.edu>
102 208
103 * play/landmark.el (lm-move): Ditto. 209 * term/rxvt.el (rxvt-standard-colors): Fix some colors.
104 210
105 * play/decipher.el (decipher-show-alphabet): Ditto. 2112005-09-20 Michael Kifer <kifer@cs.stonybrook.edu>
106 212
107 * net/newsticker.el (newsticker--display-jump) 213 * ediff-ptch.el (ediff-prompt-for-patch-file): More intuitive prompt.
108 (newsticker--display-scroll): Ditto. 214 (ediff-file-name-sans-prefix): Treat nil as an empty string.
215 (ediff-fixup-patch-map): Better heuristic for intuiting the file names
216 to patch.
109 217
110 * mail/rmail-spam-filter.el (rsf-add-subject-to-spam-list) 218 * ediff-util.el: Use insert-buffer-substring.
111 (rsf-add-sender-to-spam-list, rsf-add-region-to-spam-list): Ditto.
112 219
113 * mail/feedmail.el (feedmail-dump-message-to-queue): Ditto. 220 * ediff-vers.el (cvs-run-ediff-on-file-descriptor): Bug fix.
114 221
115 * eshell/esh-proc.el (eshell-remove-process-entry): Ditto. 222 * emulation/viper-cmd.el (viper-change-state): Don't move over the
223 field boundaries in the minibuffer.
224 (viper-set-minibuffer-style): Add viper-minibuffer-post-command-hook.
225 (viper-minibuffer-post-command-hook): New hook.
226 (viper-line): Don't move cursor at bolp.
116 227
117 * emulation/ws-mode.el (ws-last-error): Ditto. 228 * emulation/viper-ex.el (ex-pwd, viper-info-on-file): Fix message.
118 229
119 * emulation/viper-macs.el (ex-map-read-args, ex-unmap-read-args) 230 * emulation/viper-init.el: Add alias to make-variable-buffer-local to
120 (viper-record-kbd-macro): Ditto. 231 avoid compiler warnings.
121 232
122 * emulation/viper-ex.el (ex-pwd, viper-info-on-file): Ditto. 233 * emulation/viper-macs.el (ex-map): Better messages.
123 234
124 * emacs-lisp/lisp-mnt.el (lm-report-bug): Ditto. 235 * emulation/viper-utils.el (viper-beginning-of-field): New function.
125 236
126 * emacs-lisp/find-func.el (find-function-noselect): Ditto. 237 * emulation/viper.el: Replace make-variable-buffer-local with
238 viper-make-variable-buffer-local everywhere, to avoid warnings.
127 239
128 * calendar/timeclock.el (timeclock-status-string) 2402005-09-19 Stefan Monnier <monnier@iro.umontreal.ca>
129 (timeclock-workday-remaining-string)
130 (timeclock-workday-elapsed-string)
131 (timeclock-when-to-leave-string): Ditto.
132 241
133 * calendar/icalendar.el (icalendar--convert-ical-to-diary): Ditto. 242 * mouse.el (mouse-drag-mode-line-1, mouse-drag-vertical-line):
243 Delete unused var `old-selected-window'.
244 (mouse-drag-region-1): Delete unused vars `start-frame', `end-of-range'.
245 (mouse-drag-secondary): Delete unused var `start-frame'.
134 246
135 * calc/calc-units.el (calc-enter-units-table): Ditto. 2472005-09-19 Emanuele Giaquinta <emanuele.giaquinta@gmail.com> (tiny change)
136 248
137 * calc/calc-mode.el (calc-mode-record-mode): Ditto. 249 * term/rxvt.el (terminal-init-rxvt): Add entry for [end].
138 250
139 * woman.el (woman-mini-help): Ditto. 2512005-09-19 Stefan Monnier <monnier@iro.umontreal.ca>
140 252
141 * wdired.el (wdired-change-to-wdired-mode): Ditto. 253 * calendar/calendar.el (mark-visible-calendar-date): Save excursion.
254 Re-indent within 80 columns. Use inhibit-read-only.
142 255
143 * vc.el (vc-retrieve-snapshot): Ditto. 2562005-09-19 Romain Francoise <romain@orebokech.com>
144 257
145 * strokes.el (strokes-read-stroke, strokes-read-complex-stroke): Ditto. 258 * calendar/diary-lib.el (mark-diary-entries): Revert last change.
146 259
147 * startup.el (display-startup-echo-area-message): Ditto. 2602005-09-19 Stefan Monnier <monnier@iro.umontreal.ca>
148 261
149 * simple.el (set-goal-column): Ditto. 262 * font-lock.el (font-lock-default-fontify-region): Don't add a line
263 unconditionally, since the after-change-function already did it.
150 264
151 * ses.el (ses-command-hook, ses-recalculate-cell): Ditto. 2652005-09-19 Miles Bader <miles@gnu.org>
152 266
153 * server.el (server-process-filter): Ditto. 267 * net/newsticker.el: Get rid of CVS keyword.
154 268
155 * printing.el (pr-interface-txt-print, pr-interface-printify) 2692005-09-19 Johan Bockg,Ae(Brd <bojohan+sf@dd.chalmers.se>
156 (pr-interface-ps): Ditto.
157 270
158 * pcvs.el (cvs-help): Ditto. 271 * dired-aux.el (dired-handle-overwrite): Don't use `format' here.
272 The prompt is formatted later.
159 273
160 * log-edit.el (log-edit, log-edit-mode-help): Ditto. 2742005-09-19 David Ponce <david@dponce.com>
161 275
162 * iswitchb.el (iswitchb-possible-new-buffer): Ditto. 276 * tree-widget.el (tree-widget-value-create): Save the converted
277 tree :node widget.
163 278
164 * isearch.el (isearch-edit-string): Ditto. 2792005-09-19 Juanma Barranquero <lekktu@gmail.com>
165 280
166 * image-mode.el (image-mode, image-minor-mode): Ditto. 281 * progmodes/sh-script.el (sh-blink): Fix spurious reference to
282 variable `message'.
167 283
168 * ibuf-macs.el (define-ibuffer-filter): Ditto. 2842005-09-18 Michael Albinus <michael.albinus@gmx.de>
169 285
170 * hi-lock.el (hi-lock-find-patterns): Ditto. 286 * net/tramp.el (tramp-login-prompt-regexp): Expand regexp in order
287 to cover prompts like "login as:". Reported by Slawomir Nowaczyk
288 <slawomir.nowaczyk.847@student.lu.se>.
171 289
172 * files.el (toggle-read-only): Ditto. 2902005-09-18 Chong Yidong <cyd@stupidchicken.com>
173 291
174 * ediff-util.el (ediff-copy-diff) 292 * image.el (image-load-path): Use symbol `data-directory' instead
175 (ediff-write-merge-buffer-and-maybe-kill): Ditto. 293 of its value, for backward compatibility with packages that bind
294 it during `find-image'. Suggested by Katsumi Yamaoka.
295 (image-search-load-path): Handle symbols whose values are strings.
176 296
177 * echistory.el (Electric-history-undefined): Ditto. 2972005-09-18 Romain Francoise <romain@orebokech.com>
178 298
179 * dnd.el (dnd-insert-text): Ditto. 299 * calendar/diary-lib.el (mark-diary-entries): Rearrange to wrap
300 with-current-buffer form in save-excursion.
180 301
181 * dired-aux.el (dired-query): Ditto. 3022005-09-18 D Goel <deego@gnufans.org>
182 303
183 * desktop.el (desktop-restore-file-buffer) 304 * apropos.el (apropos-command): Fix `message' call: first arg
184 (desktop-lazy-create-buffer): Ditto. 305 should be a format spec. In this and all other cases that appear
306 below and elsewhere in the source code, I made a change only when
307 two conditions were satisfied: [1] I can think of a possibility
308 that the arguments would cause an error, for example, the code in
309 question relies on external variables such as filenames. [2] I
310 was sure that the arg to `message' could not have been nil in the code.
185 311
186 * bookmark.el (bookmark-bmenu-locate): Ditto. 312 * textmodes/tildify.el (tildify-region): Ditto.
187 313
188 * obsolete/fast-lock.el (@top-level): Ditto in the macro 314 * textmodes/reftex-index.el (reftex-index-change-entry)
189 definition of `with-temp-message'. 315 (reftex-index-phrase-selection-or-word, reftex-query-index-phrase):
316 * textmodes/reftex-dcr.el (reftex-echo-ref, reftex-echo-cite):
317 * textmodes/org.el (org-complete, org-deadline, org-schedule)
318 (org-priority, org-table-sum):
319 * textmodes/ispell.el (ispell-check-version, ispell-parse-output):
320 * textmodes/flyspell.el (flyspell-mode-on, flyspell-notify-misspell)
321 (flyspell-word, flyspell-display-next-corrections):
322 * textmodes/bibtex.el (bibtex-print-help-message):
323 * textmodes/artist.el (artist-key-set-point-poly):
324 * term/mac-win.el (mac-services-insert-text):
325 * progmodes/vhdl-mode.el (vhdl-warning, vhdl-print-warnings)
326 (vhdl-hooked-abbrev, vhdl-template-insert-fun)
327 (vhdl-port-paste-testbench, vhdl-compose-new-component)
328 (vhdl-compose-configuration):
329 * progmodes/sh-script.el (sh-blink, sh-show-indent)
330 (sh-set-indent, sh-learn-line-indent):
331 * progmodes/ps-mode.el (ps-mode-target-column):
332 * progmodes/idlwave.el (idlwave-make-tags)
333 (idlwave-scan-library-catalogs):
334 * progmodes/idlw-shell.el (idlwave-shell-parse-stack-and-display):
335 * progmodes/gud.el (gud-jdb-analyze-source):
336 * progmodes/flymake.el (flymake-log):
337 * progmodes/ebnf2ps.el (ebnf-generate-region):
338 * progmodes/cmacexp.el (c-macro-expansion):
339 * progmodes/ada-xref.el (ada-treat-cmd-string):
340 * progmodes/ada-mode.el (ada-create-case-exception-substring)
341 (ada-justified-indent-current, ada-batch-reformat):
342 * play/zone.el (zone):
343 * play/landmark.el (lm-move):
344 * play/decipher.el (decipher-show-alphabet):
345 * net/newsticker.el (newsticker--display-jump)
346 (newsticker--display-scroll):
347 * mail/rmail-spam-filter.el (rsf-add-subject-to-spam-list)
348 (rsf-add-sender-to-spam-list, rsf-add-region-to-spam-list):
349 * mail/feedmail.el (feedmail-dump-message-to-queue):
350 * eshell/esh-proc.el (eshell-remove-process-entry):
351 * emulation/ws-mode.el (ws-last-error):
352 * emulation/viper-macs.el (ex-map-read-args, ex-unmap-read-args)
353 (viper-record-kbd-macro):
354 * emulation/viper-ex.el (ex-pwd, viper-info-on-file):
355 * emacs-lisp/lisp-mnt.el (lm-report-bug):
356 * emacs-lisp/find-func.el (find-function-noselect):
357 * calendar/timeclock.el (timeclock-status-string)
358 (timeclock-workday-remaining-string, timeclock-workday-elapsed-string)
359 (timeclock-when-to-leave-string):
360 * calendar/icalendar.el (icalendar--convert-ical-to-diary):
361 * calc/calc-units.el (calc-enter-units-table):
362 * calc/calc-mode.el (calc-mode-record-mode):
363 * woman.el (woman-mini-help):
364 * wdired.el (wdired-change-to-wdired-mode):
365 * vc.el (vc-retrieve-snapshot):
366 * strokes.el (strokes-read-stroke, strokes-read-complex-stroke):
367 * startup.el (display-startup-echo-area-message):
368 * simple.el (set-goal-column):
369 * ses.el (ses-command-hook, ses-recalculate-cell):
370 * server.el (server-process-filter):
371 * printing.el (pr-interface-txt-print, pr-interface-printify)
372 (pr-interface-ps):
373 * pcvs.el (cvs-help):
374 * log-edit.el (log-edit, log-edit-mode-help):
375 * iswitchb.el (iswitchb-possible-new-buffer):
376 * isearch.el (isearch-edit-string):
377 * image-mode.el (image-mode, image-minor-mode):
378 * ibuf-macs.el (define-ibuffer-filter):
379 * hi-lock.el (hi-lock-find-patterns):
380 * files.el (toggle-read-only):
381 * ediff-util.el (ediff-copy-diff)
382 (ediff-write-merge-buffer-and-maybe-kill):
383 * echistory.el (Electric-history-undefined):
384 * dnd.el (dnd-insert-text):
385 * dired-aux.el (dired-query):
386 * desktop.el (desktop-restore-file-buffer, desktop-lazy-create-buffer):
387 * bookmark.el (bookmark-bmenu-locate):
388 * obsolete/fast-lock.el (@top-level) <with-temp-message macro>:
389 Fix `message' calls to ensure first arg is a format string.
390 The change was made only when these two conditions were satisfied:
391 [1] when there is a possibility that the arguments would cause an error
392 for example, if the code in question relies on external variables
393 such as filenames, and
394 [2] if the arg to `message' could not have been nil in the code.
190 395
191 * pcomplete.el (pcomplete--help): Fix `message' format spec. 396 * pcomplete.el (pcomplete--help): Fix `message' format spec.
192 Not having a %s would be weird, though not technically wrong. 397 Not having a %s would be weird, though not technically wrong.
diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el
index b44d8d256a5..2bbbbcceee5 100644
--- a/lisp/calc/calc-prog.el
+++ b/lisp/calc/calc-prog.el
@@ -197,7 +197,7 @@
197 (progn 197 (progn
198 (setq cmd-base-default (concat "User-" keyname)) 198 (setq cmd-base-default (concat "User-" keyname))
199 (setq cmd (completing-read 199 (setq cmd (completing-read
200 (concat "Define M-x command name (default: calc-" 200 (concat "Define M-x command name (default calc-"
201 cmd-base-default 201 cmd-base-default
202 "): ") 202 "): ")
203 obarray 'commandp nil 203 obarray 'commandp nil
@@ -233,7 +233,7 @@
233 (setq func 233 (setq func
234 (concat "calcFunc-" 234 (concat "calcFunc-"
235 (completing-read 235 (completing-read
236 (concat "Define algebraic function name (default: " 236 (concat "Define algebraic function name (default "
237 cmd-base-default "): ") 237 cmd-base-default "): ")
238 (mapcar (lambda (x) (substring x 9)) 238 (mapcar (lambda (x) (substring x 9))
239 (all-completions "calcFunc-" 239 (all-completions "calcFunc-"
diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el
index 1410b7d6651..82c7077ba91 100644
--- a/lisp/calc/calc-store.el
+++ b/lisp/calc/calc-store.el
@@ -430,7 +430,7 @@
430 (calc-wrapper 430 (calc-wrapper
431 (or var (setq var (calc-read-var-name 431 (or var (setq var (calc-read-var-name
432 (if calc-last-edited-variable 432 (if calc-last-edited-variable
433 (format "Edit: (default %s) " 433 (format "Edit (default %s): "
434 (calc-var-name calc-last-edited-variable)) 434 (calc-var-name calc-last-edited-variable))
435 "Edit: ")))) 435 "Edit: "))))
436 (or var (setq var calc-last-edited-variable)) 436 (or var (setq var calc-last-edited-variable))
@@ -587,7 +587,7 @@
587(defun calc-permanent-variable (&optional var) 587(defun calc-permanent-variable (&optional var)
588 (interactive) 588 (interactive)
589 (calc-wrapper 589 (calc-wrapper
590 (or var (setq var (calc-read-var-name "Save variable (default=all): "))) 590 (or var (setq var (calc-read-var-name "Save variable (default all): ")))
591 (let (calc-pv-pos) 591 (let (calc-pv-pos)
592 (and var (or (and (boundp var) (symbol-value var)) 592 (and var (or (and (boundp var) (symbol-value var))
593 (error "No such variable"))) 593 (error "No such variable")))
diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el
index 0aef3ba55af..d5ef567866f 100644
--- a/lisp/calc/calcalg3.el
+++ b/lisp/calc/calcalg3.el
@@ -370,7 +370,7 @@
370 (setq defv (calc-invent-independent-variables nv))) 370 (setq defv (calc-invent-independent-variables nv)))
371 (or defc 371 (or defc
372 (setq defc (calc-invent-parameter-variables nc defv))) 372 (setq defc (calc-invent-parameter-variables nc defv)))
373 (let ((vars (read-string (format "Fitting variables: (default %s; %s) " 373 (let ((vars (read-string (format "Fitting variables (default %s; %s): "
374 (mapconcat 'symbol-name 374 (mapconcat 'symbol-name
375 (mapcar (function (lambda (v) 375 (mapcar (function (lambda (v)
376 (nth 1 v))) 376 (nth 1 v)))
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 2d2e5256977..ec70c8c6c35 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -2900,43 +2900,50 @@ interpreted as BC; -1 being 1 BC, and so on."
2900MARK is a single-character string, a list of face attributes/values, or a face. 2900MARK is a single-character string, a list of face attributes/values, or a face.
2901MARK defaults to `diary-entry-marker'." 2901MARK defaults to `diary-entry-marker'."
2902 (if (calendar-date-is-legal-p date) 2902 (if (calendar-date-is-legal-p date)
2903 (save-excursion 2903 (with-current-buffer calendar-buffer
2904 (set-buffer calendar-buffer) 2904 (save-excursion
2905 (calendar-cursor-to-visible-date date) 2905 (calendar-cursor-to-visible-date date)
2906 (let ((mark (or (and (stringp mark) (= (length mark) 1) mark) ; single-char 2906 (setq mark
2907 (and (listp mark) (> (length mark) 0) mark) ; attr list 2907 (or (and (stringp mark) (= (length mark) 1) mark) ; single-char
2908 (and (facep mark) mark) ; face-name 2908 (and (listp mark) (> (length mark) 0) mark) ; attr list
2909 diary-entry-marker))) 2909 (and (facep mark) mark) ; face-name
2910 (if (facep mark) 2910 diary-entry-marker))
2911 (progn ; face or an attr-list that contained a face 2911 (cond
2912 (overlay-put 2912 ;; face or an attr-list that contained a face
2913 (make-overlay (1- (point)) (1+ (point))) 'face mark)) 2913 ((facep mark)
2914 (if (and (stringp mark) 2914 (overlay-put
2915 (= (length mark) 1)) ; single-char 2915 (make-overlay (1- (point)) (1+ (point))) 'face mark))
2916 (let ((buffer-read-only nil)) 2916 ;; single-char
2917 (forward-char 1) 2917 ((and (stringp mark) (= (length mark) 1))
2918 (delete-char 1) 2918 (let ((inhibit-read-only t))
2919 (insert mark) 2919 (forward-char 1)
2920 (forward-char -2)) 2920 ;; Insert before delete so as to better preserve markers.
2921 (let ; attr list 2921 (insert mark)
2922 ((temp-face 2922 (delete-char 1)
2923 (make-symbol (apply 'concat "temp-" 2923 (forward-char -2)))
2924 (mapcar '(lambda (sym) 2924 (t ;; attr list
2925 (cond ((symbolp sym) (symbol-name sym)) 2925 (let ((temp-face
2926 ((numberp sym) (int-to-string sym)) 2926 (make-symbol
2927 (t sym))) mark)))) 2927 (apply 'concat "temp-"
2928 (faceinfo mark)) 2928 (mapcar (lambda (sym)
2929 (make-face temp-face) 2929 (cond
2930 ;; Remove :face info from the mark, copy the face info into temp-face 2930 ((symbolp sym) (symbol-name sym))
2931 (while (setq faceinfo (memq :face faceinfo)) 2931 ((numberp sym) (number-to-string sym))
2932 (copy-face (read (nth 1 faceinfo)) temp-face) 2932 (t sym)))
2933 (setcar faceinfo nil) 2933 mark))))
2934 (setcar (cdr faceinfo) nil)) 2934 (faceinfo mark))
2935 (setq mark (delq nil mark)) 2935 (make-face temp-face)
2936 ;; Apply the font aspects 2936 ;; Remove :face info from the mark, copy the face info into
2937 (apply 'set-face-attribute temp-face nil mark) 2937 ;; temp-face
2938 (overlay-put 2938 (while (setq faceinfo (memq :face faceinfo))
2939 (make-overlay (1- (point)) (1+ (point))) 'face temp-face)))))))) 2939 (copy-face (read (nth 1 faceinfo)) temp-face)
2940 (setcar faceinfo nil)
2941 (setcar (cdr faceinfo) nil))
2942 (setq mark (delq nil mark))
2943 ;; Apply the font aspects
2944 (apply 'set-face-attribute temp-face nil mark)
2945 (overlay-put
2946 (make-overlay (1- (point)) (1+ (point))) 'face temp-face))))))))
2940 2947
2941(defun calendar-star-date () 2948(defun calendar-star-date ()
2942 "Replace the date under the cursor in the calendar window with asterisks. 2949 "Replace the date under the cursor in the calendar window with asterisks.
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index b748d15e41c..3b634caaa9c 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -864,8 +864,8 @@ diary entries."
864 (redraw-calendar)) 864 (redraw-calendar))
865 (let ((marking-diary-entries t) 865 (let ((marking-diary-entries t)
866 file-glob-attrs marks) 866 file-glob-attrs marks)
867 (save-excursion 867 (with-current-buffer (find-file-noselect (diary-check-diary-file) t)
868 (with-current-buffer (find-file-noselect (diary-check-diary-file) t) 868 (save-excursion
869 (setq mark-diary-entries-in-calendar t) 869 (setq mark-diary-entries-in-calendar t)
870 (message "Marking diary entries...") 870 (message "Marking diary entries...")
871 (setq file-glob-attrs (nth 1 (diary-pull-attrs nil '()))) 871 (setq file-glob-attrs (nth 1 (diary-pull-attrs nil '())))
diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el
index afa7b0e87d9..f2ee3f3a048 100644
--- a/lisp/calendar/timeclock.el
+++ b/lisp/calendar/timeclock.el
@@ -599,7 +599,7 @@ relative only to the time worked today, and not to past time."
599(defun timeclock-ask-for-project () 599(defun timeclock-ask-for-project ()
600 "Ask the user for the project they are clocking into." 600 "Ask the user for the project they are clocking into."
601 (timeclock-completing-read 601 (timeclock-completing-read
602 (format "Clock into which project (default \"%s\"): " 602 (format "Clock into which project (default %s): "
603 (or timeclock-last-project 603 (or timeclock-last-project
604 (car timeclock-project-list))) 604 (car timeclock-project-list)))
605 (mapcar 'list timeclock-project-list) 605 (mapcar 'list timeclock-project-list)
diff --git a/lisp/completion.el b/lisp/completion.el
index 4b0f6cac9a6..12df9a52714 100644
--- a/lisp/completion.el
+++ b/lisp/completion.el
@@ -1343,7 +1343,7 @@ String must be longer than `completion-prefix-min-length'."
1343 (let* ((default (symbol-under-or-before-point)) 1343 (let* ((default (symbol-under-or-before-point))
1344 (new-prompt 1344 (new-prompt
1345 (if default 1345 (if default
1346 (format "%s: (default: %s) " prompt default) 1346 (format "%s (default %s): " prompt default)
1347 (format "%s: " prompt))) 1347 (format "%s: " prompt)))
1348 (read (completing-read new-prompt cmpl-obarray))) 1348 (read (completing-read new-prompt cmpl-obarray)))
1349 (if (zerop (length read)) (setq read (or default ""))) 1349 (if (zerop (length read)) (setq read (or default "")))
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 9827ab7d594..eb6656a426d 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -495,7 +495,7 @@ Return a list suitable for use in `interactive'."
495 val) 495 val)
496 (setq val (completing-read 496 (setq val (completing-read
497 (if (and (symbolp v) (custom-variable-p v)) 497 (if (and (symbolp v) (custom-variable-p v))
498 (format "Customize option: (default %s) " v) 498 (format "Customize option (default %s): " v)
499 "Customize option: ") 499 "Customize option: ")
500 obarray 'custom-variable-p t)) 500 obarray 'custom-variable-p t))
501 (list (if (equal val "") 501 (list (if (equal val "")
@@ -967,7 +967,7 @@ then prompt for the MODE to customize."
967(defun customize-group (group) 967(defun customize-group (group)
968 "Customize GROUP, which must be a customization group." 968 "Customize GROUP, which must be a customization group."
969 (interactive (list (let ((completion-ignore-case t)) 969 (interactive (list (let ((completion-ignore-case t))
970 (completing-read "Customize group: (default emacs) " 970 (completing-read "Customize group (default emacs): "
971 obarray 971 obarray
972 (lambda (symbol) 972 (lambda (symbol)
973 (or (get symbol 'custom-loads) 973 (or (get symbol 'custom-loads)
@@ -990,7 +990,7 @@ then prompt for the MODE to customize."
990(defun customize-group-other-window (group) 990(defun customize-group-other-window (group)
991 "Customize GROUP, which must be a customization group." 991 "Customize GROUP, which must be a customization group."
992 (interactive (list (let ((completion-ignore-case t)) 992 (interactive (list (let ((completion-ignore-case t))
993 (completing-read "Customize group: (default emacs) " 993 (completing-read "Customize group (default emacs): "
994 obarray 994 obarray
995 (lambda (symbol) 995 (lambda (symbol)
996 (or (get symbol 'custom-loads) 996 (or (get symbol 'custom-loads)
diff --git a/lisp/diff.el b/lisp/diff.el
index 7602ecb0e37..8c4332b2da2 100644
--- a/lisp/diff.el
+++ b/lisp/diff.el
@@ -83,15 +83,15 @@ With prefix arg, prompt for diff switches."
83 (setq newf (buffer-file-name) 83 (setq newf (buffer-file-name)
84 newf (if (and newf (file-exists-p newf)) 84 newf (if (and newf (file-exists-p newf))
85 (read-file-name 85 (read-file-name
86 (concat "Diff new file: (default " 86 (concat "Diff new file (default "
87 (file-name-nondirectory newf) ") ") 87 (file-name-nondirectory newf) "): ")
88 nil newf t) 88 nil newf t)
89 (read-file-name "Diff new file: " nil nil t))) 89 (read-file-name "Diff new file: " nil nil t)))
90 (setq oldf (file-newest-backup newf) 90 (setq oldf (file-newest-backup newf)
91 oldf (if (and oldf (file-exists-p oldf)) 91 oldf (if (and oldf (file-exists-p oldf))
92 (read-file-name 92 (read-file-name
93 (concat "Diff original file: (default " 93 (concat "Diff original file (default "
94 (file-name-nondirectory oldf) ") ") 94 (file-name-nondirectory oldf) "): ")
95 (file-name-directory oldf) oldf t) 95 (file-name-directory oldf) oldf t)
96 (read-file-name "Diff original file: " 96 (read-file-name "Diff original file: "
97 (file-name-directory newf) nil t))) 97 (file-name-directory newf) nil t)))
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 6426c6daf58..f946199bbd6 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -59,10 +59,10 @@ With prefix arg, prompt for second argument SWITCHES,
59 (save-excursion (goto-char (mark t)) 59 (save-excursion (goto-char (mark t))
60 (dired-get-filename t t))))) 60 (dired-get-filename t t)))))
61 (require 'diff) 61 (require 'diff)
62 (list (read-file-name (format "Diff %s with: %s" 62 (list (read-file-name (format "Diff %s with%s: "
63 (dired-get-filename t) 63 (dired-get-filename t)
64 (if default 64 (if default
65 (concat "(default " default ") ") 65 (concat " (default " default ")")
66 "")) 66 ""))
67 (if default 67 (if default
68 (dired-current-directory) 68 (dired-current-directory)
@@ -1147,7 +1147,7 @@ Special value `always' suppresses confirmation."
1147 (if (and recursive 1147 (if (and recursive
1148 (eq t (car attrs)) 1148 (eq t (car attrs))
1149 (or (eq recursive 'always) 1149 (or (eq recursive 'always)
1150 (yes-or-no-p (format "Recursive copies of %s " from)))) 1150 (yes-or-no-p (format "Recursive copies of %s? " from))))
1151 ;; This is a directory. 1151 ;; This is a directory.
1152 (let ((files (directory-files from nil dired-re-no-dot))) 1152 (let ((files (directory-files from nil dired-re-no-dot)))
1153 (if (eq recursive 'top) (setq recursive 'always)) ; Don't ask any more. 1153 (if (eq recursive 'top) (setq recursive 'always)) ; Don't ask any more.
diff --git a/lisp/dired.el b/lisp/dired.el
index e06e808e1ae..3934fe4e433 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2379,7 +2379,7 @@ Anything else, ask for each sub-directory."
2379 (setq files 2379 (setq files
2380 (directory-files file t dired-re-no-dot)) ; Not empty. 2380 (directory-files file t dired-re-no-dot)) ; Not empty.
2381 (or (eq recursive 'always) 2381 (or (eq recursive 'always)
2382 (yes-or-no-p (format "Recursive delete of %s " 2382 (yes-or-no-p (format "Recursive delete of %s? "
2383 (dired-make-relative file))))) 2383 (dired-make-relative file)))))
2384 (if (eq recursive 'top) (setq recursive 'always)) ; Don't ask again. 2384 (if (eq recursive 'top) (setq recursive 'always)) ; Don't ask again.
2385 (while files ; Recursively delete (possibly asking). 2385 (while files ; Recursively delete (possibly asking).
diff --git a/lisp/ediff-mult.el b/lisp/ediff-mult.el
index 2c192c133e2..436c1817edf 100644
--- a/lisp/ediff-mult.el
+++ b/lisp/ediff-mult.el
@@ -1314,7 +1314,7 @@ Useful commands:
1314 (if otherfile 1314 (if otherfile
1315 (or (file-exists-p otherfile) 1315 (or (file-exists-p otherfile)
1316 (if (y-or-n-p 1316 (if (y-or-n-p
1317 (format "Copy %s to %s ? " file-abs otherfile)) 1317 (format "Copy %s to %s? " file-abs otherfile))
1318 (let* ((file-diff-record (assoc file-tail dir-diff-list)) 1318 (let* ((file-diff-record (assoc file-tail dir-diff-list))
1319 (new-mem-code 1319 (new-mem-code
1320 (* (cdr file-diff-record) file-mem-code))) 1320 (* (cdr file-diff-record) file-mem-code)))
diff --git a/lisp/ediff-ptch.el b/lisp/ediff-ptch.el
index df781e92b5b..ec0e26e7d5c 100644
--- a/lisp/ediff-ptch.el
+++ b/lisp/ediff-ptch.el
@@ -163,10 +163,16 @@ program."
163;; strip prefix from filename 163;; strip prefix from filename
164;; returns /dev/null, if can't strip prefix 164;; returns /dev/null, if can't strip prefix
165(defsubst ediff-file-name-sans-prefix (filename prefix) 165(defsubst ediff-file-name-sans-prefix (filename prefix)
166 (save-match-data 166 (if prefix
167 (if (string-match (concat "^" (regexp-quote prefix)) filename) 167 (save-match-data
168 (substring filename (match-end 0)) 168 (if (string-match (concat "^" (if (stringp prefix)
169 (concat "/null/" filename)))) 169 (regexp-quote prefix)
170 ""))
171 filename)
172 (substring filename (match-end 0))
173 (concat "/null/" filename)))
174 filename)
175 )
170 176
171 177
172 178
@@ -260,11 +266,14 @@ program."
260 count))) 266 count)))
261 267
262;; Fix up the file names in the list using the argument FILENAME 268;; Fix up the file names in the list using the argument FILENAME
263;; Algorithm: find the first file's directory and cut it out from each file 269;; Algorithm: find the files' directories in the patch and, if a directory is
264;; name in the patch. Prepend the directory of FILENAME to each file in the 270;; absolute, cut it out from the corresponding file name in the patch.
265;; patch. In addition, the first file in the patch is replaced by FILENAME. 271;; Relative directories are not cut out.
266;; Each file is actually a file-pair of files found in the context diff header 272;; Prepend the directory of FILENAME to each resulting file (which came
267;; In the end, for each pair, we select the shortest existing file. 273;; originally from the patch).
274;; In addition, the first file in the patch document is replaced by FILENAME.
275;; Each file is actually a pair of files found in the context diff header
276;; In the end, for each pair, we ask the user which file to patch.
268;; Note: Ediff doesn't recognize multi-file patches that are separated 277;; Note: Ediff doesn't recognize multi-file patches that are separated
269;; with the `Index:' line. It treats them as a single-file patch. 278;; with the `Index:' line. It treats them as a single-file patch.
270;; 279;;
@@ -275,30 +284,41 @@ program."
275 ;; directory part of filename 284 ;; directory part of filename
276 (file-name-as-directory filename) 285 (file-name-as-directory filename)
277 (file-name-directory filename))) 286 (file-name-directory filename)))
278 ;; Filename-spec is objA; at this point it is represented as 287 ;; In case 2 files are possible patch targets, the user will be offered
279 ;; (file1 . file2). We get it using ediff-get-session-objA 288 ;; to choose file1 or file2. In a multifile patch, if the user chooses
280 ;; directory part of the first file in the patch 289 ;; 1 or 2, this choice is preserved to decide future alternatives.
281 (base-dir1 (file-name-directory 290 chosen-alternative
282 (car (ediff-get-session-objA-name (car ediff-patch-map)))))
283 ;; directory part of the 2nd file in the patch
284 (base-dir2 (file-name-directory
285 (cdr (ediff-get-session-objA-name (car ediff-patch-map)))))
286 ) 291 )
287 292
288 ;; chop off base-dirs 293 ;; chop off base-dirs
289 (mapcar (lambda (session-info) 294 (mapcar (lambda (session-info)
290 (let ((proposed-file-names 295 (let* ((proposed-file-names
291 (ediff-get-session-objA-name session-info))) 296 ;; Filename-spec is objA; it is represented as
297 ;; (file1 . file2). Get it using ediff-get-session-objA.
298 (ediff-get-session-objA-name session-info))
299 ;; base-dir1 is the dir part of the 1st file in the patch
300 (base-dir1 (file-name-directory (car proposed-file-names)))
301 ;; directory part of the 2nd file in the patch
302 (base-dir2 (file-name-directory (cdr proposed-file-names)))
303 )
304 ;; If both base-dir1 and base-dir2 are relative, assume that
305 ;; these dirs lead to the actual files starting at the present
306 ;; directory. So, we don't strip these relative dirs from the
307 ;; file names. This is a heuristic intended to improve guessing
308 (unless (or (file-name-absolute-p base-dir1)
309 (file-name-absolute-p base-dir2))
310 (setq base-dir1 ""
311 base-dir2 ""))
292 (or (string= (car proposed-file-names) "/dev/null") 312 (or (string= (car proposed-file-names) "/dev/null")
293 (setcar proposed-file-names 313 (setcar proposed-file-names
294 (ediff-file-name-sans-prefix 314 (ediff-file-name-sans-prefix
295 (car proposed-file-names) base-dir1))) 315 (car proposed-file-names) base-dir1)))
296 (or (string= 316 (or (string=
297 (cdr proposed-file-names) "/dev/null") 317 (cdr proposed-file-names) "/dev/null")
298 (setcdr proposed-file-names 318 (setcdr proposed-file-names
299 (ediff-file-name-sans-prefix 319 (ediff-file-name-sans-prefix
300 (cdr proposed-file-names) base-dir2))) 320 (cdr proposed-file-names) base-dir2)))
301 )) 321 ))
302 ediff-patch-map) 322 ediff-patch-map)
303 323
304 ;; take the given file name into account 324 ;; take the given file name into account
@@ -314,8 +334,8 @@ program."
314 (ediff-get-session-objA-name session-info))) 334 (ediff-get-session-objA-name session-info)))
315 (if (and (string-match "^/null/" (car proposed-file-names)) 335 (if (and (string-match "^/null/" (car proposed-file-names))
316 (string-match "^/null/" (cdr proposed-file-names))) 336 (string-match "^/null/" (cdr proposed-file-names)))
317 ;; couldn't strip base-dir1 and base-dir2 337 ;; couldn't intuit the file name to patch, so
318 ;; hence, something is wrong 338 ;; something is amiss
319 (progn 339 (progn
320 (with-output-to-temp-buffer ediff-msg-buffer 340 (with-output-to-temp-buffer ediff-msg-buffer
321 (ediff-with-current-buffer standard-output 341 (ediff-with-current-buffer standard-output
@@ -367,17 +387,29 @@ other files, enter /dev/null
367 (f1-exists (file-exists-p file1)) 387 (f1-exists (file-exists-p file1))
368 (f2-exists (file-exists-p file2))) 388 (f2-exists (file-exists-p file2)))
369 (cond 389 (cond
370 ((and (< (length file2) (length file1)) 390 ((and
371 f2-exists) 391 ;; The patch program prefers the shortest file as the patch
392 ;; target. However, this is a questionable heuristic. In an
393 ;; interactive program, like ediff, we can offer the user a
394 ;; choice.
395 ;; (< (length file2) (length file1))
396 (not f1-exists)
397 f2-exists)
372 ;; replace file-pair with the winning file2 398 ;; replace file-pair with the winning file2
373 (setcar session-file-object file2)) 399 (setcar session-file-object file2))
374 ((and (< (length file1) (length file2)) 400 ((and
375 f1-exists) 401 ;; (< (length file1) (length file2))
402 (not f2-exists)
403 f1-exists)
376 ;; replace file-pair with the winning file1 404 ;; replace file-pair with the winning file1
377 (setcar session-file-object file1)) 405 (setcar session-file-object file1))
378 ((and f1-exists f2-exists 406 ((and f1-exists f2-exists
379 (string= file1 file2)) 407 (string= file1 file2))
380 (setcar session-file-object file1)) 408 (setcar session-file-object file1))
409 ((and f1-exists f2-exists (eq chosen-alternative 1))
410 (setcar session-file-object file1))
411 ((and f1-exists f2-exists (eq chosen-alternative 2))
412 (setcar session-file-object file2))
381 ((and f1-exists f2-exists) 413 ((and f1-exists f2-exists)
382 (with-output-to-temp-buffer ediff-msg-buffer 414 (with-output-to-temp-buffer ediff-msg-buffer
383 (ediff-with-current-buffer standard-output 415 (ediff-with-current-buffer standard-output
@@ -393,10 +425,15 @@ Please advice:
393 Type `y' to use %s as the target; 425 Type `y' to use %s as the target;
394 Type `n' to use %s as the target. 426 Type `n' to use %s as the target.
395" 427"
396 file1 file2 file2 file1))) 428 file1 file2 file1 file2)))
397 (setcar session-file-object 429 (setcar session-file-object
398 (if (y-or-n-p (format "Use %s ? " file2)) 430 (if (y-or-n-p (format "Use %s ? " file1))
399 file2 file1))) 431 (progn
432 (setq chosen-alternative 1)
433 file1)
434 (setq chosen-alternative 2)
435 file2))
436 )
400 (f2-exists (setcar session-file-object file2)) 437 (f2-exists (setcar session-file-object file2))
401 (f1-exists (setcar session-file-object file1)) 438 (f1-exists (setcar session-file-object file1))
402 (t 439 (t
@@ -407,7 +444,7 @@ Please advice:
407 (if (string= file1 file2) 444 (if (string= file1 file2)
408 (princ (format " 445 (princ (format "
409 %s 446 %s
410is the target for this patch. However, this file does not exist." 447is assumed to be the target for this patch. However, this file does not exist."
411 file1)) 448 file1))
412 (princ (format " 449 (princ (format "
413 %s 450 %s
@@ -441,22 +478,26 @@ are two possible targets for this patch. However, these files do not exist."
441 478
442;; prompt for file, get the buffer 479;; prompt for file, get the buffer
443(defun ediff-prompt-for-patch-file () 480(defun ediff-prompt-for-patch-file ()
444 (let ((dir (cond (ediff-patch-default-directory) ; try patch default dir 481 (let ((dir (cond (ediff-use-last-dir ediff-last-dir-patch)
445 (ediff-use-last-dir ediff-last-dir-patch) 482 (ediff-patch-default-directory) ; try patch default dir
446 (t default-directory))) 483 (t default-directory)))
447 (coding-system-for-read ediff-coding-system-for-read)) 484 (coding-system-for-read ediff-coding-system-for-read)
448 (find-file-noselect 485 patch-file-name)
449 (read-file-name 486 (setq patch-file-name
450 (format "Patch is in file:%s " 487 (read-file-name
451 (cond ((and buffer-file-name 488 (format "Patch is in file%s: "
452 (equal (expand-file-name dir) 489 (cond ((and buffer-file-name
453 (file-name-directory buffer-file-name))) 490 (equal (expand-file-name dir)
454 (concat 491 (file-name-directory buffer-file-name)))
455 " (default " 492 (concat
456 (file-name-nondirectory buffer-file-name) 493 " (default "
457 ")")) 494 (file-name-nondirectory buffer-file-name)
458 (t ""))) 495 ")"))
459 dir buffer-file-name 'must-match)) 496 (t "")))
497 dir buffer-file-name 'must-match))
498 (if (file-directory-p patch-file-name)
499 (error "Patch file cannot be a directory: %s" patch-file-name)
500 (find-file-noselect patch-file-name))
460 )) 501 ))
461 502
462 503
@@ -647,7 +688,7 @@ optional argument, then use it."
647 (ediff-maybe-checkout buf-to-patch) 688 (ediff-maybe-checkout buf-to-patch)
648 689
649 (ediff-with-current-buffer patch-diagnostics 690 (ediff-with-current-buffer patch-diagnostics
650 (insert-buffer patch-buf) 691 (insert-buffer-substring patch-buf)
651 (message "Applying patch ... ") 692 (message "Applying patch ... ")
652 ;; fix environment for gnu patch, so it won't make numbered extensions 693 ;; fix environment for gnu patch, so it won't make numbered extensions
653 (setq backup-style (getenv "VERSION_CONTROL")) 694 (setq backup-style (getenv "VERSION_CONTROL"))
diff --git a/lisp/ediff-util.el b/lisp/ediff-util.el
index a28f9d459ff..9ab24ce5f64 100644
--- a/lisp/ediff-util.el
+++ b/lisp/ediff-util.el
@@ -367,7 +367,7 @@ to invocation.")
367 (ediff-unique-buffer-name "*ediff-merge" "*"))) 367 (ediff-unique-buffer-name "*ediff-merge" "*")))
368 (save-excursion 368 (save-excursion
369 (set-buffer buffer-C) 369 (set-buffer buffer-C)
370 (insert-buffer buf) 370 (insert-buffer-substring buf)
371 (funcall (ediff-with-current-buffer buf major-mode)) 371 (funcall (ediff-with-current-buffer buf major-mode))
372 (widen) ; merge buffer is always widened 372 (widen) ; merge buffer is always widened
373 (add-hook 'local-write-file-hooks 'ediff-set-merge-mode nil t) 373 (add-hook 'local-write-file-hooks 'ediff-set-merge-mode nil t)
@@ -2111,7 +2111,7 @@ ARG is a prefix argument. If nil, copy the current difference region."
2111 (if this-buf-n-th-diff-saved 2111 (if this-buf-n-th-diff-saved
2112 (if (yes-or-no-p 2112 (if (yes-or-no-p
2113 (format 2113 (format
2114 "You've previously copied diff region %d to buffer %S. Confirm " 2114 "You've previously copied diff region %d to buffer %S. Confirm? "
2115 (1+ n) buf-type)) 2115 (1+ n) buf-type))
2116 t 2116 t
2117 (error "Quit")) 2117 (error "Quit"))
@@ -2219,18 +2219,18 @@ a regular expression typed in by the user."
2219 regexp-A 2219 regexp-A
2220 (read-string 2220 (read-string
2221 (format 2221 (format
2222 "Ignore A-regions matching this regexp (default \"%s\"): " 2222 "Ignore A-regions matching this regexp (default %s): "
2223 ediff-regexp-hide-A)) 2223 ediff-regexp-hide-A))
2224 regexp-B 2224 regexp-B
2225 (read-string 2225 (read-string
2226 (format 2226 (format
2227 "Ignore B-regions matching this regexp (default \"%s\"): " 2227 "Ignore B-regions matching this regexp (default %s): "
2228 ediff-regexp-hide-B))) 2228 ediff-regexp-hide-B)))
2229 (if ediff-3way-comparison-job 2229 (if ediff-3way-comparison-job
2230 (setq regexp-C 2230 (setq regexp-C
2231 (read-string 2231 (read-string
2232 (format 2232 (format
2233 "Ignore C-regions matching this regexp (default \"%s\"): " 2233 "Ignore C-regions matching this regexp (default %s): "
2234 ediff-regexp-hide-C)))) 2234 ediff-regexp-hide-C))))
2235 (if (eq ediff-hide-regexp-connective 'and) 2235 (if (eq ediff-hide-regexp-connective 'and)
2236 (setq msg-connective "BOTH" 2236 (setq msg-connective "BOTH"
@@ -2258,18 +2258,18 @@ a regular expression typed in by the user."
2258 regexp-A 2258 regexp-A
2259 (read-string 2259 (read-string
2260 (format 2260 (format
2261 "Focus on A-regions matching this regexp (default \"%s\"): " 2261 "Focus on A-regions matching this regexp (default %s): "
2262 ediff-regexp-focus-A)) 2262 ediff-regexp-focus-A))
2263 regexp-B 2263 regexp-B
2264 (read-string 2264 (read-string
2265 (format 2265 (format
2266 "Focus on B-regions matching this regexp (default \"%s\"): " 2266 "Focus on B-regions matching this regexp (default %s): "
2267 ediff-regexp-focus-B))) 2267 ediff-regexp-focus-B)))
2268 (if ediff-3way-comparison-job 2268 (if ediff-3way-comparison-job
2269 (setq regexp-C 2269 (setq regexp-C
2270 (read-string 2270 (read-string
2271 (format 2271 (format
2272 "Focus on C-regions matching this regexp (default \"%s\"): " 2272 "Focus on C-regions matching this regexp (default %s): "
2273 ediff-regexp-focus-C)))) 2273 ediff-regexp-focus-C))))
2274 (if (eq ediff-focus-regexp-connective 'and) 2274 (if (eq ediff-focus-regexp-connective 'and)
2275 (setq msg-connective "BOTH" 2275 (setq msg-connective "BOTH"
diff --git a/lisp/ediff-vers.el b/lisp/ediff-vers.el
index 9ae720e9bc3..f1f2305de81 100644
--- a/lisp/ediff-vers.el
+++ b/lisp/ediff-vers.el
@@ -299,7 +299,10 @@
299 ((eq type 'MODIFIED) 299 ((eq type 'MODIFIED)
300 (ediff-buffers 300 (ediff-buffers
301 (find-file-noselect tmp-file) 301 (find-file-noselect tmp-file)
302 (find-file-noselect (cvs-fileinfo->full-path fileinfo)) 302 (if (featurep 'xemacs)
303 ;; XEmacs doesn't seem to have cvs-fileinfo->full-name
304 (find-file-noselect (cvs-fileinfo->full-path fileinfo))
305 (find-file-noselect (cvs-fileinfo->full-name fileinfo)))
303 nil ; startup-hooks 306 nil ; startup-hooks
304 'ediff-revisions))) 307 'ediff-revisions)))
305 (if (stringp tmp-file) (delete-file tmp-file)) 308 (if (stringp tmp-file) (delete-file tmp-file))
diff --git a/lisp/ediff.el b/lisp/ediff.el
index 35b28a3e550..8d4bb4d86fe 100644
--- a/lisp/ediff.el
+++ b/lisp/ediff.el
@@ -7,8 +7,8 @@
7;; Created: February 2, 1994 7;; Created: February 2, 1994
8;; Keywords: comparing, merging, patching, tools, unix 8;; Keywords: comparing, merging, patching, tools, unix
9 9
10(defconst ediff-version "2.80" "The current version of Ediff") 10(defconst ediff-version "2.80.1" "The current version of Ediff")
11(defconst ediff-date "July 8, 2005" "Date of last update") 11(defconst ediff-date "September 19, 2005" "Date of last update")
12 12
13 13
14;; This file is part of GNU Emacs. 14;; This file is part of GNU Emacs.
@@ -1261,13 +1261,13 @@ buffer."
1261 (setq rev1 1261 (setq rev1
1262 (read-string 1262 (read-string
1263 (format 1263 (format
1264 "Version 1 to merge (default: %s's working version): " 1264 "Version 1 to merge (default %s's working version): "
1265 (if (stringp file) 1265 (if (stringp file)
1266 (file-name-nondirectory file) "current buffer"))) 1266 (file-name-nondirectory file) "current buffer")))
1267 rev2 1267 rev2
1268 (read-string 1268 (read-string
1269 (format 1269 (format
1270 "Version 2 to merge (default: %s): " 1270 "Version 2 to merge (default %s): "
1271 (if (stringp file) 1271 (if (stringp file)
1272 (file-name-nondirectory file) "current buffer")))) 1272 (file-name-nondirectory file) "current buffer"))))
1273 (ediff-load-version-control) 1273 (ediff-load-version-control)
@@ -1293,19 +1293,19 @@ buffer."
1293 (setq rev1 1293 (setq rev1
1294 (read-string 1294 (read-string
1295 (format 1295 (format
1296 "Version 1 to merge (default: %s's working version): " 1296 "Version 1 to merge (default %s's working version): "
1297 (if (stringp file) 1297 (if (stringp file)
1298 (file-name-nondirectory file) "current buffer"))) 1298 (file-name-nondirectory file) "current buffer")))
1299 rev2 1299 rev2
1300 (read-string 1300 (read-string
1301 (format 1301 (format
1302 "Version 2 to merge (default: %s): " 1302 "Version 2 to merge (default %s): "
1303 (if (stringp file) 1303 (if (stringp file)
1304 (file-name-nondirectory file) "current buffer"))) 1304 (file-name-nondirectory file) "current buffer")))
1305 ancestor-rev 1305 ancestor-rev
1306 (read-string 1306 (read-string
1307 (format 1307 (format
1308 "Ancestor version (default: %s's base revision): " 1308 "Ancestor version (default %s's base revision): "
1309 (if (stringp file) 1309 (if (stringp file)
1310 (file-name-nondirectory file) "current buffer")))) 1310 (file-name-nondirectory file) "current buffer"))))
1311 (ediff-load-version-control) 1311 (ediff-load-version-control)
@@ -1411,11 +1411,11 @@ Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
1411 (let (rev1 rev2) 1411 (let (rev1 rev2)
1412 (setq rev1 1412 (setq rev1
1413 (read-string 1413 (read-string
1414 (format "Revision 1 to compare (default: %s's latest revision): " 1414 (format "Revision 1 to compare (default %s's latest revision): "
1415 (file-name-nondirectory file))) 1415 (file-name-nondirectory file)))
1416 rev2 1416 rev2
1417 (read-string 1417 (read-string
1418 (format "Revision 2 to compare (default: %s's current state): " 1418 (format "Revision 2 to compare (default %s's current state): "
1419 (file-name-nondirectory file)))) 1419 (file-name-nondirectory file))))
1420 (ediff-load-version-control) 1420 (ediff-load-version-control)
1421 (funcall 1421 (funcall
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index 480c838b878..ce727c30d14 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -2218,7 +2218,7 @@ which PREDICATE returns non-nil)."
2218 (let* ((ad-pReDiCaTe predicate) 2218 (let* ((ad-pReDiCaTe predicate)
2219 (function 2219 (function
2220 (completing-read 2220 (completing-read
2221 (format "%s(default %s) " (or prompt "Function: ") default) 2221 (format "%s (default %s): " (or prompt "Function") default)
2222 ad-advised-functions 2222 ad-advised-functions
2223 (if predicate 2223 (if predicate
2224 (function 2224 (function
@@ -2250,7 +2250,7 @@ class of FUNCTION)."
2250 (ad-do-return class))) 2250 (ad-do-return class)))
2251 (error "ad-read-advice-class: `%s' has no advices" function))) 2251 (error "ad-read-advice-class: `%s' has no advices" function)))
2252 (let ((class (completing-read 2252 (let ((class (completing-read
2253 (format "%s(default %s) " (or prompt "Class: ") default) 2253 (format "%s (default %s): " (or prompt "Class") default)
2254 ad-advice-class-completion-table nil t))) 2254 ad-advice-class-completion-table nil t)))
2255 (if (equal class "") 2255 (if (equal class "")
2256 default 2256 default
@@ -2268,7 +2268,7 @@ An optional PROMPT is used to prompt for the name."
2268 (error "ad-read-advice-name: `%s' has no %s advice" 2268 (error "ad-read-advice-name: `%s' has no %s advice"
2269 function class) 2269 function class)
2270 (car (car name-completion-table)))) 2270 (car (car name-completion-table))))
2271 (prompt (format "%s(default %s) " (or prompt "Name: ") default)) 2271 (prompt (format "%s (default %s): " (or prompt "Name") default))
2272 (name (completing-read prompt name-completion-table nil t))) 2272 (name (completing-read prompt name-completion-table nil t)))
2273 (if (equal name "") 2273 (if (equal name "")
2274 (intern default) 2274 (intern default)
@@ -2289,9 +2289,9 @@ be used to prompt for the function."
2289(defun ad-read-regexp (&optional prompt) 2289(defun ad-read-regexp (&optional prompt)
2290 "Read a regular expression from the minibuffer." 2290 "Read a regular expression from the minibuffer."
2291 (let ((regexp (read-from-minibuffer 2291 (let ((regexp (read-from-minibuffer
2292 (concat (or prompt "Regular expression: ") 2292 (concat (or prompt "Regular expression")
2293 (if (equal ad-last-regexp "") "" 2293 (if (equal ad-last-regexp "") ": "
2294 (format "(default \"%s\") " ad-last-regexp)))))) 2294 (format " (default %s): " ad-last-regexp))))))
2295 (setq ad-last-regexp 2295 (setq ad-last-regexp
2296 (if (equal regexp "") ad-last-regexp regexp)))) 2296 (if (equal regexp "") ad-last-regexp regexp))))
2297 2297
@@ -2352,7 +2352,7 @@ FUNCTION was not advised)."
2352 2352
2353(defun ad-enable-advice (function class name) 2353(defun ad-enable-advice (function class name)
2354 "Enables the advice of FUNCTION with CLASS and NAME." 2354 "Enables the advice of FUNCTION with CLASS and NAME."
2355 (interactive (ad-read-advice-specification "Enable advice of: ")) 2355 (interactive (ad-read-advice-specification "Enable advice of"))
2356 (if (ad-is-advised function) 2356 (if (ad-is-advised function)
2357 (if (eq (ad-enable-advice-internal function class name t) 0) 2357 (if (eq (ad-enable-advice-internal function class name t) 0)
2358 (error "ad-enable-advice: `%s' has no %s advice matching `%s'" 2358 (error "ad-enable-advice: `%s' has no %s advice matching `%s'"
@@ -2361,7 +2361,7 @@ FUNCTION was not advised)."
2361 2361
2362(defun ad-disable-advice (function class name) 2362(defun ad-disable-advice (function class name)
2363 "Disable the advice of FUNCTION with CLASS and NAME." 2363 "Disable the advice of FUNCTION with CLASS and NAME."
2364 (interactive (ad-read-advice-specification "Disable advice of: ")) 2364 (interactive (ad-read-advice-specification "Disable advice of"))
2365 (if (ad-is-advised function) 2365 (if (ad-is-advised function)
2366 (if (eq (ad-enable-advice-internal function class name nil) 0) 2366 (if (eq (ad-enable-advice-internal function class name nil) 0)
2367 (error "ad-disable-advice: `%s' has no %s advice matching `%s'" 2367 (error "ad-disable-advice: `%s' has no %s advice matching `%s'"
@@ -2385,7 +2385,7 @@ affected advices will be returned."
2385 "Enables all advices with names that contain a match for REGEXP. 2385 "Enables all advices with names that contain a match for REGEXP.
2386All currently advised functions will be considered." 2386All currently advised functions will be considered."
2387 (interactive 2387 (interactive
2388 (list (ad-read-regexp "Enable advices via regexp: "))) 2388 (list (ad-read-regexp "Enable advices via regexp")))
2389 (let ((matched-advices (ad-enable-regexp-internal regexp 'any t))) 2389 (let ((matched-advices (ad-enable-regexp-internal regexp 'any t)))
2390 (if (interactive-p) 2390 (if (interactive-p)
2391 (message "%d matching advices enabled" matched-advices)) 2391 (message "%d matching advices enabled" matched-advices))
@@ -2395,7 +2395,7 @@ All currently advised functions will be considered."
2395 "Disable all advices with names that contain a match for REGEXP. 2395 "Disable all advices with names that contain a match for REGEXP.
2396All currently advised functions will be considered." 2396All currently advised functions will be considered."
2397 (interactive 2397 (interactive
2398 (list (ad-read-regexp "Disable advices via regexp: "))) 2398 (list (ad-read-regexp "Disable advices via regexp")))
2399 (let ((matched-advices (ad-enable-regexp-internal regexp 'any nil))) 2399 (let ((matched-advices (ad-enable-regexp-internal regexp 'any nil)))
2400 (if (interactive-p) 2400 (if (interactive-p)
2401 (message "%d matching advices disabled" matched-advices)) 2401 (message "%d matching advices disabled" matched-advices))
@@ -2405,7 +2405,7 @@ All currently advised functions will be considered."
2405 "Remove FUNCTION's advice with NAME from its advices in CLASS. 2405 "Remove FUNCTION's advice with NAME from its advices in CLASS.
2406If such an advice was found it will be removed from the list of advices 2406If such an advice was found it will be removed from the list of advices
2407in that CLASS." 2407in that CLASS."
2408 (interactive (ad-read-advice-specification "Remove advice of: ")) 2408 (interactive (ad-read-advice-specification "Remove advice of"))
2409 (if (ad-is-advised function) 2409 (if (ad-is-advised function)
2410 (let* ((advice-to-remove (ad-find-advice function class name))) 2410 (let* ((advice-to-remove (ad-find-advice function class name)))
2411 (if advice-to-remove 2411 (if advice-to-remove
@@ -3285,7 +3285,7 @@ should be modified. The assembled function will be returned."
3285Clear the cache if you want to force `ad-activate' to construct a new 3285Clear the cache if you want to force `ad-activate' to construct a new
3286advised definition from scratch." 3286advised definition from scratch."
3287 (interactive 3287 (interactive
3288 (list (ad-read-advised-function "Clear cached definition of: "))) 3288 (list (ad-read-advised-function "Clear cached definition of")))
3289 (ad-set-advice-info-field function 'cache nil)) 3289 (ad-set-advice-info-field function 'cache nil))
3290 3290
3291(defun ad-make-cache-id (function) 3291(defun ad-make-cache-id (function)
@@ -3602,7 +3602,7 @@ an advised function that has actual pieces of advice but none of them are
3602enabled is equivalent to a call to `ad-deactivate'. The current advised 3602enabled is equivalent to a call to `ad-deactivate'. The current advised
3603definition will always be cached for later usage." 3603definition will always be cached for later usage."
3604 (interactive 3604 (interactive
3605 (list (ad-read-advised-function "Activate advice of: ") 3605 (list (ad-read-advised-function "Activate advice of")
3606 current-prefix-arg)) 3606 current-prefix-arg))
3607 (if ad-activate-on-top-level 3607 (if ad-activate-on-top-level
3608 ;; avoid recursive calls to `ad-activate': 3608 ;; avoid recursive calls to `ad-activate':
@@ -3632,7 +3632,7 @@ definition of FUNCTION will be replaced with it. All the advice
3632information will still be available so it can be activated again with 3632information will still be available so it can be activated again with
3633a call to `ad-activate'." 3633a call to `ad-activate'."
3634 (interactive 3634 (interactive
3635 (list (ad-read-advised-function "Deactivate advice of: " 'ad-is-active))) 3635 (list (ad-read-advised-function "Deactivate advice of" 'ad-is-active)))
3636 (if (not (ad-is-advised function)) 3636 (if (not (ad-is-advised function))
3637 (error "ad-deactivate: `%s' is not advised" function) 3637 (error "ad-deactivate: `%s' is not advised" function)
3638 (cond ((ad-is-active function) 3638 (cond ((ad-is-active function)
@@ -3650,7 +3650,7 @@ a call to `ad-activate'."
3650See `ad-activate' for documentation on the optional COMPILE argument." 3650See `ad-activate' for documentation on the optional COMPILE argument."
3651 (interactive 3651 (interactive
3652 (list (ad-read-advised-function 3652 (list (ad-read-advised-function
3653 "Update advised definition of: " 'ad-is-active))) 3653 "Update advised definition of" 'ad-is-active)))
3654 (if (ad-is-active function) 3654 (if (ad-is-active function)
3655 (ad-activate function compile))) 3655 (ad-activate function compile)))
3656 3656
@@ -3658,7 +3658,7 @@ See `ad-activate' for documentation on the optional COMPILE argument."
3658 "Deactivate FUNCTION and then remove all its advice information. 3658 "Deactivate FUNCTION and then remove all its advice information.
3659If FUNCTION was not advised this will be a noop." 3659If FUNCTION was not advised this will be a noop."
3660 (interactive 3660 (interactive
3661 (list (ad-read-advised-function "Unadvise function: "))) 3661 (list (ad-read-advised-function "Unadvise function")))
3662 (cond ((ad-is-advised function) 3662 (cond ((ad-is-advised function)
3663 (if (ad-is-active function) 3663 (if (ad-is-active function)
3664 (ad-deactivate function)) 3664 (ad-deactivate function))
@@ -3689,7 +3689,7 @@ This activates the advice for each function
3689that has at least one piece of advice whose name includes a match for REGEXP. 3689that has at least one piece of advice whose name includes a match for REGEXP.
3690See `ad-activate' for documentation on the optional COMPILE argument." 3690See `ad-activate' for documentation on the optional COMPILE argument."
3691 (interactive 3691 (interactive
3692 (list (ad-read-regexp "Activate via advice regexp: ") 3692 (list (ad-read-regexp "Activate via advice regexp")
3693 current-prefix-arg)) 3693 current-prefix-arg))
3694 (ad-do-advised-functions (function) 3694 (ad-do-advised-functions (function)
3695 (if (ad-find-some-advice function 'any regexp) 3695 (if (ad-find-some-advice function 'any regexp)
@@ -3700,7 +3700,7 @@ See `ad-activate' for documentation on the optional COMPILE argument."
3700This deactivates the advice for each function 3700This deactivates the advice for each function
3701that has at least one piece of advice whose name includes a match for REGEXP." 3701that has at least one piece of advice whose name includes a match for REGEXP."
3702 (interactive 3702 (interactive
3703 (list (ad-read-regexp "Deactivate via advice regexp: "))) 3703 (list (ad-read-regexp "Deactivate via advice regexp")))
3704 (ad-do-advised-functions (function) 3704 (ad-do-advised-functions (function)
3705 (if (ad-find-some-advice function 'any regexp) 3705 (if (ad-find-some-advice function 'any regexp)
3706 (ad-deactivate function)))) 3706 (ad-deactivate function))))
@@ -3711,7 +3711,7 @@ This reactivates the advice for each function
3711that has at least one piece of advice whose name includes a match for REGEXP. 3711that has at least one piece of advice whose name includes a match for REGEXP.
3712See `ad-activate' for documentation on the optional COMPILE argument." 3712See `ad-activate' for documentation on the optional COMPILE argument."
3713 (interactive 3713 (interactive
3714 (list (ad-read-regexp "Update via advice regexp: ") 3714 (list (ad-read-regexp "Update via advice regexp")
3715 current-prefix-arg)) 3715 current-prefix-arg))
3716 (ad-do-advised-functions (function) 3716 (ad-do-advised-functions (function)
3717 (if (ad-find-some-advice function 'any regexp) 3717 (if (ad-find-some-advice function 'any regexp)
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 913ffcf1941..bab50a1c822 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -1585,7 +1585,7 @@ mouse-[0-3]\\)\\)\\>"))
1585 ;; a prefix. 1585 ;; a prefix.
1586 (let ((disambiguate 1586 (let ((disambiguate
1587 (completing-read 1587 (completing-read
1588 "Disambiguating Keyword (default: variable): " 1588 "Disambiguating Keyword (default variable): "
1589 '(("function") ("command") ("variable") 1589 '(("function") ("command") ("variable")
1590 ("option") ("symbol")) 1590 ("option") ("symbol"))
1591 nil t nil nil "variable"))) 1591 nil t nil nil "variable")))
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 58b12376b05..2b47b139759 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -754,7 +754,7 @@ To specify a nil argument interactively, exit with an empty minibuffer."
754 (interactive 754 (interactive
755 (list (let ((name 755 (list (let ((name
756 (completing-read 756 (completing-read
757 "Cancel debug on entry to function (default: all functions): " 757 "Cancel debug on entry to function (default all functions): "
758 (mapcar 'symbol-name debug-function-list) nil t))) 758 (mapcar 'symbol-name debug-function-list) nil t)))
759 (when name 759 (when name
760 (unless (string= name "") 760 (unless (string= name "")
diff --git a/lisp/emulation/vip.el b/lisp/emulation/vip.el
index 51fbdb6b8c4..b07c634d9b4 100644
--- a/lisp/emulation/vip.el
+++ b/lisp/emulation/vip.el
@@ -893,7 +893,7 @@ is the name of the register for COM."
893each line in the region." 893each line in the region."
894 (setq vip-quote-string 894 (setq vip-quote-string
895 (let ((str 895 (let ((str
896 (vip-read-string (format "quote string \(default \"%s\"\): " 896 (vip-read-string (format "quote string (default %s): "
897 vip-quote-string)))) 897 vip-quote-string))))
898 (if (string= str "") vip-quote-string str))) 898 (if (string= str "") vip-quote-string str)))
899 (vip-enlarge-region (point) (mark)) 899 (vip-enlarge-region (point) (mark))
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 99a130e7f1d..398c47d4784 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -358,7 +358,7 @@
358 'viper-insertion-ring)) 358 'viper-insertion-ring))
359 359
360 (if viper-ESC-moves-cursor-back 360 (if viper-ESC-moves-cursor-back
361 (or (bolp) (backward-char 1)))) 361 (or (bolp) (viper-beginning-of-field) (backward-char 1))))
362 )) 362 ))
363 363
364 ;; insert or replace 364 ;; insert or replace
@@ -1996,7 +1996,8 @@ Undo previous insertion and inserts new."
1996;;; Minibuffer business 1996;;; Minibuffer business
1997 1997
1998(defsubst viper-set-minibuffer-style () 1998(defsubst viper-set-minibuffer-style ()
1999 (add-hook 'minibuffer-setup-hook 'viper-minibuffer-setup-sentinel)) 1999 (add-hook 'minibuffer-setup-hook 'viper-minibuffer-setup-sentinel)
2000 (add-hook 'post-command-hook 'viper-minibuffer-post-command-hook))
2000 2001
2001 2002
2002(defun viper-minibuffer-setup-sentinel () 2003(defun viper-minibuffer-setup-sentinel ()
@@ -2039,6 +2040,11 @@ Undo previous insertion and inserts new."
2039 (minibuffer-prompt-end) 2040 (minibuffer-prompt-end)
2040 (point-min))) 2041 (point-min)))
2041 2042
2043(defun viper-minibuffer-post-command-hook()
2044 (when (active-minibuffer-window)
2045 (when (< (point) (viper-minibuffer-real-start))
2046 (goto-char (viper-minibuffer-real-start)))))
2047
2042 2048
2043;; Interpret last event in the local map first; if fails, use exit-minibuffer. 2049;; Interpret last event in the local map first; if fails, use exit-minibuffer.
2044;; Run viper-minibuffer-exit-hook before exiting. 2050;; Run viper-minibuffer-exit-hook before exiting.
@@ -2154,7 +2160,7 @@ problems."
2154 (setq keymap (or keymap minibuffer-local-map) 2160 (setq keymap (or keymap minibuffer-local-map)
2155 initial (or initial "") 2161 initial (or initial "")
2156 temp-msg (if default 2162 temp-msg (if default
2157 (format "(default: %s) " default) 2163 (format "(default %s) " default)
2158 "")) 2164 ""))
2159 2165
2160 (setq viper-incomplete-ex-cmd nil) 2166 (setq viper-incomplete-ex-cmd nil)
@@ -2570,7 +2576,7 @@ These keys are ESC, RET, and LineFeed"
2570 ;; last line of buffer when this line has no \n. 2576 ;; last line of buffer when this line has no \n.
2571 (viper-add-newline-at-eob-if-necessary) 2577 (viper-add-newline-at-eob-if-necessary)
2572 (viper-execute-com 'viper-line val com)) 2578 (viper-execute-com 'viper-line val com))
2573 (if (and (eobp) (not (bobp))) (forward-line -1)) 2579 (if (and (eobp) (bolp) (not (bobp))) (forward-line -1))
2574 ) 2580 )
2575 2581
2576(defun viper-yank-line (arg) 2582(defun viper-yank-line (arg)
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el
index 9c1df1b0ad5..8aa7e4649d4 100644
--- a/lisp/emulation/viper-init.el
+++ b/lisp/emulation/viper-init.el
@@ -115,6 +115,11 @@ In all likelihood, you don't need to bother with this setting."
115 115
116;;; Macros 116;;; Macros
117 117
118;; Fool the compiler to avoid warnings.
119;; Viper calls make-variable-buffer-local from within other functions, which
120;; triggers compiler warnings.
121(defalias 'viper-make-variable-buffer-local 'make-variable-buffer-local)
122
118(defmacro viper-deflocalvar (var default-value &optional documentation) 123(defmacro viper-deflocalvar (var default-value &optional documentation)
119 `(progn 124 `(progn
120 (defvar ,var ,default-value 125 (defvar ,var ,default-value
diff --git a/lisp/emulation/viper-macs.el b/lisp/emulation/viper-macs.el
index 9349a950e97..d401c148ad6 100644
--- a/lisp/emulation/viper-macs.el
+++ b/lisp/emulation/viper-macs.el
@@ -118,7 +118,7 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
118 (define-key viper-vi-intercept-map "\C-x)" 'viper-end-mapping-kbd-macro) 118 (define-key viper-vi-intercept-map "\C-x)" 'viper-end-mapping-kbd-macro)
119 (define-key viper-insert-intercept-map "\C-x)" 'viper-end-mapping-kbd-macro) 119 (define-key viper-insert-intercept-map "\C-x)" 'viper-end-mapping-kbd-macro)
120 (define-key viper-emacs-intercept-map "\C-x)" 'viper-end-mapping-kbd-macro) 120 (define-key viper-emacs-intercept-map "\C-x)" 'viper-end-mapping-kbd-macro)
121 (message "Mapping %S in %s state. Hit `C-x )' to complete the mapping" 121 (message "Mapping %S in %s state. Type macro definition followed by `C-x )'"
122 (viper-display-macro macro-name) 122 (viper-display-macro macro-name)
123 (if ins "Insert" "Vi"))) 123 (if ins "Insert" "Vi")))
124 )) 124 ))
@@ -170,7 +170,7 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
170 ((stringp macro-name) 170 ((stringp macro-name)
171 (setq macro-name (vconcat macro-name))) 171 (setq macro-name (vconcat macro-name)))
172 (t (setq macro-name (vconcat (prin1-to-string macro-name))))) 172 (t (setq macro-name (vconcat (prin1-to-string macro-name)))))
173 (message ":map%s <Name>" variant)(sit-for 2) 173 (message ":map%s <Macro Name>" variant)(sit-for 2)
174 (while 174 (while
175 (not (member key 175 (not (member key
176 '(?\C-m ?\n (control m) (control j) return linefeed))) 176 '(?\C-m ?\n (control m) (control j) return linefeed)))
@@ -442,10 +442,6 @@ If SCOPE is nil, the user is asked to specify the scope."
442 scope) 442 scope)
443 viper-custom-file-name)) 443 viper-custom-file-name))
444 444
445 ;; 2005-09-18 T06:41:22-0400 (Sunday) D. Goel
446 ;; From careful parsing of the above code, it looks like msg
447 ;; couldn't be nil when we reach here. Since it is a string,
448 ;; and a complicated one too, we might as well provide it a "%s"
449 (message "%s" msg) 445 (message "%s" msg)
450 )) 446 ))
451 447
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index cc9f42b9800..d0b9b34e4d6 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -1405,6 +1405,7 @@ This option is appropriate if you like Emacs-style words."
1405 viper-SEP-char-class 1405 viper-SEP-char-class
1406 (or within-line "\n") 1406 (or within-line "\n")
1407 (if within-line (viper-line-pos 'end))))) 1407 (if within-line (viper-line-pos 'end)))))
1408
1408(defsubst viper-skip-all-separators-backward (&optional within-line) 1409(defsubst viper-skip-all-separators-backward (&optional within-line)
1409 (if (eq viper-syntax-preference 'strict-vi) 1410 (if (eq viper-syntax-preference 'strict-vi)
1410 (if within-line 1411 (if within-line
@@ -1433,6 +1434,7 @@ This option is appropriate if you like Emacs-style words."
1433 ;; Emacs may consider some of these as words, but we don't want them 1434 ;; Emacs may consider some of these as words, but we don't want them
1434 viper-non-word-characters 1435 viper-non-word-characters
1435 (viper-line-pos 'end)))) 1436 (viper-line-pos 'end))))
1437
1436(defun viper-skip-nonalphasep-backward () 1438(defun viper-skip-nonalphasep-backward ()
1437 (if (eq viper-syntax-preference 'strict-vi) 1439 (if (eq viper-syntax-preference 'strict-vi)
1438 (skip-chars-backward 1440 (skip-chars-backward
@@ -1502,6 +1504,12 @@ This option is appropriate if you like Emacs-style words."
1502 total 1504 total
1503 )) 1505 ))
1504 1506
1507;; tells when point is at the beginning of field
1508(defun viper-beginning-of-field ()
1509 (or (bobp)
1510 (not (eq (get-char-property (point) 'field)
1511 (get-char-property (1- (point)) 'field)))))
1512
1505 1513
1506;; this is copied from cl-extra.el 1514;; this is copied from cl-extra.el
1507;; Return the subsequence of SEQ from START to END. 1515;; Return the subsequence of SEQ from START to END.
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index bfa730cc434..b3fd6d139c0 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -9,7 +9,7 @@
9;; Author: Michael Kifer <kifer@cs.stonybrook.edu> 9;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
10;; Keywords: emulations 10;; Keywords: emulations
11 11
12(defconst viper-version "3.11.5 of August 6, 2005" 12(defconst viper-version "3.11.5 of September 19, 2005"
13 "The current version of Viper") 13 "The current version of Viper")
14 14
15;; This file is part of GNU Emacs. 15;; This file is part of GNU Emacs.
@@ -606,7 +606,7 @@ This startup message appears whenever you load Viper, unless you type `y' now."
606 (viper-set-expert-level 'dont-change-unless))) 606 (viper-set-expert-level 'dont-change-unless)))
607 607
608 (if viper-xemacs-p 608 (if viper-xemacs-p
609 (make-variable-buffer-local 'bar-cursor)) 609 (viper-make-variable-buffer-local 'bar-cursor))
610 (if (eq major-mode 'viper-mode) 610 (if (eq major-mode 'viper-mode)
611 (setq major-mode 'fundamental-mode)) 611 (setq major-mode 'fundamental-mode))
612 612
@@ -769,6 +769,7 @@ It also can't undo some Viper settings."
769 (remove-hook 'comint-mode-hook 'viper-comint-mode-hook) 769 (remove-hook 'comint-mode-hook 'viper-comint-mode-hook)
770 (remove-hook 'minibuffer-setup-hook 'viper-minibuffer-setup-sentinel) 770 (remove-hook 'minibuffer-setup-hook 'viper-minibuffer-setup-sentinel)
771 (remove-hook 'change-major-mode-hook 'viper-major-mode-change-sentinel) 771 (remove-hook 'change-major-mode-hook 'viper-major-mode-change-sentinel)
772 (remove-hook 'post-command-hook 'viper-minibuffer-post-command-hook)
772 773
773 ;; unbind Viper mouse bindings 774 ;; unbind Viper mouse bindings
774 (viper-unbind-mouse-search-key) 775 (viper-unbind-mouse-search-key)
@@ -1008,7 +1009,7 @@ It also can't undo some Viper settings."
1008 ;; ***This is needed only in case emulation-mode-map-alists is not defined 1009 ;; ***This is needed only in case emulation-mode-map-alists is not defined
1009 (unless 1010 (unless
1010 (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists)) 1011 (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists))
1011 (make-variable-buffer-local 'minor-mode-map-alist)) 1012 (viper-make-variable-buffer-local 'minor-mode-map-alist))
1012 1013
1013 ;; Viper changes the default mode-line-buffer-identification 1014 ;; Viper changes the default mode-line-buffer-identification
1014 (setq-default mode-line-buffer-identification '(" %b")) 1015 (setq-default mode-line-buffer-identification '(" %b"))
@@ -1017,7 +1018,7 @@ It also can't undo some Viper settings."
1017 (setq next-line-add-newlines nil 1018 (setq next-line-add-newlines nil
1018 require-final-newline t) 1019 require-final-newline t)
1019 1020
1020 (make-variable-buffer-local 'require-final-newline) 1021 (viper-make-variable-buffer-local 'require-final-newline)
1021 1022
1022 ;; don't bark when mark is inactive 1023 ;; don't bark when mark is inactive
1023 (if viper-emacs-p 1024 (if viper-emacs-p
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index d8529fc1fb6..1604e130e3d 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1061,7 +1061,8 @@ a very meaningful entity to highlight.")
1061 'font-lock-multiline nil) 1061 'font-lock-multiline nil)
1062 (point-max)))) 1062 (point-max))))
1063 (goto-char end) 1063 (goto-char end)
1064 (setq end (line-beginning-position 2)) 1064 ;; Round up to a whole line.
1065 (unless (bolp) (setq end (line-beginning-position 2)))
1065 ;; Now do the fontification. 1066 ;; Now do the fontification.
1066 (font-lock-unfontify-region beg end) 1067 (font-lock-unfontify-region beg end)
1067 (when font-lock-syntactic-keywords 1068 (when font-lock-syntactic-keywords
@@ -1073,12 +1074,12 @@ a very meaningful entity to highlight.")
1073 (set-syntax-table old-syntax-table)))) 1074 (set-syntax-table old-syntax-table))))
1074 1075
1075;; The following must be rethought, since keywords can override fontification. 1076;; The following must be rethought, since keywords can override fontification.
1076; ;; Now scan for keywords, but not if we are inside a comment now. 1077;; ;; Now scan for keywords, but not if we are inside a comment now.
1077; (or (and (not font-lock-keywords-only) 1078;; (or (and (not font-lock-keywords-only)
1078; (let ((state (parse-partial-sexp beg end nil nil 1079;; (let ((state (parse-partial-sexp beg end nil nil
1079; font-lock-cache-state))) 1080;; font-lock-cache-state)))
1080; (or (nth 4 state) (nth 7 state)))) 1081;; (or (nth 4 state) (nth 7 state))))
1081; (font-lock-fontify-keywords-region beg end)) 1082;; (font-lock-fontify-keywords-region beg end))
1082 1083
1083(defvar font-lock-extra-managed-props nil 1084(defvar font-lock-extra-managed-props nil
1084 "Additional text properties managed by font-lock. 1085 "Additional text properties managed by font-lock.
diff --git a/lisp/format.el b/lisp/format.el
index dd6b2d215ce..fb242b9a143 100644
--- a/lisp/format.el
+++ b/lisp/format.el
@@ -307,7 +307,7 @@ If the format is not specified, this function attempts to guess.
307`buffer-file-format' is set to the format used, and any mode-functions 307`buffer-file-format' is set to the format used, and any mode-functions
308for the format are called." 308for the format are called."
309 (interactive 309 (interactive
310 (list (format-read "Translate buffer from format (default: guess): "))) 310 (list (format-read "Translate buffer from format (default guess): ")))
311 (save-excursion 311 (save-excursion
312 (goto-char (point-min)) 312 (goto-char (point-min))
313 (format-decode format (buffer-size) t))) 313 (format-decode format (buffer-size) t)))
@@ -318,7 +318,7 @@ Arg FORMAT is optional; if omitted the format will be determined by looking
318for identifying regular expressions at the beginning of the region." 318for identifying regular expressions at the beginning of the region."
319 (interactive 319 (interactive
320 (list (region-beginning) (region-end) 320 (list (region-beginning) (region-end)
321 (format-read "Translate region from format (default: guess): "))) 321 (format-read "Translate region from format (default guess): ")))
322 (save-excursion 322 (save-excursion
323 (goto-char from) 323 (goto-char from)
324 (format-decode format (- to from) nil))) 324 (format-decode format (- to from) nil)))
diff --git a/lisp/forms.el b/lisp/forms.el
index 419a6fa3778..e7282ee0ea5 100644
--- a/lisp/forms.el
+++ b/lisp/forms.el
@@ -519,7 +519,7 @@ Commands: Equivalent keys in read-only mode:
519 (if (or (eq enable-local-eval t) 519 (if (or (eq enable-local-eval t)
520 (yes-or-no-p 520 (yes-or-no-p
521 (concat "Evaluate lisp code in buffer " 521 (concat "Evaluate lisp code in buffer "
522 (buffer-name) " to display forms "))) 522 (buffer-name) " to display forms? ")))
523 (eval-buffer) 523 (eval-buffer)
524 (error "`enable-local-eval' inhibits buffer evaluation")) 524 (error "`enable-local-eval' inhibits buffer evaluation"))
525 525
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 08fd723cf1f..44675cdacd0 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,8 +1,49 @@
12005-09-25 Romain Francoise <romain@orebokech.com>
2
3 * gnus-agent.el (gnus-agent-expire-group, gnus-agent-expire):
4 * gnus-start.el (gnus-subscribe-interactively):
5 * gnus-uu.el (gnus-uu-grab-articles):
6 End `yes-or-no-p' and `y-or-n-p' prompts with question mark and
7 space.
8
92005-09-24 Emilio C. Lopes <eclig@gmx.net>
10
11 * smime.el (smime-sign-buffer, smime-decrypt-buffer):
12 * mm-view.el (mm-view-pkcs7-decrypt):
13 * gnus-sum.el (gnus-summary-limit-to-extra)
14 (gnus-summary-respool-article, gnus-read-move-group-name):
15 * gnus-score.el (gnus-summary-increase-score):
16 * gnus-util.el (gnus-completing-read-with-default):
17 * gnus-art.el (gnus-read-save-file-name)
18 (gnus-summary-save-in-rmail, gnus-summary-save-in-mail)
19 (gnus-summary-save-in-file, gnus-summary-save-body-in-file):
20 * message.el (message-check-news-header-syntax):
21 Follow convention for reading with the minibuffer.
22
232005-09-22 Reiner Steib <Reiner.Steib@gmx.de>
24
25 * spam-report.el (spam-report-url-ping-plain): Use
26 gnus-extended-version as User-Agent.
27
28 * gnus-agent.el (gnus-agent-synchronize-flags): Explain why the
29 default value is nil.
30
312005-09-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
32
33 * gnus-agent.el (gnus-agent-synchronize-flags): Switch the
34 default to nil, to be able to use Gnus at all. If the default
35 switches to something else, then the function should be fixed not
36 be exceedingly slow.
37
382005-09-19 Reiner Steib <Reiner.Steib@gmx.de>
39
40 * mm-url.el (mm-url-decode-entities): Fix regexp.
41
12005-09-18 D Goel <deego@gnufans.org> 422005-09-18 D Goel <deego@gnufans.org>
2 43
3 * sieve.el (sieve-help): Fix `message' call: first arg should be a 44 * sieve.el (sieve-help): Fix `message' call: first arg should be a
4 format spec. 45 format spec.
5 46
62005-09-16 Katsumi Yamaoka <yamaoka@jpl.org> 472005-09-16 Katsumi Yamaoka <yamaoka@jpl.org>
7 48
8 * gnus.el (gnus-group-startup-message): Bind image-load-path. 49 * gnus.el (gnus-group-startup-message): Bind image-load-path.
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index 47d1dfd7364..0357ddd18cb 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -118,6 +118,8 @@ If nil, only read articles will be expired."
118(defcustom gnus-agent-synchronize-flags t 118(defcustom gnus-agent-synchronize-flags t
119 "Indicate if flags are synchronized when you plug in. 119 "Indicate if flags are synchronized when you plug in.
120If this is `ask' the hook will query the user." 120If this is `ask' the hook will query the user."
121 ;; If the default switches to something else than nil, then the function
122 ;; should be fixed not be exceedingly slow. See 2005-09-20 ChangeLog entry.
121 :version "21.1" 123 :version "21.1"
122 :type '(choice (const :tag "Always" t) 124 :type '(choice (const :tag "Always" t)
123 (const :tag "Never" nil) 125 (const :tag "Never" nil)
@@ -2934,7 +2936,7 @@ FORCE is equivalent to setting the expiration predicates to true."
2934 (if (or (not (eq articles t)) 2936 (if (or (not (eq articles t))
2935 (yes-or-no-p 2937 (yes-or-no-p
2936 (concat "Are you sure that you want to " 2938 (concat "Are you sure that you want to "
2937 "expire all articles in " group "."))) 2939 "expire all articles in " group "? ")))
2938 (let ((gnus-command-method (gnus-find-method-for-group group)) 2940 (let ((gnus-command-method (gnus-find-method-for-group group))
2939 (overview (gnus-get-buffer-create " *expire overview*")) 2941 (overview (gnus-get-buffer-create " *expire overview*"))
2940 orig) 2942 orig)
@@ -3308,7 +3310,7 @@ FORCE is equivalent to setting the expiration predicates to true."
3308 (gnus-agent-expire-group group articles force) 3310 (gnus-agent-expire-group group articles force)
3309 (if (or (not (eq articles t)) 3311 (if (or (not (eq articles t))
3310 (yes-or-no-p "Are you sure that you want to expire all \ 3312 (yes-or-no-p "Are you sure that you want to expire all \
3311articles in every agentized group.")) 3313articles in every agentized group? "))
3312 (let ((methods (gnus-agent-covered-methods)) 3314 (let ((methods (gnus-agent-covered-methods))
3313 ;; Bind gnus-agent-expire-current-dirs to enable tracking 3315 ;; Bind gnus-agent-expire-current-dirs to enable tracking
3314 ;; of agent directories. 3316 ;; of agent directories.
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 3821f9ecf18..4957d3ae98b 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -3255,7 +3255,7 @@ This format is defined by the `gnus-article-time-format' variable."
3255 ((null split-name) 3255 ((null split-name)
3256 (read-file-name 3256 (read-file-name
3257 (concat prompt " (default " 3257 (concat prompt " (default "
3258 (file-name-nondirectory default-name) ") ") 3258 (file-name-nondirectory default-name) "): ")
3259 (file-name-directory default-name) 3259 (file-name-directory default-name)
3260 default-name)) 3260 default-name))
3261 ;; A single group name is returned. 3261 ;; A single group name is returned.
@@ -3265,7 +3265,7 @@ This format is defined by the `gnus-article-time-format' variable."
3265 (symbol-value variable))) 3265 (symbol-value variable)))
3266 (read-file-name 3266 (read-file-name
3267 (concat prompt " (default " 3267 (concat prompt " (default "
3268 (file-name-nondirectory default-name) ") ") 3268 (file-name-nondirectory default-name) "): ")
3269 (file-name-directory default-name) 3269 (file-name-directory default-name)
3270 default-name)) 3270 default-name))
3271 ;; A single split name was found 3271 ;; A single split name was found
@@ -3278,7 +3278,7 @@ This format is defined by the `gnus-article-time-format' variable."
3278 ((file-exists-p name) name) 3278 ((file-exists-p name) name)
3279 (t gnus-article-save-directory)))) 3279 (t gnus-article-save-directory))))
3280 (read-file-name 3280 (read-file-name
3281 (concat prompt " (default " name ") ") 3281 (concat prompt " (default " name "): ")
3282 dir name))) 3282 dir name)))
3283 ;; A list of splits was found. 3283 ;; A list of splits was found.
3284 (t 3284 (t
@@ -3289,7 +3289,7 @@ This format is defined by the `gnus-article-time-format' variable."
3289 (setq result 3289 (setq result
3290 (expand-file-name 3290 (expand-file-name
3291 (read-file-name 3291 (read-file-name
3292 (concat prompt " (`M-p' for defaults) ") 3292 (concat prompt " (`M-p' for defaults): ")
3293 gnus-article-save-directory 3293 gnus-article-save-directory
3294 (car split-name)) 3294 (car split-name))
3295 gnus-article-save-directory))) 3295 gnus-article-save-directory)))
@@ -3323,7 +3323,7 @@ This format is defined by the `gnus-article-time-format' variable."
3323Optional argument FILENAME specifies file name. 3323Optional argument FILENAME specifies file name.
3324Directory to save to is default to `gnus-article-save-directory'." 3324Directory to save to is default to `gnus-article-save-directory'."
3325 (setq filename (gnus-read-save-file-name 3325 (setq filename (gnus-read-save-file-name
3326 "Save %s in rmail file:" filename 3326 "Save %s in rmail file" filename
3327 gnus-rmail-save-name gnus-newsgroup-name 3327 gnus-rmail-save-name gnus-newsgroup-name
3328 gnus-current-headers 'gnus-newsgroup-last-rmail)) 3328 gnus-current-headers 'gnus-newsgroup-last-rmail))
3329 (gnus-eval-in-buffer-window gnus-save-article-buffer 3329 (gnus-eval-in-buffer-window gnus-save-article-buffer
@@ -3338,7 +3338,7 @@ Directory to save to is default to `gnus-article-save-directory'."
3338Optional argument FILENAME specifies file name. 3338Optional argument FILENAME specifies file name.
3339Directory to save to is default to `gnus-article-save-directory'." 3339Directory to save to is default to `gnus-article-save-directory'."
3340 (setq filename (gnus-read-save-file-name 3340 (setq filename (gnus-read-save-file-name
3341 "Save %s in Unix mail file:" filename 3341 "Save %s in Unix mail file" filename
3342 gnus-mail-save-name gnus-newsgroup-name 3342 gnus-mail-save-name gnus-newsgroup-name
3343 gnus-current-headers 'gnus-newsgroup-last-mail)) 3343 gnus-current-headers 'gnus-newsgroup-last-mail))
3344 (gnus-eval-in-buffer-window gnus-save-article-buffer 3344 (gnus-eval-in-buffer-window gnus-save-article-buffer
@@ -3357,7 +3357,7 @@ Directory to save to is default to `gnus-article-save-directory'."
3357Optional argument FILENAME specifies file name. 3357Optional argument FILENAME specifies file name.
3358Directory to save to is default to `gnus-article-save-directory'." 3358Directory to save to is default to `gnus-article-save-directory'."
3359 (setq filename (gnus-read-save-file-name 3359 (setq filename (gnus-read-save-file-name
3360 "Save %s in file:" filename 3360 "Save %s in file" filename
3361 gnus-file-save-name gnus-newsgroup-name 3361 gnus-file-save-name gnus-newsgroup-name
3362 gnus-current-headers 'gnus-newsgroup-last-file)) 3362 gnus-current-headers 'gnus-newsgroup-last-file))
3363 (gnus-eval-in-buffer-window gnus-save-article-buffer 3363 (gnus-eval-in-buffer-window gnus-save-article-buffer
@@ -3381,7 +3381,7 @@ The directory to save in defaults to `gnus-article-save-directory'."
3381Optional argument FILENAME specifies file name. 3381Optional argument FILENAME specifies file name.
3382The directory to save in defaults to `gnus-article-save-directory'." 3382The directory to save in defaults to `gnus-article-save-directory'."
3383 (setq filename (gnus-read-save-file-name 3383 (setq filename (gnus-read-save-file-name
3384 "Save %s body in file:" filename 3384 "Save %s body in file" filename
3385 gnus-file-save-name gnus-newsgroup-name 3385 gnus-file-save-name gnus-newsgroup-name
3386 gnus-current-headers 'gnus-newsgroup-last-file)) 3386 gnus-current-headers 'gnus-newsgroup-last-file))
3387 (gnus-eval-in-buffer-window gnus-save-article-buffer 3387 (gnus-eval-in-buffer-window gnus-save-article-buffer
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el
index e866f7f32fc..22a579c3d69 100644
--- a/lisp/gnus/gnus-score.el
+++ b/lisp/gnus/gnus-score.el
@@ -652,7 +652,7 @@ file for the command instead of the current score file."
652 (intern ; need symbol 652 (intern ; need symbol
653 (gnus-completing-read-with-default 653 (gnus-completing-read-with-default
654 (symbol-name (car gnus-extra-headers)) ; default response 654 (symbol-name (car gnus-extra-headers)) ; default response
655 "Score extra header:" ; prompt 655 "Score extra header" ; prompt
656 (mapcar (lambda (x) ; completion list 656 (mapcar (lambda (x) ; completion list
657 (cons (symbol-name x) x)) 657 (cons (symbol-name x) x))
658 gnus-extra-headers) 658 gnus-extra-headers)
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index e30faa85c7f..0eb66bb824e 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -608,7 +608,7 @@ Can be used to turn version control on or off."
608 "Subscribe the new GROUP interactively. 608 "Subscribe the new GROUP interactively.
609It is inserted in hierarchical newsgroup order if subscribed. If not, 609It is inserted in hierarchical newsgroup order if subscribed. If not,
610it is killed." 610it is killed."
611 (if (gnus-y-or-n-p (format "Subscribe new newsgroup: %s " group)) 611 (if (gnus-y-or-n-p (format "Subscribe new newsgroup %s? " group))
612 (gnus-subscribe-hierarchically group) 612 (gnus-subscribe-hierarchically group)
613 (push group gnus-killed-list))) 613 (push group gnus-killed-list)))
614 614
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 88fe21fd5a2..c9e93d19f42 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -7696,8 +7696,8 @@ articles that are younger than AGE days."
7696 (gnus-completing-read-with-default 7696 (gnus-completing-read-with-default
7697 (symbol-name (car gnus-extra-headers)) 7697 (symbol-name (car gnus-extra-headers))
7698 (if current-prefix-arg 7698 (if current-prefix-arg
7699 "Exclude extra header:" 7699 "Exclude extra header"
7700 "Limit extra header:") 7700 "Limit extra header")
7701 (mapcar (lambda (x) 7701 (mapcar (lambda (x)
7702 (cons (symbol-name x) x)) 7702 (cons (symbol-name x) x))
7703 gnus-extra-headers) 7703 gnus-extra-headers)
@@ -9218,7 +9218,7 @@ latter case, they will be copied into the relevant groups."
9218 gnus-newsgroup-name))))) 9218 gnus-newsgroup-name)))))
9219 (method 9219 (method
9220 (gnus-completing-read-with-default 9220 (gnus-completing-read-with-default
9221 methname "What backend do you want to use when respooling?" 9221 methname "Backend to use when respooling"
9222 methods nil t nil 'gnus-mail-method-history)) 9222 methods nil t nil 'gnus-mail-method-history))
9223 ms) 9223 ms)
9224 (cond 9224 (cond
@@ -11044,7 +11044,7 @@ save those articles instead."
11044 (let* ((split-name (gnus-get-split-value gnus-move-split-methods)) 11044 (let* ((split-name (gnus-get-split-value gnus-move-split-methods))
11045 (minibuffer-confirm-incomplete nil) ; XEmacs 11045 (minibuffer-confirm-incomplete nil) ; XEmacs
11046 (prom 11046 (prom
11047 (format "%s %s to:" 11047 (format "%s %s to"
11048 prompt 11048 prompt
11049 (if (> (length articles) 1) 11049 (if (> (length articles) 1)
11050 (format "these %d articles" (length articles)) 11050 (format "these %d articles" (length articles))
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 4c1721029be..5556a815d2a 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -335,8 +335,8 @@ is slower."
335(defun gnus-completing-read-with-default (default prompt &rest args) 335(defun gnus-completing-read-with-default (default prompt &rest args)
336 ;; Like `completing-read', except that DEFAULT is the default argument. 336 ;; Like `completing-read', except that DEFAULT is the default argument.
337 (let* ((prompt (if default 337 (let* ((prompt (if default
338 (concat prompt " (default " default ") ") 338 (concat prompt " (default " default "): ")
339 (concat prompt " "))) 339 (concat prompt ": ")))
340 (answer (apply 'completing-read prompt args))) 340 (answer (apply 'completing-read prompt args)))
341 (if (or (null answer) (zerop (length answer))) 341 (if (or (null answer) (zerop (length answer)))
342 default 342 default
diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el
index a2f3f353a05..01f21887aee 100644
--- a/lisp/gnus/gnus-uu.el
+++ b/lisp/gnus/gnus-uu.el
@@ -1294,7 +1294,7 @@ When called interactively, prompt for REGEXP."
1294 (not gnus-uu-be-dangerous) 1294 (not gnus-uu-be-dangerous)
1295 (or (eq gnus-uu-be-dangerous t) 1295 (or (eq gnus-uu-be-dangerous t)
1296 (gnus-y-or-n-p 1296 (gnus-y-or-n-p
1297 (format "Delete unsuccessfully decoded file %s" 1297 (format "Delete unsuccessfully decoded file %s? "
1298 result-file)))) 1298 result-file))))
1299 (delete-file result-file))) 1299 (delete-file result-file)))
1300 (when (memq 'begin process-state) 1300 (when (memq 'begin process-state)
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 75554a6079c..943e272867a 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -4197,7 +4197,7 @@ Otherwise, generate and save a value for `canlock-password' first."
4197 (zerop 4197 (zerop
4198 (length 4198 (length
4199 (setq to (completing-read 4199 (setq to (completing-read
4200 "Followups to (default: no Followup-To header) " 4200 "Followups to (default no Followup-To header): "
4201 (mapcar #'list 4201 (mapcar #'list
4202 (cons "poster" 4202 (cons "poster"
4203 (message-tokenize-header 4203 (message-tokenize-header
diff --git a/lisp/gnus/mm-url.el b/lisp/gnus/mm-url.el
index 961ee0ea4fb..4fd39e477f6 100644
--- a/lisp/gnus/mm-url.el
+++ b/lisp/gnus/mm-url.el
@@ -365,7 +365,7 @@ If FOLLOW-REFRESH is non-nil, redirect refresh url in META."
365(defun mm-url-decode-entities () 365(defun mm-url-decode-entities ()
366 "Decode all HTML entities." 366 "Decode all HTML entities."
367 (goto-char (point-min)) 367 (goto-char (point-min))
368 (while (re-search-forward "&\\(#[0-9]+\\|[a-z]+\\);" nil t) 368 (while (re-search-forward "&\\(#[0-9]+\\|[a-z]+[0-9]*\\);" nil t)
369 (let ((elem (if (eq (aref (match-string 1) 0) ?\#) 369 (let ((elem (if (eq (aref (match-string 1) 0) ?\#)
370 (let ((c 370 (let ((c
371 (string-to-number (substring 371 (string-to-number (substring
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index ac408aa179f..dec03bf0b9c 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -576,9 +576,10 @@
576 (cadar smime-keys) 576 (cadar smime-keys)
577 (smime-get-key-by-email 577 (smime-get-key-by-email
578 (gnus-completing-read-maybe-default 578 (gnus-completing-read-maybe-default
579 (concat "Decipher using which key? " 579 (concat "Decipher using key"
580 (if smime-keys (concat "(default " (caar smime-keys) ") ") 580 (if smime-keys
581 "")) 581 (concat " (default " (caar smime-keys) "): ")
582 ": "))
582 smime-keys nil nil nil nil (car-safe (car-safe smime-keys)))))) 583 smime-keys nil nil nil nil (car-safe (car-safe smime-keys))))))
583 (goto-char (point-min)) 584 (goto-char (point-min))
584 (while (search-forward "\r\n" nil t) 585 (while (search-forward "\r\n" nil t)
diff --git a/lisp/gnus/smime.el b/lisp/gnus/smime.el
index 485cf177154..22489affa89 100644
--- a/lisp/gnus/smime.el
+++ b/lisp/gnus/smime.el
@@ -341,9 +341,10 @@ KEYFILE should contain a PEM encoded key and certificate."
341 keyfile 341 keyfile
342 (smime-get-key-with-certs-by-email 342 (smime-get-key-with-certs-by-email
343 (completing-read 343 (completing-read
344 (concat "Sign using which key? " 344 (concat "Sign using key"
345 (if smime-keys (concat "(default " (caar smime-keys) ") ") 345 (if smime-keys
346 "")) 346 (concat " (default " (caar smime-keys) "): ")
347 ": "))
347 smime-keys nil nil (car-safe (car-safe smime-keys)))))) 348 smime-keys nil nil (car-safe (car-safe smime-keys))))))
348 (error "Signing failed")))) 349 (error "Signing failed"))))
349 350
@@ -472,9 +473,9 @@ in the buffer specified by `smime-details-buffer'."
472 (or keyfile 473 (or keyfile
473 (smime-get-key-by-email 474 (smime-get-key-by-email
474 (completing-read 475 (completing-read
475 (concat "Decipher using which key? " 476 (concat "Decipher using key"
476 (if smime-keys (concat "(default " (caar smime-keys) ") ") 477 (if smime-keys (concat " (default " (caar smime-keys) "): ")
477 "")) 478 ": "))
478 smime-keys nil nil (car-safe (car-safe smime-keys))))))))) 479 smime-keys nil nil (car-safe (car-safe smime-keys)))))))))
479 480
480;; Various operations 481;; Various operations
diff --git a/lisp/gnus/spam-report.el b/lisp/gnus/spam-report.el
index 173306ec55e..293a41d7b60 100644
--- a/lisp/gnus/spam-report.el
+++ b/lisp/gnus/spam-report.el
@@ -150,7 +150,7 @@ the function specified by `spam-report-url-ping-function'."
150 (process-send-string 150 (process-send-string
151 tcp-connection 151 tcp-connection
152 (format "GET %s HTTP/1.1\nUser-Agent: %s (spam-report.el)\nHost: %s\n\n" 152 (format "GET %s HTTP/1.1\nUser-Agent: %s (spam-report.el)\nHost: %s\n\n"
153 report (gnus-emacs-version) host))))) 153 report (gnus-extended-version) host)))))
154 154
155;;;###autoload 155;;;###autoload
156(defun spam-report-process-queue (&optional file keep) 156(defun spam-report-process-queue (&optional file keep)
diff --git a/lisp/ido.el b/lisp/ido.el
index 7c9d269417a..2d62f6c74ef 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -2138,7 +2138,7 @@ If INITIAL is non-nil, it specifies the initial input string."
2138 (ido-record-command method dirname) 2138 (ido-record-command method dirname)
2139 (ido-record-work-directory) 2139 (ido-record-work-directory)
2140 (funcall method dirname)) 2140 (funcall method dirname))
2141 ((y-or-n-p (format "Directory %s does not exist. Create it " filename)) 2141 ((y-or-n-p (format "Directory %s does not exist. Create it? " filename))
2142 (ido-record-command method dirname) 2142 (ido-record-command method dirname)
2143 (ido-record-work-directory dirname) 2143 (ido-record-work-directory dirname)
2144 (make-directory-internal dirname) 2144 (make-directory-internal dirname)
@@ -3529,7 +3529,7 @@ for first matching file."
3529 (file-exists-p file) 3529 (file-exists-p file)
3530 (not (file-directory-p file)) 3530 (not (file-directory-p file))
3531 (file-writable-p ido-current-directory) 3531 (file-writable-p ido-current-directory)
3532 (yes-or-no-p (concat "Delete " file " "))) 3532 (yes-or-no-p (concat "Delete " file "? ")))
3533 (delete-file file) 3533 (delete-file file)
3534 ;; Check if file still exists. 3534 ;; Check if file still exists.
3535 (if (file-exists-p file) 3535 (if (file-exists-p file)
diff --git a/lisp/info.el b/lisp/info.el
index 4c40e187c03..7868125b9b0 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1569,11 +1569,11 @@ PATH-AND-SUFFIXES is a pair of lists, (DIRECTORIES . SUFFIXES)."
1569If DIRECTION is `backward', search in the reverse direction." 1569If DIRECTION is `backward', search in the reverse direction."
1570 (interactive (list (read-string 1570 (interactive (list (read-string
1571 (if Info-search-history 1571 (if Info-search-history
1572 (format "Regexp search%s (default `%s'): " 1572 (format "Regexp search%s (default %s): "
1573 (if case-fold-search "" " case-sensitively") 1573 (if case-fold-search "" " case-sensitively")
1574 (car Info-search-history)) 1574 (car Info-search-history))
1575 (format "Regexp search%s: " 1575 (format "Regexp search%s: "
1576 (if case-fold-search "" " case-sensitively"))) 1576 (if case-fold-search "" " case-sensitively")))
1577 nil 'Info-search-history))) 1577 nil 'Info-search-history)))
1578 (when transient-mark-mode 1578 (when transient-mark-mode
1579 (deactivate-mark)) 1579 (deactivate-mark))
@@ -1757,11 +1757,11 @@ If DIRECTION is `backward', search in the reverse direction."
1757 "Search for REGEXP in the reverse direction." 1757 "Search for REGEXP in the reverse direction."
1758 (interactive (list (read-string 1758 (interactive (list (read-string
1759 (if Info-search-history 1759 (if Info-search-history
1760 (format "Regexp search%s backward (default `%s'): " 1760 (format "Regexp search%s backward (default %s): "
1761 (if case-fold-search "" " case-sensitively") 1761 (if case-fold-search "" " case-sensitively")
1762 (car Info-search-history)) 1762 (car Info-search-history))
1763 (format "Regexp search%s backward: " 1763 (format "Regexp search%s backward: "
1764 (if case-fold-search "" " case-sensitively"))) 1764 (if case-fold-search "" " case-sensitively")))
1765 nil 'Info-search-history))) 1765 nil 'Info-search-history)))
1766 (Info-search regexp bound noerror count 'backward)) 1766 (Info-search regexp bound noerror count 'backward))
1767 1767
@@ -2107,8 +2107,8 @@ new buffer."
2107 (if completions 2107 (if completions
2108 (let ((input (completing-read (if default 2108 (let ((input (completing-read (if default
2109 (concat 2109 (concat
2110 "Follow reference named: (default " 2110 "Follow reference named (default "
2111 default ") ") 2111 default "): ")
2112 "Follow reference named: ") 2112 "Follow reference named: ")
2113 completions nil t))) 2113 completions nil t)))
2114 (list (if (equal input "") 2114 (list (if (equal input "")
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index c297ce5e27b..b42ac755347 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -281,7 +281,7 @@ wrong, use this command again to toggle back to the right mode."
281 buffer-file-coding-system))) 281 buffer-file-coding-system)))
282 (list (read-coding-system 282 (list (read-coding-system
283 (if default 283 (if default
284 (format "Coding system for following command (default, %s): " default) 284 (format "Coding system for following command (default %s): " default)
285 "Coding system for following command: ") 285 "Coding system for following command: ")
286 default)))) 286 default))))
287 (let* ((keyseq (read-key-sequence 287 (let* ((keyseq (read-key-sequence
@@ -596,7 +596,7 @@ or nil if all characters are encodable."
596 (interactive 596 (interactive
597 (list (let ((default (or buffer-file-coding-system 'us-ascii))) 597 (list (let ((default (or buffer-file-coding-system 'us-ascii)))
598 (read-coding-system 598 (read-coding-system
599 (format "Coding-system (default, %s): " default) 599 (format "Coding-system (default %s): " default)
600 default)))) 600 default))))
601 (let ((pos (unencodable-char-position (point) (point-max) coding-system))) 601 (let ((pos (unencodable-char-position (point) (point-max) coding-system)))
602 (if pos 602 (if pos
@@ -1452,7 +1452,7 @@ which marks the variable `default-input-method' as set for Custom buffers."
1452 "Describe input method INPUT-METHOD." 1452 "Describe input method INPUT-METHOD."
1453 (interactive 1453 (interactive
1454 (list (read-input-method-name 1454 (list (read-input-method-name
1455 "Describe input method (default, current choice): "))) 1455 "Describe input method (default current choice): ")))
1456 (if (and input-method (symbolp input-method)) 1456 (if (and input-method (symbolp input-method))
1457 (setq input-method (symbol-name input-method))) 1457 (setq input-method (symbol-name input-method)))
1458 (help-setup-xref (list #'describe-input-method 1458 (help-setup-xref (list #'describe-input-method
@@ -1740,7 +1740,7 @@ which is the name of a language environment. For example, \"Latin-1\"
1740specifies the character set for the major languages of Western Europe." 1740specifies the character set for the major languages of Western Europe."
1741 (interactive (list (read-language-name 1741 (interactive (list (read-language-name
1742 nil 1742 nil
1743 "Set language environment (default, English): "))) 1743 "Set language environment (default English): ")))
1744 (if language-name 1744 (if language-name
1745 (if (symbolp language-name) 1745 (if (symbolp language-name)
1746 (setq language-name (symbol-name language-name))) 1746 (setq language-name (symbol-name language-name)))
@@ -1938,7 +1938,7 @@ of `buffer-file-coding-system' set by this function."
1938 (interactive 1938 (interactive
1939 (list (read-language-name 1939 (list (read-language-name
1940 'documentation 1940 'documentation
1941 "Describe language environment (default, current choice): "))) 1941 "Describe language environment (default current choice): ")))
1942 (if (null language-name) 1942 (if (null language-name)
1943 (setq language-name current-language-environment)) 1943 (setq language-name current-language-environment))
1944 (if (or (null language-name) 1944 (if (or (null language-name)
@@ -1966,7 +1966,7 @@ of `buffer-file-coding-system' set by this function."
1966 (l (copy-sequence input-method-alist))) 1966 (l (copy-sequence input-method-alist)))
1967 (insert "Input methods") 1967 (insert "Input methods")
1968 (when input-method 1968 (when input-method
1969 (insert " (default, " input-method ")") 1969 (insert " (default " input-method ")")
1970 (setq input-method (assoc input-method input-method-alist)) 1970 (setq input-method (assoc input-method input-method-alist))
1971 (setq l (cons input-method (delete input-method l)))) 1971 (setq l (cons input-method (delete input-method l))))
1972 (insert ":\n") 1972 (insert ":\n")
diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el
index b26629ec551..8b0a25dbae0 100644
--- a/lisp/international/mule-diag.el
+++ b/lisp/international/mule-diag.el
@@ -419,7 +419,7 @@ detailed meanings of these arguments."
419;;;###autoload 419;;;###autoload
420(defun describe-coding-system (coding-system) 420(defun describe-coding-system (coding-system)
421 "Display information about CODING-SYSTEM." 421 "Display information about CODING-SYSTEM."
422 (interactive "zDescribe coding system (default, current choices): ") 422 (interactive "zDescribe coding system (default current choices): ")
423 (if (null coding-system) 423 (if (null coding-system)
424 (describe-current-coding-system) 424 (describe-current-coding-system)
425 (help-setup-xref (list #'describe-coding-system coding-system) 425 (help-setup-xref (list #'describe-coding-system coding-system)
@@ -831,7 +831,7 @@ but still contains full information about each coding system."
831;;;###autoload 831;;;###autoload
832(defun describe-font (fontname) 832(defun describe-font (fontname)
833 "Display information about fonts which partially match FONTNAME." 833 "Display information about fonts which partially match FONTNAME."
834 (interactive "sFontname (default, current choice for ASCII chars): ") 834 (interactive "sFontname (default current choice for ASCII chars): ")
835 (or (and window-system (fboundp 'fontset-list)) 835 (or (and window-system (fboundp 'fontset-list))
836 (error "No fontsets being used")) 836 (error "No fontsets being used"))
837 (when (or (not fontname) (= (length fontname) 0)) 837 (when (or (not fontname) (= (length fontname) 0))
@@ -921,7 +921,7 @@ This shows which font is used for which character(s)."
921 (mapcar 'cdr fontset-alias-alist))) 921 (mapcar 'cdr fontset-alias-alist)))
922 (completion-ignore-case t)) 922 (completion-ignore-case t))
923 (list (completing-read 923 (list (completing-read
924 "Fontset (default, used by the current frame): " 924 "Fontset (default used by the current frame): "
925 fontset-list nil t))))) 925 fontset-list nil t)))))
926 (if (= (length fontset) 0) 926 (if (= (length fontset) 0)
927 (setq fontset (frame-parameter nil 'font))) 927 (setq fontset (frame-parameter nil 'font)))
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 52a98145534..322f432d8dc 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -1139,7 +1139,7 @@ surely saves the buffer with CODING-SYSTEM. From a program, if you
1139don't want to mark the buffer modified, specify t for NOMODIFY. 1139don't want to mark the buffer modified, specify t for NOMODIFY.
1140If you know exactly what coding system you want to use, 1140If you know exactly what coding system you want to use,
1141just set the variable `buffer-file-coding-system' directly." 1141just set the variable `buffer-file-coding-system' directly."
1142 (interactive "zCoding system for saving file (default, nil): \nP") 1142 (interactive "zCoding system for saving file (default nil): \nP")
1143 (check-coding-system coding-system) 1143 (check-coding-system coding-system)
1144 (if (and coding-system buffer-file-coding-system (null force)) 1144 (if (and coding-system buffer-file-coding-system (null force))
1145 (setq coding-system 1145 (setq coding-system
@@ -1163,7 +1163,7 @@ do. If FORCE is nil, get the unspecified aspect (or aspects) from the
1163buffer's previous `buffer-file-coding-system' value (if it is 1163buffer's previous `buffer-file-coding-system' value (if it is
1164specified there). Otherwise, determine it from the file contents as 1164specified there). Otherwise, determine it from the file contents as
1165usual for visiting a file." 1165usual for visiting a file."
1166 (interactive "zCoding system for visited file (default, nil): \nP") 1166 (interactive "zCoding system for visited file (default nil): \nP")
1167 (check-coding-system coding-system) 1167 (check-coding-system coding-system)
1168 (if (and coding-system buffer-file-coding-system (null force)) 1168 (if (and coding-system buffer-file-coding-system (null force))
1169 (setq coding-system 1169 (setq coding-system
@@ -1175,7 +1175,7 @@ usual for visiting a file."
1175 "Set coding system for decoding and encoding file names to CODING-SYSTEM. 1175 "Set coding system for decoding and encoding file names to CODING-SYSTEM.
1176It actually just set the variable `file-name-coding-system' (which 1176It actually just set the variable `file-name-coding-system' (which
1177see) to CODING-SYSTEM." 1177see) to CODING-SYSTEM."
1178 (interactive "zCoding system for file names (default, nil): ") 1178 (interactive "zCoding system for file names (default nil): ")
1179 (check-coding-system coding-system) 1179 (check-coding-system coding-system)
1180 (if (and coding-system 1180 (if (and coding-system
1181 (not (coding-system-get coding-system :ascii-compatible-p)) 1181 (not (coding-system-get coding-system :ascii-compatible-p))
@@ -1200,7 +1200,7 @@ or by the previous use of this command."
1200 default-terminal-coding-system) 1200 default-terminal-coding-system)
1201 default-terminal-coding-system))) 1201 default-terminal-coding-system)))
1202 (read-coding-system 1202 (read-coding-system
1203 (format "Coding system for terminal display (default, %s): " 1203 (format "Coding system for terminal display (default %s): "
1204 default) 1204 default)
1205 default)))) 1205 default))))
1206 (if (and (not coding-system) 1206 (if (and (not coding-system)
@@ -1229,7 +1229,7 @@ or by the previous use of this command."
1229 default-keyboard-coding-system) 1229 default-keyboard-coding-system)
1230 default-keyboard-coding-system))) 1230 default-keyboard-coding-system)))
1231 (read-coding-system 1231 (read-coding-system
1232 (format "Coding system for keyboard input (default, %s): " 1232 (format "Coding system for keyboard input (default %s): "
1233 default) 1233 default)
1234 default)))) 1234 default))))
1235 (if (and (not coding-system) 1235 (if (and (not coding-system)
@@ -1303,7 +1303,7 @@ This setting is effective for the next communication only."
1303 (interactive 1303 (interactive
1304 (list (read-coding-system 1304 (list (read-coding-system
1305 (if last-next-selection-coding-system 1305 (if last-next-selection-coding-system
1306 (format "Coding system for the next selection (default, %S): " 1306 (format "Coding system for the next selection (default %S): "
1307 last-next-selection-coding-system) 1307 last-next-selection-coding-system)
1308 "Coding system for the next selection: ") 1308 "Coding system for the next selection: ")
1309 last-next-selection-coding-system))) 1309 last-next-selection-coding-system)))
diff --git a/lisp/international/quail.el b/lisp/international/quail.el
index ec797cbff15..ea22cd7fe38 100644
--- a/lisp/international/quail.el
+++ b/lisp/international/quail.el
@@ -897,7 +897,7 @@ The format of KBD-LAYOUT is the same as `quail-keyboard-layout'."
897The variable `quail-keyboard-layout-type' holds the currently selected 897The variable `quail-keyboard-layout-type' holds the currently selected
898keyboard type." 898keyboard type."
899 (interactive 899 (interactive
900 (list (completing-read "Keyboard type (default, current choice): " 900 (list (completing-read "Keyboard type (default current choice): "
901 quail-keyboard-layout-alist 901 quail-keyboard-layout-alist
902 nil t))) 902 nil t)))
903 (or (and keyboard-type (> (length keyboard-type) 0)) 903 (or (and keyboard-type (> (length keyboard-type) 0))
diff --git a/lisp/locate.el b/lisp/locate.el
index cbf2e4866ab..390e0ec72b3 100644
--- a/lisp/locate.el
+++ b/lisp/locate.el
@@ -209,7 +209,7 @@ With prefix arg, prompt for the locate command to run."
209 (input 209 (input
210 (read-from-minibuffer 210 (read-from-minibuffer
211 (if (> (length default) 0) 211 (if (> (length default) 0)
212 (format "Locate (default `%s'): " default) 212 (format "Locate (default %s): " default)
213 (format "Locate: ")) 213 (format "Locate: "))
214 nil nil nil 'locate-history-list default t))) 214 nil nil nil 'locate-history-list default t)))
215 (and (equal input "") default 215 (and (equal input "") default
diff --git a/lisp/log-edit.el b/lisp/log-edit.el
index 4e179ef8bad..54249eb52e3 100644
--- a/lisp/log-edit.el
+++ b/lisp/log-edit.el
@@ -383,7 +383,7 @@ If you want to abort the commit, simply delete the buffer."
383 (equal (log-edit-files) log-edit-initial-files))) 383 (equal (log-edit-files) log-edit-initial-files)))
384 (progn 384 (progn
385 (log-edit-show-files) 385 (log-edit-show-files)
386 (not (y-or-n-p "Really commit ? ")))) 386 (not (y-or-n-p "Really commit? "))))
387 (progn (when (not win) (log-edit-hide-buf)) 387 (progn (when (not win) (log-edit-hide-buf))
388 (message "Oh, well! Later maybe?")) 388 (message "Oh, well! Later maybe?"))
389 (run-hooks 'log-edit-done-hook) 389 (run-hooks 'log-edit-done-hook)
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el
index 270d2cd6385..06af543b4da 100644
--- a/lisp/mail/mailabbrev.el
+++ b/lisp/mail/mailabbrev.el
@@ -528,7 +528,7 @@ of a mail alias. The value is set up, buffer-local, when first needed.")
528 (default-directory (expand-file-name "~/")) 528 (default-directory (expand-file-name "~/"))
529 (def mail-personal-alias-file)) 529 (def mail-personal-alias-file))
530 (read-file-name 530 (read-file-name
531 (format "Read additional aliases from file: (default %s) " 531 (format "Read additional aliases from file (default %s): "
532 def) 532 def)
533 default-directory 533 default-directory
534 (expand-file-name def default-directory) 534 (expand-file-name def default-directory)
@@ -542,7 +542,7 @@ of a mail alias. The value is set up, buffer-local, when first needed.")
542 (default-directory (expand-file-name "~/")) 542 (default-directory (expand-file-name "~/"))
543 (def mail-personal-alias-file)) 543 (def mail-personal-alias-file))
544 (read-file-name 544 (read-file-name
545 (format "Read mail aliases from file: (default %s) " def) 545 (format "Read mail aliases from file (default %s): " def)
546 default-directory 546 default-directory
547 (expand-file-name def default-directory) 547 (expand-file-name def default-directory)
548 t)))) 548 t))))
diff --git a/lisp/mail/mailclient.el b/lisp/mail/mailclient.el
new file mode 100644
index 00000000000..eb12d97f576
--- /dev/null
+++ b/lisp/mail/mailclient.el
@@ -0,0 +1,174 @@
1;;; mailclient.el --- mail sending via system's mail client. -*- byte-compile-dynamic: t -*-
2
3;; Copyright (C) 2005 Free Software Foundation
4
5;; Author: David Reitter <david.reitter@gmail.com>
6;; Keywords: mail
7
8;; This file is part of GNU Emacs.
9
10;; GNU Emacs is free software; you can redistribute it and/or modify
11;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation; either version 2, or (at your option)
13;; any later version.
14
15;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; GNU General Public License for more details.
19
20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs; see the file COPYING. If not, write to the
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA.
24
25;;; Commentary:
26
27;; This package allows to hand over a buffer to be sent off
28;; via the system's designated e-mail client.
29;; Note that the e-mail client will display the contents of the buffer
30;; again for editing.
31;; The e-mail client is taken to be whoever handles a mailto: URL
32;; via `browse-url'.
33;; Mailto: URLs are composed according to RFC2368.
34
35;; MIME bodies are not supported - we rather expect the mail client
36;; to encode the body and add, for example, a digital signature.
37;; The mailto URL RFC calls for "short text messages that are
38;; actually the content of automatic processing."
39;; So mailclient.el is ideal for situations where an e-mail is
40;; generated automatically, and the user can edit it in the
41;; mail client (e.g. bug-reports).
42
43;; To activate:
44;; (setq send-mail-function 'mailclient-send-it) ; if you use `mail'
45
46;;; Code:
47
48
49(require 'sendmail) ;; for mail-sendmail-undelimit-header
50(require 'mail-utils) ;; for mail-fetch-field
51
52(defcustom mailclient-place-body-on-clipboard-flag
53 (fboundp 'w32-set-clipboard-data)
54 "If non-nil, put the e-mail body on the clipboard in mailclient.
55This is useful on systems where only short mailto:// URLs are
56supported. Defaults to non-nil on Windows, nil otherwise."
57 :type 'boolean
58 :group 'mail)
59
60(defun mailclient-encode-string-as-url (string)
61 "Convert STRING to a URL, using utf-8 as encoding."
62 (apply (function concat)
63 (mapcar
64 (lambda (char)
65 (cond
66 ((eq char ?\x20) "%20") ;; space
67 ((eq char ?\n) "%0D%0A") ;; newline
68 ((string-match "[-a-zA-Z0-9_:/.@]" (char-to-string char))
69 (char-to-string char)) ;; printable
70 (t ;; everything else
71 (format "%%%02x" char)))) ;; escape
72 ;; Convert string to list of chars
73 (append (encode-coding-string string 'utf-8)))))
74
75(defvar mailclient-delim-static "?")
76(defun mailclient-url-delim ()
77 (let ((current mailclient-delim-static))
78 (setq mailclient-delim-static "&")
79 current))
80
81(defun mailclient-gather-addresses (str &optional drop-first-name)
82 (let ((field (mail-fetch-field str nil t)))
83 (if field
84 (save-excursion
85 (let ((first t)
86 (result ""))
87 (mapc
88 (lambda (recp)
89 (setq result
90 (concat
91 result
92 (if (and drop-first-name
93 first)
94 ""
95 (concat (mailclient-url-delim) str "="))
96 (mailclient-encode-string-as-url
97 recp)))
98 (setq first nil))
99 (split-string
100 (mail-strip-quoted-names field) "\, *"))
101 result)))))
102
103;;;###autoload
104(defun mailclient-send-it ()
105 "Pass current buffer on to the system's mail client.
106Suitable value for `send-mail-function'.
107The mail client is taken to be the handler of mailto URLs."
108 (require 'mail-utils)
109 (let ((case-fold-search nil)
110 delimline
111 (mailbuf (current-buffer)))
112 (unwind-protect
113 (with-temp-buffer
114 (insert-buffer-substring mailbuf)
115 ;; Move to header delimiter
116 (mail-sendmail-undelimit-header)
117 (setq delimline (point-marker))
118 (if mail-aliases
119 (expand-mail-aliases (point-min) delimline))
120 (goto-char (point-min))
121 ;; ignore any blank lines in the header
122 (while (and (re-search-forward "\n\n\n*" delimline t)
123 (< (point) delimline))
124 (replace-match "\n"))
125 (let ((case-fold-search t))
126 ;; initialize limiter
127 (setq mailclient-delim-static "?")
128 ;; construct and call up mailto URL
129 (browse-url
130 (concat
131 (save-excursion
132 (narrow-to-region (point-min) delimline)
133 (concat
134 "mailto:"
135 ;; some of the headers according to RFC822
136 (mailclient-gather-addresses "To"
137 'drop-first-name)
138 (mailclient-gather-addresses "cc" )
139 (mailclient-gather-addresses "bcc" )
140 (mailclient-gather-addresses "Resent-To" )
141 (mailclient-gather-addresses "Resent-cc" )
142 (mailclient-gather-addresses "Resent-bcc" )
143 (mailclient-gather-addresses "Reply-To" )
144 ;; The From field is not honored for now: it's
145 ;; not necessarily configured. The mail client
146 ;; knows the user's address(es)
147 ;; (mailclient-gather-addresses "From" )
148 ;; subject line
149 (let ((subj (mail-fetch-field "Subject" nil t)))
150 (widen) ;; so we can read the body later on
151 (if subj ;; if non-blank
152 ;; the mail client will deal with
153 ;; warning the user etc.
154 (concat (mailclient-url-delim) "subject="
155 (mailclient-encode-string-as-url subj))
156 ""))))
157 ;; body
158 (concat
159 (mailclient-url-delim) "body="
160 (mailclient-encode-string-as-url
161 (if mailclient-place-body-on-clipboard-flag
162 (progn
163 (clipboard-kill-ring-save
164 (+ 1 delimline) (point-max))
165 (concat
166 "*** E-Mail body has been placed on clipboard, "
167 "please paste them here! ***"))
168 ;; else
169 (buffer-substring (+ 1 delimline) (point-max))))))))))))
170
171(provide 'mailclient)
172
173;; arch-tag: 35d10fc8-a1bc-4f29-a4e6-c288e53578ef
174;;; mailclient.el ends here
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 9c4fe335828..1016b1ed1e6 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -3038,13 +3038,14 @@ Interactively, empty argument means use same regexp used last time."
3038 (interactive 3038 (interactive
3039 (let* ((reversep (< (prefix-numeric-value current-prefix-arg) 0)) 3039 (let* ((reversep (< (prefix-numeric-value current-prefix-arg) 0))
3040 (prompt 3040 (prompt
3041 (concat (if reversep "Reverse " "") "Rmail search (regexp): ")) 3041 (concat (if reversep "Reverse " "") "Rmail search (regexp"))
3042 regexp) 3042 regexp)
3043 (if rmail-search-last-regexp 3043 (setq prompt
3044 (setq prompt (concat prompt 3044 (concat prompt
3045 "(default " 3045 (if rmail-search-last-regexp
3046 rmail-search-last-regexp 3046 (concat ", default "
3047 ") "))) 3047 rmail-search-last-regexp "): ")
3048 "): ")))
3048 (setq regexp (read-string prompt)) 3049 (setq regexp (read-string prompt))
3049 (cond ((not (equal regexp "")) 3050 (cond ((not (equal regexp ""))
3050 (setq rmail-search-last-regexp regexp)) 3051 (setq rmail-search-last-regexp regexp))
@@ -3109,13 +3110,14 @@ Interactively, empty argument means use same regexp used last time."
3109 (interactive 3110 (interactive
3110 (let* ((reversep (>= (prefix-numeric-value current-prefix-arg) 0)) 3111 (let* ((reversep (>= (prefix-numeric-value current-prefix-arg) 0))
3111 (prompt 3112 (prompt
3112 (concat (if reversep "Reverse " "") "Rmail search (regexp): ")) 3113 (concat (if reversep "Reverse " "") "Rmail search (regexp"))
3113 regexp) 3114 regexp)
3114 (if rmail-search-last-regexp 3115 (setq prompt
3115 (setq prompt (concat prompt 3116 (concat prompt
3116 "(default " 3117 (if rmail-search-last-regexp
3117 rmail-search-last-regexp 3118 (concat ", default "
3118 ") "))) 3119 rmail-search-last-regexp "): ")
3120 "): ")))
3119 (setq regexp (read-string prompt)) 3121 (setq regexp (read-string prompt))
3120 (cond ((not (equal regexp "")) 3122 (cond ((not (equal regexp ""))
3121 (setq rmail-search-last-regexp regexp)) 3123 (setq rmail-search-last-regexp regexp))
diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el
index a3b46ddaedf..d97c181eb81 100644
--- a/lisp/mail/rmailout.el
+++ b/lisp/mail/rmailout.el
@@ -63,9 +63,9 @@ Set `rmail-default-rmail-file' to this name as well as returning it."
63 (let ((read-file 63 (let ((read-file
64 (expand-file-name 64 (expand-file-name
65 (read-file-name 65 (read-file-name
66 (concat "Output message to Rmail file: (default " 66 (concat "Output message to Rmail file (default "
67 (file-name-nondirectory default-file) 67 (file-name-nondirectory default-file)
68 ") ") 68 "): ")
69 (file-name-directory default-file) 69 (file-name-directory default-file)
70 (abbreviate-file-name default-file)) 70 (abbreviate-file-name default-file))
71 (file-name-directory default-file)))) 71 (file-name-directory default-file))))
@@ -95,9 +95,9 @@ Set `rmail-default-file' to this name as well as returning it."
95 (let ((read-file 95 (let ((read-file
96 (expand-file-name 96 (expand-file-name
97 (read-file-name 97 (read-file-name
98 (concat "Output message to Unix mail file: (default " 98 (concat "Output message to Unix mail file (default "
99 (file-name-nondirectory default-file) 99 (file-name-nondirectory default-file)
100 ") ") 100 "): ")
101 (file-name-directory default-file) 101 (file-name-directory default-file)
102 (abbreviate-file-name default-file)) 102 (abbreviate-file-name default-file))
103 (file-name-directory default-file)))) 103 (file-name-directory default-file))))
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index ad2c275a679..497f2f75301 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -1346,13 +1346,14 @@ Interactively, empty argument means use same regexp used last time."
1346 (interactive 1346 (interactive
1347 (let* ((reversep (>= (prefix-numeric-value current-prefix-arg) 0)) 1347 (let* ((reversep (>= (prefix-numeric-value current-prefix-arg) 0))
1348 (prompt 1348 (prompt
1349 (concat (if reversep "Reverse " "") "Rmail search (regexp): ")) 1349 (concat (if reversep "Reverse " "") "Rmail search (regexp"))
1350 regexp) 1350 regexp)
1351 (if rmail-search-last-regexp 1351 (setq prompt
1352 (setq prompt (concat prompt 1352 (concat prompt
1353 "(default " 1353 (if rmail-search-last-regexp
1354 rmail-search-last-regexp 1354 (concat ", default "
1355 ") "))) 1355 rmail-search-last-regexp "): ")
1356 "): ")))
1356 (setq regexp (read-string prompt)) 1357 (setq regexp (read-string prompt))
1357 (cond ((not (equal regexp "")) 1358 (cond ((not (equal regexp ""))
1358 (setq rmail-search-last-regexp regexp)) 1359 (setq rmail-search-last-regexp regexp))
@@ -1377,13 +1378,14 @@ Interactively, empty argument means use same regexp used last time."
1377 (interactive 1378 (interactive
1378 (let* ((reversep (< (prefix-numeric-value current-prefix-arg) 0)) 1379 (let* ((reversep (< (prefix-numeric-value current-prefix-arg) 0))
1379 (prompt 1380 (prompt
1380 (concat (if reversep "Reverse " "") "Rmail search (regexp): ")) 1381 (concat (if reversep "Reverse " "") "Rmail search (regexp"))
1381 regexp) 1382 regexp)
1382 (if rmail-search-last-regexp 1383 (setq prompt
1383 (setq prompt (concat prompt 1384 (concat prompt
1384 "(default " 1385 (if rmail-search-last-regexp
1385 rmail-search-last-regexp 1386 (concat ", default "
1386 ") "))) 1387 rmail-search-last-regexp "): ")
1388 "): ")))
1387 (setq regexp (read-string prompt)) 1389 (setq regexp (read-string prompt))
1388 (cond ((not (equal regexp "")) 1390 (cond ((not (equal regexp ""))
1389 (setq rmail-search-last-regexp regexp)) 1391 (setq rmail-search-last-regexp regexp))
diff --git a/lisp/man.el b/lisp/man.el
index 60fc7c009e1..6c8a5a18b44 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -663,10 +663,10 @@ all sections related to a subject, put something appropriate into the
663 (interactive 663 (interactive
664 (list (let* ((default-entry (Man-default-man-entry)) 664 (list (let* ((default-entry (Man-default-man-entry))
665 (input (read-string 665 (input (read-string
666 (format "Manual entry%s: " 666 (format "Manual entry%s"
667 (if (string= default-entry "") 667 (if (string= default-entry "")
668 "" 668 ": "
669 (format " (default %s)" default-entry))) 669 (format " (default %s): " default-entry)))
670 nil nil default-entry))) 670 nil nil default-entry)))
671 (if (string= input "") 671 (if (string= input "")
672 (error "No man args given") 672 (error "No man args given")
@@ -1273,7 +1273,7 @@ Returns t if section is found, nil otherwise."
1273 (let* ((default (aheadsym Man-sections-alist)) 1273 (let* ((default (aheadsym Man-sections-alist))
1274 (completion-ignore-case t) 1274 (completion-ignore-case t)
1275 chosen 1275 chosen
1276 (prompt (concat "Go to section: (default " default ") "))) 1276 (prompt (concat "Go to section (default " default "): ")))
1277 (setq chosen (completing-read prompt Man-sections-alist)) 1277 (setq chosen (completing-read prompt Man-sections-alist))
1278 (if (or (not chosen) 1278 (if (or (not chosen)
1279 (string= chosen "")) 1279 (string= chosen ""))
@@ -1328,7 +1328,7 @@ Specify which REFERENCE to use; default is based on word at point."
1328 Man-refpages-alist)) 1328 Man-refpages-alist))
1329 (aheadsym Man-refpages-alist))) 1329 (aheadsym Man-refpages-alist)))
1330 chosen 1330 chosen
1331 (prompt (concat "Refer to: (default " default ") "))) 1331 (prompt (concat "Refer to (default " default "): ")))
1332 (setq chosen (completing-read prompt Man-refpages-alist)) 1332 (setq chosen (completing-read prompt Man-refpages-alist))
1333 (if (or (not chosen) 1333 (if (or (not chosen)
1334 (string= chosen "")) 1334 (string= chosen ""))
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 631bc5cb6a3..e851b399ce0 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,10 @@
12005-09-24 Emilio C. Lopes <eclig@gmx.net>
2
3 * mh-mime.el (mh-compose-forward, mh-mhn-compose-forw):
4 * mh-comp.el (mh-insert-letter):
5 * mh-utils.el (mh-prompt-for-folder):
6 Follow convention for reading with the minibuffer.
7
12005-09-19 Juanma Barranquero <lekktu@gmail.com> 82005-09-19 Juanma Barranquero <lekktu@gmail.com>
2 9
3 * mh-print.el (mh-ps-print-msg-show): Fix misplaced parenthesis in 10 * mh-print.el (mh-ps-print-msg-show): Fix misplaced parenthesis in
diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el
index 59111098bf1..a99c05debea 100644
--- a/lisp/mh-e/mh-comp.el
+++ b/lisp/mh-e/mh-comp.el
@@ -1424,10 +1424,10 @@ not indent and do not delete headers. Leaves the mark before the letter
1424and point after it." 1424and point after it."
1425 (interactive 1425 (interactive
1426 (list (mh-prompt-for-folder "Message from" mh-sent-from-folder nil) 1426 (list (mh-prompt-for-folder "Message from" mh-sent-from-folder nil)
1427 (read-input (format "Message number%s: " 1427 (read-input (concat "Message number"
1428 (if (numberp mh-sent-from-msg) 1428 (if (numberp mh-sent-from-msg)
1429 (format " [%d]" mh-sent-from-msg) 1429 (format " (default %d): " mh-sent-from-msg)
1430 ""))) 1430 ": ")))
1431 current-prefix-arg)) 1431 current-prefix-arg))
1432 (save-restriction 1432 (save-restriction
1433 (narrow-to-region (point) (point)) 1433 (narrow-to-region (point) (point))
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index 980942a0f47..527d322c48a 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -81,10 +81,10 @@ If any of the optional arguments are absent, they are prompted for."
81 (interactive (list 81 (interactive (list
82 (read-string "Forw Content-description: ") 82 (read-string "Forw Content-description: ")
83 (mh-prompt-for-folder "Message from" mh-sent-from-folder nil) 83 (mh-prompt-for-folder "Message from" mh-sent-from-folder nil)
84 (read-string (format "Messages%s: " 84 (read-string (concat "Messages"
85 (if (numberp mh-sent-from-msg) 85 (if (numberp mh-sent-from-msg)
86 (format " [%d]" mh-sent-from-msg) 86 (format " (default %d): " mh-sent-from-msg)
87 ""))))) 87 ": ")))))
88 (if (equal mh-compose-insertion 'gnus) 88 (if (equal mh-compose-insertion 'gnus)
89 (mh-mml-forward-message description folder message) 89 (mh-mml-forward-message description folder message)
90 (mh-mhn-compose-forw description folder message))) 90 (mh-mhn-compose-forw description folder message)))
@@ -374,10 +374,10 @@ See also \\[mh-edit-mhn]."
374 (interactive (list 374 (interactive (list
375 (read-string "Forw Content-description: ") 375 (read-string "Forw Content-description: ")
376 (mh-prompt-for-folder "Message from" mh-sent-from-folder nil) 376 (mh-prompt-for-folder "Message from" mh-sent-from-folder nil)
377 (read-string (format "Messages%s: " 377 (read-string (concat "Messages"
378 (if (numberp mh-sent-from-msg) 378 (if (numberp mh-sent-from-msg)
379 (format " [%d]" mh-sent-from-msg) 379 (format " (default %d): " mh-sent-from-msg)
380 ""))))) 380 ": ")))))
381 (beginning-of-line) 381 (beginning-of-line)
382 (insert "#forw [") 382 (insert "#forw [")
383 (and description 383 (and description
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index 522ccda088c..0e608e52062 100644
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -2315,10 +2315,10 @@ non-nil then the function will accept the folder +, which means all folders
2315when used in searching." 2315when used in searching."
2316 (if (null default) 2316 (if (null default)
2317 (setq default "")) 2317 (setq default ""))
2318 (let* ((default-string (cond (default-string (format "[%s] " default-string)) 2318 (let* ((default-string (cond (default-string (format " (default %s)" default-string))
2319 ((equal "" default) "") 2319 ((equal "" default) "")
2320 (t (format "[%s] " default)))) 2320 (t (format " (default %s)" default))))
2321 (prompt (format "%s folder: %s" prompt default-string)) 2321 (prompt (format "%s folder%s: " prompt default-string))
2322 (mh-current-folder-name mh-current-folder) 2322 (mh-current-folder-name mh-current-folder)
2323 read-name folder-name) 2323 read-name folder-name)
2324 (while (and (setq read-name (mh-folder-completing-read 2324 (while (and (setq read-name (mh-folder-completing-read
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 3b591694cfe..5390abacb5c 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -405,7 +405,6 @@ MODE-LINE-P non-nil means dragging a mode line; nil means a header line."
405 (start-event-window (posn-window start)) 405 (start-event-window (posn-window start))
406 (start-event-frame (window-frame start-event-window)) 406 (start-event-frame (window-frame start-event-window))
407 (start-nwindows (count-windows t)) 407 (start-nwindows (count-windows t))
408 (old-selected-window (selected-window))
409 (minibuffer (frame-parameter nil 'minibuffer)) 408 (minibuffer (frame-parameter nil 'minibuffer))
410 should-enlarge-minibuffer event mouse y top bot edges wconfig growth) 409 should-enlarge-minibuffer event mouse y top bot edges wconfig growth)
411 (track-mouse 410 (track-mouse
@@ -553,7 +552,6 @@ resized by dragging their header-line."
553 (start-event-frame (window-frame (car (car (cdr start-event))))) 552 (start-event-frame (window-frame (car (car (cdr start-event)))))
554 (start-event-window (car (car (cdr start-event)))) 553 (start-event-window (car (car (cdr start-event))))
555 (start-nwindows (count-windows t)) 554 (start-nwindows (count-windows t))
556 (old-selected-window (selected-window))
557 event mouse x left right edges wconfig growth 555 event mouse x left right edges wconfig growth
558 (which-side 556 (which-side
559 (or (cdr (assq 'vertical-scroll-bars (frame-parameters start-event-frame))) 557 (or (cdr (assq 'vertical-scroll-bars (frame-parameters start-event-frame)))
@@ -745,9 +743,11 @@ Upon exit, point is at the far edge of the newly visible text."
745 (goto-char opoint)))) 743 (goto-char opoint))))
746 744
747;; Create an overlay and immediately delete it, to get "overlay in no buffer". 745;; Create an overlay and immediately delete it, to get "overlay in no buffer".
748(defvar mouse-drag-overlay (make-overlay 1 1)) 746(defconst mouse-drag-overlay
749(delete-overlay mouse-drag-overlay) 747 (let ((ol (make-overlay (point-min) (point-min))))
750(overlay-put mouse-drag-overlay 'face 'region) 748 (delete-overlay ol)
749 (overlay-put ol 'face 'region)
750 ol))
751 751
752(defvar mouse-selection-click-count 0) 752(defvar mouse-selection-click-count 0)
753 753
@@ -858,14 +858,34 @@ at the same position."
858 "mouse-1" (substring msg 7))))))) 858 "mouse-1" (substring msg 7)))))))
859 msg) 859 msg)
860 860
861(defun mouse-move-drag-overlay (ol start end mode)
862 (unless (= start end)
863 ;; Go to START first, so that when we move to END, if it's in the middle
864 ;; of intangible text, point jumps in the direction away from START.
865 ;; Don't do it if START=END otherwise a single click risks selecting
866 ;; a region if it's on intangible text. This exception was originally
867 ;; only applied on entry to mouse-drag-region, which had the problem
868 ;; that a tiny move during a single-click would cause the intangible
869 ;; text to be selected.
870 (goto-char start)
871 (goto-char end)
872 (setq end (point)))
873 (let ((range (mouse-start-end start end mode)))
874 (move-overlay ol (car range) (nth 1 range))))
875
861(defun mouse-drag-region-1 (start-event) 876(defun mouse-drag-region-1 (start-event)
862 (mouse-minibuffer-check start-event) 877 (mouse-minibuffer-check start-event)
863 (let* ((echo-keystrokes 0) 878 (setq mouse-selection-click-count-buffer (current-buffer))
879 (let* ((original-window (selected-window))
880 ;; We've recorded what we needed from the current buffer and
881 ;; window, now let's jump to the place of the event, where things
882 ;; are happening.
883 (_ (mouse-set-point start-event))
884 (echo-keystrokes 0)
864 (start-posn (event-start start-event)) 885 (start-posn (event-start start-event))
865 (start-point (posn-point start-posn)) 886 (start-point (posn-point start-posn))
866 (start-window (posn-window start-posn)) 887 (start-window (posn-window start-posn))
867 (start-window-start (window-start start-window)) 888 (start-window-start (window-start start-window))
868 (start-frame (window-frame start-window))
869 (start-hscroll (window-hscroll start-window)) 889 (start-hscroll (window-hscroll start-window))
870 (bounds (window-edges start-window)) 890 (bounds (window-edges start-window))
871 (make-cursor-line-fully-visible nil) 891 (make-cursor-line-fully-visible nil)
@@ -876,39 +896,34 @@ at the same position."
876 (1- (nth 3 bounds)))) 896 (1- (nth 3 bounds))))
877 (on-link (and mouse-1-click-follows-link 897 (on-link (and mouse-1-click-follows-link
878 (or mouse-1-click-in-non-selected-windows 898 (or mouse-1-click-in-non-selected-windows
879 (eq start-window (selected-window))))) 899 (eq start-window original-window))
880 remap-double-click 900 ;; Use start-point before the intangibility
881 (click-count (1- (event-click-count start-event)))) 901 ;; treatment, in case we click on a link inside an
902 ;; intangible text.
903 (mouse-on-link-p start-point)))
904 (click-count (1- (event-click-count start-event)))
905 (remap-double-click (and on-link
906 (eq mouse-1-click-follows-link 'double)
907 (= click-count 1))))
882 (setq mouse-selection-click-count click-count) 908 (setq mouse-selection-click-count click-count)
883 (setq mouse-selection-click-count-buffer (current-buffer))
884 (mouse-set-point start-event)
885 ;; In case the down click is in the middle of some intangible text, 909 ;; In case the down click is in the middle of some intangible text,
886 ;; use the end of that text, and put it in START-POINT. 910 ;; use the end of that text, and put it in START-POINT.
887 (if (< (point) start-point) 911 (if (< (point) start-point)
888 (goto-char start-point)) 912 (goto-char start-point))
889 (setq start-point (point)) 913 (setq start-point (point))
890 (setq on-link (and on-link 914 (if remap-double-click ;; Don't expand mouse overlay in links
891 (mouse-on-link-p start-point)))
892 (setq remap-double-click (and on-link
893 (eq mouse-1-click-follows-link 'double)
894 (= click-count 1)))
895 (if remap-double-click ;; Don't expand mouse overlay in links
896 (setq click-count 0)) 915 (setq click-count 0))
897 (let ((range (mouse-start-end start-point start-point click-count))) 916 (mouse-move-drag-overlay mouse-drag-overlay start-point start-point
898 (move-overlay mouse-drag-overlay (car range) (nth 1 range) 917 click-count)
899 (window-buffer start-window)) 918 (overlay-put mouse-drag-overlay 'window start-window)
900 (overlay-put mouse-drag-overlay 'window (selected-window)))
901 (deactivate-mark) 919 (deactivate-mark)
902 ;; end-of-range is used only in the single-click case. 920 (let (event end end-point last-end-point)
903 ;; It is the place where the drag has reached so far
904 ;; (but not outside the window where the drag started).
905 (let (event end end-point last-end-point (end-of-range (point)))
906 (track-mouse 921 (track-mouse
907 (while (progn 922 (while (progn
908 (setq event (read-event)) 923 (setq event (read-event))
909 (or (mouse-movement-p event) 924 (or (mouse-movement-p event)
910 (memq (car-safe event) '(switch-frame select-window)))) 925 (memq (car-safe event) '(switch-frame select-window))))
911 (if (memq (car-safe event) '(switch-frame select-window)) 926 (if (memq (car-safe event) '(switch-frame select-window))
912 nil 927 nil
913 (setq end (event-end event) 928 (setq end (event-end event)
914 end-point (posn-point end)) 929 end-point (posn-point end))
@@ -919,53 +934,33 @@ at the same position."
919 ;; Are we moving within the original window? 934 ;; Are we moving within the original window?
920 ((and (eq (posn-window end) start-window) 935 ((and (eq (posn-window end) start-window)
921 (integer-or-marker-p end-point)) 936 (integer-or-marker-p end-point))
922 ;; Go to START-POINT first, so that when we move to END-POINT, 937 (mouse-move-drag-overlay mouse-drag-overlay start-point end-point click-count))
923 ;; if it's in the middle of intangible text,
924 ;; point jumps in the direction away from START-POINT.
925 (goto-char start-point)
926 (goto-char end-point)
927 (if (zerop (% click-count 3))
928 (setq end-of-range (point)))
929 (let ((range (mouse-start-end start-point (point) click-count)))
930 (move-overlay mouse-drag-overlay (car range) (nth 1 range))))
931 938
932 (t 939 (t
933 (let ((mouse-row (cdr (cdr (mouse-position))))) 940 (let ((mouse-row (cdr (cdr (mouse-position)))))
934 (cond 941 (cond
935 ((null mouse-row)) 942 ((null mouse-row))
936 ((< mouse-row top) 943 ((< mouse-row top)
937 (mouse-scroll-subr start-window (- mouse-row top) 944 (mouse-scroll-subr start-window (- mouse-row top)
938 mouse-drag-overlay start-point) 945 mouse-drag-overlay start-point))
939 ;; Without this, point tends to jump back to the starting 946 ((>= mouse-row bottom)
940 ;; position where the mouse button was pressed down. 947 (mouse-scroll-subr start-window (1+ (- mouse-row bottom))
941 (setq end-of-range (overlay-start mouse-drag-overlay))) 948 mouse-drag-overlay start-point)))))))))
942 ((>= mouse-row bottom)
943 (mouse-scroll-subr start-window (1+ (- mouse-row bottom))
944 mouse-drag-overlay start-point)
945 (setq end-of-range (overlay-end mouse-drag-overlay))))))))))
946 949
947 ;; In case we did not get a mouse-motion event 950 ;; In case we did not get a mouse-motion event
948 ;; for the final move of the mouse before a drag event 951 ;; for the final move of the mouse before a drag event
949 ;; pretend that we did get one. 952 ;; pretend that we did get one.
950 (when (and (memq 'drag (event-modifiers (car-safe event))) 953 (when (and (memq 'drag (event-modifiers (car-safe event)))
951 (setq end (event-end event) 954 (setq end (event-end event)
952 end-point (posn-point end)) 955 end-point (posn-point end))
953 (eq (posn-window end) start-window) 956 (eq (posn-window end) start-window)
954 (integer-or-marker-p end-point)) 957 (integer-or-marker-p end-point))
955 ;; Go to START-POINT first, so that when we move to END-POINT, 958 (mouse-move-drag-overlay mouse-drag-overlay start-point end-point click-count))
956 ;; if it's in the middle of intangible text,
957 ;; point jumps in the direction away from START-POINT.
958 (goto-char start-point)
959 (goto-char end-point)
960 (if (zerop (% click-count 3))
961 (setq end-of-range (point)))
962 (let ((range (mouse-start-end start-point (point) click-count)))
963 (move-overlay mouse-drag-overlay (car range) (nth 1 range))))
964 959
965 (if (consp event) 960 (if (consp event)
966 (let ((fun (key-binding (vector (car event))))) 961 (let ((fun (key-binding (vector (car event)))))
967 ;; Run the binding of the terminating up-event, if possible. 962 ;; Run the binding of the terminating up-event, if possible.
968 ;; In the case of a multiple click, it gives the wrong results, 963 ;; In the case of a multiple click, it gives the wrong results,
969 ;; because it would fail to set up a region. 964 ;; because it would fail to set up a region.
970 (if (not (= (overlay-start mouse-drag-overlay) 965 (if (not (= (overlay-start mouse-drag-overlay)
971 (overlay-end mouse-drag-overlay))) 966 (overlay-end mouse-drag-overlay)))
@@ -976,74 +971,75 @@ at the same position."
976 ;; The end that comes from where we ended the drag. 971 ;; The end that comes from where we ended the drag.
977 ;; Point goes here. 972 ;; Point goes here.
978 (region-termination 973 (region-termination
979 (if (and stop-point (< stop-point start-point)) 974 (if (and stop-point (< stop-point start-point))
980 (overlay-start mouse-drag-overlay) 975 (overlay-start mouse-drag-overlay)
981 (overlay-end mouse-drag-overlay))) 976 (overlay-end mouse-drag-overlay)))
982 ;; The end that comes from where we started the drag. 977 ;; The end that comes from where we started the drag.
983 ;; Mark goes there. 978 ;; Mark goes there.
984 (region-commencement 979 (region-commencement
985 (- (+ (overlay-end mouse-drag-overlay) 980 (- (+ (overlay-end mouse-drag-overlay)
986 (overlay-start mouse-drag-overlay)) 981 (overlay-start mouse-drag-overlay))
987 region-termination)) 982 region-termination))
988 last-command this-command) 983 last-command this-command)
989 (push-mark region-commencement t t) 984 (push-mark region-commencement t t)
990 (goto-char region-termination) 985 (goto-char region-termination)
991 ;; Don't let copy-region-as-kill set deactivate-mark. 986 ;; Don't let copy-region-as-kill set deactivate-mark.
992 (when mouse-drag-copy-region 987 (when mouse-drag-copy-region
993 (let (deactivate-mark) 988 (let (deactivate-mark)
994 (copy-region-as-kill (point) (mark t)))) 989 (copy-region-as-kill (point) (mark t))))
995 (let ((buffer (current-buffer))) 990 (let ((buffer (current-buffer)))
996 (mouse-show-mark) 991 (mouse-show-mark)
997 ;; mouse-show-mark can call read-event, 992 ;; mouse-show-mark can call read-event,
998 ;; and that means the Emacs server could switch buffers 993 ;; and that means the Emacs server could switch buffers
999 ;; under us. If that happened, 994 ;; under us. If that happened,
1000 ;; avoid trying to use the region. 995 ;; avoid trying to use the region.
1001 (and (mark t) mark-active 996 (and (mark t) mark-active
1002 (eq buffer (current-buffer)) 997 (eq buffer (current-buffer))
1003 (mouse-set-region-1)))) 998 (mouse-set-region-1))))
1004 (delete-overlay mouse-drag-overlay) 999 (delete-overlay mouse-drag-overlay)
1005 ;; Run the binding of the terminating up-event. 1000 ;; Run the binding of the terminating up-event.
1006 (when (and (functionp fun) 1001 (when (and (functionp fun)
1007 (= start-hscroll (window-hscroll start-window)) 1002 (= start-hscroll (window-hscroll start-window))
1008 ;; Don't run the up-event handler if the 1003 ;; Don't run the up-event handler if the
1009 ;; window start changed in a redisplay after 1004 ;; window start changed in a redisplay after
1010 ;; the mouse-set-point for the down-mouse 1005 ;; the mouse-set-point for the down-mouse
1011 ;; event at the beginning of this function. 1006 ;; event at the beginning of this function.
1012 ;; When the window start has changed, the 1007 ;; When the window start has changed, the
1013 ;; up-mouse event will contain a different 1008 ;; up-mouse event will contain a different
1014 ;; position due to the new window contents, 1009 ;; position due to the new window contents,
1015 ;; and point is set again. 1010 ;; and point is set again.
1016 (or end-point 1011 (or end-point
1017 (= (window-start start-window) 1012 (= (window-start start-window)
1018 start-window-start))) 1013 start-window-start)))
1019 (if (and on-link 1014 (if (and on-link
1020 (or (not end-point) (= end-point start-point)) 1015 (or (not end-point) (= end-point start-point))
1021 (consp event) 1016 (consp event)
1022 (or remap-double-click 1017 (or remap-double-click
1023 (and 1018 (and
1024 (not (eq mouse-1-click-follows-link 'double)) 1019 (not (eq mouse-1-click-follows-link 'double))
1025 (= click-count 0) 1020 (= click-count 0)
1026 (= (event-click-count event) 1) 1021 (= (event-click-count event) 1)
1027 (not (input-pending-p)) 1022 (not (input-pending-p))
1028 (or (not (integerp mouse-1-click-follows-link)) 1023 (or (not (integerp mouse-1-click-follows-link))
1029 (let ((t0 (posn-timestamp (event-start start-event))) 1024 (let ((t0 (posn-timestamp (event-start start-event)))
1030 (t1 (posn-timestamp (event-end event)))) 1025 (t1 (posn-timestamp (event-end event))))
1031 (and (integerp t0) (integerp t1) 1026 (and (integerp t0) (integerp t1)
1032 (if (> mouse-1-click-follows-link 0) 1027 (if (> mouse-1-click-follows-link 0)
1033 (<= (- t1 t0) mouse-1-click-follows-link) 1028 (<= (- t1 t0) mouse-1-click-follows-link)
1034 (< (- t0 t1) mouse-1-click-follows-link))))) 1029 (< (- t0 t1) mouse-1-click-follows-link)))))
1035 (or (not double-click-time) 1030 (or (not double-click-time)
1036 (sit-for 0 (if (integerp double-click-time) 1031 (sit-for 0 (if (integerp double-click-time)
1037 double-click-time 500) t))))) 1032 double-click-time 500) t)))))
1038 (if (or (vectorp on-link) (stringp on-link)) 1033 (if (or (vectorp on-link) (stringp on-link))
1039 (setq event (aref on-link 0)) 1034 (setq event (aref on-link 0))
1040 (setcar event 'mouse-2))) 1035 (setcar event 'mouse-2)))
1041 (setq unread-command-events 1036 (push event unread-command-events))))
1042 (cons event unread-command-events))))) 1037
1038 ;; Case where the end-event is not a cons cell (it's just a boring
1039 ;; char-key-press).
1043 (delete-overlay mouse-drag-overlay))))) 1040 (delete-overlay mouse-drag-overlay)))))
1044 1041
1045;; Commands to handle xterm-style multiple clicks. 1042;; Commands to handle xterm-style multiple clicks.
1046
1047(defun mouse-skip-word (dir) 1043(defun mouse-skip-word (dir)
1048 "Skip over word, over whitespace, or over identical punctuation. 1044 "Skip over word, over whitespace, or over identical punctuation.
1049If DIR is positive skip forward; if negative, skip backward." 1045If DIR is positive skip forward; if negative, skip backward."
@@ -1352,8 +1348,8 @@ If you do this twice in the same position, the selection is killed."
1352 ;; Don't let a subsequent kill command append to this one: 1348 ;; Don't let a subsequent kill command append to this one:
1353 ;; prevent setting this-command to kill-region. 1349 ;; prevent setting this-command to kill-region.
1354 (this-command this-command)) 1350 (this-command this-command))
1355 (if (and (save-excursion 1351 (if (and (with-current-buffer
1356 (set-buffer (window-buffer (posn-window (event-start click)))) 1352 (window-buffer (posn-window (event-start click)))
1357 (and (mark t) (> (mod mouse-selection-click-count 3) 0) 1353 (and (mark t) (> (mod mouse-selection-click-count 3) 0)
1358 ;; Don't be fooled by a recent click in some other buffer. 1354 ;; Don't be fooled by a recent click in some other buffer.
1359 (eq mouse-selection-click-count-buffer 1355 (eq mouse-selection-click-count-buffer
@@ -1416,15 +1412,14 @@ If you do this twice in the same position, the selection is killed."
1416 (goto-char new) 1412 (goto-char new)
1417 (set-mark new)) 1413 (set-mark new))
1418 (setq deactivate-mark nil))) 1414 (setq deactivate-mark nil)))
1419 (kill-new (buffer-substring (point) (mark t)) t) 1415 (kill-new (buffer-substring (point) (mark t)) t))
1420 (mouse-show-mark))
1421 ;; Set the mark where point is, then move where clicked. 1416 ;; Set the mark where point is, then move where clicked.
1422 (mouse-set-mark-fast click) 1417 (mouse-set-mark-fast click)
1423 (if before-scroll 1418 (if before-scroll
1424 (goto-char before-scroll)) 1419 (goto-char before-scroll))
1425 (exchange-point-and-mark) 1420 (exchange-point-and-mark) ;Why??? --Stef
1426 (kill-new (buffer-substring (point) (mark t))) 1421 (kill-new (buffer-substring (point) (mark t))))
1427 (mouse-show-mark)) 1422 (mouse-show-mark)
1428 (mouse-set-region-1) 1423 (mouse-set-region-1)
1429 (setq mouse-save-then-kill-posn 1424 (setq mouse-save-then-kill-posn
1430 (list (car kill-ring) (point) click-posn))))))) 1425 (list (car kill-ring) (point) click-posn)))))))
@@ -1435,10 +1430,13 @@ If you do this twice in the same position, the selection is killed."
1435(global-set-key [M-mouse-3] 'mouse-secondary-save-then-kill) 1430(global-set-key [M-mouse-3] 'mouse-secondary-save-then-kill)
1436(global-set-key [M-mouse-2] 'mouse-yank-secondary) 1431(global-set-key [M-mouse-2] 'mouse-yank-secondary)
1437 1432
1438;; An overlay which records the current secondary selection 1433(defconst mouse-secondary-overlay
1439;; or else is deleted when there is no secondary selection. 1434 (let ((ol (make-overlay (point-min) (point-min))))
1440;; May be nil. 1435 (delete-overlay ol)
1441(defvar mouse-secondary-overlay nil) 1436 (overlay-put ol 'face 'secondary-selection)
1437 ol)
1438 "An overlay which records the current secondary selection.
1439It is deleted when there is no secondary selection.")
1442 1440
1443(defvar mouse-secondary-click-count 0) 1441(defvar mouse-secondary-click-count 0)
1444 1442
@@ -1453,11 +1451,9 @@ and complete the secondary selection."
1453 (interactive "e") 1451 (interactive "e")
1454 (mouse-minibuffer-check click) 1452 (mouse-minibuffer-check click)
1455 (let ((posn (event-start click))) 1453 (let ((posn (event-start click)))
1456 (save-excursion 1454 (with-current-buffer (window-buffer (posn-window posn))
1457 (set-buffer (window-buffer (posn-window posn)))
1458 ;; Cancel any preexisting secondary selection. 1455 ;; Cancel any preexisting secondary selection.
1459 (if mouse-secondary-overlay 1456 (delete-overlay mouse-secondary-overlay)
1460 (delete-overlay mouse-secondary-overlay))
1461 (if (numberp (posn-point posn)) 1457 (if (numberp (posn-point posn))
1462 (progn 1458 (progn
1463 (or mouse-secondary-start 1459 (or mouse-secondary-start
@@ -1472,14 +1468,10 @@ This must be bound to a mouse drag event."
1472 (let ((posn (event-start click)) 1468 (let ((posn (event-start click))
1473 beg 1469 beg
1474 (end (event-end click))) 1470 (end (event-end click)))
1475 (save-excursion 1471 (with-current-buffer (window-buffer (posn-window posn))
1476 (set-buffer (window-buffer (posn-window posn)))
1477 (if (numberp (posn-point posn)) 1472 (if (numberp (posn-point posn))
1478 (setq beg (posn-point posn))) 1473 (setq beg (posn-point posn)))
1479 (if mouse-secondary-overlay 1474 (move-overlay mouse-secondary-overlay beg (posn-point end)))))
1480 (move-overlay mouse-secondary-overlay beg (posn-point end))
1481 (setq mouse-secondary-overlay (make-overlay beg (posn-point end))))
1482 (overlay-put mouse-secondary-overlay 'face 'secondary-selection))))
1483 1475
1484(defun mouse-drag-secondary (start-event) 1476(defun mouse-drag-secondary (start-event)
1485 "Set the secondary selection to the text that the mouse is dragged over. 1477 "Set the secondary selection to the text that the mouse is dragged over.
@@ -1492,7 +1484,6 @@ The function returns a non-nil value if it creates a secondary selection."
1492 (start-posn (event-start start-event)) 1484 (start-posn (event-start start-event))
1493 (start-point (posn-point start-posn)) 1485 (start-point (posn-point start-posn))
1494 (start-window (posn-window start-posn)) 1486 (start-window (posn-window start-posn))
1495 (start-frame (window-frame start-window))
1496 (bounds (window-edges start-window)) 1487 (bounds (window-edges start-window))
1497 (top (nth 1 bounds)) 1488 (top (nth 1 bounds))
1498 (bottom (if (window-minibuffer-p start-window) 1489 (bottom (if (window-minibuffer-p start-window)
@@ -1500,20 +1491,16 @@ The function returns a non-nil value if it creates a secondary selection."
1500 ;; Don't count the mode line. 1491 ;; Don't count the mode line.
1501 (1- (nth 3 bounds)))) 1492 (1- (nth 3 bounds))))
1502 (click-count (1- (event-click-count start-event)))) 1493 (click-count (1- (event-click-count start-event))))
1503 (save-excursion 1494 (with-current-buffer (window-buffer start-window)
1504 (set-buffer (window-buffer start-window))
1505 (setq mouse-secondary-click-count click-count) 1495 (setq mouse-secondary-click-count click-count)
1506 (or mouse-secondary-overlay
1507 (setq mouse-secondary-overlay
1508 (make-overlay (point) (point))))
1509 (overlay-put mouse-secondary-overlay 'face 'secondary-selection)
1510 (if (> (mod click-count 3) 0) 1496 (if (> (mod click-count 3) 0)
1511 ;; Double or triple press: make an initial selection 1497 ;; Double or triple press: make an initial selection
1512 ;; of one word or line. 1498 ;; of one word or line.
1513 (let ((range (mouse-start-end start-point start-point click-count))) 1499 (let ((range (mouse-start-end start-point start-point click-count)))
1514 (set-marker mouse-secondary-start nil) 1500 (set-marker mouse-secondary-start nil)
1515 (move-overlay mouse-secondary-overlay 1 1 1501 ;; Why the double move? --Stef
1516 (window-buffer start-window)) 1502 ;; (move-overlay mouse-secondary-overlay 1 1
1503 ;; (window-buffer start-window))
1517 (move-overlay mouse-secondary-overlay (car range) (nth 1 range) 1504 (move-overlay mouse-secondary-overlay (car range) (nth 1 range)
1518 (window-buffer start-window))) 1505 (window-buffer start-window)))
1519 ;; Single-press: cancel any preexisting secondary selection. 1506 ;; Single-press: cancel any preexisting secondary selection.
@@ -1598,13 +1585,12 @@ is to prevent accidents."
1598 (current-buffer))) 1585 (current-buffer)))
1599 (error "Select or click on the buffer where the secondary selection is"))) 1586 (error "Select or click on the buffer where the secondary selection is")))
1600 (let (this-command) 1587 (let (this-command)
1601 (save-excursion 1588 (with-current-buffer (overlay-buffer mouse-secondary-overlay)
1602 (set-buffer (overlay-buffer mouse-secondary-overlay))
1603 (kill-region (overlay-start mouse-secondary-overlay) 1589 (kill-region (overlay-start mouse-secondary-overlay)
1604 (overlay-end mouse-secondary-overlay)))) 1590 (overlay-end mouse-secondary-overlay))))
1605 (delete-overlay mouse-secondary-overlay) 1591 (delete-overlay mouse-secondary-overlay)
1606;;; (x-set-selection 'SECONDARY nil) 1592;;; (x-set-selection 'SECONDARY nil)
1607 (setq mouse-secondary-overlay nil)) 1593 )
1608 1594
1609(defun mouse-secondary-save-then-kill (click) 1595(defun mouse-secondary-save-then-kill (click)
1610 "Save text to point in kill ring; the second time, kill the text. 1596 "Save text to point in kill ring; the second time, kill the text.
@@ -1627,13 +1613,11 @@ again. If you do this twice in the same position, it kills the selection."
1627 ;; prevent setting this-command to kill-region. 1613 ;; prevent setting this-command to kill-region.
1628 (this-command this-command)) 1614 (this-command this-command))
1629 (or (eq (window-buffer (posn-window posn)) 1615 (or (eq (window-buffer (posn-window posn))
1630 (or (and mouse-secondary-overlay 1616 (or (overlay-buffer mouse-secondary-overlay)
1631 (overlay-buffer mouse-secondary-overlay))
1632 (if mouse-secondary-start 1617 (if mouse-secondary-start
1633 (marker-buffer mouse-secondary-start)))) 1618 (marker-buffer mouse-secondary-start))))
1634 (error "Wrong buffer")) 1619 (error "Wrong buffer"))
1635 (save-excursion 1620 (with-current-buffer (window-buffer (posn-window posn))
1636 (set-buffer (window-buffer (posn-window posn)))
1637 (if (> (mod mouse-secondary-click-count 3) 0) 1621 (if (> (mod mouse-secondary-click-count 3) 0)
1638 (if (not (and (eq last-command 'mouse-secondary-save-then-kill) 1622 (if (not (and (eq last-command 'mouse-secondary-save-then-kill)
1639 (equal click-posn 1623 (equal click-posn
@@ -1712,10 +1696,7 @@ again. If you do this twice in the same position, it kills the selection."
1712 ;; so put the other end here. 1696 ;; so put the other end here.
1713 (let ((start (+ 0 mouse-secondary-start))) 1697 (let ((start (+ 0 mouse-secondary-start)))
1714 (kill-ring-save start click-posn) 1698 (kill-ring-save start click-posn)
1715 (if mouse-secondary-overlay 1699 (move-overlay mouse-secondary-overlay start click-posn))))
1716 (move-overlay mouse-secondary-overlay start click-posn)
1717 (setq mouse-secondary-overlay (make-overlay start click-posn)))
1718 (overlay-put mouse-secondary-overlay 'face 'secondary-selection))))
1719 (setq mouse-save-then-kill-posn 1700 (setq mouse-save-then-kill-posn
1720 (list (car kill-ring) (point) click-posn)))) 1701 (list (car kill-ring) (point) click-posn))))
1721 (if (overlay-buffer mouse-secondary-overlay) 1702 (if (overlay-buffer mouse-secondary-overlay)
@@ -2433,5 +2414,5 @@ and selects that window."
2433(make-obsolete 'mldrag-drag-vertical-line 'mouse-drag-vertical-line "21.1") 2414(make-obsolete 'mldrag-drag-vertical-line 'mouse-drag-vertical-line "21.1")
2434(provide 'mldrag) 2415(provide 'mldrag)
2435 2416
2436;;; arch-tag: 9a710ce1-914a-4923-9b81-697f7bf82ab3 2417;; arch-tag: 9a710ce1-914a-4923-9b81-697f7bf82ab3
2437;;; mouse.el ends here 2418;;; mouse.el ends here
diff --git a/lisp/net/eudcb-ldap.el b/lisp/net/eudcb-ldap.el
index e28a044ba55..93f7c24d077 100644
--- a/lisp/net/eudcb-ldap.el
+++ b/lisp/net/eudcb-ldap.el
@@ -194,7 +194,7 @@ attribute names are returned. Default to `person'"
194 "Check if the current LDAP server has a configured search base." 194 "Check if the current LDAP server has a configured search base."
195 (unless (or (eudc-ldap-get-host-parameter eudc-server 'base) 195 (unless (or (eudc-ldap-get-host-parameter eudc-server 'base)
196 ldap-default-base 196 ldap-default-base
197 (null (y-or-n-p "No search base defined. Configure it now ?"))) 197 (null (y-or-n-p "No search base defined. Configure it now? ")))
198 ;; If the server is not in ldap-host-parameters-alist we add it for the 198 ;; If the server is not in ldap-host-parameters-alist we add it for the
199 ;; user 199 ;; user
200 (if (null (assoc eudc-server ldap-host-parameters-alist)) 200 (if (null (assoc eudc-server ldap-host-parameters-alist))
diff --git a/lisp/net/newsticker.el b/lisp/net/newsticker.el
index acbac4bb3f2..f1ee41563f3 100644
--- a/lisp/net/newsticker.el
+++ b/lisp/net/newsticker.el
@@ -26,9 +26,8 @@
26;; General Public License for more details. 26;; General Public License for more details.
27 27
28;; You should have received a copy of the GNU General Public License 28;; You should have received a copy of the GNU General Public License
29;; along with this program; if not, write to the Free Software 29;; along with this program; if not, write to the Free Software Foundation,
30;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 30;; Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
31;; USA
32 31
33;; ====================================================================== 32;; ======================================================================
34;;; Commentary: 33;;; Commentary:
diff --git a/lisp/net/rcompile.el b/lisp/net/rcompile.el
index 47ee84d42b8..c643d72da97 100644
--- a/lisp/net/rcompile.el
+++ b/lisp/net/rcompile.el
@@ -138,7 +138,7 @@ See \\[compile]."
138 remote-compile-host) 138 remote-compile-host)
139 user (if remote-compile-prompt-for-user 139 user (if remote-compile-prompt-for-user
140 (read-from-minibuffer (format 140 (read-from-minibuffer (format
141 "Compile by user (default %s)" 141 "Compile by user (default %s): "
142 (or remote-compile-user 142 (or remote-compile-user
143 (user-login-name))) 143 (user-login-name)))
144 "" nil nil 144 "" nil nil
diff --git a/lisp/play/animate.el b/lisp/play/animate.el
index 662adf119b7..47f08a8b098 100644
--- a/lisp/play/animate.el
+++ b/lisp/play/animate.el
@@ -156,7 +156,7 @@ Strings will be separated from each other by SPACE lines."
156(defun animate-birthday-present (&optional name) 156(defun animate-birthday-present (&optional name)
157 "Display one's birthday present in a new buffer. 157 "Display one's birthday present in a new buffer.
158You can specify the one's name by NAME; the default value is \"Sarah\"." 158You can specify the one's name by NAME; the default value is \"Sarah\"."
159 (interactive (list (read-string "Name (default \"Sarah\"): " 159 (interactive (list (read-string "Name (default Sarah): "
160 nil nil "Sarah"))) 160 nil nil "Sarah")))
161 ;; Make a suitable buffer to display the birthday present in. 161 ;; Make a suitable buffer to display the birthday present in.
162 (switch-to-buffer (get-buffer-create (format "*%s*" name))) 162 (switch-to-buffer (get-buffer-create (format "*%s*" name)))
diff --git a/lisp/play/gomoku.el b/lisp/play/gomoku.el
index e9f7a07abe9..c7089ddd7f7 100644
--- a/lisp/play/gomoku.el
+++ b/lisp/play/gomoku.el
@@ -671,11 +671,11 @@ that DVAL has been added on SQUARE."
671 (cond ((< gomoku-number-of-moves 20) 671 (cond ((< gomoku-number-of-moves 20)
672 "This was a REALLY QUICK win.") 672 "This was a REALLY QUICK win.")
673 (gomoku-human-refused-draw 673 (gomoku-human-refused-draw
674 "I won... Too bad you refused my offer of a draw !") 674 "I won... Too bad you refused my offer of a draw!")
675 (gomoku-human-took-back 675 (gomoku-human-took-back
676 "I won... Taking moves back will not help you !") 676 "I won... Taking moves back will not help you!")
677 ((not gomoku-emacs-played-first) 677 ((not gomoku-emacs-played-first)
678 "I won... Playing first did not help you much !") 678 "I won... Playing first did not help you much!")
679 ((and (zerop gomoku-number-of-human-wins) 679 ((and (zerop gomoku-number-of-human-wins)
680 (zerop gomoku-number-of-draws) 680 (zerop gomoku-number-of-draws)
681 (> gomoku-number-of-emacs-wins 1)) 681 (> gomoku-number-of-emacs-wins 1))
@@ -688,7 +688,7 @@ that DVAL has been added on SQUARE."
688 (gomoku-human-took-back 688 (gomoku-human-took-back
689 " I, for one, never take my moves back...") 689 " I, for one, never take my moves back...")
690 (gomoku-emacs-played-first 690 (gomoku-emacs-played-first
691 ".. so what ?") 691 ".. so what?")
692 (" Now, let me play first just once.")))) 692 (" Now, let me play first just once."))))
693 ((eq result 'human-resigned) 693 ((eq result 'human-resigned)
694 (setq gomoku-number-of-emacs-wins (1+ gomoku-number-of-emacs-wins)) 694 (setq gomoku-number-of-emacs-wins (1+ gomoku-number-of-emacs-wins))
@@ -758,7 +758,7 @@ Use \\[describe-mode] for more info."
758 (setq gomoku-emacs-is-computing nil) 758 (setq gomoku-emacs-is-computing nil)
759 (gomoku-terminate-game 'crash-game) 759 (gomoku-terminate-game 'crash-game)
760 (sit-for 4) 760 (sit-for 4)
761 (or (y-or-n-p "Another game ") (error "Chicken !"))) 761 (or (y-or-n-p "Another game? ") (error "Chicken!")))
762 (switch-to-buffer gomoku-buffer-name) 762 (switch-to-buffer gomoku-buffer-name)
763 (gomoku-mode)) 763 (gomoku-mode))
764 (cond 764 (cond
@@ -779,14 +779,14 @@ Use \\[describe-mode] for more info."
779 (if (and (> m max-height) 779 (if (and (> m max-height)
780 (not (eq m gomoku-saved-board-height)) 780 (not (eq m gomoku-saved-board-height))
781 ;; Use EQ because SAVED-BOARD-HEIGHT may be nil 781 ;; Use EQ because SAVED-BOARD-HEIGHT may be nil
782 (not (y-or-n-p (format "Do you really want %d rows " m)))) 782 (not (y-or-n-p (format "Do you really want %d rows? " m))))
783 (setq m max-height))) 783 (setq m max-height)))
784 (message "One moment, please...") 784 (message "One moment, please...")
785 (gomoku-start-game n m) 785 (gomoku-start-game n m)
786 (if (y-or-n-p "Do you allow me to play first ") 786 (if (y-or-n-p "Do you allow me to play first? ")
787 (gomoku-emacs-plays) 787 (gomoku-emacs-plays)
788 (gomoku-prompt-for-move))) 788 (gomoku-prompt-for-move)))
789 ((y-or-n-p "Shall we continue our game ") 789 ((y-or-n-p "Shall we continue our game? ")
790 (gomoku-prompt-for-move)) 790 (gomoku-prompt-for-move))
791 (t 791 (t
792 (gomoku-human-resigns)))) 792 (gomoku-human-resigns))))
@@ -875,9 +875,9 @@ If the game is finished, this command requests for another game."
875 (let (square score) 875 (let (square score)
876 (setq square (gomoku-point-square)) 876 (setq square (gomoku-point-square))
877 (cond ((null square) 877 (cond ((null square)
878 (error "Your point is not on a square. Retry !")) 878 (error "Your point is not on a square. Retry!"))
879 ((not (zerop (aref gomoku-board square))) 879 ((not (zerop (aref gomoku-board square)))
880 (error "Your point is not on a free square. Retry !")) 880 (error "Your point is not on a free square. Retry!"))
881 (t 881 (t
882 (setq score (aref gomoku-score-table square)) 882 (setq score (aref gomoku-score-table square))
883 (gomoku-play-move square 1) 883 (gomoku-play-move square 1)
@@ -902,7 +902,7 @@ If the game is finished, this command requests for another game."
902 (sit-for 4) 902 (sit-for 4)
903 (gomoku-prompt-for-other-game)) 903 (gomoku-prompt-for-other-game))
904 ((zerop gomoku-number-of-human-moves) 904 ((zerop gomoku-number-of-human-moves)
905 (message "You have not played yet... Your move ?")) 905 (message "You have not played yet... Your move?"))
906 (t 906 (t
907 (message "One moment, please...") 907 (message "One moment, please...")
908 ;; It is possible for the user to let Emacs play several consecutive 908 ;; It is possible for the user to let Emacs play several consecutive
@@ -923,9 +923,9 @@ If the game is finished, this command requests for another game."
923 (gomoku-crash-game)) 923 (gomoku-crash-game))
924 ((not gomoku-game-in-progress) 924 ((not gomoku-game-in-progress)
925 (message "There is no game in progress")) 925 (message "There is no game in progress"))
926 ((y-or-n-p "You mean, you resign ") 926 ((y-or-n-p "You mean, you resign? ")
927 (gomoku-terminate-game 'human-resigned)) 927 (gomoku-terminate-game 'human-resigned))
928 ((y-or-n-p "You mean, we continue ") 928 ((y-or-n-p "You mean, we continue? ")
929 (gomoku-prompt-for-move)) 929 (gomoku-prompt-for-move))
930 (t 930 (t
931 (gomoku-terminate-game 'human-resigned)))) ; OK. Accept it 931 (gomoku-terminate-game 'human-resigned)))) ; OK. Accept it
@@ -937,21 +937,21 @@ If the game is finished, this command requests for another game."
937(defun gomoku-prompt-for-move () 937(defun gomoku-prompt-for-move ()
938 "Display a message asking for Human's move." 938 "Display a message asking for Human's move."
939 (message (if (zerop gomoku-number-of-human-moves) 939 (message (if (zerop gomoku-number-of-human-moves)
940 "Your move ? (move to a free square and hit X, RET ...)" 940 "Your move? (move to a free square and hit X, RET ...)"
941 "Your move ?")) 941 "Your move?"))
942 ;; This may seem silly, but if one omits the following line (or a similar 942 ;; This may seem silly, but if one omits the following line (or a similar
943 ;; one), the cursor may very well go to some place where POINT is not. 943 ;; one), the cursor may very well go to some place where POINT is not.
944 (save-excursion (set-buffer (other-buffer)))) 944 (save-excursion (set-buffer (other-buffer))))
945 945
946(defun gomoku-prompt-for-other-game () 946(defun gomoku-prompt-for-other-game ()
947 "Ask for another game, and start it." 947 "Ask for another game, and start it."
948 (if (y-or-n-p "Another game ") 948 (if (y-or-n-p "Another game? ")
949 (gomoku gomoku-board-width gomoku-board-height) 949 (gomoku gomoku-board-width gomoku-board-height)
950 (error "Chicken !"))) 950 (error "Chicken!")))
951 951
952(defun gomoku-offer-a-draw () 952(defun gomoku-offer-a-draw ()
953 "Offer a draw and return t if Human accepted it." 953 "Offer a draw and return t if Human accepted it."
954 (or (y-or-n-p "I offer you a draw. Do you accept it ") 954 (or (y-or-n-p "I offer you a draw. Do you accept it? ")
955 (not (setq gomoku-human-refused-draw t)))) 955 (not (setq gomoku-human-refused-draw t))))
956 956
957;;; 957;;;
diff --git a/lisp/play/landmark.el b/lisp/play/landmark.el
index 67c6c0d3021..48b614ea111 100644
--- a/lisp/play/landmark.el
+++ b/lisp/play/landmark.el
@@ -763,9 +763,9 @@ If the game is finished, this command requests for another game."
763 (let (square score) 763 (let (square score)
764 (setq square (lm-point-square)) 764 (setq square (lm-point-square))
765 (cond ((null square) 765 (cond ((null square)
766 (error "Your point is not on a square. Retry !")) 766 (error "Your point is not on a square. Retry!"))
767 ((not (zerop (aref lm-board square))) 767 ((not (zerop (aref lm-board square)))
768 (error "Your point is not on a free square. Retry !")) 768 (error "Your point is not on a free square. Retry!"))
769 (t 769 (t
770 (setq score (aref lm-score-table square)) 770 (setq score (aref lm-score-table square))
771 (lm-play-move square 1) 771 (lm-play-move square 1)
@@ -790,7 +790,7 @@ If the game is finished, this command requests for another game."
790 (sit-for 4) 790 (sit-for 4)
791 (lm-prompt-for-other-game)) 791 (lm-prompt-for-other-game))
792 ((zerop lm-number-of-human-moves) 792 ((zerop lm-number-of-human-moves)
793 (message "You have not played yet... Your move ?")) 793 (message "You have not played yet... Your move?"))
794 (t 794 (t
795 (message "One moment, please...") 795 (message "One moment, please...")
796 ;; It is possible for the user to let Emacs play several consecutive 796 ;; It is possible for the user to let Emacs play several consecutive
@@ -811,9 +811,9 @@ If the game is finished, this command requests for another game."
811 (lm-crash-game)) 811 (lm-crash-game))
812 ((not lm-game-in-progress) 812 ((not lm-game-in-progress)
813 (message "There is no game in progress")) 813 (message "There is no game in progress"))
814 ((y-or-n-p "You mean, you resign ") 814 ((y-or-n-p "You mean, you resign? ")
815 (lm-terminate-game 'human-resigned)) 815 (lm-terminate-game 'human-resigned))
816 ((y-or-n-p "You mean, we continue ") 816 ((y-or-n-p "You mean, we continue? ")
817 (lm-prompt-for-move)) 817 (lm-prompt-for-move))
818 (t 818 (t
819 (lm-terminate-game 'human-resigned)))) ; OK. Accept it 819 (lm-terminate-game 'human-resigned)))) ; OK. Accept it
@@ -823,23 +823,23 @@ If the game is finished, this command requests for another game."
823(defun lm-prompt-for-move () 823(defun lm-prompt-for-move ()
824 "Display a message asking for Human's move." 824 "Display a message asking for Human's move."
825 (message (if (zerop lm-number-of-human-moves) 825 (message (if (zerop lm-number-of-human-moves)
826 "Your move ? (move to a free square and hit X, RET ...)" 826 "Your move? (move to a free square and hit X, RET ...)"
827 "Your move ?")) 827 "Your move?"))
828 ;; This may seem silly, but if one omits the following line (or a similar 828 ;; This may seem silly, but if one omits the following line (or a similar
829 ;; one), the cursor may very well go to some place where POINT is not. 829 ;; one), the cursor may very well go to some place where POINT is not.
830 (save-excursion (set-buffer (other-buffer)))) 830 (save-excursion (set-buffer (other-buffer))))
831 831
832(defun lm-prompt-for-other-game () 832(defun lm-prompt-for-other-game ()
833 "Ask for another game, and start it." 833 "Ask for another game, and start it."
834 (if (y-or-n-p "Another game ") 834 (if (y-or-n-p "Another game? ")
835 (if (y-or-n-p "Retain learned weights ") 835 (if (y-or-n-p "Retain learned weights ")
836 (lm 2) 836 (lm 2)
837 (lm 1)) 837 (lm 1))
838 (message "Chicken !"))) 838 (message "Chicken!")))
839 839
840(defun lm-offer-a-draw () 840(defun lm-offer-a-draw ()
841 "Offer a draw and return t if Human accepted it." 841 "Offer a draw and return t if Human accepted it."
842 (or (y-or-n-p "I offer you a draw. Do you accept it ") 842 (or (y-or-n-p "I offer you a draw. Do you accept it? ")
843 (not (setq lm-human-refused-draw t)))) 843 (not (setq lm-human-refused-draw t))))
844 844
845 845
@@ -1523,9 +1523,9 @@ If the game is finished, this command requests for another game."
1523 (let (square score) 1523 (let (square score)
1524 (setq square (lm-point-square)) 1524 (setq square (lm-point-square))
1525 (cond ((null square) 1525 (cond ((null square)
1526 (error "Your point is not on a square. Retry !")) 1526 (error "Your point is not on a square. Retry!"))
1527 ((not (zerop (aref lm-board square))) 1527 ((not (zerop (aref lm-board square)))
1528 (error "Your point is not on a free square. Retry !")) 1528 (error "Your point is not on a free square. Retry!"))
1529 (t 1529 (t
1530 (progn 1530 (progn
1531 (lm-plot-square square 1) 1531 (lm-plot-square square 1)
@@ -1678,7 +1678,7 @@ Use \\[describe-mode] for more info."
1678 (if (and (> lm-m max-height) 1678 (if (and (> lm-m max-height)
1679 (not (eq lm-m lm-saved-board-height)) 1679 (not (eq lm-m lm-saved-board-height))
1680 ;; Use EQ because SAVED-BOARD-HEIGHT may be nil 1680 ;; Use EQ because SAVED-BOARD-HEIGHT may be nil
1681 (not (y-or-n-p (format "Do you really want %d rows " lm-m)))) 1681 (not (y-or-n-p (format "Do you really want %d rows? " lm-m))))
1682 (setq lm-m max-height))) 1682 (setq lm-m max-height)))
1683 (if lm-one-moment-please 1683 (if lm-one-moment-please
1684 (message "One moment, please...")) 1684 (message "One moment, please..."))
diff --git a/lisp/play/mpuz.el b/lisp/play/mpuz.el
index 948ae126ffa..6f2c9200928 100644
--- a/lisp/play/mpuz.el
+++ b/lisp/play/mpuz.el
@@ -400,7 +400,7 @@ You may abort a game by typing \\<mpuz-mode-map>\\[mpuz-offer-abort]."
400(defun mpuz-offer-abort () 400(defun mpuz-offer-abort ()
401 "Ask if user wants to abort current puzzle." 401 "Ask if user wants to abort current puzzle."
402 (interactive) 402 (interactive)
403 (if (y-or-n-p "Abort game ") 403 (if (y-or-n-p "Abort game? ")
404 (let ((buf (mpuz-get-buffer))) 404 (let ((buf (mpuz-get-buffer)))
405 (message "Mult Puzzle aborted.") 405 (message "Mult Puzzle aborted.")
406 (setq mpuz-in-progress nil 406 (setq mpuz-in-progress nil
@@ -444,7 +444,7 @@ You may abort a game by typing \\<mpuz-mode-map>\\[mpuz-offer-abort]."
444 (mpuz-ding t)) 444 (mpuz-ding t))
445 (t 445 (t
446 (mpuz-try-proposal letter-char digit-char)))) 446 (mpuz-try-proposal letter-char digit-char))))
447 (if (y-or-n-p "Start a new game ") 447 (if (y-or-n-p "Start a new game? ")
448 (mpuz-start-new-game) 448 (mpuz-start-new-game)
449 (message "OK. I won't.")))) 449 (message "OK. I won't."))))
450 450
@@ -489,7 +489,7 @@ You may abort a game by typing \\<mpuz-mode-map>\\[mpuz-offer-abort]."
489 (t "not serious."))))) 489 (t "not serious.")))))
490 (message message) 490 (message message)
491 (sit-for 4) 491 (sit-for 4)
492 (if (y-or-n-p (concat message " Start a new game ")) 492 (if (y-or-n-p (concat message " Start a new game? "))
493 (mpuz-start-new-game) 493 (mpuz-start-new-game)
494 (message "Good Bye!")))) 494 (message "Good Bye!"))))
495 495
diff --git a/lisp/printing.el b/lisp/printing.el
index ec2c8a3cfda..3771871c9c8 100644
--- a/lisp/printing.el
+++ b/lisp/printing.el
@@ -5704,7 +5704,7 @@ If menu binding was not done, calls `pr-menu-bind'."
5704(defun pr-interactive-n-up (mess) 5704(defun pr-interactive-n-up (mess)
5705 (or (stringp mess) (setq mess "*")) 5705 (or (stringp mess) (setq mess "*"))
5706 (save-match-data 5706 (save-match-data
5707 (let* ((fmt-prompt "%s[%s] N-up printing: (default 1) ") 5707 (let* ((fmt-prompt "%s[%s] N-up printing (default 1): ")
5708 (prompt "") 5708 (prompt "")
5709 (str (pr-f-read-string (format fmt-prompt prompt mess) "1" nil "1")) 5709 (str (pr-f-read-string (format fmt-prompt prompt mess) "1" nil "1"))
5710 int) 5710 int)
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 8f5670ed57b..92c402dbad4 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -519,6 +519,7 @@ This does not load the font-lock package. Use after
519 nil nil 519 nil nil
520 ,c-identifier-syntax-modifications 520 ,c-identifier-syntax-modifications
521 c-beginning-of-syntax 521 c-beginning-of-syntax
522 (font-lock-lines-before . 1)
522 (font-lock-mark-block-function 523 (font-lock-mark-block-function
523 . c-mark-function))) 524 . c-mark-function)))
524 (add-hook 'font-lock-mode-hook 'c-after-font-lock-init nil t)) 525 (add-hook 'font-lock-mode-hook 'c-after-font-lock-init nil t))
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index f29051ab0b0..5ff256e5f8f 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1778,7 +1778,7 @@ Pop up the buffer containing MARKER and scroll to MARKER if we ask the user."
1778 marker) 1778 marker)
1779 (let ((name (expand-file-name 1779 (let ((name (expand-file-name
1780 (read-file-name 1780 (read-file-name
1781 (format "Find this %s in: (default %s) " 1781 (format "Find this %s in (default %s): "
1782 compilation-error filename) 1782 compilation-error filename)
1783 spec-dir filename t)))) 1783 spec-dir filename t))))
1784 (if (file-directory-p name) 1784 (if (file-directory-p name)
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el
index 49d0207882c..47e9a12f235 100644
--- a/lisp/progmodes/ebrowse.el
+++ b/lisp/progmodes/ebrowse.el
@@ -1798,7 +1798,7 @@ INFO is a list (TREE-HEADER TREE-OR-MEMBER MEMBER-LIST)."
1798 ;; START will be 0. 1798 ;; START will be 0.
1799 (when (and (boundp 'ebrowse-debug) 1799 (when (and (boundp 'ebrowse-debug)
1800 (symbol-value 'ebrowse-debug)) 1800 (symbol-value 'ebrowse-debug))
1801 (y-or-n-p (format "start = %d" start)) 1801 (y-or-n-p (format "start = %d? " start))
1802 (y-or-n-p pattern)) 1802 (y-or-n-p pattern))
1803 (setf found 1803 (setf found
1804 (loop do (goto-char (max (point-min) (- start offset))) 1804 (loop do (goto-char (max (point-min) (- start offset)))
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 54b4cda9d18..ea87dce591f 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -284,7 +284,7 @@ With a prefix arg, set the buffer-local value instead.
284When you find a tag with \\[find-tag], the buffer it finds the tag 284When you find a tag with \\[find-tag], the buffer it finds the tag
285in is given a local value of this variable which is the name of the tags 285in is given a local value of this variable which is the name of the tags
286file the tag was in." 286file the tag was in."
287 (interactive (list (read-file-name "Visit tags table: (default TAGS) " 287 (interactive (list (read-file-name "Visit tags table (default TAGS): "
288 default-directory 288 default-directory
289 (expand-file-name "TAGS" 289 (expand-file-name "TAGS"
290 default-directory) 290 default-directory)
@@ -590,7 +590,7 @@ Returns t if it visits a tags table, or nil if there are no more in the list."
590 (car list)) 590 (car list))
591 ;; Finally, prompt the user for a file name. 591 ;; Finally, prompt the user for a file name.
592 (expand-file-name 592 (expand-file-name
593 (read-file-name "Visit tags table: (default TAGS) " 593 (read-file-name "Visit tags table (default TAGS): "
594 default-directory 594 default-directory
595 "TAGS" 595 "TAGS"
596 t)))))) 596 t))))))
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el
index 7dc12226722..4b646a72f3b 100644
--- a/lisp/progmodes/idlw-shell.el
+++ b/lisp/progmodes/idlw-shell.el
@@ -2462,7 +2462,7 @@ the problem with not being able to set the breakpoint."
2462 (beep) 2462 (beep)
2463 (y-or-n-p 2463 (y-or-n-p
2464 (concat "Okay to recompile file " 2464 (concat "Okay to recompile file "
2465 (idlwave-shell-bp-get bp 'file) " "))) 2465 (idlwave-shell-bp-get bp 'file) "? ")))
2466 ;; Recompile 2466 ;; Recompile
2467 (progn 2467 (progn
2468 ;; Clean up before retrying 2468 ;; Clean up before retrying
diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el
index 47b36db6539..b84fa87a0de 100644
--- a/lisp/progmodes/pascal.el
+++ b/lisp/progmodes/pascal.el
@@ -1470,7 +1470,7 @@ The default is a name found in the buffer around point."
1470 default "")) 1470 default ""))
1471 (label (if (not (string= default "")) 1471 (label (if (not (string= default ""))
1472 ;; Do completion with default 1472 ;; Do completion with default
1473 (completing-read (concat "Label: (default " default ") ") 1473 (completing-read (concat "Label (default " default "): ")
1474 'pascal-comp-defun nil t "") 1474 'pascal-comp-defun nil t "")
1475 ;; There is no default value. Complete without it 1475 ;; There is no default value. Complete without it
1476 (completing-read "Label: " 1476 (completing-read "Label: "
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 433476f7957..f7788404350 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1341,9 +1341,9 @@ don't support `help'."
1341 nil nil symbol)))) 1341 nil nil symbol))))
1342 (if (equal symbol "") (error "No symbol")) 1342 (if (equal symbol "") (error "No symbol"))
1343 (let* ((func `(lambda () 1343 (let* ((func `(lambda ()
1344 (comint-redirect-send-command (format "emacs.ehelp(%S)\n" 1344 (comint-redirect-send-command
1345 ,symbol) 1345 (format "emacs.ehelp(%S, globals(), locals())\n" ,symbol)
1346 "*Help*" nil)))) 1346 "*Help*" nil))))
1347 ;; Ensure we have a suitable help buffer. 1347 ;; Ensure we have a suitable help buffer.
1348 ;; Fixme: Maybe process `Related help topics' a la help xrefs and 1348 ;; Fixme: Maybe process `Related help topics' a la help xrefs and
1349 ;; allow C-c C-f in help buffer. 1349 ;; allow C-c C-f in help buffer.
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 4d44eb36ab3..2c528ff2f84 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -4663,7 +4663,7 @@ page-height == ((floor print-height ((th + ls) * zh)) * ((th + ls) * zh)) - th
4663 (let* ((name (concat (file-name-nondirectory (or (buffer-file-name) 4663 (let* ((name (concat (file-name-nondirectory (or (buffer-file-name)
4664 (buffer-name))) 4664 (buffer-name)))
4665 ".ps")) 4665 ".ps"))
4666 (prompt (format "Save PostScript to file: (default %s) " name)) 4666 (prompt (format "Save PostScript to file (default %s): " name))
4667 (res (read-file-name prompt default-directory name nil))) 4667 (res (read-file-name prompt default-directory name nil)))
4668 (while (cond ((file-directory-p res) 4668 (while (cond ((file-directory-p res)
4669 (ding) 4669 (ding)
diff --git a/lisp/rect.el b/lisp/rect.el
index d7ae6592f74..a7a863e204b 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -332,7 +332,7 @@ Called from a program, takes three args; START, END and STRING."
332 (list 332 (list
333 (region-beginning) 333 (region-beginning)
334 (region-end) 334 (region-end)
335 (read-string (format "String rectangle (default `%s'): " 335 (read-string (format "String rectangle (default %s): "
336 (or (car string-rectangle-history) "")) 336 (or (car string-rectangle-history) ""))
337 nil 'string-rectangle-history 337 nil 'string-rectangle-history
338 (car string-rectangle-history))))) 338 (car string-rectangle-history)))))
@@ -353,7 +353,7 @@ This command does not delete or overwrite any existing text."
353 (list 353 (list
354 (region-beginning) 354 (region-beginning)
355 (region-end) 355 (region-end)
356 (read-string (format "String insert rectangle (default `%s'): " 356 (read-string (format "String insert rectangle (default %s): "
357 (or (car string-rectangle-history) "")) 357 (or (car string-rectangle-history) ""))
358 nil 'string-rectangle-history 358 nil 'string-rectangle-history
359 (car string-rectangle-history))))) 359 (car string-rectangle-history)))))
diff --git a/lisp/replace.el b/lisp/replace.el
index 33162b02d3c..e2562ed3469 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -907,7 +907,7 @@ If the value is nil, don't highlight the buffer names specially."
907 (input 907 (input
908 (read-from-minibuffer 908 (read-from-minibuffer
909 (if default 909 (if default
910 (format "List lines matching regexp (default `%s'): " 910 (format "List lines matching regexp (default %s): "
911 (query-replace-descr default)) 911 (query-replace-descr default))
912 "List lines matching regexp: ") 912 "List lines matching regexp: ")
913 nil 913 nil
diff --git a/lisp/ses.el b/lisp/ses.el
index 75562edddb9..4c959c015a7 100644
--- a/lisp/ses.el
+++ b/lisp/ses.el
@@ -2560,7 +2560,7 @@ spot, or error signal if user requests cancel."
2560 colbool (> needcols 0)) 2560 colbool (> needcols 0))
2561 (when (or rowbool colbool) 2561 (when (or rowbool colbool)
2562 ;;Need to insert. Get confirm 2562 ;;Need to insert. Get confirm
2563 (or (y-or-n-p (format "Yank will insert %s%s%s. Continue " 2563 (or (y-or-n-p (format "Yank will insert %s%s%s. Continue? "
2564 (if rowbool (format "%d rows" needrows) "") 2564 (if rowbool (format "%d rows" needrows) "")
2565 (if (and rowbool colbool) " and " "") 2565 (if (and rowbool colbool) " and " "")
2566 (if colbool (format "%d columns" needcols) ""))) 2566 (if colbool (format "%d columns" needcols) "")))
diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el
index 990049afff1..8dd5f375daa 100644
--- a/lisp/shadowfile.el
+++ b/lisp/shadowfile.el
@@ -438,7 +438,7 @@ in the cluster."
438 (sit-for 2)) 438 (sit-for 2))
439 try-regexp)) 439 try-regexp))
440; (username (read-no-blanks-input 440; (username (read-no-blanks-input
441; (format "Username [default: %s]: " 441; (format "Username (default %s): "
442; (shadow-get-user primary)) 442; (shadow-get-user primary))
443; (if old (or (shadow-cluster-username old) "") 443; (if old (or (shadow-cluster-username old) "")
444; (user-login-name)))) 444; (user-login-name))))
@@ -458,7 +458,7 @@ specific hostnames, or names of clusters \(see `shadow-define-cluster')."
458 (name (nth 2 hup)) 458 (name (nth 2 hup))
459 user site group) 459 user site group)
460 (while (setq site (shadow-read-site)) 460 (while (setq site (shadow-read-site))
461 (setq user (read-string (format "Username [default %s]: " 461 (setq user (read-string (format "Username (default %s): "
462 (shadow-get-user site))) 462 (shadow-get-user site)))
463 name (read-string "Filename: " name)) 463 name (read-string "Filename: " name))
464 (setq group (cons (shadow-make-fullname site 464 (setq group (cons (shadow-make-fullname site
diff --git a/lisp/smerge-mode.el b/lisp/smerge-mode.el
index 31c7c4f2f12..e777f3f8211 100644
--- a/lisp/smerge-mode.el
+++ b/lisp/smerge-mode.el
@@ -335,7 +335,17 @@ according to `smerge-match-conflict'.")
335 335
336(defun smerge-remove-props (beg end) 336(defun smerge-remove-props (beg end)
337 (remove-overlays beg end 'smerge 'refine) 337 (remove-overlays beg end 'smerge 'refine)
338 (remove-overlays beg end 'smerge 'conflict)) 338 (remove-overlays beg end 'smerge 'conflict)
339 ;; Now that we use overlays rather than text-properties, this function
340 ;; does not cause refontification any more. It can be seen very clearly
341 ;; in buffers where jit-lock-contextually is not t, in which case deleting
342 ;; the "<<<<<<< foobar" leading line leaves the rest of the conflict
343 ;; highlighted as if it were still a valid conflict. Note that in many
344 ;; important cases (such as the previous example) we're actually called
345 ;; during font-locking so inhibit-modification-hooks is non-nil, so we
346 ;; can't just modify the buffer and expect font-lock to be triggered as in:
347 ;; (put-text-property beg end 'smerge-force-highlighting nil)
348 (remove-text-properties beg end '(fontified nil)))
339 349
340(defun smerge-popup-context-menu (event) 350(defun smerge-popup-context-menu (event)
341 "Pop up the Smerge mode context menu under mouse." 351 "Pop up the Smerge mode context menu under mouse."
diff --git a/lisp/subr.el b/lisp/subr.el
index 91d21aa85a6..644172d88f3 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2862,9 +2862,11 @@ Usually the separator is \".\", but it can be any other string.")
2862 2862
2863 2863
2864(defvar version-regexp-alist 2864(defvar version-regexp-alist
2865 '(("^a\\(lpha\\)?$" . -3) 2865 '(("^[-_+]?a\\(lpha\\)?$" . -3)
2866 ("^b\\(eta\\)?$" . -2) 2866 ("^[-_+]$" . -3) ; treat "1.2.3-20050920" and "1.2-3" as alpha releases
2867 ("^\\(pre\\|rc\\)$" . -1)) 2867 ("^[-_+]cvs$" . -3) ; treat "1.2.3-CVS" as alpha release
2868 ("^[-_+]?b\\(eta\\)?$" . -2)
2869 ("^[-_+]?\\(pre\\|rc\\)$" . -1))
2868 "*Specify association between non-numeric version part and a priority. 2870 "*Specify association between non-numeric version part and a priority.
2869 2871
2870This association is used to handle version string like \"1.0pre2\", 2872This association is used to handle version string like \"1.0pre2\",
@@ -2887,6 +2889,9 @@ Each element has the following form:
2887Where: 2889Where:
2888 2890
2889REGEXP regexp used to match non-numeric part of a version string. 2891REGEXP regexp used to match non-numeric part of a version string.
2892 It should begin with a `^' anchor and end with a `$' to
2893 prevent false hits. Letter-case is ignored while matching
2894 REGEXP.
2890 2895
2891PRIORITY negative integer which indicate the non-numeric priority.") 2896PRIORITY negative integer which indicate the non-numeric priority.")
2892 2897
@@ -2903,9 +2908,12 @@ The version syntax is given by the following EBNF:
2903 SEPARATOR ::= `version-separator' (which see) 2908 SEPARATOR ::= `version-separator' (which see)
2904 | `version-regexp-alist' (which see). 2909 | `version-regexp-alist' (which see).
2905 2910
2911The NUMBER part is optional if SEPARATOR is a match for an element
2912in `version-regexp-alist'.
2913
2906As an example of valid version syntax: 2914As an example of valid version syntax:
2907 2915
2908 1.0pre2 1.0.7.5 22.8beta3 0.9alpha1 2916 1.0pre2 1.0.7.5 22.8beta3 0.9alpha1 6.9.30Beta
2909 2917
2910As an example of invalid version syntax: 2918As an example of invalid version syntax:
2911 2919
@@ -2928,7 +2936,7 @@ See documentation for `version-separator' and `version-regexp-alist'."
2928 (error "Invalid version string: '%s'" ver)) 2936 (error "Invalid version string: '%s'" ver))
2929 (save-match-data 2937 (save-match-data
2930 (let ((i 0) 2938 (let ((i 0)
2931 case-fold-search ; ignore case in matching 2939 (case-fold-search t) ; ignore case in matching
2932 lst s al) 2940 lst s al)
2933 (while (and (setq s (string-match "[0-9]+" ver i)) 2941 (while (and (setq s (string-match "[0-9]+" ver i))
2934 (= s i)) 2942 (= s i))
diff --git a/lisp/term/rxvt.el b/lisp/term/rxvt.el
index 1b4e5a6f61f..7cd02570d84 100644
--- a/lisp/term/rxvt.el
+++ b/lisp/term/rxvt.el
@@ -33,7 +33,7 @@
33 ;; a PC-style keyboard these keys correspond to 33 ;; a PC-style keyboard these keys correspond to
34 ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C-, C-S-. The 34 ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C-, C-S-. The
35 ;; code here subsitutes the corresponding defintions in 35 ;; code here subsitutes the corresponding defintions in
36 ;; function-key-map. This substitution is needed because if a key 36 ;; function-key-map. This substitution is needed because if a key
37 ;; definition if found in function-key-map, there are no further 37 ;; definition if found in function-key-map, there are no further
38 ;; lookups in other keymaps. 38 ;; lookups in other keymaps.
39 (substitute-key-definition [f11] [S-f1] function-key-map) 39 (substitute-key-definition [f11] [S-f1] function-key-map)
@@ -75,12 +75,13 @@
75 (define-key map "\e[B" [down]) 75 (define-key map "\e[B" [down])
76 (define-key map "\e[C" [right]) 76 (define-key map "\e[C" [right])
77 (define-key map "\e[D" [left]) 77 (define-key map "\e[D" [left])
78 (define-key map "\e[7~" [home])
79 (define-key map "\e[2~" [insert]) 78 (define-key map "\e[2~" [insert])
80 (define-key map "\e[3~" [delete]) 79 (define-key map "\e[3~" [delete])
81 (define-key map "\e[4~" [select]) 80 (define-key map "\e[4~" [select])
82 (define-key map "\e[5~" [prior]) 81 (define-key map "\e[5~" [prior])
83 (define-key map "\e[6~" [next]) 82 (define-key map "\e[6~" [next])
83 (define-key map "\e[7~" [home])
84 (define-key map "\e[8~" [end])
84 (define-key map "\e[11~" [f1]) 85 (define-key map "\e[11~" [f1])
85 (define-key map "\e[12~" [f2]) 86 (define-key map "\e[12~" [f2])
86 (define-key map "\e[13~" [f3]) 87 (define-key map "\e[13~" [f3])
@@ -145,8 +146,8 @@
145 (define-key map "\e[3$" [S-delete]) 146 (define-key map "\e[3$" [S-delete])
146 (define-key map "\e[5$" [S-prior]) 147 (define-key map "\e[5$" [S-prior])
147 (define-key map "\e[6$" [S-next]) 148 (define-key map "\e[6$" [S-next])
148 (define-key map "\e[8$" [S-end])
149 (define-key map "\e[7$" [S-home]) 149 (define-key map "\e[7$" [S-home])
150 (define-key map "\e[8$" [S-end])
150 (define-key map "\e[d" [S-left]) 151 (define-key map "\e[d" [S-left])
151 (define-key map "\e[c" [S-right]) 152 (define-key map "\e[c" [S-right])
152 (define-key map "\e[a" [S-up]) 153 (define-key map "\e[a" [S-up])
@@ -175,8 +176,8 @@
175 ("blue" 4 ( 0 0 205)) ; blue3 176 ("blue" 4 ( 0 0 205)) ; blue3
176 ("magenta" 5 (205 0 205)) ; magenta3 177 ("magenta" 5 (205 0 205)) ; magenta3
177 ("cyan" 6 ( 0 205 205)) ; cyan3 178 ("cyan" 6 ( 0 205 205)) ; cyan3
178 ("white" 7 (250 235 215)) ; AntiqueWhite 179 ("white" 7 (229 229 229)) ; gray90
179 ("brightblack" 8 ( 64 64 64)) ; gray25 180 ("brightblack" 8 ( 77 77 77)) ; gray30
180 ("brightred" 9 (255 0 0)) ; red 181 ("brightred" 9 (255 0 0)) ; red
181 ("brightgreen" 10 ( 0 255 0)) ; green 182 ("brightgreen" 10 ( 0 255 0)) ; green
182 ("brightyellow" 11 (255 255 0)) ; yellow 183 ("brightyellow" 11 (255 255 0)) ; yellow
@@ -209,6 +210,67 @@ for the currently selected frame."
209 (setq colors (cdr colors) 210 (setq colors (cdr colors)
210 color (car colors) 211 color (car colors)
211 ncolors (1- ncolors))) 212 ncolors (1- ncolors)))
213 (when (> ncolors 0)
214 (cond
215 ((= ncolors 240) ; 256-color rxvt
216 ;; 216 non-gray colors first
217 (let ((r 0) (g 0) (b 0))
218 (while (> ncolors 24)
219 ;; This and other formulae taken from 256colres.pl and
220 ;; 88colres.pl in the xterm distribution.
221 (tty-color-define (format "color-%d" (- 256 ncolors))
222 (- 256 ncolors)
223 (mapcar 'rxvt-rgb-convert-to-16bit
224 (list (round (* r 42.5))
225 (round (* g 42.5))
226 (round (* b 42.5)))))
227 (setq b (1+ b))
228 (if (> b 5)
229 (setq g (1+ g)
230 b 0))
231 (if (> g 5)
232 (setq r (1+ r)
233 g 0))
234 (setq ncolors (1- ncolors))))
235 ;; Now the 24 gray colors
236 (while (> ncolors 0)
237 (setq color (rxvt-rgb-convert-to-16bit (+ 8 (* (- 24 ncolors) 10))))
238 (tty-color-define (format "color-%d" (- 256 ncolors))
239 (- 256 ncolors)
240 (list color color color))
241 (setq ncolors (1- ncolors))))
242
243 ((= ncolors 72) ; rxvt-unicode
244 ;; 64 non-gray colors
245 (let ((levels '(0 139 205 255))
246 (r 0) (g 0) (b 0))
247 (while (> ncolors 8)
248 (tty-color-define (format "color-%d" (- 88 ncolors))
249 (- 88 ncolors)
250 (mapcar 'rxvt-rgb-convert-to-16bit
251 (list (nth r levels)
252 (nth g levels)
253 (nth b levels))))
254 (setq b (1+ b))
255 (if (> b 3)
256 (setq g (1+ g)
257 b 0))
258 (if (> g 3)
259 (setq r (1+ r)
260 g 0))
261 (setq ncolors (1- ncolors))))
262 ;; Now the 8 gray colors
263 (while (> ncolors 0)
264 (setq color (rxvt-rgb-convert-to-16bit
265 (floor
266 (if (= ncolors 8)
267 46.36363636
268 (+ (* (- 8 ncolors) 23.18181818) 69.54545454)))))
269 (tty-color-define (format "color-%d" (- 88 ncolors))
270 (- 88 ncolors)
271 (list color color color))
272 (setq ncolors (1- ncolors))))
273 (t (error "Unsupported number of rxvt colors (%d)" (+ 16 ncolors)))))
212 ;; Modifying color mappings means realized faces don't use the 274 ;; Modifying color mappings means realized faces don't use the
213 ;; right colors, so clear them. 275 ;; right colors, so clear them.
214 (clear-face-cache))) 276 (clear-face-cache)))
@@ -236,5 +298,5 @@ for the currently selected frame."
236 (setq default-frame-background-mode 'dark))) 298 (setq default-frame-background-mode 'dark)))
237 (frame-set-background-mode (selected-frame)))) 299 (frame-set-background-mode (selected-frame))))
238 300
239;;; arch-tag: 20cf2fb6-6318-4bab-9dbf-1d15048f2257 301;; arch-tag: 20cf2fb6-6318-4bab-9dbf-1d15048f2257
240;;; rxvt.el ends here 302;;; rxvt.el ends here
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index ce37d1b6086..60b85a4522a 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -34,7 +34,7 @@
34 (if (and (getenv "COLORTERM") 34 (if (and (getenv "COLORTERM")
35 (string-match "\\`rxvt" (getenv "COLORTERM"))) 35 (string-match "\\`rxvt" (getenv "COLORTERM")))
36 (progn 36 (progn
37 (eval-when-compile (load "term/rxvt")) 37 (eval-and-compile (load "term/rxvt"))
38 (terminal-init-rxvt)) 38 (terminal-init-rxvt))
39 39
40 ;; The terminal intialization C code file might have initialized 40 ;; The terminal intialization C code file might have initialized
diff --git a/lisp/terminal.el b/lisp/terminal.el
index 75d0c7acbd7..645d7a6bd6a 100644
--- a/lisp/terminal.el
+++ b/lisp/terminal.el
@@ -1115,7 +1115,7 @@ subprocess started."
1115 (getenv "SHELL") 1115 (getenv "SHELL")
1116 "/bin/sh")) 1116 "/bin/sh"))
1117 (s (read-string 1117 (s (read-string
1118 (format "Run program in emulator: (default %s) " 1118 (format "Run program in emulator (default %s): "
1119 default-s)))) 1119 default-s))))
1120 (if (equal s "") 1120 (if (equal s "")
1121 (list default-s '()) 1121 (list default-s '())
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index c3340d6fd37..c9fcd01d018 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -2863,9 +2863,9 @@ Returns a list of strings."
2863 "Read any extra arguments for figlet." 2863 "Read any extra arguments for figlet."
2864 (interactive) 2864 (interactive)
2865 (let* ((avail-fonts (artist-figlet-get-font-list)) 2865 (let* ((avail-fonts (artist-figlet-get-font-list))
2866 (font (completing-read (concat "Select font: (default " 2866 (font (completing-read (concat "Select font (default "
2867 artist-figlet-default-font 2867 artist-figlet-default-font
2868 ") ") 2868 "): ")
2869 (mapcar 2869 (mapcar
2870 (lambda (font) (cons font font)) 2870 (lambda (font) (cons font font))
2871 avail-fonts)))) 2871 avail-fonts))))
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index e46b8533fc4..151a32c60a9 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -169,11 +169,12 @@ command was not the very same command."
169 169
170(defcustom flyspell-incorrect-hook nil 170(defcustom flyspell-incorrect-hook nil
171 "*List of functions to be called when incorrect words are encountered. 171 "*List of functions to be called when incorrect words are encountered.
172Each function is given three arguments: the beginning and the end 172Each function is given three arguments. The first two
173of the incorrect region. The third is either the symbol 'doublon' or the list 173arguments are the beginning and the end of the incorrect region.
174The third is either the symbol `doublon' or the list
174of possible corrections as returned by `ispell-parse-output'. 175of possible corrections as returned by `ispell-parse-output'.
175 176
176If any of the functions return non-Nil, the word is not highlighted as 177If any of the functions return non-nil, the word is not highlighted as
177incorrect." 178incorrect."
178 :group 'flyspell 179 :group 'flyspell
179 :version "21.1" 180 :version "21.1"
@@ -1086,6 +1087,8 @@ Mostly we check word delimiters."
1086 word 1087 word
1087 (+ end 1088 (+ end
1088 flyspell-duplicate-distance)))))) 1089 flyspell-duplicate-distance))))))
1090 ;; This is a misspelled word which occurs
1091 ;; twice within flyspell-duplicate-distance.
1089 (setq flyspell-word-cache-result nil) 1092 (setq flyspell-word-cache-result nil)
1090 (if flyspell-highlight-flag 1093 (if flyspell-highlight-flag
1091 (flyspell-highlight-duplicate-region 1094 (flyspell-highlight-duplicate-region
@@ -1559,7 +1562,11 @@ for the overlay."
1559;* flyspell-highlight-incorrect-region ... */ 1562;* flyspell-highlight-incorrect-region ... */
1560;*---------------------------------------------------------------------*/ 1563;*---------------------------------------------------------------------*/
1561(defun flyspell-highlight-incorrect-region (beg end poss) 1564(defun flyspell-highlight-incorrect-region (beg end poss)
1562 "Set up an overlay on a misspelled word, in the buffer from BEG to END." 1565 "Set up an overlay on a misspelled word, in the buffer from BEG to END.
1566POSS is usually a list of possible spelling/correction lists,
1567as returned by `ispell-parse-output'.
1568It can also be the symbol `doublon', in the case where the word
1569is itself incorrect, but suspiciously repeated."
1563 (let ((inhibit-read-only t)) 1570 (let ((inhibit-read-only t))
1564 (unless (run-hook-with-args-until-success 1571 (unless (run-hook-with-args-until-success
1565 'flyspell-incorrect-hook beg end poss) 1572 'flyspell-incorrect-hook beg end poss)
@@ -1592,8 +1599,9 @@ for the overlay."
1592;* flyspell-highlight-duplicate-region ... */ 1599;* flyspell-highlight-duplicate-region ... */
1593;*---------------------------------------------------------------------*/ 1600;*---------------------------------------------------------------------*/
1594(defun flyspell-highlight-duplicate-region (beg end poss) 1601(defun flyspell-highlight-duplicate-region (beg end poss)
1595 "Set up an overlay on a duplicated word, in the buffer from BEG to END. 1602 "Set up an overlay on a duplicate misspelled word, in the buffer from BEG to END.
1596??? What does POSS mean?" 1603POSS is a list of possible spelling/correction lists,
1604as returned by `ispell-parse-output'."
1597 (let ((inhibit-read-only t)) 1605 (let ((inhibit-read-only t))
1598 (unless (run-hook-with-args-until-success 1606 (unless (run-hook-with-args-until-success
1599 'flyspell-incorrect-hook beg end poss) 1607 'flyspell-incorrect-hook beg end poss)
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 209e532b0e7..8da812dd45a 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -880,6 +880,16 @@ and added as a submenu of the \"Edit\" menu.")
880(defvar ispell-have-aspell-dictionaries nil 880(defvar ispell-have-aspell-dictionaries nil
881 "Non-nil if we have queried Aspell for dictionaries at least once.") 881 "Non-nil if we have queried Aspell for dictionaries at least once.")
882 882
883(defun ispell-maybe-find-aspell-dictionaries ()
884 "Find Aspell's dictionaries, unless already done."
885 (when (and (not ispell-have-aspell-dictionaries)
886 (condition-case ()
887 (progn (ispell-check-version) t)
888 (error nil))
889 ispell-really-aspell
890 ispell-aspell-supports-utf8)
891 (ispell-find-aspell-dictionaries)))
892
883(defun ispell-find-aspell-dictionaries () 893(defun ispell-find-aspell-dictionaries ()
884 "Find Aspell's dictionaries, and record in `ispell-dictionary-alist'." 894 "Find Aspell's dictionaries, and record in `ispell-dictionary-alist'."
885 (interactive) 895 (interactive)
@@ -976,13 +986,7 @@ Assumes that value contains no whitespace."
976 "Returns a list of valid dictionaries. 986 "Returns a list of valid dictionaries.
977The variable `ispell-library-directory' defines the library location." 987The variable `ispell-library-directory' defines the library location."
978 ;; If Ispell is really Aspell, query it for the dictionary list. 988 ;; If Ispell is really Aspell, query it for the dictionary list.
979 (when (and (not ispell-have-aspell-dictionaries) 989 (ispell-maybe-find-aspell-dictionaries)
980 (condition-case ()
981 (progn (ispell-check-version) t)
982 (error nil))
983 ispell-really-aspell
984 ispell-aspell-supports-utf8)
985 (ispell-find-aspell-dictionaries))
986 (let ((dicts (append ispell-local-dictionary-alist ispell-dictionary-alist)) 990 (let ((dicts (append ispell-local-dictionary-alist ispell-dictionary-alist))
987 (dict-list (cons "default" nil)) 991 (dict-list (cons "default" nil))
988 name load-dict) 992 name load-dict)
@@ -3543,6 +3547,7 @@ You can bind this to the key C-c i in GNUS or mail by adding to
3543 3547
3544(defun ispell-accept-buffer-local-defs () 3548(defun ispell-accept-buffer-local-defs ()
3545 "Load all buffer-local information, restarting Ispell when necessary." 3549 "Load all buffer-local information, restarting Ispell when necessary."
3550 (ispell-maybe-find-aspell-dictionaries)
3546 (ispell-buffer-local-dict) ; May kill ispell-process. 3551 (ispell-buffer-local-dict) ; May kill ispell-process.
3547 (ispell-buffer-local-words) ; Will initialize ispell-process. 3552 (ispell-buffer-local-words) ; Will initialize ispell-process.
3548 (ispell-buffer-local-parsing)) 3553 (ispell-buffer-local-parsing))
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el
index 9dadfcb152d..938091d18eb 100644
--- a/lisp/textmodes/org.el
+++ b/lisp/textmodes/org.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <dominik at science dot uva dot nl> 5;; Author: Carsten Dominik <dominik at science dot uva dot nl>
6;; Keywords: outlines, hypermedia, calendar 6;; Keywords: outlines, hypermedia, calendar
7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ 7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
8;; Version: 3.15 8;; Version: 3.16
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -21,8 +21,8 @@
21 21
22;; You should have received a copy of the GNU General Public License 22;; You should have received a copy of the GNU General Public License
23;; along with GNU Emacs; see the file COPYING. If not, write to the 23;; along with GNU Emacs; see the file COPYING. If not, write to the
24;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 24;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25;; Boston, MA 02111-1307, USA. 25;; Boston, MA 02110-1301, USA.
26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
27;; 27;;
28;;; Commentary: 28;;; Commentary:
@@ -80,6 +80,17 @@
80;; 80;;
81;; Changes: 81;; Changes:
82;; ------- 82;; -------
83;; Version 3.16
84;; - In tables, directly after the field motion commands like TAB and RET,
85;; typing a character will blank the field. Can be turned off with
86;; variable `org-table-auto-blank-field'.
87;; - Inactive timestamps with `C-c !'. These do not trigger the agenda
88;; and are not linked to the calendar.
89;; - Additional key bindings to allow Org-mode to function on a tty emacs.
90;; - `C-c C-h' prefix key replaced by `C-c C-x', and `C-c C-x C-h' replaced
91;; by `C-c C-x b' (b=Browser). This was necessary to recover the
92;; standard meaning of C-h after a prefix key (show prefix bindings).
93;;
83;; Version 3.15 94;; Version 3.15
84;; - QUOTE keyword at the beginning of an entry causes fixed-width export 95;; - QUOTE keyword at the beginning of an entry causes fixed-width export
85;; of unmodified entry text. `C-c :' toggles this keyword. 96;; of unmodified entry text. `C-c :' toggles this keyword.
@@ -199,7 +210,7 @@
199 210
200;;; Customization variables 211;;; Customization variables
201 212
202(defvar org-version "3.15" 213(defvar org-version "3.16"
203 "The version number of the file org.el.") 214 "The version number of the file org.el.")
204(defun org-version () 215(defun org-version ()
205 (interactive) 216 (interactive)
@@ -843,6 +854,13 @@ as possible."
843 :group 'org-structure 854 :group 'org-structure
844 :type 'hook) 855 :type 'hook)
845 856
857(defcustom org-level-color-stars-only nil
858 "Non-nil means fontify only the stars in each headline.
859When nil, the entire headline is fontified.
860After changin this, requires restart of Emacs to become effective."
861 :group 'org-structure
862 :type 'boolean)
863
846(defcustom org-adapt-indentation t 864(defcustom org-adapt-indentation t
847 "Non-nil means, adapt indentation when promoting and demoting. 865 "Non-nil means, adapt indentation when promoting and demoting.
848When this is set and the *entire* text in an entry is indented, the 866When this is set and the *entire* text in an entry is indented, the
@@ -852,6 +870,14 @@ body starts at column 0, indentation is not changed at all."
852 :group 'org-structure 870 :group 'org-structure
853 :type 'boolean) 871 :type 'boolean)
854 872
873(defcustom org-enable-fixed-width-editor t
874 "Non-nil means, lines starting with \":\" are treated as fixed-width.
875This currently only means, they are never auto-wrapped.
876When nil, such lines will be treated like ordinary lines.
877See also the QUOTE keyword."
878 :group 'org-structure
879 :type 'boolean)
880
855(defcustom org-cycle-emulate-tab t 881(defcustom org-cycle-emulate-tab t
856 "Where should `org-cycle' emulate TAB. 882 "Where should `org-cycle' emulate TAB.
857nil Never 883nil Never
@@ -1155,24 +1181,34 @@ do the following
1155 field does not exceed the column width. 1181 field does not exceed the column width.
1156- Minimize the number of realigns. Normally, the table is aligned each time 1182- Minimize the number of realigns. Normally, the table is aligned each time
1157 TAB or RET are pressed to move to another field. With optimization this 1183 TAB or RET are pressed to move to another field. With optimization this
1158 happens only if changes to a field might have changed the column width. 1184 happens only if changes to a field might have changed the column width.
1159Optimization requires replacing the functions `self-insert-command', 1185Optimization requires replacing the functions `self-insert-command',
1160`delete-char', and `backward-delete-char' in Org-mode buffers, with a 1186`delete-char', and `backward-delete-char' in Org-mode buffers, with a
1161slight (in fact: unnoticeable) speed impact for normal typing. Org-mode is 1187slight (in fact: unnoticeable) speed impact for normal typing. Org-mode is
1162very good at guessing when a re-align will be necessary, but you can always 1188very good at guessing when a re-align will be necessary, but you can always
1163force one with `C-c C-c'. 1189force one with \\[org-ctrl-c-ctrl-c].
1164 1190
1165If you would like to use the optimized version in Org-mode, but the 1191If you would like to use the optimized version in Org-mode, but the
1166un-optimized version in OrgTbl-mode, see the variable `orgtbl-optimized'. 1192un-optimized version in OrgTbl-mode, see the variable `orgtbl-optimized'.
1167 1193
1168This variable can be used to turn on and off the table editor during a session, 1194This variable can be used to turn on and off the table editor during a session,
1169but in order to toggle optimization, a restart is required." 1195but in order to toggle optimization, a restart is required.
1196
1197See also the variable `org-table-auto-blank-field'."
1170 :group 'org-table 1198 :group 'org-table
1171 :type '(choice 1199 :type '(choice
1172 (const :tag "off" nil) 1200 (const :tag "off" nil)
1173 (const :tag "on" t) 1201 (const :tag "on" t)
1174 (const :tag "on, optimized" optimized))) 1202 (const :tag "on, optimized" optimized)))
1175 1203
1204(defcustom org-table-auto-blank-field t
1205 "Non-nil means, automatically blank table field when starting to type into it.
1206This only happens when typing immediately after a field motion
1207command (TAB, S-TAB or RET).
1208Only relevant when `org-enable-table-editor' is equal to `optimized'."
1209 :group 'org-table
1210 :type 'boolean)
1211
1176(defcustom org-table-default-size "5x2" 1212(defcustom org-table-default-size "5x2"
1177 "The default size for newly created tables, Columns x Rows." 1213 "The default size for newly created tables, Columns x Rows."
1178 :group 'org-table 1214 :group 'org-table
@@ -1248,14 +1284,6 @@ calls `table-recognize-table'."
1248 :group 'org-table 1284 :group 'org-table
1249 :type 'boolean) 1285 :type 'boolean)
1250 1286
1251;; FIXME: Should this one be in another group? Which one?
1252(defcustom org-enable-fixed-width-editor t
1253 "Non-nil means, lines starting with \":\" are treated as fixed-width.
1254This currently only means, they are never auto-wrapped.
1255When nil, such lines will be treated like ordinary lines."
1256 :group 'org-table
1257 :type 'boolean)
1258
1259(defgroup org-table-calculation nil 1287(defgroup org-table-calculation nil
1260 "Options concerning tables in Org-mode." 1288 "Options concerning tables in Org-mode."
1261 :tag "Org Table Calculation" 1289 :tag "Org Table Calculation"
@@ -1978,17 +2006,19 @@ The following commands are available:
1978 (append 2006 (append
1979 (if org-noutline-p ; FIXME: I am not sure if eval will work 2007 (if org-noutline-p ; FIXME: I am not sure if eval will work
1980 ; on XEmacs if noutline is ever ported 2008 ; on XEmacs if noutline is ever ported
1981 '((eval . (list "^\\(\\*+\\).*" 2009 `((eval . (list "^\\(\\*+\\).*"
1982 0 '(nth 2010 ,(if org-level-color-stars-only 1 0)
2011 '(nth ;; FIXME: 1<->0 ????
1983 (% (- (match-end 1) (match-beginning 1) 1) 2012 (% (- (match-end 1) (match-beginning 1) 1)
1984 org-n-levels) 2013 org-n-levels)
1985 org-level-faces) 2014 org-level-faces)
1986 nil t))) 2015 nil t)))
1987 '(("^\\(\\(\\*+\\)[^\r\n]*\\)[\n\r]" 2016 `(("^\\(\\(\\*+\\)[^\r\n]*\\)[\n\r]"
1988 (1 (nth (% (- (match-end 2) (match-beginning 2) 1) 2017 (,(if org-level-color-stars-only 2 0)
1989 org-n-levels) 2018 (nth (% (- (match-end 2) (match-beginning 2) 1)
1990 org-level-faces) 2019 org-n-levels)
1991 nil t)))) 2020 org-level-faces)
2021 nil t))))
1992 org-font-lock-extra-keywords)) 2022 org-font-lock-extra-keywords))
1993 (set (make-local-variable 'font-lock-defaults) 2023 (set (make-local-variable 'font-lock-defaults)
1994 '(org-font-lock-keywords t nil nil backward-paragraph)) 2024 '(org-font-lock-keywords t nil nil backward-paragraph))
@@ -2806,7 +2836,7 @@ At all other locations, this simply calls `ispell-complete-word'."
2806 (insert " ")) 2836 (insert " "))
2807 (if (and (equal type :opt) (assoc completion table)) 2837 (if (and (equal type :opt) (assoc completion table))
2808 (message "%s" (substitute-command-keys 2838 (message "%s" (substitute-command-keys
2809 "Press \\[org-complete] again to insert example settings")))) 2839 "Press \\[org-complete] again to insert example settings"))))
2810 (t 2840 (t
2811 (message "Making completion list...") 2841 (message "Making completion list...")
2812 (let ((list (sort (all-completions pattern table) 'string<))) 2842 (let ((list (sort (all-completions pattern table) 'string<)))
@@ -2913,7 +2943,7 @@ to modify it to the correct date."
2913 (format-time-string (car org-time-stamp-formats) 2943 (format-time-string (car org-time-stamp-formats)
2914 (org-read-date nil 'to-time))) 2944 (org-read-date nil 'to-time)))
2915 (message "%s" (substitute-command-keys 2945 (message "%s" (substitute-command-keys
2916 "Use \\[org-timestamp-up-day] and \\[org-timestamp-down-day] to change the date."))) 2946 "Use \\[org-timestamp-up-day] and \\[org-timestamp-down-day] to change the date.")))
2917 2947
2918(defun org-schedule () 2948(defun org-schedule ()
2919 "Insert the SCHEDULED: string to schedule a TODO item. 2949 "Insert the SCHEDULED: string to schedule a TODO item.
@@ -2925,7 +2955,7 @@ to modify it to the correct date."
2925 (format-time-string (car org-time-stamp-formats) 2955 (format-time-string (car org-time-stamp-formats)
2926 (org-read-date nil 'to-time))) 2956 (org-read-date nil 'to-time)))
2927 (message "%s" (substitute-command-keys 2957 (message "%s" (substitute-command-keys
2928 "Use \\[org-timestamp-up-day] and \\[org-timestamp-down-day] to change the date."))) 2958 "Use \\[org-timestamp-up-day] and \\[org-timestamp-down-day] to change the date.")))
2929 2959
2930 2960
2931(defun org-occur (regexp &optional callback) 2961(defun org-occur (regexp &optional callback)
@@ -3077,6 +3107,21 @@ at the cursor, it will be modified."
3077 (if org-time-was-given (setq fmt (cdr org-time-stamp-formats))) 3107 (if org-time-was-given (setq fmt (cdr org-time-stamp-formats)))
3078 (insert (format-time-string fmt time)))))) 3108 (insert (format-time-string fmt time))))))
3079 3109
3110(defun org-time-stamp-inactive (&optional arg)
3111 "Insert an inactive time stamp.
3112An inactive time stamp is enclosed in square brackets instead of angle
3113brackets. It is inactive in the sense that it does not trigger agenda entries,
3114does not link to the calendar and cannot be changed with the S-cursor keys."
3115 (interactive "P")
3116 (let ((fmt (if arg (cdr org-time-stamp-formats)
3117 (car org-time-stamp-formats)))
3118 (org-time-was-given nil)
3119 time)
3120 (setq time (org-read-date arg 'totime))
3121 (if org-time-was-given (setq fmt (cdr org-time-stamp-formats)))
3122 (setq fmt (concat "[" (substring fmt 1 -1) "]"))
3123 (insert (format-time-string fmt time))))
3124
3080;;; FIXME: Make the function take "Fri" as "next friday" 3125;;; FIXME: Make the function take "Fri" as "next friday"
3081(defun org-read-date (&optional with-time to-time) 3126(defun org-read-date (&optional with-time to-time)
3082 "Read a date and make things smooth for the user. 3127 "Read a date and make things smooth for the user.
@@ -3539,6 +3584,8 @@ The following commands are available:
3539(define-key org-agenda-mode-map "w" 'org-agenda-week-view) 3584(define-key org-agenda-mode-map "w" 'org-agenda-week-view)
3540(define-key org-agenda-mode-map (org-key 'S-right) 'org-agenda-date-later) 3585(define-key org-agenda-mode-map (org-key 'S-right) 'org-agenda-date-later)
3541(define-key org-agenda-mode-map (org-key 'S-left) 'org-agenda-date-earlier) 3586(define-key org-agenda-mode-map (org-key 'S-left) 'org-agenda-date-earlier)
3587(define-key org-agenda-mode-map [?\C-c ?\C-x (right)] 'org-agenda-date-later)
3588(define-key org-agenda-mode-map [?\C-c ?\C-x (left)] 'org-agenda-date-earlier)
3542 3589
3543(define-key org-agenda-mode-map ">" 'org-agenda-date-prompt) 3590(define-key org-agenda-mode-map ">" 'org-agenda-date-prompt)
3544(let ((l '(1 2 3 4 5 6 7 8 9 0))) 3591(let ((l '(1 2 3 4 5 6 7 8 9 0)))
@@ -3574,6 +3621,8 @@ The following commands are available:
3574(define-key org-agenda-mode-map "-" 'org-agenda-priority-down) 3621(define-key org-agenda-mode-map "-" 'org-agenda-priority-down)
3575(define-key org-agenda-mode-map (org-key 'S-up) 'org-agenda-priority-up) 3622(define-key org-agenda-mode-map (org-key 'S-up) 'org-agenda-priority-up)
3576(define-key org-agenda-mode-map (org-key 'S-down) 'org-agenda-priority-down) 3623(define-key org-agenda-mode-map (org-key 'S-down) 'org-agenda-priority-down)
3624(define-key org-agenda-mode-map [?\C-c ?\C-x (up)] 'org-agenda-priority-up)
3625(define-key org-agenda-mode-map [?\C-c ?\C-x (down)] 'org-agenda-priority-down)
3577(define-key org-agenda-mode-map [(right)] 'org-agenda-later) 3626(define-key org-agenda-mode-map [(right)] 'org-agenda-later)
3578(define-key org-agenda-mode-map [(left)] 'org-agenda-earlier) 3627(define-key org-agenda-mode-map [(left)] 'org-agenda-earlier)
3579 3628
@@ -6321,7 +6370,8 @@ integer, it will be incremented while copying."
6321 6370
6322(defun org-table-check-inside-data-field () 6371(defun org-table-check-inside-data-field ()
6323 "Is point inside a table data field? 6372 "Is point inside a table data field?
6324I.e. not on a hline or before the first or after the last column?" 6373I.e. not on a hline or before the first or after the last column?
6374This actually throws an error, so it aborts the current command."
6325 (if (or (not (org-at-table-p)) 6375 (if (or (not (org-at-table-p))
6326 (= (org-table-current-column) 0) 6376 (= (org-table-current-column) 0)
6327 (org-at-table-hline-p) 6377 (org-at-table-hline-p)
@@ -7014,13 +7064,10 @@ If NLAST is a number, only the NLAST fields will actually be summed."
7014 (format "%d:%02d:%02d" h m s)))) 7064 (format "%d:%02d:%02d" h m s))))
7015 (kill-new sres) 7065 (kill-new sres)
7016 (if (interactive-p) 7066 (if (interactive-p)
7017 (message "%s" 7067 (message "s"
7018 (concat 7068 (substitute-command-keys
7019 (format "Sum of %d items: %-20s " (length numbers) sres) 7069 (format "Sum of %d items: %-20s (\\[yank] will insert result into buffer)"
7020 (substitute-command-keys 7070 (length numbers) sres))))
7021 "(\\[yank] will insert result into buffer)")
7022 ))
7023 )
7024 sres)))) 7071 sres))))
7025 7072
7026(defun org-table-get-number-for-summing (s) 7073(defun org-table-get-number-for-summing (s)
@@ -7126,7 +7173,7 @@ the current column, to avoid unnecessary parsing."
7126 (stored-list (org-table-get-stored-formulas)) 7173 (stored-list (org-table-get-stored-formulas))
7127 (stored (cdr (assoc scol stored-list))) 7174 (stored (cdr (assoc scol stored-list)))
7128 (eq (cond 7175 (eq (cond
7129 ((and stored equation (string-match "^ *= *$" equation)) 7176 ((and stored equation (string-match "^ *=? *$" equation))
7130 stored) 7177 stored)
7131 ((stringp equation) 7178 ((stringp equation)
7132 equation) 7179 equation)
@@ -7294,7 +7341,7 @@ If yes, store the formula and apply it."
7294 (when org-table-formula-evaluate-inline 7341 (when org-table-formula-evaluate-inline
7295 (let* ((field (org-trim (or (org-table-get-field) ""))) 7342 (let* ((field (org-trim (or (org-table-get-field) "")))
7296 named eq) 7343 named eq)
7297 (when (string-match "^:?=\\(.+\\)" field) 7344 (when (string-match "^:?=\\(.*\\)" field)
7298 (setq named (equal (string-to-char field) ?:) 7345 (setq named (equal (string-to-char field) ?:)
7299 eq (match-string 1 field)) 7346 eq (match-string 1 field))
7300 (if (fboundp 'calc-eval) 7347 (if (fboundp 'calc-eval)
@@ -7916,8 +7963,7 @@ to execute outside of tables."
7916 '("\C-c\M-w" org-table-copy-region) 7963 '("\C-c\M-w" org-table-copy-region)
7917 '("\C-c\C-y" org-table-paste-rectangle) 7964 '("\C-c\C-y" org-table-paste-rectangle)
7918 '("\C-c-" org-table-insert-hline) 7965 '("\C-c-" org-table-insert-hline)
7919 '([(shift tab)] org-table-previous-field) 7966; '([(shift tab)] org-table-previous-field)
7920 '("\C-c\C-c" org-ctrl-c-ctrl-c)
7921 '("\C-m" org-table-next-row) 7967 '("\C-m" org-table-next-row)
7922 (list (org-key 'S-return) 'org-table-copy-down) 7968 (list (org-key 'S-return) 'org-table-copy-down)
7923 '([(meta return)] org-table-wrap-region) 7969 '([(meta return)] org-table-wrap-region)
@@ -7946,16 +7992,18 @@ to execute outside of tables."
7946 (orgtbl-make-binding 'orgtbl-tab 102 [(tab)] "\C-i")) 7992 (orgtbl-make-binding 'orgtbl-tab 102 [(tab)] "\C-i"))
7947 (define-key orgtbl-mode-map "\C-i" 7993 (define-key orgtbl-mode-map "\C-i"
7948 (orgtbl-make-binding 'orgtbl-tab 103 "\C-i" [(tab)]))) 7994 (orgtbl-make-binding 'orgtbl-tab 103 "\C-i" [(tab)])))
7995 (define-key orgtbl-mode-map "\C-i"
7996 (orgtbl-make-binding 'orgtbl-tab 104 [(shift tab)]))
7997 (define-key orgtbl-mode-map "\C-c\C-c"
7998 (orgtbl-make-binding 'org-ctrl-c-ctrl-c 105 "\C-c\C-c"))
7949 (when orgtbl-optimized 7999 (when orgtbl-optimized
7950 ;; If the user wants maximum table support, we need to hijack 8000 ;; If the user wants maximum table support, we need to hijack
7951 ;; some standard editing functions 8001 ;; some standard editing functions
7952 (substitute-key-definition 'self-insert-command 'orgtbl-self-insert-command 8002 (org-remap orgtbl-mode-map
7953 orgtbl-mode-map global-map) 8003 'self-insert-command 'orgtbl-self-insert-command
7954 (substitute-key-definition 'delete-char 'orgtbl-delete-char 8004 'delete-char 'orgtbl-delete-char
7955 orgtbl-mode-map global-map) 8005 'delete-backward-char 'orgtbl-delete-backward-char)
7956 (substitute-key-definition 'delete-backward-char 'orgtbl-delete-backward-char 8006 (define-key orgtbl-mode-map "|" 'org-force-self-insert))
7957 orgtbl-mode-map global-map)
7958 (define-key org-mode-map "|" 'self-insert-command))
7959 (easy-menu-define orgtbl-mode-menu orgtbl-mode-map "OrgTbl menu" 8007 (easy-menu-define orgtbl-mode-menu orgtbl-mode-map "OrgTbl menu"
7960 '("OrgTbl" 8008 '("OrgTbl"
7961 ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p) :keys "C-c C-c"] 8009 ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p) :keys "C-c C-c"]
@@ -7980,9 +8028,9 @@ to execute outside of tables."
7980 "--" 8028 "--"
7981 ["Insert Hline" org-table-insert-hline :active (org-at-table-p) :keys "C-c -"]) 8029 ["Insert Hline" org-table-insert-hline :active (org-at-table-p) :keys "C-c -"])
7982 ("Rectangle" 8030 ("Rectangle"
7983 ["Copy Rectangle" org-copy-special :active (org-at-table-p) :keys "C-c M-w"] 8031 ["Copy Rectangle" org-copy-special :active (org-at-table-p) :keys "C-c C-x M-w"]
7984 ["Cut Rectangle" org-cut-special :active (org-at-table-p) :keys "C-c C-w"] 8032 ["Cut Rectangle" org-cut-special :active (org-at-table-p) :keys "C-c C-x C-w"]
7985 ["Paste Rectangle" org-paste-special :active (org-at-table-p) :keys "C-c C-y"] 8033 ["Paste Rectangle" org-paste-special :active (org-at-table-p) :keys "C-c C-x C-y"]
7986 ["Fill Rectangle" org-table-wrap-region :active (org-at-table-p) :keys "C-c C-q"]) 8034 ["Fill Rectangle" org-table-wrap-region :active (org-at-table-p) :keys "C-c C-q"])
7987 "--" 8035 "--"
7988 ["Set Column Formula" org-table-eval-formula :active (org-at-table-p) :keys "C-c ="] 8036 ["Set Column Formula" org-table-eval-formula :active (org-at-table-p) :keys "C-c ="]
@@ -8018,6 +8066,17 @@ If the cursor is in a table looking at whitespace, the whitespace is
8018overwritten, and the table is not marked as requiring realignment." 8066overwritten, and the table is not marked as requiring realignment."
8019 (interactive "p") 8067 (interactive "p")
8020 (if (and (org-at-table-p) 8068 (if (and (org-at-table-p)
8069 (or
8070 (and org-table-auto-blank-field
8071 (member last-command
8072 '(orgtbl-hijacker-command-100
8073 orgtbl-hijacker-command-101
8074 orgtbl-hijacker-command-102
8075 orgtbl-hijacker-command-103
8076 orgtbl-hijacker-command-104
8077 orgtbl-hijacker-command-105))
8078 (org-table-blank-field))
8079 t)
8021 (eq N 1) 8080 (eq N 1)
8022 (looking-at "[^|\n]* +|")) 8081 (looking-at "[^|\n]* +|"))
8023 (let (org-table-may-need-update) 8082 (let (org-table-may-need-update)
@@ -8029,6 +8088,11 @@ overwritten, and the table is not marked as requiring realignment."
8029 (let (orgtbl-mode) 8088 (let (orgtbl-mode)
8030 (call-interactively (key-binding (vector last-input-event)))))) 8089 (call-interactively (key-binding (vector last-input-event))))))
8031 8090
8091(defun org-force-self-insert (N)
8092 "Needed to enforce self-insert under remapping."
8093 (interactive "p")
8094 (self-insert-command N))
8095
8032(defun orgtbl-delete-backward-char (N) 8096(defun orgtbl-delete-backward-char (N)
8033 "Like `delete-backward-char', insert whitespace at field end in tables. 8097 "Like `delete-backward-char', insert whitespace at field end in tables.
8034When deleting backwards, in tables this function will insert whitespace in 8098When deleting backwards, in tables this function will insert whitespace in
@@ -9344,23 +9408,55 @@ When LEVEL is non-nil, increase section numbers on that level."
9344;; i k @ expendable from outline-mode 9408;; i k @ expendable from outline-mode
9345;; 0123456789 ! %^& ()_{} " `' free 9409;; 0123456789 ! %^& ()_{} " `' free
9346 9410
9347(define-key org-mode-map "\C-i" 'org-cycle) 9411;; TAB key with modifiers
9412(define-key org-mode-map "\C-i" 'org-cycle)
9348(define-key org-mode-map [(meta tab)] 'org-complete) 9413(define-key org-mode-map [(meta tab)] 'org-complete)
9349(define-key org-mode-map "\M-\C-i" 'org-complete) 9414(define-key org-mode-map "\M-\C-i" 'org-complete) ; for tty emacs
9350(define-key org-mode-map [(meta shift left)] 'org-shiftmetaleft) 9415;; The following line is necessary under Suse GNU/Linux
9351(define-key org-mode-map [(meta left)] 'org-metaleft) 9416(unless org-xemacs-p
9352(define-key org-mode-map [(meta shift right)] 'org-shiftmetaright) 9417 (define-key org-mode-map [S-iso-lefttab] 'org-shifttab))
9353(define-key org-mode-map [(meta shift up)] 'org-shiftmetaup) 9418(define-key org-mode-map [(shift tab)] 'org-shifttab)
9354(define-key org-mode-map [(meta shift down)] 'org-shiftmetadown) 9419
9420(define-key org-mode-map (org-key 'S-return) 'org-table-copy-down)
9421(define-key org-mode-map "\C-c\C-xc" 'org-table-copy-down) ; tty
9422(define-key org-mode-map [(meta shift return)] 'org-insert-todo-heading)
9423(define-key org-mode-map "\C-c\C-xM" 'org-insert-todo-heading) ; tty
9424(define-key org-mode-map [(meta return)] 'org-meta-return)
9425(define-key org-mode-map "\C-c\C-xm" 'org-meta-return) ; tty emacs
9426(define-key org-mode-map [?\e (return)] 'org-meta-return) ; tty emacs
9427
9428;; Cursor keys with modifiers
9429(define-key org-mode-map [(meta left)] 'org-metaleft)
9430(define-key org-mode-map [?\e (left)] 'org-metaleft) ; for tty emacs
9431(define-key org-mode-map "\C-c\C-xl" 'org-metaleft) ; for tty emacs
9355(define-key org-mode-map [(meta right)] 'org-metaright) 9432(define-key org-mode-map [(meta right)] 'org-metaright)
9356(define-key org-mode-map [(meta up)] 'org-metaup) 9433(define-key org-mode-map [?\e (right)] 'org-metaright) ; for tty emacs
9357(define-key org-mode-map [(meta down)] 'org-metadown) 9434(define-key org-mode-map "\C-c\C-xr" 'org-metaright) ; for tty emacs
9358;(define-key org-mode-map "\C-c\C-h\C-w" 'org-cut-subtree) 9435(define-key org-mode-map [(meta up)] 'org-metaup)
9359;(define-key org-mode-map "\C-c\C-h\M-w" 'org-copy-subtree) 9436(define-key org-mode-map [?\e (up)] 'org-metaup) ; for tty emacs
9360;(define-key org-mode-map "\C-c\C-h\C-y" 'org-paste-subtree) 9437(define-key org-mode-map "\C-c\C-xu" 'org-metaup) ; for tty emacs
9361(define-key org-mode-map "\C-c\C-h\C-w" 'org-cut-special) 9438(define-key org-mode-map [(meta down)] 'org-metadown)
9362(define-key org-mode-map "\C-c\C-h\M-w" 'org-copy-special) 9439(define-key org-mode-map [?\e (down)] 'org-metadown) ; for tty emacs
9363(define-key org-mode-map "\C-c\C-h\C-y" 'org-paste-special) 9440(define-key org-mode-map "\C-c\C-xd" 'org-metadown) ; for tty emacs
9441
9442(define-key org-mode-map [(meta shift left)] 'org-shiftmetaleft)
9443(define-key org-mode-map "\C-c\C-xL" 'org-shiftmetaleft) ; tty
9444(define-key org-mode-map [(meta shift right)] 'org-shiftmetaright)
9445(define-key org-mode-map "\C-c\C-xR" 'org-shiftmetaright) ; tty
9446(define-key org-mode-map [(meta shift up)] 'org-shiftmetaup)
9447(define-key org-mode-map "\C-c\C-xU" 'org-shiftmetaup) ; tty
9448(define-key org-mode-map [(meta shift down)] 'org-shiftmetadown)
9449(define-key org-mode-map "\C-c\C-xD" 'org-shiftmetadown) ; tty
9450(define-key org-mode-map (org-key 'S-up) 'org-shiftup)
9451(define-key org-mode-map [?\C-c ?\C-x (up)] 'org-shiftup)
9452(define-key org-mode-map (org-key 'S-down) 'org-shiftdown)
9453(define-key org-mode-map [?\C-c ?\C-x (down)] 'org-shiftdown)
9454(define-key org-mode-map (org-key 'S-left) 'org-timestamp-down-day)
9455(define-key org-mode-map [?\C-c ?\C-x (left)] 'org-timestamp-down-day)
9456(define-key org-mode-map (org-key 'S-right) 'org-timestamp-up-day)
9457(define-key org-mode-map [?\C-c ?\C-x (right)] 'org-timestamp-up-day)
9458
9459;; All the other keys
9364(define-key org-mode-map "\C-c$" 'org-archive-subtree) 9460(define-key org-mode-map "\C-c$" 'org-archive-subtree)
9365(define-key org-mode-map "\C-c\C-j" 'org-goto) 9461(define-key org-mode-map "\C-c\C-j" 'org-goto)
9366(define-key org-mode-map "\C-c\C-t" 'org-todo) 9462(define-key org-mode-map "\C-c\C-t" 'org-todo)
@@ -9372,11 +9468,11 @@ When LEVEL is non-nil, increase section numbers on that level."
9372(define-key org-mode-map "\C-c/" 'org-occur) ; Minor-mode reserved 9468(define-key org-mode-map "\C-c/" 'org-occur) ; Minor-mode reserved
9373(define-key org-mode-map "\C-c\C-m" 'org-insert-heading) 9469(define-key org-mode-map "\C-c\C-m" 'org-insert-heading)
9374(define-key org-mode-map "\M-\C-m" 'org-insert-heading) 9470(define-key org-mode-map "\M-\C-m" 'org-insert-heading)
9375(define-key org-mode-map [(meta shift return)] 'org-insert-todo-heading)
9376(define-key org-mode-map "\C-c\C-l" 'org-insert-link) 9471(define-key org-mode-map "\C-c\C-l" 'org-insert-link)
9377(define-key org-mode-map "\C-c\C-o" 'org-open-at-point) 9472(define-key org-mode-map "\C-c\C-o" 'org-open-at-point)
9378(define-key org-mode-map "\C-c\C-z" 'org-time-stamp) ; Alternative binding 9473(define-key org-mode-map "\C-c\C-z" 'org-time-stamp) ; Alternative binding
9379(define-key org-mode-map "\C-c." 'org-time-stamp) ; Minor-mode reserved 9474(define-key org-mode-map "\C-c." 'org-time-stamp) ; Minor-mode reserved
9475(define-key org-mode-map "\C-c!" 'org-time-stamp-inactive) ; Minor-mode r.
9380(define-key org-mode-map "\C-c," 'org-priority) ; Minor-mode reserved 9476(define-key org-mode-map "\C-c," 'org-priority) ; Minor-mode reserved
9381(define-key org-mode-map "\C-c\C-y" 'org-evaluate-time-range) 9477(define-key org-mode-map "\C-c\C-y" 'org-evaluate-time-range)
9382(define-key org-mode-map "\C-c>" 'org-goto-calendar) 9478(define-key org-mode-map "\C-c>" 'org-goto-calendar)
@@ -9384,19 +9480,9 @@ When LEVEL is non-nil, increase section numbers on that level."
9384(define-key org-mode-map "\C-c[" 'org-add-file) 9480(define-key org-mode-map "\C-c[" 'org-add-file)
9385(define-key org-mode-map "\C-c]" 'org-remove-file) 9481(define-key org-mode-map "\C-c]" 'org-remove-file)
9386(define-key org-mode-map "\C-c\C-r" 'org-timeline) 9482(define-key org-mode-map "\C-c\C-r" 'org-timeline)
9387(define-key org-mode-map (org-key 'S-up) 'org-shiftup)
9388(define-key org-mode-map (org-key 'S-down) 'org-shiftdown)
9389(define-key org-mode-map (org-key 'S-left) 'org-timestamp-down-day)
9390(define-key org-mode-map (org-key 'S-right) 'org-timestamp-up-day)
9391(define-key org-mode-map "\C-c-" 'org-table-insert-hline) 9483(define-key org-mode-map "\C-c-" 'org-table-insert-hline)
9392;; The following line is necessary for German keyboards under Suse GNU/Linux
9393(unless org-xemacs-p
9394 (define-key org-mode-map [S-iso-lefttab] 'org-shifttab))
9395(define-key org-mode-map [(shift tab)] 'org-shifttab)
9396(define-key org-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c) 9484(define-key org-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c)
9397(define-key org-mode-map "\C-m" 'org-return) 9485(define-key org-mode-map "\C-m" 'org-return)
9398(define-key org-mode-map (org-key 'S-return) 'org-table-copy-down)
9399(define-key org-mode-map [(meta return)] 'org-meta-return)
9400(define-key org-mode-map "\C-c?" 'org-table-current-column) 9486(define-key org-mode-map "\C-c?" 'org-table-current-column)
9401(define-key org-mode-map "\C-c " 'org-table-blank-field) 9487(define-key org-mode-map "\C-c " 'org-table-blank-field)
9402(define-key org-mode-map "\C-c+" 'org-table-sum) 9488(define-key org-mode-map "\C-c+" 'org-table-sum)
@@ -9411,12 +9497,18 @@ When LEVEL is non-nil, increase section numbers on that level."
9411(define-key org-mode-map "\C-c\C-x\C-a" 'org-export-as-ascii) 9497(define-key org-mode-map "\C-c\C-x\C-a" 'org-export-as-ascii)
9412(define-key org-mode-map "\C-c\C-xv" 'org-export-copy-visible) 9498(define-key org-mode-map "\C-c\C-xv" 'org-export-copy-visible)
9413(define-key org-mode-map "\C-c\C-x\C-v" 'org-export-copy-visible) 9499(define-key org-mode-map "\C-c\C-x\C-v" 'org-export-copy-visible)
9500;; OPML support is only planned
9414;(define-key org-mode-map "\C-c\C-xo" 'org-export-as-opml) 9501;(define-key org-mode-map "\C-c\C-xo" 'org-export-as-opml)
9415;(define-key org-mode-map "\C-c\C-x\C-o" 'org-export-as-opml) 9502;(define-key org-mode-map "\C-c\C-x\C-o" 'org-export-as-opml)
9416(define-key org-mode-map "\C-c\C-xt" 'org-insert-export-options-template) 9503(define-key org-mode-map "\C-c\C-xt" 'org-insert-export-options-template)
9417(define-key org-mode-map "\C-c:" 'org-toggle-fixed-width-section) 9504(define-key org-mode-map "\C-c:" 'org-toggle-fixed-width-section)
9418(define-key org-mode-map "\C-c\C-xh" 'org-export-as-html) 9505(define-key org-mode-map "\C-c\C-xh" 'org-export-as-html)
9419(define-key org-mode-map "\C-c\C-x\C-h" 'org-export-as-html-and-open) 9506(define-key org-mode-map "\C-c\C-xb" 'org-export-as-html-and-open)
9507(define-key org-mode-map "\C-c\C-x\C-b" 'org-export-as-html-and-open)
9508
9509(define-key org-mode-map "\C-c\C-x\C-w" 'org-cut-special)
9510(define-key org-mode-map "\C-c\C-x\M-w" 'org-copy-special)
9511(define-key org-mode-map "\C-c\C-x\C-y" 'org-paste-special)
9420 9512
9421(defsubst org-table-p () (org-at-table-p)) 9513(defsubst org-table-p () (org-at-table-p))
9422 9514
@@ -9426,6 +9518,12 @@ If the cursor is in a table looking at whitespace, the whitespace is
9426overwritten, and the table is not marked as requiring realignment." 9518overwritten, and the table is not marked as requiring realignment."
9427 (interactive "p") 9519 (interactive "p")
9428 (if (and (org-table-p) 9520 (if (and (org-table-p)
9521 (or
9522 (and org-table-auto-blank-field
9523 (member last-command
9524 '(org-cycle org-return org-shifttab org-ctrl-c-ctrl-c))
9525 (org-table-blank-field))
9526 t)
9429 (eq N 1) 9527 (eq N 1)
9430 (looking-at "[^|\n]* +|")) 9528 (looking-at "[^|\n]* +|"))
9431 (let (org-table-may-need-update) 9529 (let (org-table-may-need-update)
@@ -9480,30 +9578,42 @@ a reduced column width."
9480;; How to do this: Measure non-white length of current string 9578;; How to do this: Measure non-white length of current string
9481;; If equal to column width, we should realign. 9579;; If equal to column width, we should realign.
9482 9580
9581(defun org-remap (map &rest commands)
9582 "In MAP, remap the functions given in COMMANDS.
9583COMMANDS is a list of alternating OLDDEF NEWDEF command names."
9584 (let (new old)
9585 (while commands
9586 (setq old (pop commands) new (pop commands))
9587 (if (fboundp 'command-remapping)
9588 (define-key map (vector 'remap old) new)
9589 (substitute-key-definition old new map global-map)))))
9590
9483(when (eq org-enable-table-editor 'optimized) 9591(when (eq org-enable-table-editor 'optimized)
9484 ;; If the user wants maximum table support, we need to hijack 9592 ;; If the user wants maximum table support, we need to hijack
9485 ;; some standard editing functions 9593 ;; some standard editing functions
9486 (substitute-key-definition 'self-insert-command 'org-self-insert-command 9594 (org-remap org-mode-map
9487 org-mode-map global-map) 9595 'self-insert-command 'org-self-insert-command
9488 (substitute-key-definition 'delete-char 'org-delete-char 9596 'delete-char 'org-delete-char
9489 org-mode-map global-map) 9597 'delete-backward-char 'org-delete-backward-char)
9490 (substitute-key-definition 'delete-backward-char 'org-delete-backward-char 9598 (define-key org-mode-map "|" 'org-force-self-insert))
9491 org-mode-map global-map)
9492 (define-key org-mode-map "|" 'self-insert-command))
9493 9599
9494(defun org-shiftcursor-error () 9600(defun org-shiftcursor-error ()
9495 "Throw an error because Shift-Cursor command was applied in wrong context." 9601 "Throw an error because Shift-Cursor command was applied in wrong context."
9496 (error "This command is only active in tables and on headlines")) 9602 (error "This command is only active in tables and on headlines"))
9497 9603
9498(defun org-shifttab () 9604(defun org-shifttab ()
9499 "Call `(org-cycle t)' or `org-table-previous-field'." 9605 "Global visibility cycling or move to previous table field.
9606Calls `(org-cycle t)' or `org-table-previous-field', depending on context.
9607See the individual commands for more information."
9500 (interactive) 9608 (interactive)
9501 (cond 9609 (cond
9502 ((org-at-table-p) (org-table-previous-field)) 9610 ((org-at-table-p) (org-table-previous-field))
9503 (t (org-cycle '(4))))) 9611 (t (org-cycle '(4)))))
9504 9612
9505(defun org-shiftmetaleft () 9613(defun org-shiftmetaleft ()
9506 "Call `org-promote-subtree' or `org-table-delete-column'." 9614 "Promote subtree or delete table column.
9615Calls `org-promote-subtree' or `org-table-delete-column', depending on context.
9616See the individual commands for more information."
9507 (interactive) 9617 (interactive)
9508 (cond 9618 (cond
9509 ((org-at-table-p) (org-table-delete-column)) 9619 ((org-at-table-p) (org-table-delete-column))
@@ -9511,7 +9621,9 @@ a reduced column width."
9511 (t (org-shiftcursor-error)))) 9621 (t (org-shiftcursor-error))))
9512 9622
9513(defun org-shiftmetaright () 9623(defun org-shiftmetaright ()
9514 "Call `org-demote-subtree' or `org-table-insert-column'." 9624 "Demote subtree or insert table column.
9625Calls `org-demote-subtree' or `org-table-insert-column', depending on context.
9626See the individual commands for more information."
9515 (interactive) 9627 (interactive)
9516 (cond 9628 (cond
9517 ((org-at-table-p) (org-table-insert-column)) 9629 ((org-at-table-p) (org-table-insert-column))
@@ -9519,14 +9631,18 @@ a reduced column width."
9519 (t (org-shiftcursor-error)))) 9631 (t (org-shiftcursor-error))))
9520 9632
9521(defun org-shiftmetaup (&optional arg) 9633(defun org-shiftmetaup (&optional arg)
9522 "Call `org-move-subtree-up' or `org-table-kill-row'." 9634 "Move subtree up or kill table row.
9635Calls `org-move-subtree-up' or `org-table-kill-row', depending on context.
9636See the individual commands for more information."
9523 (interactive "P") 9637 (interactive "P")
9524 (cond 9638 (cond
9525 ((org-at-table-p) (org-table-kill-row)) 9639 ((org-at-table-p) (org-table-kill-row))
9526 ((org-on-heading-p) (org-move-subtree-up arg)) 9640 ((org-on-heading-p) (org-move-subtree-up arg))
9527 (t (org-shiftcursor-error)))) 9641 (t (org-shiftcursor-error))))
9528(defun org-shiftmetadown (&optional arg) 9642(defun org-shiftmetadown (&optional arg)
9529 "Call `org-move-subtree-down' or `org-table-insert-row'." 9643 "Move subtree down or insert table row.
9644Calls `org-move-subtree-down' or `org-table-insert-row', depending on context.
9645See the individual commands for more information."
9530 (interactive "P") 9646 (interactive "P")
9531 (cond 9647 (cond
9532 ((org-at-table-p) (org-table-insert-row arg)) 9648 ((org-at-table-p) (org-table-insert-row arg))
@@ -9534,7 +9650,9 @@ a reduced column width."
9534 (t (org-shiftcursor-error)))) 9650 (t (org-shiftcursor-error))))
9535 9651
9536(defun org-metaleft (&optional arg) 9652(defun org-metaleft (&optional arg)
9537 "Call `org-do-promote' or `org-table-move-column' to left." 9653 "Promote heading or move table column to left.
9654Calls `org-do-promote' or `org-table-move-column', depending on context.
9655See the individual commands for more information."
9538 (interactive "P") 9656 (interactive "P")
9539 (cond 9657 (cond
9540 ((org-at-table-p) (org-table-move-column 'left)) 9658 ((org-at-table-p) (org-table-move-column 'left))
@@ -9542,7 +9660,9 @@ a reduced column width."
9542 (t (backward-word (prefix-numeric-value arg))))) 9660 (t (backward-word (prefix-numeric-value arg)))))
9543 9661
9544(defun org-metaright (&optional arg) 9662(defun org-metaright (&optional arg)
9545 "Call `org-do-demote' or `org-table-move-column' to right." 9663 "Demote subtree or move table column to right.
9664Calls `org-do-demote' or `org-table-move-column', depending on context.
9665See the individual commands for more information."
9546 (interactive "P") 9666 (interactive "P")
9547 (cond 9667 (cond
9548 ((org-at-table-p) (org-table-move-column nil)) 9668 ((org-at-table-p) (org-table-move-column nil))
@@ -9550,7 +9670,9 @@ a reduced column width."
9550 (t (forward-word (prefix-numeric-value arg))))) 9670 (t (forward-word (prefix-numeric-value arg)))))
9551 9671
9552(defun org-metaup (&optional arg) 9672(defun org-metaup (&optional arg)
9553 "Call `org-move-subtree-up' or `org-table-move-row' up." 9673 "Move subtree up or move table row up.
9674Calls `org-move-subtree-up' or `org-table-move-row', depending on context.
9675See the individual commands for more information."
9554 (interactive "P") 9676 (interactive "P")
9555 (cond 9677 (cond
9556 ((org-at-table-p) (org-table-move-row 'up)) 9678 ((org-at-table-p) (org-table-move-row 'up))
@@ -9558,7 +9680,9 @@ a reduced column width."
9558 (t (org-shiftcursor-error)))) 9680 (t (org-shiftcursor-error))))
9559 9681
9560(defun org-metadown (&optional arg) 9682(defun org-metadown (&optional arg)
9561 "Call `org-move-subtree-down' or `org-table-move-row' down." 9683 "Move subtree down or move table row down.
9684Calls `org-move-subtree-down' or `org-table-move-row', depending on context.
9685See the individual commands for more information."
9562 (interactive "P") 9686 (interactive "P")
9563 (cond 9687 (cond
9564 ((org-at-table-p) (org-table-move-row nil)) 9688 ((org-at-table-p) (org-table-move-row nil))
@@ -9566,33 +9690,43 @@ a reduced column width."
9566 (t (org-shiftcursor-error)))) 9690 (t (org-shiftcursor-error))))
9567 9691
9568(defun org-shiftup (&optional arg) 9692(defun org-shiftup (&optional arg)
9569 "Call `org-timestamp-up' or `org-priority-up'." 9693 "Increase item in timestamp or increase priority of current item.
9694Calls `org-timestamp-up' or `org-priority-up', depending on context.
9695See the individual commands for more information."
9570 (interactive "P") 9696 (interactive "P")
9571 (cond 9697 (cond
9572 ((org-at-timestamp-p) (org-timestamp-up arg)) 9698 ((org-at-timestamp-p) (org-timestamp-up arg))
9573 (t (org-priority-up)))) 9699 (t (org-priority-up))))
9574 9700
9575(defun org-shiftdown (&optional arg) 9701(defun org-shiftdown (&optional arg)
9576 "Call `org-timestamp-down' or `org-priority-down'." 9702 "Decrease item in timestamp or decrease priority of current item.
9703Calls `org-timestamp-down' or `org-priority-down', depending on context.
9704See the individual commands for more information."
9577 (interactive "P") 9705 (interactive "P")
9578 (cond 9706 (cond
9579 ((org-at-timestamp-p) (org-timestamp-down arg)) 9707 ((org-at-timestamp-p) (org-timestamp-down arg))
9580 (t (org-priority-down)))) 9708 (t (org-priority-down))))
9581 9709
9582(defun org-copy-special () 9710(defun org-copy-special ()
9583 "Call either `org-table-copy' or `org-copy-subtree'." 9711 "Copy region in table or copy current subtree.
9712Calls `org-table-copy' or `org-copy-subtree', depending on context.
9713See the individual commands for more information."
9584 (interactive) 9714 (interactive)
9585 (call-interactively 9715 (call-interactively
9586 (if (org-at-table-p) 'org-table-copy-region 'org-copy-subtree))) 9716 (if (org-at-table-p) 'org-table-copy-region 'org-copy-subtree)))
9587 9717
9588(defun org-cut-special () 9718(defun org-cut-special ()
9589 "Call either `org-table-copy' or `org-cut-subtree'." 9719 "Cut region in table or cut current subtree.
9720Calls `org-table-copy' or `org-cut-subtree', depending on context.
9721See the individual commands for more information."
9590 (interactive) 9722 (interactive)
9591 (call-interactively 9723 (call-interactively
9592 (if (org-at-table-p) 'org-table-cut-region 'org-cut-subtree))) 9724 (if (org-at-table-p) 'org-table-cut-region 'org-cut-subtree)))
9593 9725
9594(defun org-paste-special (arg) 9726(defun org-paste-special (arg)
9595 "Call either `org-table-paste-rectangle' or `org-paste-subtree'." 9727 "Paste rectangular region into table, or past subtree relative to level.
9728Calls `org-table-paste-rectangle' or `org-paste-subtree', depending on context.
9729See the individual commands for more information."
9596 (interactive "P") 9730 (interactive "P")
9597 (if (org-at-table-p) 9731 (if (org-at-table-p)
9598 (org-table-paste-rectangle) 9732 (org-table-paste-rectangle)
@@ -9605,7 +9739,8 @@ activate that table. Otherwise, if the cursor is at a normal table
9605created with org.el, re-align that table. This command works even if 9739created with org.el, re-align that table. This command works even if
9606the automatic table editor has been turned off. 9740the automatic table editor has been turned off.
9607If the cursor is in one of the special #+KEYWORD lines, this triggers 9741If the cursor is in one of the special #+KEYWORD lines, this triggers
9608scanning the buffer for these lines and updating the information." 9742scanning the buffer for these lines and updating the information.
9743If the cursor is on a #+TBLFM line, re-apply the formulae to the table."
9609 (interactive "P") 9744 (interactive "P")
9610 (let ((org-enable-table-editor t)) 9745 (let ((org-enable-table-editor t))
9611 (cond 9746 (cond
@@ -9629,7 +9764,7 @@ scanning the buffer for these lines and updating the information."
9629 (skip-chars-backward " \r\n\t") 9764 (skip-chars-backward " \r\n\t")
9630 (if (org-at-table-p) (org-table-recalculate t)))) 9765 (if (org-at-table-p) (org-table-recalculate t))))
9631 (t 9766 (t
9632 (let ((org-inhibit-startup t)) (org-mode))))) 9767 (org-mode-restart))))
9633 ((org-region-active-p) 9768 ((org-region-active-p)
9634 (org-table-convert-region (region-beginning) (region-end) arg)) 9769 (org-table-convert-region (region-beginning) (region-end) arg))
9635 ((and (region-beginning) (region-end)) 9770 ((and (region-beginning) (region-end))
@@ -9638,8 +9773,17 @@ scanning the buffer for these lines and updating the information."
9638 (error "Abort"))) 9773 (error "Abort")))
9639 (t (error "No table at point, and no region to make one"))))) 9774 (t (error "No table at point, and no region to make one")))))
9640 9775
9776(defun org-mode-restart ()
9777 "Restart Org-mode, to scan again for special lines.
9778Also updates the keyword regular expressions."
9779 (interactive)
9780 (let ((org-inhibit-startup t)) (org-mode))
9781 (message "Org-mode restarted to refresh keyword and special line setup"))
9782
9641(defun org-return () 9783(defun org-return ()
9642 "Call `org-table-next-row' or `newline'." 9784 "Goto next table row or insert a newline.
9785Calls `org-table-next-row' or `newline', depending on context.
9786See the individual commands for more information."
9643 (interactive) 9787 (interactive)
9644 (cond 9788 (cond
9645 ((org-at-table-p) 9789 ((org-at-table-p)
@@ -9648,7 +9792,9 @@ scanning the buffer for these lines and updating the information."
9648 (t (newline)))) 9792 (t (newline))))
9649 9793
9650(defun org-meta-return (&optional arg) 9794(defun org-meta-return (&optional arg)
9651 "Call `org-insert-heading' or `org-table-wrap-region'." 9795 "Insert a new heading or wrap a region in a table.
9796Calls `org-insert-heading' or `org-table-wrap-region', depending on context.
9797See the individual commands for more information."
9652 (interactive "P") 9798 (interactive "P")
9653 (cond 9799 (cond
9654 ((org-at-table-p) 9800 ((org-at-table-p)
@@ -9716,6 +9862,7 @@ scanning the buffer for these lines and updating the information."
9716(easy-menu-define org-org-menu org-mode-map "Org menu" 9862(easy-menu-define org-org-menu org-mode-map "Org menu"
9717 '("Org" 9863 '("Org"
9718 ["Cycle Visibility" org-cycle (or (bobp) (outline-on-heading-p))] 9864 ["Cycle Visibility" org-cycle (or (bobp) (outline-on-heading-p))]
9865 ["Cycle Global Visibility" org-shifttab (not (org-at-table-p))]
9719 ["Sparse Tree" org-occur t] 9866 ["Sparse Tree" org-occur t]
9720 ["Show All" show-all t] 9867 ["Show All" show-all t]
9721 "--" 9868 "--"
@@ -9752,6 +9899,7 @@ scanning the buffer for these lines and updating the information."
9752 ["Priority Down" org-shiftdown t]) 9899 ["Priority Down" org-shiftdown t])
9753 ("Dates and Scheduling" 9900 ("Dates and Scheduling"
9754 ["Timestamp" org-time-stamp t] 9901 ["Timestamp" org-time-stamp t]
9902 ["Timestamp (inactive)" org-time-stamp-inactive t]
9755 ("Change Date" 9903 ("Change Date"
9756 ["1 Day Later" org-timestamp-up-day t] 9904 ["1 Day Later" org-timestamp-up-day t]
9757 ["1 Day Earlier" org-timestamp-down-day t] 9905 ["1 Day Earlier" org-timestamp-down-day t]
@@ -9795,6 +9943,8 @@ scanning the buffer for these lines and updating the information."
9795 "--" 9943 "--"
9796 ["Build Full Customize Menu" org-create-customize-menu 9944 ["Build Full Customize Menu" org-create-customize-menu
9797 (fboundp 'customize-menu-create)]) 9945 (fboundp 'customize-menu-create)])
9946 "--"
9947 ["Refresh setup" org-mode-restart t]
9798 )) 9948 ))
9799 9949
9800(defun org-info (&optional node) 9950(defun org-info (&optional node)
diff --git a/lisp/textmodes/refer.el b/lisp/textmodes/refer.el
index 82f06576c1a..9fa0afe2046 100644
--- a/lisp/textmodes/refer.el
+++ b/lisp/textmodes/refer.el
@@ -339,7 +339,7 @@ found on the last refer-find-entry or refer-find-next-entry."
339 (list (expand-file-name 339 (list (expand-file-name
340 (if (eq major-mode 'bibtex-mode) 340 (if (eq major-mode 'bibtex-mode)
341 (read-file-name 341 (read-file-name
342 (format ".bib file: (default %s) " 342 (format ".bib file (default %s): "
343 (file-name-nondirectory 343 (file-name-nondirectory
344 (buffer-file-name))) 344 (buffer-file-name)))
345 (file-name-directory (buffer-file-name)) 345 (file-name-directory (buffer-file-name))
diff --git a/lisp/textmodes/reftex-auc.el b/lisp/textmodes/reftex-auc.el
index f94a9d0956f..65815dd2885 100644
--- a/lisp/textmodes/reftex-auc.el
+++ b/lisp/textmodes/reftex-auc.el
@@ -19,8 +19,8 @@
19 19
20;; You should have received a copy of the GNU General Public License 20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs; see the file COPYING. If not, write to the 21;; along with GNU Emacs; see the file COPYING. If not, write to the
22;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02111-1307, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25;;; Commentary: 25;;; Commentary:
26 26
@@ -67,8 +67,8 @@ What is being used depends upon `reftex-plug-into-AUCTeX'."
67 (setq items (list (or (reftex-citation t) "")))) 67 (setq items (list (or (reftex-citation t) ""))))
68 (t 68 (t
69 (setq prompt (concat (if optional "(Optional) " "") 69 (setq prompt (concat (if optional "(Optional) " "")
70 (if prompt prompt "Add key") 70 (if prompt prompt "Add key")
71 ": (default none) ")) 71 " (default none): "))
72 (setq items (multi-prompt "," t prompt (LaTeX-bibitem-list))))) 72 (setq items (multi-prompt "," t prompt (LaTeX-bibitem-list)))))
73 (apply 'LaTeX-add-bibitems items) 73 (apply 'LaTeX-add-bibitems items)
74 (TeX-argument-insert (mapconcat 'identity items ",") optional))) 74 (TeX-argument-insert (mapconcat 'identity items ",") optional)))
@@ -79,8 +79,8 @@ What is being used depends upon `reftex-plug-into-AUCTeX'."
79This is the name of an index, not the entry." 79This is the name of an index, not the entry."
80 (let (tag taglist) 80 (let (tag taglist)
81 (setq prompt (concat (if optional "(Optional) " "") 81 (setq prompt (concat (if optional "(Optional) " "")
82 (if prompt prompt "Index tag") 82 (if prompt prompt "Index tag")
83 ": (default none) ")) 83 " (default none): "))
84 (if (and reftex-support-index (reftex-plug-flag 4)) 84 (if (and reftex-support-index (reftex-plug-flag 4))
85 ;; Use RefTeX completion 85 ;; Use RefTeX completion
86 (progn 86 (progn
diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el
index fbe1fc4621a..cb85ea201fa 100644
--- a/lisp/textmodes/reftex-cite.el
+++ b/lisp/textmodes/reftex-cite.el
@@ -19,8 +19,8 @@
19 19
20;; You should have received a copy of the GNU General Public License 20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs; see the file COPYING. If not, write to the 21;; along with GNU Emacs; see the file COPYING. If not, write to the
22;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02111-1307, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25;;; Commentary: 25;;; Commentary:
26 26
diff --git a/lisp/textmodes/reftex-dcr.el b/lisp/textmodes/reftex-dcr.el
index 18e12a66325..56adf2956c6 100644
--- a/lisp/textmodes/reftex-dcr.el
+++ b/lisp/textmodes/reftex-dcr.el
@@ -20,8 +20,8 @@
20 20
21;; You should have received a copy of the GNU General Public License 21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs; see the file COPYING. If not, write to the 22;; along with GNU Emacs; see the file COPYING. If not, write to the
23;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24;; Boston, MA 02111-1307, USA. 24;; Boston, MA 02110-1301, USA.
25 25
26;;; Commentary: 26;;; Commentary:
27 27
diff --git a/lisp/textmodes/reftex-global.el b/lisp/textmodes/reftex-global.el
index aa8c6a354ca..580a0c8e314 100644
--- a/lisp/textmodes/reftex-global.el
+++ b/lisp/textmodes/reftex-global.el
@@ -19,8 +19,8 @@
19 19
20;; You should have received a copy of the GNU General Public License 20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs; see the file COPYING. If not, write to the 21;; along with GNU Emacs; see the file COPYING. If not, write to the
22;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02111-1307, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25;;; Commentary: 25;;; Commentary:
26 26
diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el
index 83a5d4ac137..65025645c0d 100644
--- a/lisp/textmodes/reftex-index.el
+++ b/lisp/textmodes/reftex-index.el
@@ -19,8 +19,8 @@
19 19
20;; You should have received a copy of the GNU General Public License 20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs; see the file COPYING. If not, write to the 21;; along with GNU Emacs; see the file COPYING. If not, write to the
22;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02111-1307, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25;;; Commentary: 25;;; Commentary:
26 26
@@ -166,13 +166,20 @@ will prompt for other arguments."
166 ;; OPT-ARGS is a list of optional argument indices, as given by 166 ;; OPT-ARGS is a list of optional argument indices, as given by
167 ;; `reftex-parse-args'. 167 ;; `reftex-parse-args'.
168 (let* ((opt (and (integerp itag) (member itag opt-args))) 168 (let* ((opt (and (integerp itag) (member itag opt-args)))
169 (index-tags (cdr (assq 'index-tags 169 (index-tags (cdr (assq 'index-tags
170 (symbol-value reftex-docstruct-symbol)))) 170 (symbol-value reftex-docstruct-symbol))))
171 (default (reftex-default-index)) 171 (default (reftex-default-index))
172 (prompt (concat "Index tag" 172 (prompt (concat "Index tag"
173 (if default (format " (default: %s)" default) "") 173 (if (or opt default)
174 (if opt " (optional)" "") ": ")) 174 (format " (%s): "
175 (tag (completing-read prompt (mapcar 'list index-tags)))) 175 (concat
176 (if opt "optional" "")
177 (if default
178 (concat (if opt ", " "")
179 (format "default %s" default))
180 "")))
181 ": ")))
182 (tag (completing-read prompt (mapcar 'list index-tags))))
176 (if (and default (equal tag "")) (setq tag default)) 183 (if (and default (equal tag "")) (setq tag default))
177 (reftex-update-default-index tag) 184 (reftex-update-default-index tag)
178 tag)) 185 tag))
@@ -1232,7 +1239,7 @@ If the buffer is non-empty, delete the old header first."
1232 (beginning-of-line 2)) 1239 (beginning-of-line 2))
1233 (cond ((fboundp 'zmacs-activate-region) (zmacs-activate-region)) 1240 (cond ((fboundp 'zmacs-activate-region) (zmacs-activate-region))
1234 ((boundp 'make-active) (setq mark-active t))) 1241 ((boundp 'make-active) (setq mark-active t)))
1235 (if (yes-or-no-p "Delete and rebuilt header ") 1242 (if (yes-or-no-p "Delete and rebuild header? ")
1236 (delete-region (point-min) (point)))) 1243 (delete-region (point-min) (point))))
1237 1244
1238 ;; Insert the mode line 1245 ;; Insert the mode line
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el
index 448f4381d23..032bcba7dc9 100644
--- a/lisp/textmodes/reftex-parse.el
+++ b/lisp/textmodes/reftex-parse.el
@@ -20,8 +20,8 @@
20 20
21;; You should have received a copy of the GNU General Public License 21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs; see the file COPYING. If not, write to the 22;; along with GNU Emacs; see the file COPYING. If not, write to the
23;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24;; Boston, MA 02111-1307, USA. 24;; Boston, MA 02110-1301, USA.
25 25
26;;; Commentary: 26;;; Commentary:
27 27
diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el
index d3fce91a946..c250806c118 100644
--- a/lisp/textmodes/reftex-ref.el
+++ b/lisp/textmodes/reftex-ref.el
@@ -19,8 +19,8 @@
19 19
20;; You should have received a copy of the GNU General Public License 20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs; see the file COPYING. If not, write to the 21;; along with GNU Emacs; see the file COPYING. If not, write to the
22;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02111-1307, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25;;; Commentary: 25;;; Commentary:
26 26
diff --git a/lisp/textmodes/reftex-sel.el b/lisp/textmodes/reftex-sel.el
index 6402a8fea41..f4fc8368a50 100644
--- a/lisp/textmodes/reftex-sel.el
+++ b/lisp/textmodes/reftex-sel.el
@@ -19,8 +19,8 @@
19 19
20;; You should have received a copy of the GNU General Public License 20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs; see the file COPYING. If not, write to the 21;; along with GNU Emacs; see the file COPYING. If not, write to the
22;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02111-1307, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25;;; Commentary: 25;;; Commentary:
26 26
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el
index 3e8cd87bea2..541b3091af0 100644
--- a/lisp/textmodes/reftex-toc.el
+++ b/lisp/textmodes/reftex-toc.el
@@ -19,8 +19,8 @@
19 19
20;; You should have received a copy of the GNU General Public License 20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs; see the file COPYING. If not, write to the 21;; along with GNU Emacs; see the file COPYING. If not, write to the
22;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02111-1307, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25;;; Commentary: 25;;; Commentary:
26 26
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index 7a3cfab6742..703f5b8dd2a 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -19,8 +19,8 @@
19 19
20;; You should have received a copy of the GNU General Public License 20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs; see the file COPYING If not, write to the 21;; along with GNU Emacs; see the file COPYING If not, write to the
22;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02111-1307, USA. 23;; Boston, MA 02110-1301, USA.
24 24
25;;; Commentary: 25;;; Commentary:
26 26
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 81f6ad70f87..8d0aa4bf80d 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -20,8 +20,8 @@
20 20
21;; You should have received a copy of the GNU General Public License 21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs; see the file COPYING. If not, write to the 22;; along with GNU Emacs; see the file COPYING. If not, write to the
23;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24;; Boston, MA 02111-1307, USA. 24;; Boston, MA 02110-1301, USA.
25 25
26;;--------------------------------------------------------------------------- 26;;---------------------------------------------------------------------------
27;; 27;;
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index fa6fdea8b18..4c5fe0d3e09 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -472,7 +472,7 @@ An alternative value is \" . \", if you use a font with a narrow period."
472 (arg "{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)")) 472 (arg "{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)"))
473 (list 473 (list
474 ;; font-lock-syntactic-keywords causes the \ of \end{verbatim} to be 474 ;; font-lock-syntactic-keywords causes the \ of \end{verbatim} to be
475 ;; highlighted as tex-verbatim-face. Let's undo that. 475 ;; highlighted as tex-verbatim face. Let's undo that.
476 ;; This is ugly and brittle :-( --Stef 476 ;; This is ugly and brittle :-( --Stef
477 '("^\\(\\\\\\)end" (1 (get-text-property (match-end 1) 'face) t)) 477 '("^\\(\\\\\\)end" (1 (get-text-property (match-end 1) 'face) t))
478 ;; display $$ math $$ 478 ;; display $$ math $$
@@ -509,7 +509,7 @@ An alternative value is \" . \", if you use a font with a narrow period."
509 509
510(defun tex-font-lock-append-prop (prop) 510(defun tex-font-lock-append-prop (prop)
511 (unless (memq (get-text-property (match-end 1) 'face) 511 (unless (memq (get-text-property (match-end 1) 'face)
512 '(font-lock-comment-face tex-verbatim-face)) 512 '(font-lock-comment-face tex-verbatim))
513 prop)) 513 prop))
514 514
515(defconst tex-font-lock-keywords-2 515(defconst tex-font-lock-keywords-2
@@ -583,7 +583,7 @@ An alternative value is \" . \", if you use a font with a narrow period."
583(defun tex-font-lock-suscript (pos) 583(defun tex-font-lock-suscript (pos)
584 (unless (or (memq (get-text-property pos 'face) 584 (unless (or (memq (get-text-property pos 'face)
585 '(font-lock-constant-face font-lock-builtin-face 585 '(font-lock-constant-face font-lock-builtin-face
586 font-lock-comment-face tex-verbatim-face)) 586 font-lock-comment-face tex-verbatim))
587 ;; Check for backslash quoting 587 ;; Check for backslash quoting
588 (let ((odd nil) 588 (let ((odd nil)
589 (pos pos)) 589 (pos pos))
@@ -1109,7 +1109,7 @@ Inserts the value of `tex-open-quote' (normally ``) or `tex-close-quote'
1109inserts \" characters." 1109inserts \" characters."
1110 (interactive "*P") 1110 (interactive "*P")
1111 (if (or arg (memq (char-syntax (preceding-char)) '(?/ ?\\)) 1111 (if (or arg (memq (char-syntax (preceding-char)) '(?/ ?\\))
1112 (eq (get-text-property (point) 'face) tex-verbatim-face) 1112 (eq (get-text-property (point) 'face) tex-verbatim)
1113 (save-excursion 1113 (save-excursion
1114 (backward-char (length tex-open-quote)) 1114 (backward-char (length tex-open-quote))
1115 (when (or (looking-at (regexp-quote tex-open-quote)) 1115 (when (or (looking-at (regexp-quote tex-open-quote))
@@ -2341,7 +2341,7 @@ Runs the shell command defined by `tex-show-queue-command'."
2341 2341
2342(defun latex-indent (&optional arg) 2342(defun latex-indent (&optional arg)
2343 (if (and (eq (get-text-property (line-beginning-position) 'face) 2343 (if (and (eq (get-text-property (line-beginning-position) 'face)
2344 tex-verbatim-face)) 2344 tex-verbatim))
2345 'noindent 2345 'noindent
2346 (with-syntax-table tex-latex-indent-syntax-table 2346 (with-syntax-table tex-latex-indent-syntax-table
2347 ;; TODO: Rather than ignore $, we should try to be more clever about it. 2347 ;; TODO: Rather than ignore $, we should try to be more clever about it.
diff --git a/lisp/tree-widget.el b/lisp/tree-widget.el
index 28207436688..d29e224f549 100644
--- a/lisp/tree-widget.el
+++ b/lisp/tree-widget.el
@@ -651,7 +651,9 @@ This hook should be local in the buffer setup to display widgets.")
651 (widget-put tree :node (widget-convert node)) 651 (widget-put tree :node (widget-convert node))
652 ;; Create the icon widget for the expanded tree. 652 ;; Create the icon widget for the expanded tree.
653 (push (widget-create-child-and-convert 653 (push (widget-create-child-and-convert
654 tree (widget-get tree (if args :open-icon :empty-icon))) 654 tree (widget-get tree (if args :open-icon :empty-icon))
655 ;; Pass the node widget to child.
656 :node (widget-get tree :node))
655 buttons) 657 buttons)
656 ;; Create the tree node widget. 658 ;; Create the tree node widget.
657 (push (widget-create-child tree (widget-get tree :node)) 659 (push (widget-create-child tree (widget-get tree :node))
@@ -701,7 +703,9 @@ This hook should be local in the buffer setup to display widgets.")
701 (widget-put tree :node (widget-convert node)) 703 (widget-put tree :node (widget-convert node))
702 ;; Create the icon widget for the collapsed tree. 704 ;; Create the icon widget for the collapsed tree.
703 (push (widget-create-child-and-convert 705 (push (widget-create-child-and-convert
704 tree (widget-get tree :close-icon)) 706 tree (widget-get tree :close-icon)
707 ;; Pass the node widget to child.
708 :node (widget-get tree :node))
705 buttons) 709 buttons)
706 ;; Create the tree node widget. 710 ;; Create the tree node widget.
707 (push (widget-create-child tree (widget-get tree :node)) 711 (push (widget-create-child tree (widget-get tree :node))
diff --git a/lisp/vc-mcvs.el b/lisp/vc-mcvs.el
index 271cd01cbfb..b52bc797dda 100644
--- a/lisp/vc-mcvs.el
+++ b/lisp/vc-mcvs.el
@@ -225,7 +225,7 @@ the Meta-CVS command (in that order)."
225 ;; Make sure the `mcvs add' will not fire up the CVSEDITOR 225 ;; Make sure the `mcvs add' will not fire up the CVSEDITOR
226 ;; to add a rule for the given file's extension. 226 ;; to add a rule for the given file's extension.
227 (when (and ext (not (assoc ext types))) 227 (when (and ext (not (assoc ext types)))
228 (let ((type (completing-read "Type to use [default]: " 228 (let ((type (completing-read "Type to use (default): "
229 '("default" "name-only" "keep-old" 229 '("default" "name-only" "keep-old"
230 "binary" "value-only") 230 "binary" "value-only")
231 nil t nil nil "default"))) 231 nil t nil nil "default")))
diff --git a/lisp/vc.el b/lisp/vc.el
index 665bb3d31e7..f7afbedc354 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -1707,7 +1707,7 @@ versions of all registered files in or below it."
1707 (interactive 1707 (interactive
1708 (let ((file (expand-file-name 1708 (let ((file (expand-file-name
1709 (read-file-name (if buffer-file-name 1709 (read-file-name (if buffer-file-name
1710 "File or dir to diff: (default visited file) " 1710 "File or dir to diff (default visited file): "
1711 "File or dir to diff: ") 1711 "File or dir to diff: ")
1712 default-directory buffer-file-name t))) 1712 default-directory buffer-file-name t)))
1713 (rev1-default nil) (rev2-default nil)) 1713 (rev1-default nil) (rev2-default nil))
@@ -1728,14 +1728,14 @@ versions of all registered files in or below it."
1728 ;; construct argument list 1728 ;; construct argument list
1729 (list file 1729 (list file
1730 (read-string (if rev1-default 1730 (read-string (if rev1-default
1731 (concat "Older version: (default " 1731 (concat "Older version (default "
1732 rev1-default ") ") 1732 rev1-default "): ")
1733 "Older version: ") 1733 "Older version: ")
1734 nil nil rev1-default) 1734 nil nil rev1-default)
1735 (read-string (if rev2-default 1735 (read-string (if rev2-default
1736 (concat "Newer version: (default " 1736 (concat "Newer version (default "
1737 rev2-default ") ") 1737 rev2-default "): ")
1738 "Newer version (default: current source): ") 1738 "Newer version (default current source): ")
1739 nil nil rev2-default)))) 1739 nil nil rev2-default))))
1740 (if (file-directory-p file) 1740 (if (file-directory-p file)
1741 ;; recursive directory diff 1741 ;; recursive directory diff
@@ -1998,7 +1998,7 @@ See Info node `Merging'."
1998 (error "Merge aborted")))) 1998 (error "Merge aborted"))))
1999 (setq first-version 1999 (setq first-version
2000 (read-string (concat "Branch or version to merge from " 2000 (read-string (concat "Branch or version to merge from "
2001 "(default: news on current branch): "))) 2001 "(default news on current branch): ")))
2002 (if (string= first-version "") 2002 (if (string= first-version "")
2003 (if (not (vc-find-backend-function backend 'merge-news)) 2003 (if (not (vc-find-backend-function backend 'merge-news))
2004 (error "Sorry, merging news is not implemented for %s" backend) 2004 (error "Sorry, merging news is not implemented for %s" backend)
@@ -2727,7 +2727,7 @@ backend to NEW-BACKEND, and unregister FILE from the current backend.
2727 (error "Deleting files under %s is not supported in VC" backend)) 2727 (error "Deleting files under %s is not supported in VC" backend))
2728 (if (and buf (buffer-modified-p buf)) 2728 (if (and buf (buffer-modified-p buf))
2729 (error "Please save files before deleting them")) 2729 (error "Please save files before deleting them"))
2730 (unless (y-or-n-p (format "Really want to delete %s ? " 2730 (unless (y-or-n-p (format "Really want to delete %s? "
2731 (file-name-nondirectory file))) 2731 (file-name-nondirectory file)))
2732 (error "Abort!")) 2732 (error "Abort!"))
2733 (unless (or (file-directory-p file) (null make-backup-files)) 2733 (unless (or (file-directory-p file) (null make-backup-files))
@@ -3080,7 +3080,7 @@ colors. `vc-annotate-background' specifies the background color."
3080 (bfn buffer-file-name) 3080 (bfn buffer-file-name)
3081 (vc-annotate-version 3081 (vc-annotate-version
3082 (if prefix (read-string 3082 (if prefix (read-string
3083 (format "Annotate from version: (default %s) " rev) 3083 (format "Annotate from version (default %s): " rev)
3084 nil nil rev) 3084 nil nil rev)
3085 rev))) 3085 rev)))
3086 (if display-mode 3086 (if display-mode
@@ -3088,7 +3088,7 @@ colors. `vc-annotate-background' specifies the background color."
3088 (if prefix 3088 (if prefix
3089 (setq vc-annotate-display-mode 3089 (setq vc-annotate-display-mode
3090 (float (string-to-number 3090 (float (string-to-number
3091 (read-string "Annotate span days: (default 20) " 3091 (read-string "Annotate span days (default 20): "
3092 nil nil "20")))))) 3092 nil nil "20"))))))
3093 (setq temp-buffer-name (format "*Annotate %s (rev %s)*" 3093 (setq temp-buffer-name (format "*Annotate %s (rev %s)*"
3094 (buffer-name) vc-annotate-version)) 3094 (buffer-name) vc-annotate-version))
diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el
index 290f23276b1..3bcea6329a8 100644
--- a/lisp/w32-fns.el
+++ b/lisp/w32-fns.el
@@ -283,7 +283,7 @@ This function is provided for backward compatibility, since
283 (interactive 283 (interactive
284 (list (let ((default locale-coding-system)) 284 (list (let ((default locale-coding-system))
285 (read-coding-system 285 (read-coding-system
286 (format "Coding system for system calls (default, %s): " 286 (format "Coding system for system calls (default %s): "
287 default) 287 default)
288 default)))) 288 default))))
289 (check-coding-system coding-system) 289 (check-coding-system coding-system)
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index b11240addab..b6ce0aa0f67 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -3055,7 +3055,7 @@ It will read a file name from the minibuffer when invoked."
3055 (abbreviate-file-name 3055 (abbreviate-file-name
3056 (if unbound 3056 (if unbound
3057 (read-file-name prompt) 3057 (read-file-name prompt)
3058 (let ((prompt2 (format "%s (default %s) " prompt value)) 3058 (let ((prompt2 (format "%s (default %s): " prompt value))
3059 (dir (file-name-directory value)) 3059 (dir (file-name-directory value))
3060 (file (file-name-nondirectory value)) 3060 (file (file-name-nondirectory value))
3061 (must-match (widget-get widget :must-match))) 3061 (must-match (widget-get widget :must-match)))
@@ -3068,7 +3068,7 @@ It will read a file name from the minibuffer when invoked."
3068;;; (file (file-name-nondirectory value)) 3068;;; (file (file-name-nondirectory value))
3069;;; (menu-tag (widget-apply widget :menu-tag-get)) 3069;;; (menu-tag (widget-apply widget :menu-tag-get))
3070;;; (must-match (widget-get widget :must-match)) 3070;;; (must-match (widget-get widget :must-match))
3071;;; (answer (read-file-name (concat menu-tag ": (default `" value "') ") 3071;;; (answer (read-file-name (concat menu-tag " (default " value "): ")
3072;;; dir nil must-match file))) 3072;;; dir nil must-match file)))
3073;;; (widget-value-set widget (abbreviate-file-name answer)) 3073;;; (widget-value-set widget (abbreviate-file-name answer))
3074;;; (widget-setup) 3074;;; (widget-setup)
@@ -3169,10 +3169,10 @@ It will read a directory name from the minibuffer when invoked."
3169 "Read coding-system from minibuffer." 3169 "Read coding-system from minibuffer."
3170 (if (widget-get widget :base-only) 3170 (if (widget-get widget :base-only)
3171 (intern 3171 (intern
3172 (completing-read (format "%s (default %s) " prompt value) 3172 (completing-read (format "%s (default %s): " prompt value)
3173 (mapcar #'list (coding-system-list t)) nil nil nil 3173 (mapcar #'list (coding-system-list t)) nil nil nil
3174 coding-system-history)) 3174 coding-system-history))
3175 (read-coding-system (format "%s (default %s) " prompt value) value))) 3175 (read-coding-system (format "%s (default %s): " prompt value) value)))
3176 3176
3177(defun widget-coding-system-action (widget &optional event) 3177(defun widget-coding-system-action (widget &optional event)
3178 (let ((answer 3178 (let ((answer
diff --git a/lisp/woman.el b/lisp/woman.el
index 315a0a3bbe5..bc7ec86e4a7 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -1229,7 +1229,7 @@ cache to be re-read."
1229 word-at-point))) 1229 word-at-point)))
1230 (completing-read 1230 (completing-read
1231 (if default 1231 (if default
1232 (format "Manual entry [default: %s]: " default) 1232 (format "Manual entry (default %s): " default)
1233 "Manual entry: ") 1233 "Manual entry: ")
1234 woman-topic-all-completions nil 1 1234 woman-topic-all-completions nil 1
1235 nil 1235 nil