aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKaroly Lorentey2005-05-09 16:13:15 +0000
committerKaroly Lorentey2005-05-09 16:13:15 +0000
commit85dc59a9ff65aaf6b8e6a0c4452f74b7dade88fd (patch)
tree85aebc58216ed19de18354b3d9974942eea621d5 /lisp
parentc25b55138a36cf5f334070baf79ce61c1e956eed (diff)
parentc7bda15b58de3efcf856786167f11f5b4175e30b (diff)
downloademacs-85dc59a9ff65aaf6b8e6a0c4452f74b7dade88fd.tar.gz
emacs-85dc59a9ff65aaf6b8e6a0c4452f74b7dade88fd.zip
Merged from miles@gnu.org--gnu-2005 (patch 292-295)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-292 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-293 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-294 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-295 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-342
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog209
-rw-r--r--lisp/calc/README38
-rw-r--r--lisp/calc/calc-alg.el2
-rw-r--r--lisp/calc/calc-arith.el2
-rw-r--r--lisp/calc/calc-comb.el2
-rw-r--r--lisp/calc/calc-embed.el9
-rw-r--r--lisp/calc/calc-ext.el4
-rw-r--r--lisp/calc/calc-lang.el2
-rw-r--r--lisp/calc/calc-math.el2
-rw-r--r--lisp/calc/calc-misc.el2
-rw-r--r--lisp/calc/calc-mode.el4
-rw-r--r--lisp/calc/calc-poly.el2
-rw-r--r--lisp/calc/calc-rewr.el2
-rw-r--r--lisp/calc/calc-store.el2
-rw-r--r--lisp/calc/calc-stuff.el2
-rw-r--r--lisp/calc/calc-vec.el2
-rw-r--r--lisp/calc/calcalg2.el2
-rw-r--r--lisp/calc/calcalg3.el2
-rw-r--r--lisp/calc/calccomp.el2
-rw-r--r--lisp/calc/calcsel2.el24
-rw-r--r--lisp/calendar/appt.el4
-rw-r--r--lisp/calendar/cal-bahai.el16
-rw-r--r--lisp/calendar/solar.el1
-rw-r--r--lisp/emacs-lisp/cl-macs.el3
-rw-r--r--lisp/emacs-lisp/easy-mmode.el21
-rw-r--r--lisp/emulation/cua-base.el24
-rw-r--r--lisp/files.el5
-rw-r--r--lisp/international/mule.el4
-rw-r--r--lisp/jka-cmpr-hook.el (renamed from lisp/jka-comp-hook.el)6
-rw-r--r--lisp/jka-compr.el2
-rw-r--r--lisp/loadup.el2
-rw-r--r--lisp/net/goto-addr.el29
-rw-r--r--lisp/net/webjump.el4
-rw-r--r--lisp/obsolete/uncompress.el8
-rw-r--r--lisp/pcvs.el4
-rw-r--r--lisp/progmodes/cmacexp.el21
-rw-r--r--lisp/progmodes/compile.el3
-rw-r--r--lisp/progmodes/gdb-ui.el28
-rw-r--r--lisp/progmodes/grep.el2
-rw-r--r--lisp/progmodes/gud.el207
-rw-r--r--lisp/progmodes/idlw-help.el153
-rw-r--r--lisp/replace.el52
-rw-r--r--lisp/simple.el4
-rw-r--r--lisp/term/mac-win.el56
-rw-r--r--lisp/textmodes/ispell.el4
-rw-r--r--lisp/textmodes/po.el21
-rw-r--r--lisp/tooltip.el211
47 files changed, 736 insertions, 475 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3453149b6fd..d6c88be6b8c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,171 @@
12005-05-09 Juanma Barranquero <lekktu@gmail.com>
2
3 * obsolete/uncompress.el: Set `find-file-not-found-functions', not
4 `find-file-not-found-hooks'; use `add-hook'.
5 (uncompress-while-visiting): Set `write-file-functions', not
6 `write-file-hooks'; use `add-hook'.
7
82005-05-09 Kim F. Storm <storm@cua.dk>
9
10 * emulation/cua-base.el (cua-copy-region, cua-cut-region)
11 (cua-paste): Handle clipboard action.
12 (cua--init-keymaps): Remap clipboard-kill-region and
13 clipboard-kill-ring-save.
14
152005-05-08 Eli Zaretskii <eliz@gnu.org>
16
17 * emacs-lisp/easy-mmode.el (easy-mmode-pretty-mode-name): Improve
18 commentary.
19
20 * simple.el (next-error-overlay-arrow-position): Revert the change
21 made on 2005-04-30.
22
232005-05-07 Jay Belanger <belanger@truman.edu>
24
25 * calc/calcsel2.el (calc-commute-left, calc-commute-right)
26 (calc-sel-unpack, calc-sel-isolate): Rename variable `reselect' to
27 `calc-sel-reselect'.
28
29 * calc/calc-mode.el (calc-save-modes): Reset the modes list if
30 Calc is in embedded mode.
31
322005-05-07 Eli Zaretskii <eliz@gnu.org>
33
34 * progmodes/compile.el (compilation-setup): Set
35 overlay-arrow-string to an empty string on text terminals.
36
37 * textmodes/ispell.el (ispell-program-name): Try looking for
38 "aspell" along exec-path, and if found, use it as the default
39 speller program.
40
412005-05-07 Jirka Kosek <jirka@kosek.cz> (tiny change)
42
43 * international/mule.el (sgml-xml-auto-coding-function): Recognize
44 encoding='FOO' in single quotes as well as in double quotes.
45
462005-05-07 Johan Bockg,Ae(Brd <bojohan@dd.chalmers.se>
47
48 * emacs-lisp/cl-macs.el (cl-transform-lambda): Recognize `declare'
49 as well as `interactive', so that defmacro* would recognize
50 `declare' forms.
51
522005-05-07 Eli Zaretskii <eliz@gnu.org>
53
54 * emacs-lisp/easy-mmode.el (easy-mmode-pretty-mode-name): Explain
55 more about the LIGHTER arg's usage in the doc string. Add
56 commentary to clarify what the code does. Fix the regexp that
57 strips whitespace from LIGHTER. Quote LIGHTER before using it,
58 since it could have characters special to regular expressions.
59
602005-05-07 Matt Hodges <MPHodges@member.fsf.org> (tiny change)
61
62 * replace.el (occur-1): Bind inhibit-read-only so that
63 erase-buffer doesn't barf on read-only text properties (likewise
64 for add-text-properties in occur-engine). Mark buffer as
65 unmodified.
66 (occur-engine): Don't set buffer-read-only here.
67
682005-05-06 Stefan Monnier <monnier@iro.umontreal.ca>
69
70 * pcvs.el (cvs-mode-commit, cvs-mode-edit-log): Don't fiddle with
71 list-buffers-directory. This caused the *cvs-commit* buffer to be
72 sometimes mistakenly reused as a *cvs* buffer.
73
742005-05-07 Nick Roberts <nickrob@snap.net.nz>
75
76 * tooltip.el: Move code for GUD tooltips into gud.el.
77 (require): CL no longer needed to compile case.
78 (tooltip-mode): Do not toggle functions for GUD tooltips.
79 (tooltip-gud-tips-p): Remove. Replace with minor mode
80 gud-tooltip-mode in gud.el.
81 (tooltip-gud-modes, tooltip-gud-display, tooltip-gud-echo-area)
82 (tooltip-gud-toggle-dereference): Rename in gud.el by replacing
83 tooltip-gud prefix with gud-tooltip and obsolete.
84 (tooltip-change-major-mode, tooltip-activate-mouse-motions-if-enabled)
85 (tooltip-mouse-motions-active, tooltip-activate-mouse-motions)
86 (tooltip-mouse-motion): Mouse movement functions/variable.
87 Rename in gud.el by adding gud prefix.
88 (tooltip-gud-original-filter, tooltip-gud-dereference)
89 (tooltip-gud-event, tooltip-toggle-gud-tips)
90 (tooltip-gud-process-output, tooltip-gud-print-command)
91 (tooltip-gud-tips): GUD tooltip functions/variables. Rename in
92 gud.el by replacing tooltip-gud prefix with gud-tooltip.
93 (gdb-tooltip-print): Move to gdb-ui.el.
94
95 * progmodes/gud.el: Move code for GUD tooltips from tooltip.el.
96 (require): CL needed to compile case.
97 (gud-tooltip-mode): Use to toggle GUD tooltips unstead of
98 tooltip-gud-tips-p. Make it a minor-mode.
99 (gud-find-file): Only prepare GUD tooltips if gud-tooltip-mode is t.
100 (gud-menu-map): GUD tooltips use gud-tooltip-mode now.
101 (gud-tooltip-modes, gud-tooltip-display, gud-tooltip-echo-area)
102 (gud-tooltip-change-major-mode)
103 (gud-tooltip-activate-mouse-motions-if-enabled)
104 (gud-tooltip-mouse-motions-active, gud-tooltip-activate-mouse-motions)
105 (gud-tooltip-mouse-motion, gud-tooltip-toggle-dereference)
106 (gud-tooltip-original-filter, gud-tooltip-dereference)
107 (gud-tooltip-event, tooltip-toggle-gud-tips)
108 (gud-tooltip-process-output, gud-tooltip-print-command)
109 (gud-tooltip-tips): Move from tooltip.el.
110
111 * progmodes/gdb-ui.el (gdb-tooltip-print): Move from tooltip.el.
112 (gdb-cpp-define-alist-flags): Doc fix.
113 (gdb-set-gud-minor-mode-1): Only prepare GUD tooltips if
114 gud-tooltip-mode is t.
115
1162005-05-06 Stefan Monnier <monnier@iro.umontreal.ca>
117
118 * net/goto-addr.el (goto-address-fontify): Make sure the overlays
119 evaporate if their text is deleted.
120 (goto-address-at-point): Make it work as a mouse binding as well.
121 (goto-address-at-mouse): Obsolete it. Update users.
122
1232005-05-06 Glenn Morris <gmorris@ast.cam.ac.uk>
124
125 * calendar/appt.el (top-level): No longer activate on load.
126
1272005-05-06 Juanma Barranquero <lekktu@gmail.com>
128
129 * calendar/cal-bahai.el (mark-bahai-diary-entries):
130 * net/webjump.el (webjump):
131 * progmodes/idlw-help.el (idlwave-do-context-help1)
132 (idlwave-highlight-linked-completions):
133 * textmodes/po.el (po-find-file-coding-system-guts):
134 Replace `assoc-ignore-case' by `assoc-string'.
135
1362005-05-06 Eli Zaretskii <eliz@gnu.org>
137
138 * files.el (locate-file): Doc fix.
139
140 * progmodes/gdb-ui.el (gdb-cpp-define-alist-program): Doc fix.
141 Remove the redundant test for ms-dos.
142
143 * progmodes/cmacexp.el (c-macro-preprocessor): Use locate-file to
144 look for the preprocessor with exec-suffixes. If not found in
145 standard places, look in exec-path. Remove most of the tests that
146 used system-type.
147
148 * loadup.el: Load jka-cmpr-hook instead of jka-comp-hook.
149
150 * jka-compr.el (jka-compr-uninstall): Add autoload cookie.
151
152 * jka-cmpr-hook.el: Renamed from jka-comp-hook.el, to avoid
153 file-name clash with jka-compr.el on 8+3 filesystems.
154
1552005-05-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
156
157 * term/mac-win.el: Don't define or bind scroll bar functions if
158 x-toolkit-scroll-bars is t.
159 (x-select-text, x-get-selection-value):
160 Clear x-last-selected-text-clipboard if x-select-enable-clipboard is
161 nil.
162 (PRIMARY): Put mac-scrap-name property.
163 (mac-select-convert-to-file-url): New function.
164 (public.file-url): New selection target type. Add to
165 selection-converter-alist.
166 (x-get-selection, x-selection-value): Handle it.
167 (x-cut-buffer-or-selection-value): New alias.
168
12005-05-05 Luc Teirlinck <teirllm@auburn.edu> 1692005-05-05 Luc Teirlinck <teirllm@auburn.edu>
2 170
3 * emacs-lisp/byte-run.el (define-obsolete-function-alias) 171 * emacs-lisp/byte-run.el (define-obsolete-function-alias)
@@ -22,8 +190,8 @@
22 (ido-file-internal): Add with-no-warnings around ffap and dired code. 190 (ido-file-internal): Add with-no-warnings around ffap and dired code.
23 (ido-exit-minibuffer): Use exit-minibuffer instead of throw. 191 (ido-exit-minibuffer): Use exit-minibuffer instead of throw.
24 (ido-wide-find-file, ido-wide-find-dir): Catch quit to cancel find. 192 (ido-wide-find-file, ido-wide-find-dir): Catch quit to cancel find.
25 (ido-push-dir, ido-pop-dir, ido-wide-find-file-or-pop-dir): New 193 (ido-push-dir, ido-pop-dir, ido-wide-find-file-or-pop-dir):
26 functions for M-b/M-f to move among the directory components. 194 New functions for M-b/M-f to move among the directory components.
27 (ido-make-merged-file-list): Catch quit to cancel merge. 195 (ido-make-merged-file-list): Catch quit to cancel merge.
28 (ido-make-dir-list): Delete "." when ido-input-stack is non-empty. 196 (ido-make-dir-list): Delete "." when ido-input-stack is non-empty.
29 (ido-completion-help): No warnings for ido-completion-buffer-full. 197 (ido-completion-help): No warnings for ido-completion-buffer-full.
@@ -38,8 +206,8 @@
38 206
392005-05-05 Juanma Barranquero <lekktu@gmail.com> 2072005-05-05 Juanma Barranquero <lekktu@gmail.com>
40 208
41 * emacs-lisp/byte-run.el (define-obsolete-function-alias): Fix 209 * emacs-lisp/byte-run.el (define-obsolete-function-alias):
42 typo in docstring. 210 Fix typo in docstring.
43 211
44 * progmodes/ebrowse.el (ebrowse-install-1-to-9-keys) 212 * progmodes/ebrowse.el (ebrowse-install-1-to-9-keys)
45 (ebrowse-print-statistics-line) 213 (ebrowse-print-statistics-line)
@@ -55,12 +223,17 @@
55 223
56 * progmodes/gdb-ui.el (gdb-cpp-define-alist-flags): New variable. 224 * progmodes/gdb-ui.el (gdb-cpp-define-alist-flags): New variable.
57 (gdb-create-define-alist): Use it. 225 (gdb-create-define-alist): Use it.
58 (gdb-cpp-define-alist-program): Update for MS-DOS? 226 (gdb-cpp-define-alist-program): Update for MS-DOS.
59 227
602005-05-04 Nick Roberts <nickrob@snap.net.nz> 2282005-05-04 Nick Roberts <nickrob@snap.net.nz>
61 229
62 * progmodes/cmacexp.el (c-macro-preprocessor): Update for Mac OSX. 230 * progmodes/cmacexp.el (c-macro-preprocessor): Update for Mac OSX.
63 231
2322005-05-04 Richard M. Stallman <rms@gnu.org>
233
234 * simple.el (line-move-1): Fix previous change to signal errors
235 appropriately.
236
642005-05-03 Ulf Jasper <ulf.jasper@web.de> 2372005-05-03 Ulf Jasper <ulf.jasper@web.de>
65 238
66 * calendar/icalendar.el (icalendar-version): Now at 0.12. 239 * calendar/icalendar.el (icalendar-version): Now at 0.12.
@@ -218,10 +391,10 @@
218 391
219 * loadup.el: load jka-comp-hook. 392 * loadup.el: load jka-comp-hook.
220 393
221 * jka-compr.el: Many functions and vars moved to jka-compr-hook.el. 394 * jka-compr.el: Many functions and vars moved to jka-comp-hook.el.
222 (jka-compr-handler): Add autoload. `put' calls moved 395 (jka-compr-handler): Add autoload. `put' calls moved
223 to jka-compr-hook.el. 396 to jka-comp-hook.el.
224 (compression, jka-compr): defgroups moved to jka-compr-hook.el. 397 (compression, jka-compr): defgroups moved to jka-comp-hook.el.
225 (jka-compr-inhibit): Autoload. 398 (jka-compr-inhibit): Autoload.
226 399
227 * jka-comp-hook.el: New file. 400 * jka-comp-hook.el: New file.
@@ -2189,7 +2362,7 @@
2189 (menu-bar-showhide-menu): Use menu-bar-make-mm-toggle. 2362 (menu-bar-showhide-menu): Use menu-bar-make-mm-toggle.
2190 (menu-bar-make-mm-toggle): Simplify. 2363 (menu-bar-make-mm-toggle): Simplify.
2191 2364
21922005-03-22 JUAN-LEON Lahoz Garcia <juanleon1@gmail.com> 23652005-03-22 JUAN-LEON Lahoz Garcia <juanleon1@gmail.com>
2193 2366
2194 * progmodes/perl-mode.el (perl-font-lock-keywords-2): 2367 * progmodes/perl-mode.el (perl-font-lock-keywords-2):
2195 Accept qualified variable and function names. 2368 Accept qualified variable and function names.
@@ -2363,7 +2536,7 @@
2363 (recentf-cleanup): Use it to conditionally check availablity of 2536 (recentf-cleanup): Use it to conditionally check availablity of
2364 remote files. 2537 remote files.
2365 2538
23662005-03-19 Joe Edmonds <joe-bugs-debian-org@elem.com> (tiny change) 25392005-03-19 Joe Edmonds <joe-bugs-debian-org@elem.com> (tiny change)
2367 2540
2368 * emacs-lisp/lisp-mode.el (lisp-mode-variables): Recognize `@' in 2541 * emacs-lisp/lisp-mode.el (lisp-mode-variables): Recognize `@' in
2369 function names. 2542 function names.
@@ -3938,7 +4111,7 @@
3938 (bibtex-parse-field-name): Fix typos in docstrings. 4111 (bibtex-parse-field-name): Fix typos in docstrings.
3939 (bibtex-field-list, bibtex-find-crossref): Fix typos in error messages. 4112 (bibtex-field-list, bibtex-find-crossref): Fix typos in error messages.
3940 4113
39412005-01-24 Carsten Dominik <dominik@science.uva.nl> 41142005-01-24 Carsten Dominik <dominik@science.uva.nl>
3942 4115
3943 * textmodes/reftex-global.el (reftex-isearch-push-state-function) 4116 * textmodes/reftex-global.el (reftex-isearch-push-state-function)
3944 (reftex-isearch-pop-state-function, reftex-isearch-isearch-search) 4117 (reftex-isearch-pop-state-function, reftex-isearch-isearch-search)
@@ -5070,7 +5243,7 @@
5070 * ffap.el (ffap-string-at-point-mode-alist): Add "*" to url chars, 5243 * ffap.el (ffap-string-at-point-mode-alist): Add "*" to url chars,
5071 it can appear unencoded and has been seen from yahoo. 5244 it can appear unencoded and has been seen from yahoo.
5072 5245
50732004-12-27 Sergey Poznyakoff <gray@Mirddin.farlep.net> (tiny change) 52462004-12-27 Sergey Poznyakoff <gray@Mirddin.farlep.net> (tiny change)
5074 5247
5075 * mail/smtpmail.el (smtpmail-try-auth-methods): Send AUTH CRAM-MD5 5248 * mail/smtpmail.el (smtpmail-try-auth-methods): Send AUTH CRAM-MD5
5076 in upper case. Reported by Wojciech Polak <polak@gnu.org>. 5249 in upper case. Reported by Wojciech Polak <polak@gnu.org>.
@@ -6440,7 +6613,7 @@
6440 other frames. 6613 other frames.
6441 (gdb-reset): Remove dedicated property after debugging. 6614 (gdb-reset): Remove dedicated property after debugging.
6442 6615
64432004-11-24 Jay Belanger <belanger@truman.edu> 66162004-11-24 Jay Belanger <belanger@truman.edu>
6444 6617
6445 * calc/calc-sel.el: Add comment. 6618 * calc/calc-sel.el: Add comment.
6446 6619
@@ -7728,7 +7901,7 @@
7728 (gud-gdba-command-name, gdb-show-main, gdb-many-windows): 7901 (gud-gdba-command-name, gdb-show-main, gdb-many-windows):
7729 Add :version keyword. 7902 Add :version keyword.
7730 7903
77312004-11-02 Pavel Kobiakov <pk_at_work@yahoo.com> 79042004-11-02 Pavel Kobiakov <pk_at_work@yahoo.com>
7732 7905
7733 * progmodes/flymake.el (flymake-err-line-patterns): 7906 * progmodes/flymake.el (flymake-err-line-patterns):
7734 Use `flymake-reformat-err-line-patterns-from-compile-el' to convert 7907 Use `flymake-reformat-err-line-patterns-from-compile-el' to convert
@@ -8137,7 +8310,7 @@
8137 Handle periods and underscores in a function name. 8310 Handle periods and underscores in a function name.
8138 Remove the address fontification. 8311 Remove the address fontification.
8139 8312
81402004-10-24 Masatake YAMATO <jet@gyve.org> 83132004-10-24 Masatake YAMATO <jet@gyve.org>
8141 8314
8142 * progmodes/asm-mode.el (asm-font-lock-keywords): 8315 * progmodes/asm-mode.el (asm-font-lock-keywords):
8143 Use font-lock-variable-name-face for registers. 8316 Use font-lock-variable-name-face for registers.
@@ -8279,7 +8452,7 @@
8279 8452
8280 * paths.el (news-path): Fix previous change. 8453 * paths.el (news-path): Fix previous change.
8281 8454
82822004-10-18 Jay Belanger <belanger@truman.edu> 84552004-10-18 Jay Belanger <belanger@truman.edu>
8283 8456
8284 * calc/calc-help.el (calc-describe-bindings): 8457 * calc/calc-help.el (calc-describe-bindings):
8285 Set `buffer-read-only' to nil while working in the keybindings buffer; 8458 Set `buffer-read-only' to nil while working in the keybindings buffer;
@@ -9419,7 +9592,7 @@
9419 9592
9420 * terminal.el (te-escape): Show `?' in prompt for help key. 9593 * terminal.el (te-escape): Show `?' in prompt for help key.
9421 9594
94222004-09-04 Emilio C. Lopes <eclig@gmx.net> 95952004-09-04 Emilio C. Lopes <eclig@gmx.net>
9423 9596
9424 * emacs-lisp/lisp.el (kill-backward-up-list): New function. 9597 * emacs-lisp/lisp.el (kill-backward-up-list): New function.
9425 9598
@@ -9827,7 +10000,7 @@
9827 10000
9828 * imenu.el: Several doc fixes: don't say variables are buffer-local. 10001 * imenu.el: Several doc fixes: don't say variables are buffer-local.
9829 10002
98302004-08-16 Davis Herring <herring@lanl.gov> 100032004-08-16 Davis Herring <herring@lanl.gov>
9831 10004
9832 * isearch.el (isearch-string, isearch-message-string, isearch-point) 10005 * isearch.el (isearch-string, isearch-message-string, isearch-point)
9833 (isearch-success, isearch-forward-flag, isearch-other-end) 10006 (isearch-success, isearch-forward-flag, isearch-other-end)
diff --git a/lisp/calc/README b/lisp/calc/README
index a9e2813673c..a307b711f1e 100644
--- a/lisp/calc/README
+++ b/lisp/calc/README
@@ -2,7 +2,7 @@
2This directory contains Calc, an advanced desk calculator for GNU 2This directory contains Calc, an advanced desk calculator for GNU
3Emacs. 3Emacs.
4 4
5"Calc" Copyright 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 5"Calc" Copyright 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
6 6
7Written by: 7Written by:
8 Dave Gillespie 8 Dave Gillespie
@@ -52,20 +52,9 @@ From the introduction to the manual:
52 52
53 53
54Calc is written entirely in Emacs Lisp, for maximum portability. 54Calc is written entirely in Emacs Lisp, for maximum portability.
55You do not need to recompile Emacs to install and use Calc.
56
57You will need about six megabytes of disk space to install Calc
58and its Info documentation.
59
60See the file INSTALL for installation instructions. The instructions
61may seem long, but on typical systems you will only need to follow the
62steps shown in the first section.
63
64Don't even try to run Calc in uncompiled (.el) form! It's far too slow.
65
66 55
67I am anxious to hear about your experiences using Calc. Send mail to 56I am anxious to hear about your experiences using Calc. Send mail to
68"daveg@synaptics.com". A bug report is most useful if you include the 57"belanger@truman.edu". A bug report is most useful if you include the
69exact input and output that occurred, any modes in effect (such as the 58exact input and output that occurred, any modes in effect (such as the
70current precision), and so on. If you find Calc is difficult to operate 59current precision), and so on. If you find Calc is difficult to operate
71in any way, or if you have other suggestions, don't hesitate to let me 60in any way, or if you have other suggestions, don't hesitate to let me
@@ -73,21 +62,32 @@ know. If you find errors (including simple typos) in the manual, let
73me know. Even if you find no bugs at all I would love to hear your 62me know. Even if you find no bugs at all I would love to hear your
74opinions. 63opinions.
75 64
76The latest Calc tar files and patches are always available for anonymous
77FTP on prep.ai.mit.edu.
78 65
79Thanks,
80 66
81 -- Dave 67Summary of changes to "Calc"
68------- -- ------- -- ----
82 69
83 70
71Version 2.1:
84 72
73* Added new functions: sec, csc, cot, sech, csch, coth.
85 74
75* 0^0 now evaluates to 1.
86 76
87Summary of changes to "Calc" 77* Added a new language mode for LaTeX.
88------- -- ------- -- ---- 78
79* Calc now tries to use an appropriate language mode in embedded mode.
80
81* Calc now restores original modes when leaving embedded mode.
89 82
83* User settable variables which are not set with keystrokes are now
84 customizable.
90 85
86* Made ~/.calc.el the default Calc settings file.
87
88* Miscellaneous updates and bugfixes.
89
90
91Version 2.02f: 91Version 2.02f:
92 92
93 * Fixed a bug which broke `I', `H', `K' prefix keys in recent Emacs. 93 * Fixed a bug which broke `I', `H', `K' prefix keys in recent Emacs.
diff --git a/lisp/calc/calc-alg.el b/lisp/calc/calc-alg.el
index b722261907d..45d66231835 100644
--- a/lisp/calc/calc-alg.el
+++ b/lisp/calc/calc-alg.el
@@ -1,6 +1,6 @@
1;;; calc-alg.el --- algebraic functions for Calc 1;;; calc-alg.el --- algebraic functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
diff --git a/lisp/calc/calc-arith.el b/lisp/calc/calc-arith.el
index d9acc2ebc52..bba7a8fe942 100644
--- a/lisp/calc/calc-arith.el
+++ b/lisp/calc/calc-arith.el
@@ -1,6 +1,6 @@
1;;; calc-arith.el --- arithmetic functions for Calc 1;;; calc-arith.el --- arithmetic functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
diff --git a/lisp/calc/calc-comb.el b/lisp/calc/calc-comb.el
index adb8fcecce6..c7bf225fe7c 100644
--- a/lisp/calc/calc-comb.el
+++ b/lisp/calc/calc-comb.el
@@ -1,6 +1,6 @@
1;;; calc-comb.el --- combinatoric functions for Calc 1;;; calc-comb.el --- combinatoric functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el
index 4f45419c136..6b94cd0af0c 100644
--- a/lisp/calc/calc-embed.el
+++ b/lisp/calc/calc-embed.el
@@ -148,6 +148,15 @@
148 (setq calc-embedded-original-modes (cons lang modes))) 148 (setq calc-embedded-original-modes (cons lang modes)))
149 (setq calc-embedded-original-modes nil)))) 149 (setq calc-embedded-original-modes nil))))
150 150
151(defun calc-embedded-preserve-modes ()
152 "Preserve the current modes when leaving embedded mode."
153 (interactive)
154 (if calc-embedded-info
155 (progn
156 (calc-embedded-save-original-modes)
157 (message "Current modes will be preserved when leaving embedded mode."))
158 (message "Not in embedded mode.")))
159
151(defun calc-embedded-restore-original-modes () 160(defun calc-embedded-restore-original-modes ()
152 "Restore the original Calc modes when leaving embedded mode." 161 "Restore the original Calc modes when leaving embedded mode."
153 (let ((calcbuf (get-buffer "*Calculator*")) 162 (let ((calcbuf (get-buffer "*Calculator*"))
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index df9f9512aaa..5b23dabbbf5 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -378,6 +378,7 @@
378 (define-key calc-mode-map "m?" 'calc-m-prefix-help) 378 (define-key calc-mode-map "m?" 'calc-m-prefix-help)
379 (define-key calc-mode-map "ma" 'calc-algebraic-mode) 379 (define-key calc-mode-map "ma" 'calc-algebraic-mode)
380 (define-key calc-mode-map "md" 'calc-degrees-mode) 380 (define-key calc-mode-map "md" 'calc-degrees-mode)
381 (define-key calc-mode-map "me" 'calc-embedded-preserve-modes)
381 (define-key calc-mode-map "mf" 'calc-frac-mode) 382 (define-key calc-mode-map "mf" 'calc-frac-mode)
382 (define-key calc-mode-map "mg" 'calc-get-modes) 383 (define-key calc-mode-map "mg" 'calc-get-modes)
383 (define-key calc-mode-map "mh" 'calc-hms-mode) 384 (define-key calc-mode-map "mh" 'calc-hms-mode)
@@ -737,7 +738,8 @@ math-polar math-want-polar)
737 738
738 ("calc-embed" calc-do-embedded 739 ("calc-embed" calc-do-embedded
739calc-do-embedded-activate calc-embedded-evaluate-expr 740calc-do-embedded-activate calc-embedded-evaluate-expr
740calc-embedded-modes-change calc-embedded-var-change) 741calc-embedded-modes-change calc-embedded-var-change
742calc-embedded-preserve-modes)
741 743
742 ("calc-fin" calc-to-percentage calcFunc-ddb 744 ("calc-fin" calc-to-percentage calcFunc-ddb
743calcFunc-fv calcFunc-fvb calcFunc-fvl calcFunc-irr calcFunc-irrb 745calcFunc-fv calcFunc-fvb calcFunc-fvl calcFunc-irr calcFunc-irrb
diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el
index 9510507e276..67cc5270942 100644
--- a/lisp/calc/calc-lang.el
+++ b/lisp/calc/calc-lang.el
@@ -1,6 +1,6 @@
1;;; calc-lang.el --- calc language functions 1;;; calc-lang.el --- calc language functions
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el
index ffb7644cdfe..bd939e1669c 100644
--- a/lisp/calc/calc-math.el
+++ b/lisp/calc/calc-math.el
@@ -1,6 +1,6 @@
1;;; calc-math.el --- mathematical functions for Calc 1;;; calc-math.el --- mathematical functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el
index 8040d28d083..3b2f95d9be8 100644
--- a/lisp/calc/calc-misc.el
+++ b/lisp/calc/calc-misc.el
@@ -1,6 +1,6 @@
1;;; calc-misc.el --- miscellaenous functions for Calc 1;;; calc-misc.el --- miscellaenous functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
diff --git a/lisp/calc/calc-mode.el b/lisp/calc/calc-mode.el
index 389b52385b6..1c5bd29e804 100644
--- a/lisp/calc/calc-mode.el
+++ b/lisp/calc/calc-mode.el
@@ -304,7 +304,9 @@
304 vals (cdr vals)))) 304 vals (cdr vals))))
305 (run-hooks 'calc-mode-save-hook) 305 (run-hooks 'calc-mode-save-hook)
306 (insert ";;; End of mode settings\n") 306 (insert ";;; End of mode settings\n")
307 (save-buffer)))) 307 (save-buffer)
308 (if calc-embedded-info
309 (calc-embedded-save-original-modes)))))
308 310
309(defun calc-settings-file-name (name &optional arg) 311(defun calc-settings-file-name (name &optional arg)
310 (interactive 312 (interactive
diff --git a/lisp/calc/calc-poly.el b/lisp/calc/calc-poly.el
index 95fdba2562c..e887e77030e 100644
--- a/lisp/calc/calc-poly.el
+++ b/lisp/calc/calc-poly.el
@@ -1,6 +1,6 @@
1;;; calc-poly.el --- polynomial functions for Calc 1;;; calc-poly.el --- polynomial functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
diff --git a/lisp/calc/calc-rewr.el b/lisp/calc/calc-rewr.el
index f5788fa6e84..c520c4d390c 100644
--- a/lisp/calc/calc-rewr.el
+++ b/lisp/calc/calc-rewr.el
@@ -1,6 +1,6 @@
1;;; calc-rewr.el --- rewriting functions for Calc 1;;; calc-rewr.el --- rewriting functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el
index 52f0cc0272d..f59cad99802 100644
--- a/lisp/calc/calc-store.el
+++ b/lisp/calc/calc-store.el
@@ -1,6 +1,6 @@
1;;; calc-store.el --- value storage functions for Calc 1;;; calc-store.el --- value storage functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
diff --git a/lisp/calc/calc-stuff.el b/lisp/calc/calc-stuff.el
index 8d2180c9c47..288ec70b00e 100644
--- a/lisp/calc/calc-stuff.el
+++ b/lisp/calc/calc-stuff.el
@@ -1,6 +1,6 @@
1;;; calc-stuff.el --- miscellaneous functions for Calc 1;;; calc-stuff.el --- miscellaneous functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
diff --git a/lisp/calc/calc-vec.el b/lisp/calc/calc-vec.el
index 2ae327b36bf..efe2e30ce71 100644
--- a/lisp/calc/calc-vec.el
+++ b/lisp/calc/calc-vec.el
@@ -1,6 +1,6 @@
1;;; calc-vec.el --- vector functions for Calc 1;;; calc-vec.el --- vector functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
diff --git a/lisp/calc/calcalg2.el b/lisp/calc/calcalg2.el
index d2459919fda..7e502aa1a87 100644
--- a/lisp/calc/calcalg2.el
+++ b/lisp/calc/calcalg2.el
@@ -1,6 +1,6 @@
1;;; calcalg2.el --- more algebraic functions for Calc 1;;; calcalg2.el --- more algebraic functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el
index 90ceaea68db..bbba841c220 100644
--- a/lisp/calc/calcalg3.el
+++ b/lisp/calc/calcalg3.el
@@ -1,6 +1,6 @@
1;;; calcalg3.el --- more algebraic functions for Calc 1;;; calcalg3.el --- more algebraic functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el
index 305e155843e..70ceb01da64 100644
--- a/lisp/calc/calccomp.el
+++ b/lisp/calc/calccomp.el
@@ -1,6 +1,6 @@
1;;; calccomp.el --- composition functions for Calc 1;;; calccomp.el --- composition functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2005 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
diff --git a/lisp/calc/calcsel2.el b/lisp/calc/calcsel2.el
index 28944755a1b..20020f57468 100644
--- a/lisp/calc/calcsel2.el
+++ b/lisp/calc/calcsel2.el
@@ -34,6 +34,10 @@
34;; The variable calc-keep-selection is declared and set in calc-sel.el. 34;; The variable calc-keep-selection is declared and set in calc-sel.el.
35(defvar calc-keep-selection) 35(defvar calc-keep-selection)
36 36
37;; The variable calc-sel-reselect is local to the methods below,
38;; but is used by some functions in calc-sel.el which are called
39;; by the functions below.
40
37(defun calc-commute-left (arg) 41(defun calc-commute-left (arg)
38 (interactive "p") 42 (interactive "p")
39 (if (< arg 0) 43 (if (< arg 0)
@@ -41,7 +45,7 @@
41 (calc-wrapper 45 (calc-wrapper
42 (calc-preserve-point) 46 (calc-preserve-point)
43 (let ((num (max 1 (calc-locate-cursor-element (point)))) 47 (let ((num (max 1 (calc-locate-cursor-element (point))))
44 (reselect calc-keep-selection)) 48 (calc-sel-reselect calc-keep-selection))
45 (if (= arg 0) (setq arg nil)) 49 (if (= arg 0) (setq arg nil))
46 (while (or (null arg) (>= (setq arg (1- arg)) 0)) 50 (while (or (null arg) (>= (setq arg (1- arg)) 0))
47 (let* ((entry (calc-top num 'entry)) 51 (let* ((entry (calc-top num 'entry))
@@ -106,14 +110,14 @@
106 (if (null new) 110 (if (null new)
107 (if arg 111 (if arg
108 (error "Term is already leftmost") 112 (error "Term is already leftmost")
109 (or reselect 113 (or calc-sel-reselect
110 (calc-pop-push-list 1 (list expr) num '(nil))) 114 (calc-pop-push-list 1 (list expr) num '(nil)))
111 (setq arg 0)) 115 (setq arg 0))
112 (calc-pop-push-record-list 116 (calc-pop-push-record-list
113 1 "left" 117 1 "left"
114 (list (calc-replace-sub-formula expr parent new)) 118 (list (calc-replace-sub-formula expr parent new))
115 num 119 num
116 (list (and (or (not (eq arg 0)) reselect) 120 (list (and (or (not (eq arg 0)) calc-sel-reselect)
117 sel)))))))))) 121 sel))))))))))
118 122
119(defun calc-commute-right (arg) 123(defun calc-commute-right (arg)
@@ -123,7 +127,7 @@
123 (calc-wrapper 127 (calc-wrapper
124 (calc-preserve-point) 128 (calc-preserve-point)
125 (let ((num (max 1 (calc-locate-cursor-element (point)))) 129 (let ((num (max 1 (calc-locate-cursor-element (point))))
126 (reselect calc-keep-selection)) 130 (calc-sel-reselect calc-keep-selection))
127 (if (= arg 0) (setq arg nil)) 131 (if (= arg 0) (setq arg nil))
128 (while (or (null arg) (>= (setq arg (1- arg)) 0)) 132 (while (or (null arg) (>= (setq arg (1- arg)) 0))
129 (let* ((entry (calc-top num 'entry)) 133 (let* ((entry (calc-top num 'entry))
@@ -189,14 +193,14 @@
189 (if (null new) 193 (if (null new)
190 (if arg 194 (if arg
191 (error "Term is already rightmost") 195 (error "Term is already rightmost")
192 (or reselect 196 (or calc-sel-reselect
193 (calc-pop-push-list 1 (list expr) num '(nil))) 197 (calc-pop-push-list 1 (list expr) num '(nil)))
194 (setq arg 0)) 198 (setq arg 0))
195 (calc-pop-push-record-list 199 (calc-pop-push-record-list
196 1 "rght" 200 1 "rght"
197 (list (calc-replace-sub-formula expr parent new)) 201 (list (calc-replace-sub-formula expr parent new))
198 num 202 num
199 (list (and (or (not (eq arg 0)) reselect) 203 (list (and (or (not (eq arg 0)) calc-sel-reselect)
200 sel)))))))))) 204 sel))))))))))
201 205
202(defun calc-build-assoc-term (op lhs rhs) 206(defun calc-build-assoc-term (op lhs rhs)
@@ -225,7 +229,7 @@
225 (calc-wrapper 229 (calc-wrapper
226 (calc-preserve-point) 230 (calc-preserve-point)
227 (let* ((num (max 1 (calc-locate-cursor-element (point)))) 231 (let* ((num (max 1 (calc-locate-cursor-element (point))))
228 (reselect calc-keep-selection) 232 (calc-sel-reselect calc-keep-selection)
229 (entry (calc-top num 'entry)) 233 (entry (calc-top num 'entry))
230 (expr (car entry)) 234 (expr (car entry))
231 (sel (or (calc-auto-selection entry) expr))) 235 (sel (or (calc-auto-selection entry) expr)))
@@ -236,14 +240,14 @@
236 (list (calc-replace-sub-formula 240 (list (calc-replace-sub-formula
237 expr sel (nth 1 sel))) 241 expr sel (nth 1 sel)))
238 num 242 num
239 (list (and reselect (nth 1 sel))))))) 243 (list (and calc-sel-reselect (nth 1 sel)))))))
240 244
241(defun calc-sel-isolate () 245(defun calc-sel-isolate ()
242 (interactive) 246 (interactive)
243 (calc-slow-wrapper 247 (calc-slow-wrapper
244 (calc-preserve-point) 248 (calc-preserve-point)
245 (let* ((num (max 1 (calc-locate-cursor-element (point)))) 249 (let* ((num (max 1 (calc-locate-cursor-element (point))))
246 (reselect calc-keep-selection) 250 (calc-sel-reselect calc-keep-selection)
247 (entry (calc-top num 'entry)) 251 (entry (calc-top num 'entry))
248 (expr (car entry)) 252 (expr (car entry))
249 (sel (or (calc-auto-selection entry) (error "No selection"))) 253 (sel (or (calc-auto-selection entry) (error "No selection")))
@@ -266,7 +270,7 @@
266 (list (calc-replace-sub-formula 270 (list (calc-replace-sub-formula
267 expr eqn soln)) 271 expr eqn soln))
268 num 272 num
269 (list (and reselect sel))) 273 (list (and calc-sel-reselect sel)))
270 (calc-handle-whys)))) 274 (calc-handle-whys))))
271 275
272(defun calc-sel-commute (many) 276(defun calc-sel-commute (many)
diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el
index 8ace0be910b..d007e5b4546 100644
--- a/lisp/calendar/appt.el
+++ b/lisp/calendar/appt.el
@@ -688,10 +688,6 @@ ARG is positive, otherwise off."
688 (appt-check t)))) 688 (appt-check t))))
689 689
690 690
691;; This is needed for backwards compatibility. Feh.
692(appt-activate 1)
693
694
695(provide 'appt) 691(provide 'appt)
696 692
697;;; arch-tag: bf5791c4-8921-499e-a26f-772b1788d347 693;;; arch-tag: bf5791c4-8921-499e-a26f-772b1788d347
diff --git a/lisp/calendar/cal-bahai.el b/lisp/calendar/cal-bahai.el
index 4dfd8eb16e5..2bcfaf648ec 100644
--- a/lisp/calendar/cal-bahai.el
+++ b/lisp/calendar/cal-bahai.el
@@ -375,19 +375,21 @@ nongregorian-diary-marking-hook."
375 (string-to-int y-str))))) 375 (string-to-int y-str)))))
376 (if dd-name 376 (if dd-name
377 (mark-calendar-days-named 377 (mark-calendar-days-named
378 (cdr (assoc-ignore-case (substring dd-name 0 3) 378 (cdr (assoc-string (substring dd-name 0 3)
379 (calendar-make-alist 379 (calendar-make-alist
380 calendar-day-name-array 380 calendar-day-name-array
381 0 381 0
382 '(lambda (x) (substring x 0 3)))))) 382 '(lambda (x) (substring x 0 3)))
383 t)))
383 (if mm-name 384 (if mm-name
384 (if (string-equal mm-name "*") 385 (if (string-equal mm-name "*")
385 (setq mm 0) 386 (setq mm 0)
386 (setq mm 387 (setq mm
387 (cdr (assoc-ignore-case 388 (cdr (assoc-string
388 mm-name 389 mm-name
389 (calendar-make-alist 390 (calendar-make-alist
390 bahai-calendar-month-name-array)))))) 391 bahai-calendar-month-name-array)
392 t)))))
391 (mark-bahai-calendar-date-pattern mm dd yy))))) 393 (mark-bahai-calendar-date-pattern mm dd yy)))))
392 (setq d (cdr d))))) 394 (setq d (cdr d)))))
393 395
diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el
index 57a6c6a40a8..5eca356af59 100644
--- a/lisp/calendar/solar.el
+++ b/lisp/calendar/solar.el
@@ -4,6 +4,7 @@
4 4
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
6;; Denis B. Roegel <Denis.Roegel@loria.fr> 6;; Denis B. Roegel <Denis.Roegel@loria.fr>
7;; Maintainer: Glenn Morris <gmorris@ast.cam.ac.uk>
7;; Keywords: calendar 8;; Keywords: calendar
8;; Human-Keywords: sunrise, sunset, equinox, solstice, calendar, diary, 9;; Human-Keywords: sunrise, sunset, equinox, solstice, calendar, diary,
9;; holidays 10;; holidays
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 4a46801763a..aae2fd9f3d8 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -233,7 +233,8 @@ ARGLIST allows full Common Lisp conventions."
233 (bind-defs nil) (bind-enquote nil) 233 (bind-defs nil) (bind-enquote nil)
234 (bind-inits nil) (bind-lets nil) (bind-forms nil) 234 (bind-inits nil) (bind-lets nil) (bind-forms nil)
235 (header nil) (simple-args nil)) 235 (header nil) (simple-args nil))
236 (while (or (stringp (car body)) (eq (car-safe (car body)) 'interactive)) 236 (while (or (stringp (car body))
237 (memq (car-safe (car body)) '(interactive declare)))
237 (push (pop body) header)) 238 (push (pop body) header))
238 (setq args (if (listp args) (copy-list args) (list '&rest args))) 239 (setq args (if (listp args) (copy-list args) (list '&rest args)))
239 (let ((p (last args))) (if (cdr p) (setcdr p (list '&rest (cdr p))))) 240 (let ((p (last args))) (if (cdr p) (setcdr p (list '&rest (cdr p)))))
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 831ffb2d576..a02f7be7d13 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -58,16 +58,31 @@
58 58
59(defun easy-mmode-pretty-mode-name (mode &optional lighter) 59(defun easy-mmode-pretty-mode-name (mode &optional lighter)
60 "Turn the symbol MODE into a string intended for the user. 60 "Turn the symbol MODE into a string intended for the user.
61If provided LIGHTER will be used to help choose capitalization." 61If provided, LIGHTER will be used to help choose capitalization by,
62replacing its case-insensitive matches with the literal string in LIGHTER."
62 (let* ((case-fold-search t) 63 (let* ((case-fold-search t)
64 ;; Produce "Foo-Bar minor mode" from foo-bar-minor-mode.
63 (name (concat (replace-regexp-in-string 65 (name (concat (replace-regexp-in-string
66 ;; If the original mode name included "-minor" (some
67 ;; of them don't, e.g. auto-revert-mode), then
68 ;; replace it with " minor".
64 "-Minor" " minor" 69 "-Minor" " minor"
70 ;; "foo-bar-minor" -> "Foo-Bar-Minor"
65 (capitalize (replace-regexp-in-string 71 (capitalize (replace-regexp-in-string
72 ;; "foo-bar-minor-mode" -> "foo-bar-minor"
66 "-mode\\'" "" (symbol-name mode)))) 73 "-mode\\'" "" (symbol-name mode))))
67 " mode"))) 74 " mode")))
68 (if (not (stringp lighter)) name 75 (if (not (stringp lighter)) name
69 (setq lighter (replace-regexp-in-string "\\`\\s-+\\|\\-s+\\'" "" lighter)) 76 ;; Strip leading and trailing whitespace from LIGHTER.
70 (replace-regexp-in-string lighter lighter name t t)))) 77 (setq lighter (replace-regexp-in-string "\\`\\s-+\\|\\s-+\\'" ""
78 lighter))
79 ;; Replace any (case-insensitive) matches for LIGHTER in NAME
80 ;; with a literal LIGHTER. E.g., if NAME is "Iimage mode" and
81 ;; LIGHTER is " iImag", then this will produce "iImage mode".
82 ;; (LIGHTER normally comes from the mode-line string passed to
83 ;; define-minor-mode, and normally includes at least one leading
84 ;; space.)
85 (replace-regexp-in-string (regexp-quote lighter) lighter name t t))))
71 86
72;;;###autoload 87;;;###autoload
73(defalias 'easy-mmode-define-minor-mode 'define-minor-mode) 88(defalias 'easy-mmode-define-minor-mode 'define-minor-mode)
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index 2a515bc95f7..e9679c66dd3 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -777,9 +777,13 @@ With numeric prefix arg, copy to register 0-9 instead."
777 (let ((start (mark)) (end (point))) 777 (let ((start (mark)) (end (point)))
778 (or (<= start end) 778 (or (<= start end)
779 (setq start (prog1 end (setq end start)))) 779 (setq start (prog1 end (setq end start))))
780 (if cua--register 780 (cond
781 (copy-to-register cua--register start end nil) 781 (cua--register
782 (copy-region-as-kill start end)) 782 (copy-to-register cua--register start end nil))
783 ((eq this-original-command 'clipboard-kill-ring-save)
784 (clipboard-kill-ring-save start end))
785 (t
786 (copy-region-as-kill start end)))
783 (if cua-keep-region-after-copy 787 (if cua-keep-region-after-copy
784 (cua--keep-active) 788 (cua--keep-active)
785 (cua--deactivate)))) 789 (cua--deactivate))))
@@ -795,9 +799,13 @@ With numeric prefix arg, copy to register 0-9 instead."
795 (let ((start (mark)) (end (point))) 799 (let ((start (mark)) (end (point)))
796 (or (<= start end) 800 (or (<= start end)
797 (setq start (prog1 end (setq end start)))) 801 (setq start (prog1 end (setq end start))))
798 (if cua--register 802 (cond
799 (copy-to-register cua--register start end t) 803 (cua--register
800 (kill-region start end))) 804 (copy-to-register cua--register start end t))
805 ((eq this-original-command 'clipboard-kill-region)
806 (clipboard-kill-region start end))
807 (t
808 (kill-region start end))))
801 (cua--deactivate))) 809 (cua--deactivate)))
802 810
803;;; Generic commands for regions, rectangles, and global marks 811;;; Generic commands for regions, rectangles, and global marks
@@ -864,6 +872,8 @@ If global mark is active, copy from register or one character."
864 (cua--insert-rectangle (cdr cua--last-killed-rectangle) 872 (cua--insert-rectangle (cdr cua--last-killed-rectangle)
865 nil paste-column paste-lines) 873 nil paste-column paste-lines)
866 (if arg (goto-char pt)))) 874 (if arg (goto-char pt))))
875 ((eq this-original-command 'clipboard-yank)
876 (clipboard-yank))
867 (t (yank arg))))))) 877 (t (yank arg)))))))
868 878
869(defun cua-paste-pop (arg) 879(defun cua-paste-pop (arg)
@@ -1282,9 +1292,11 @@ If ARG is the atom `-', scroll upward by nearly full screen."
1282 (define-key cua--region-keymap [remap delete-char] 'cua-delete-region) 1292 (define-key cua--region-keymap [remap delete-char] 'cua-delete-region)
1283 ;; kill region 1293 ;; kill region
1284 (define-key cua--region-keymap [remap kill-region] 'cua-cut-region) 1294 (define-key cua--region-keymap [remap kill-region] 'cua-cut-region)
1295 (define-key cua--region-keymap [remap clipboard-kill-region] 'cua-cut-region)
1285 ;; copy region 1296 ;; copy region
1286 (define-key cua--region-keymap [remap copy-region-as-kill] 'cua-copy-region) 1297 (define-key cua--region-keymap [remap copy-region-as-kill] 'cua-copy-region)
1287 (define-key cua--region-keymap [remap kill-ring-save] 'cua-copy-region) 1298 (define-key cua--region-keymap [remap kill-ring-save] 'cua-copy-region)
1299 (define-key cua--region-keymap [remap clipboard-kill-ring-save] 'cua-copy-region)
1288 ;; cancel current region/rectangle 1300 ;; cancel current region/rectangle
1289 (define-key cua--region-keymap [remap keyboard-escape-quit] 'cua-cancel) 1301 (define-key cua--region-keymap [remap keyboard-escape-quit] 'cua-cancel)
1290 (define-key cua--region-keymap [remap keyboard-quit] 'cua-cancel) 1302 (define-key cua--region-keymap [remap keyboard-quit] 'cua-cancel)
diff --git a/lisp/files.el b/lisp/files.el
index d8aaaaf76fe..deda9dca2a7 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -632,8 +632,13 @@ The path separator is colon in GNU and GNU-like systems."
632 632
633(defun locate-file (filename path &optional suffixes predicate) 633(defun locate-file (filename path &optional suffixes predicate)
634 "Search for FILENAME through PATH. 634 "Search for FILENAME through PATH.
635If found, return the absolute file name of FILENAME, with its suffixes;
636otherwise return nil.
637PATH should be a list of directories to look in, like the lists in
638`exec-path' or `load-path'.
635If SUFFIXES is non-nil, it should be a list of suffixes to append to 639If SUFFIXES is non-nil, it should be a list of suffixes to append to
636file name when searching. If SUFFIXES is nil, it is equivalent to '(\"\"). 640file name when searching. If SUFFIXES is nil, it is equivalent to '(\"\").
641Use '(\"/\") to disable PATH search, but still try the suffixes in SUFFIXES.
637If non-nil, PREDICATE is used instead of `file-readable-p'. 642If non-nil, PREDICATE is used instead of `file-readable-p'.
638PREDICATE can also be an integer to pass to the `access' system call, 643PREDICATE can also be an integer to pass to the `access' system call,
639in which case file-name handlers are ignored. This usage is deprecated. 644in which case file-name handlers are ignored. This usage is deprecated.
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 1a3db49a667..94424dad302 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -2188,9 +2188,9 @@ This function is intended to be added to `auto-coding-functions'."
2188 (when (re-search-forward "\\`[[:space:]\n]*<\\?xml" size t) 2188 (when (re-search-forward "\\`[[:space:]\n]*<\\?xml" size t)
2189 (let ((end (save-excursion 2189 (let ((end (save-excursion
2190 ;; This is a hack. 2190 ;; This is a hack.
2191 (re-search-forward "\"\\s-*\\?>" size t)))) 2191 (re-search-forward "[\"']\\s-*\\?>" size t))))
2192 (when end 2192 (when end
2193 (if (re-search-forward "encoding=\"\\(.+?\\)\"" end t) 2193 (if (re-search-forward "encoding=[\"']\\(.+?\\)[\"']" end t)
2194 (let* ((match (match-string 1)) 2194 (let* ((match (match-string 1))
2195 (sym (intern (downcase match)))) 2195 (sym (intern (downcase match))))
2196 (if (coding-system-p sym) 2196 (if (coding-system-p sym)
diff --git a/lisp/jka-comp-hook.el b/lisp/jka-cmpr-hook.el
index ead50b76343..79b47130baf 100644
--- a/lisp/jka-comp-hook.el
+++ b/lisp/jka-cmpr-hook.el
@@ -1,4 +1,4 @@
1;;; jka-comp-hook.el --- preloaded code to enable jka-compr.el 1;;; jka-cmpr-hook.el --- preloaded code to enable jka-compr.el
2 2
3;; Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
@@ -287,7 +287,7 @@ Returns the new status of auto compression (non-nil means on)."
287;;; Turn on the mode. 287;;; Turn on the mode.
288(auto-compression-mode 1) 288(auto-compression-mode 1)
289 289
290(provide 'jka-comp-hook) 290(provide 'jka-cmpr-hook)
291 291
292;; arch-tag: 4bd73429-f400-45fe-a065-270a113e31a8 292;; arch-tag: 4bd73429-f400-45fe-a065-270a113e31a8
293;;; jka-comp-hook.el ends here \ No newline at end of file 293;;; jka-cmpr-hook.el ends here
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el
index ec2eab463cc..ca5e158349d 100644
--- a/lisp/jka-compr.el
+++ b/lisp/jka-compr.el
@@ -669,7 +669,7 @@ It is not recommended to set this variable permanently to anything but nil.")
669 (inhibit-file-name-operation operation)) 669 (inhibit-file-name-operation operation))
670 (apply operation args))) 670 (apply operation args)))
671 671
672 672;;;###autoload
673(defun jka-compr-uninstall () 673(defun jka-compr-uninstall ()
674 "Uninstall jka-compr. 674 "Uninstall jka-compr.
675This removes the entries in `file-name-handler-alist' and `auto-mode-alist' 675This removes the entries in `file-name-handler-alist' and `auto-mode-alist'
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 0963f5150ad..d5f97e49245 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -203,7 +203,7 @@
203(message "%s" (garbage-collect)) 203(message "%s" (garbage-collect))
204 204
205(load "vc-hooks") 205(load "vc-hooks")
206(load "jka-comp-hook") 206(load "jka-cmpr-hook")
207(load "ediff-hook") 207(load "ediff-hook")
208(if (fboundp 'x-show-tip) (load "tooltip")) 208(if (fboundp 'x-show-tip) (load "tooltip"))
209(message "%s" (garbage-collect)) 209(message "%s" (garbage-collect))
diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el
index 95a13b620a2..54d5854ca80 100644
--- a/lisp/net/goto-addr.el
+++ b/lisp/net/goto-addr.el
@@ -1,6 +1,6 @@
1;;; goto-addr.el --- click to browse URL or to send to e-mail address 1;;; goto-addr.el --- click to browse URL or to send to e-mail address
2 2
3;; Copyright (C) 1995, 2000, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 2000, 2001, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Eric Ding <ericding@alum.mit.edu> 5;; Author: Eric Ding <ericding@alum.mit.edu>
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -46,7 +46,7 @@
46;; 46;;
47;; (setq goto-address-highlight-keymap 47;; (setq goto-address-highlight-keymap
48;; (let ((m (make-sparse-keymap))) 48;; (let ((m (make-sparse-keymap)))
49;; (define-key m [S-mouse-2] 'goto-address-at-mouse) 49;; (define-key m [S-mouse-2] 'goto-address-at-point)
50;; m)) 50;; m))
51;; 51;;
52 52
@@ -118,9 +118,8 @@ A value of t means there is no limit--fontify regardless of the size."
118 118
119(defvar goto-address-highlight-keymap 119(defvar goto-address-highlight-keymap
120 (let ((m (make-sparse-keymap))) 120 (let ((m (make-sparse-keymap)))
121 (if (featurep 'xemacs) 121 (define-key m (if (featurep 'xemacs) (kbd "<button2>") (kbd "<mouse-2>"))
122 (define-key m (kbd "<button2>") 'goto-address-at-mouse) 122 'goto-address-at-point)
123 (define-key m (kbd "<mouse-2>") 'goto-address-at-mouse))
124 (define-key m (kbd "C-c RET") 'goto-address-at-point) 123 (define-key m (kbd "C-c RET") 'goto-address-at-point)
125 m) 124 m)
126 "keymap to hold goto-addr's mouse key defs under highlighted URLs.") 125 "keymap to hold goto-addr's mouse key defs under highlighted URLs.")
@@ -165,6 +164,7 @@ and `goto-address-fontify-p'."
165 (this-overlay (make-overlay s e))) 164 (this-overlay (make-overlay s e)))
166 (and goto-address-fontify-p 165 (and goto-address-fontify-p
167 (overlay-put this-overlay 'face goto-address-url-face)) 166 (overlay-put this-overlay 'face goto-address-url-face))
167 (overlay-put this-overlay 'evaporate t)
168 (overlay-put this-overlay 168 (overlay-put this-overlay
169 'mouse-face goto-address-url-mouse-face) 169 'mouse-face goto-address-url-mouse-face)
170 (overlay-put this-overlay 170 (overlay-put this-overlay
@@ -179,6 +179,7 @@ and `goto-address-fontify-p'."
179 (this-overlay (make-overlay s e))) 179 (this-overlay (make-overlay s e)))
180 (and goto-address-fontify-p 180 (and goto-address-fontify-p
181 (overlay-put this-overlay 'face goto-address-mail-face)) 181 (overlay-put this-overlay 'face goto-address-mail-face))
182 (overlay-put this-overlay 'evaporate t)
182 (overlay-put this-overlay 'mouse-face 183 (overlay-put this-overlay 'mouse-face
183 goto-address-mail-mouse-face) 184 goto-address-mail-mouse-face)
184 (overlay-put this-overlay 185 (overlay-put this-overlay
@@ -191,24 +192,18 @@ and `goto-address-fontify-p'."
191;; snarfed from browse-url.el 192;; snarfed from browse-url.el
192 193
193;;;###autoload 194;;;###autoload
194(defun goto-address-at-mouse (event) 195(define-obsolete-function-alias
195 "Send to the e-mail address or load the URL clicked with the mouse. 196 'goto-address-at-mouse 'goto-address-at-point "22.1")
196Send mail to address at position of mouse click. See documentation for
197`goto-address-find-address-at-point'. If no address is found
198there, then load the URL at or before the position of the mouse click."
199 (interactive "e")
200 (save-excursion
201 (mouse-set-point event)
202 (goto-address-at-point)))
203 197
204;;;###autoload 198;;;###autoload
205(defun goto-address-at-point () 199(defun goto-address-at-point (&optional event)
206 "Send to the e-mail address or load the URL at point. 200 "Send to the e-mail address or load the URL at point.
207Send mail to address at point. See documentation for 201Send mail to address at point. See documentation for
208`goto-address-find-address-at-point'. If no address is found 202`goto-address-find-address-at-point'. If no address is found
209there, then load the URL at or before point." 203there, then load the URL at or before point."
210 (interactive) 204 (interactive (list last-input-event))
211 (save-excursion 205 (save-excursion
206 (if event (mouse-set-point event))
212 (let ((address (save-excursion (goto-address-find-address-at-point)))) 207 (let ((address (save-excursion (goto-address-find-address-at-point))))
213 (if (and address 208 (if (and address
214 (save-excursion 209 (save-excursion
@@ -248,5 +243,5 @@ Also fontifies the buffer appropriately (see `goto-address-fontify-p' and
248 243
249(provide 'goto-addr) 244(provide 'goto-addr)
250 245
251;;; arch-tag: ca47c505-5661-425d-a471-62bc6e75cf0a 246;; arch-tag: ca47c505-5661-425d-a471-62bc6e75cf0a
252;;; goto-addr.el ends here 247;;; goto-addr.el ends here
diff --git a/lisp/net/webjump.el b/lisp/net/webjump.el
index 3f004b8864e..0fc47fafa85 100644
--- a/lisp/net/webjump.el
+++ b/lisp/net/webjump.el
@@ -274,9 +274,9 @@ Please submit bug reports and other feedback to the author, Neil W. Van Dyke
274<nwv@acm.org>." 274<nwv@acm.org>."
275 (interactive) 275 (interactive)
276 (let* ((completion-ignore-case t) 276 (let* ((completion-ignore-case t)
277 (item (assoc-ignore-case 277 (item (assoc-string
278 (completing-read "WebJump to site: " webjump-sites nil t) 278 (completing-read "WebJump to site: " webjump-sites nil t)
279 webjump-sites)) 279 webjump-sites t))
280 (name (car item)) 280 (name (car item))
281 (expr (cdr item))) 281 (expr (cdr item)))
282 (browse-url (webjump-url-fix 282 (browse-url (webjump-url-fix
diff --git a/lisp/obsolete/uncompress.el b/lisp/obsolete/uncompress.el
index ac567be67b0..28ad5f06c7b 100644
--- a/lisp/obsolete/uncompress.el
+++ b/lisp/obsolete/uncompress.el
@@ -83,14 +83,10 @@ It then selects a major mode from the uncompressed file name and contents."
83 (goto-char (point-min)) 83 (goto-char (point-min))
84 (message "Uncompressing...done") 84 (message "Uncompressing...done")
85 (set-buffer-modified-p nil) 85 (set-buffer-modified-p nil)
86 (make-local-variable 'write-file-hooks) 86 (add-hook 'write-file-functions 'uncompress-backup-file nil t)
87 (or (memq 'uncompress-backup-file write-file-hooks)
88 (setq write-file-hooks (cons 'uncompress-backup-file write-file-hooks)))
89 (normal-mode)) 87 (normal-mode))
90 88
91(or (memq 'find-compressed-version find-file-not-found-hooks) 89(add-hook 'find-file-not-found-functions 'find-compressed-version)
92 (setq find-file-not-found-hooks
93 (cons 'find-compressed-version find-file-not-found-hooks)))
94 90
95(defun find-compressed-version () 91(defun find-compressed-version ()
96 "Hook to read and uncompress the compressed version of a file." 92 "Hook to read and uncompress the compressed version of a file."
diff --git a/lisp/pcvs.el b/lisp/pcvs.el
index 6382705139e..7c96a080c54 100644
--- a/lisp/pcvs.el
+++ b/lisp/pcvs.el
@@ -1438,12 +1438,10 @@ The POSTPROC specified there (typically `log-edit') is then called,
1438 ;; displayed in the wrong minibuffer). 1438 ;; displayed in the wrong minibuffer).
1439 (cvs-mode!) 1439 (cvs-mode!)
1440 (let ((buf (cvs-temp-buffer "message" 'normal 'nosetup)) 1440 (let ((buf (cvs-temp-buffer "message" 'normal 'nosetup))
1441 (lbd list-buffers-directory)
1442 (setupfun (or (nth 2 (cdr (assoc "message" cvs-buffer-name-alist))) 1441 (setupfun (or (nth 2 (cdr (assoc "message" cvs-buffer-name-alist)))
1443 'log-edit))) 1442 'log-edit)))
1444 (funcall setupfun 'cvs-do-commit setup 'cvs-commit-filelist buf) 1443 (funcall setupfun 'cvs-do-commit setup 'cvs-commit-filelist buf)
1445 (set (make-local-variable 'cvs-minor-wrap-function) 'cvs-commit-minor-wrap) 1444 (set (make-local-variable 'cvs-minor-wrap-function) 'cvs-commit-minor-wrap)
1446 (set (make-local-variable 'list-buffers-directory) lbd)
1447 (run-hooks 'cvs-mode-commit-hook))) 1445 (run-hooks 'cvs-mode-commit-hook)))
1448 1446
1449(defun cvs-commit-minor-wrap (buf f) 1447(defun cvs-commit-minor-wrap (buf f)
@@ -1494,14 +1492,12 @@ This is best called from a `log-view-mode' buffer."
1494 ;; displayed in the wrong minibuffer). 1492 ;; displayed in the wrong minibuffer).
1495 (cvs-mode!) 1493 (cvs-mode!)
1496 (let ((buf (cvs-temp-buffer "message" 'normal 'nosetup)) 1494 (let ((buf (cvs-temp-buffer "message" 'normal 'nosetup))
1497 (lbd list-buffers-directory)
1498 (setupfun (or (nth 2 (cdr (assoc "message" cvs-buffer-name-alist))) 1495 (setupfun (or (nth 2 (cdr (assoc "message" cvs-buffer-name-alist)))
1499 'log-edit))) 1496 'log-edit)))
1500 (funcall setupfun 'cvs-do-edit-log nil 'cvs-edit-log-filelist buf) 1497 (funcall setupfun 'cvs-do-edit-log nil 'cvs-edit-log-filelist buf)
1501 (when text (erase-buffer) (insert text)) 1498 (when text (erase-buffer) (insert text))
1502 (set (make-local-variable 'cvs-edit-log-revision) rev) 1499 (set (make-local-variable 'cvs-edit-log-revision) rev)
1503 (set (make-local-variable 'cvs-minor-wrap-function) 'cvs-edit-log-minor-wrap) 1500 (set (make-local-variable 'cvs-minor-wrap-function) 'cvs-edit-log-minor-wrap)
1504 (set (make-local-variable 'list-buffers-directory) lbd)
1505 ;; (run-hooks 'cvs-mode-commit-hook) 1501 ;; (run-hooks 'cvs-mode-commit-hook)
1506 )) 1502 ))
1507 1503
diff --git a/lisp/progmodes/cmacexp.el b/lisp/progmodes/cmacexp.el
index 28d988961a6..65eea658d4e 100644
--- a/lisp/progmodes/cmacexp.el
+++ b/lisp/progmodes/cmacexp.el
@@ -108,18 +108,23 @@
108 :group 'c-macro) 108 :group 'c-macro)
109 109
110(defcustom c-macro-preprocessor 110(defcustom c-macro-preprocessor
111 ;; Cannot rely on standard directory on MS-DOS to find CPP. In 111 (cond ;; Solaris has it in an unusual place.
112 ;; fact, cannot rely on having cpp.exe, either, in latest GCC
113 ;; versions.
114 (cond ((eq system-type 'ms-dos) "gcc -E -C -o - -")
115 ;; Solaris has it in an unusual place.
116 ((and (string-match "^[^-]*-[^-]*-\\(solaris\\|sunos5\\)" 112 ((and (string-match "^[^-]*-[^-]*-\\(solaris\\|sunos5\\)"
117 system-configuration) 113 system-configuration)
118 (file-exists-p "/opt/SUNWspro/SC3.0.1/bin/acomp")) 114 (file-exists-p "/opt/SUNWspro/SC3.0.1/bin/acomp"))
119 "/opt/SUNWspro/SC3.0.1/bin/acomp -C -E") 115 "/opt/SUNWspro/SC3.0.1/bin/acomp -C -E")
120 ((file-exists-p "/usr/ccs/lib/cpp") "/usr/ccs/lib/cpp -C") 116 ((locate-file "/usr/ccs/lib/cpp"
121 ((memq system-type '(darwin berkeley-unix)) "gcc -E -C -") 117 '("/") exec-suffixes 'file-executable-p)
122 (t "/lib/cpp -C")) 118 "/usr/ccs/lib/cpp -C")
119 ((locate-file "/lib/cpp"
120 '("/") exec-suffixes 'file-executable-p)
121 "/lib/cpp -C")
122 ;; On some systems, we cannot rely on standard directories to
123 ;; find CPP. In fact, we cannot rely on having cpp, either,
124 ;; in some GCC versions.
125 ((locate-file "cpp" exec-path exec-suffixes 'file-executable-p)
126 "cpp -C")
127 (t "gcc -E -C -o - -"))
123 "The preprocessor used by the cmacexp package. 128 "The preprocessor used by the cmacexp package.
124 129
125If you change this, be sure to preserve the `-C' (don't strip comments) 130If you change this, be sure to preserve the `-C' (don't strip comments)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 0cc70386be8..f5180b1fb48 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1247,7 +1247,8 @@ Optional argument MINOR indicates this is called from
1247 (make-local-variable 'compilation-messages-start) 1247 (make-local-variable 'compilation-messages-start)
1248 (make-local-variable 'compilation-error-screen-columns) 1248 (make-local-variable 'compilation-error-screen-columns)
1249 (make-local-variable 'overlay-arrow-position) 1249 (make-local-variable 'overlay-arrow-position)
1250 (set (make-local-variable 'overlay-arrow-string) "=>") 1250 (set (make-local-variable 'overlay-arrow-string)
1251 (if (display-graphic-p) "=>" ""))
1251 (setq next-error-overlay-arrow-position nil) 1252 (setq next-error-overlay-arrow-position nil)
1252 (add-hook 'kill-buffer-hook 1253 (add-hook 'kill-buffer-hook
1253 (lambda () (setq next-error-overlay-arrow-position nil)) nil t) 1254 (lambda () (setq next-error-overlay-arrow-position nil)) nil t)
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 56344a67e5c..c4298ffb99b 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -196,19 +196,20 @@ detailed description of this mode.
196 :group 'gud 196 :group 'gud
197 :version "22.1") 197 :version "22.1")
198 198
199(defcustom gdb-cpp-define-alist-program 199(defcustom gdb-cpp-define-alist-program "gcc -E -dM -"
200 (cond ((eq system-type 'ms-dos) "gcc -E -dM -o - -") 200 "Shell command for generating a list of defined macros in a source file.
201 (t "gcc -E -dM -"))
202 "The program name for generating an alist of #define directives.
203This list is used to display the #define directive associated 201This list is used to display the #define directive associated
204with an identifier as a tooltip. It works in a debug session with 202with an identifier as a tooltip. It works in a debug session with
205GDB, when tooltip-gud-tips-p is t." 203GDB, when gud-tooltip-mode is t.
204
205Set `gdb-cpp-define-alist-flags' for any include paths or
206predefined macros."
206 :type 'string 207 :type 'string
207 :group 'gud 208 :group 'gud
208 :version "22.1") 209 :version "22.1")
209 210
210(defcustom gdb-cpp-define-alist-flags "" 211(defcustom gdb-cpp-define-alist-flags ""
211 "*Preprocessor flags used by `gdb-create-define-alist'." 212 "*Preprocessor flags for `gdb-cpp-define-alist-program'."
212 :type 'string 213 :type 'string
213 :group 'gud 214 :group 'gud
214 :version "22.1") 215 :version "22.1")
@@ -233,6 +234,14 @@ GDB, when tooltip-gud-tips-p is t."
233 (setq name (nth 1 (split-string define "[( ]"))) 234 (setq name (nth 1 (split-string define "[( ]")))
234 (push (cons name define) gdb-define-alist)))) 235 (push (cons name define) gdb-define-alist))))
235 236
237(defun gdb-tooltip-print ()
238 (tooltip-show
239 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
240 (let ((string (buffer-string)))
241 ;; remove newline for gud-tooltip-echo-area
242 (substring string 0 (- (length string) 1))))
243 gud-tooltip-echo-area))
244
236(defun gdb-set-gud-minor-mode (buffer) 245(defun gdb-set-gud-minor-mode (buffer)
237 "Set gud-minor-mode from find-file if appropriate." 246 "Set gud-minor-mode from find-file if appropriate."
238 (goto-char (point-min)) 247 (goto-char (point-min))
@@ -252,9 +261,10 @@ GDB, when tooltip-gud-tips-p is t."
252 (with-current-buffer buffer 261 (with-current-buffer buffer
253 (set (make-local-variable 'gud-minor-mode) 'gdba) 262 (set (make-local-variable 'gud-minor-mode) 'gdba)
254 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) 263 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
255 (make-local-variable 'gdb-define-alist) 264 (when gud-tooltip-mode
256 (gdb-create-define-alist) 265 (make-local-variable 'gdb-define-alist)
257 (add-hook 'after-save-hook 'gdb-create-define-alist nil t)))) 266 (gdb-create-define-alist)
267 (add-hook 'after-save-hook 'gdb-create-define-alist nil t)))))
258 268
259(defun gdb-set-gud-minor-mode-existing-buffers () 269(defun gdb-set-gud-minor-mode-existing-buffers ()
260 (dolist (buffer (buffer-list)) 270 (dolist (buffer (buffer-list))
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 4f5ffe0d23b..195875842a3 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -1,4 +1,4 @@
1;;; grep.el --- run compiler as inferior of Emacs, parse error messages 1;;; grep.el --- run Grep as inferior of Emacs, parse match messages
2 2
3;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4;; 2001, 2002, 2004, 2005 Free Software Foundation, Inc. 4;; 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index e98cb9eee58..544a4804639 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -39,6 +39,8 @@
39 39
40;;; Code: 40;;; Code:
41 41
42(eval-when-compile (require 'cl)) ; for case macro
43
42(require 'comint) 44(require 'comint)
43(require 'etags) 45(require 'etags)
44 46
@@ -113,11 +115,11 @@ Used to grey out relevant togolbar icons.")
113 115
114(easy-mmode-defmap gud-menu-map 116(easy-mmode-defmap gud-menu-map
115 '(([help] "Info" . gud-goto-info) 117 '(([help] "Info" . gud-goto-info)
116 ([tooltips] menu-item "Toggle GUD tooltips" tooltip-toggle-gud-tips 118 ([tooltips] menu-item "Toggle GUD tooltips" gud-tooltip-mode
117 :enable (and (not emacs-basic-display) 119 :enable (and (not emacs-basic-display)
118 (display-graphic-p) 120 (display-graphic-p)
119 (fboundp 'x-show-tip)) 121 (fboundp 'x-show-tip))
120 :button (:toggle . tooltip-gud-tips-p)) 122 :button (:toggle . gud-tooltip-mode))
121 ([refresh] "Refresh" . gud-refresh) 123 ([refresh] "Refresh" . gud-refresh)
122 ([run] menu-item "Run" gud-run 124 ([run] menu-item "Run" gud-run
123 :enable (and (not gud-running) 125 :enable (and (not gud-running)
@@ -228,7 +230,8 @@ Uses `gud-<MINOR-MODE>-directories' to find the source files."
228 (with-current-buffer buf 230 (with-current-buffer buf
229 (set (make-local-variable 'gud-minor-mode) minor-mode) 231 (set (make-local-variable 'gud-minor-mode) minor-mode)
230 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) 232 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
231 (when (memq gud-minor-mode '(gdbmi gdba)) 233 (when (and gud-tooltip-mode
234 (memq gud-minor-mode '(gdbmi gdba)))
232 (make-local-variable 'gdb-define-alist) 235 (make-local-variable 'gdb-define-alist)
233 (unless gdb-define-alist (gdb-create-define-alist)) 236 (unless gdb-define-alist (gdb-create-define-alist))
234 (add-hook 'after-save-hook 'gdb-create-define-alist nil t)) 237 (add-hook 'after-save-hook 'gdb-create-define-alist nil t))
@@ -3100,6 +3103,204 @@ Treats actions as defuns."
3100 (font-lock-syntactic-face-function 3103 (font-lock-syntactic-face-function
3101 . gdb-script-font-lock-syntactic-face)))) 3104 . gdb-script-font-lock-syntactic-face))))
3102 3105
3106
3107;;; tooltips for GUD
3108
3109;;; Customizable settings
3110(defcustom gud-tooltip-modes '(gud-mode c-mode c++-mode fortran-mode)
3111 "List of modes for which to enable GUD tips."
3112 :type 'sexp
3113 :tag "GUD modes"
3114 :group 'tooltip)
3115
3116(defcustom gud-tooltip-display
3117 '((eq (tooltip-event-buffer gud-tooltip-event)
3118 (marker-buffer gud-overlay-arrow-position)))
3119 "List of forms determining where GUD tooltips are displayed.
3120
3121Forms in the list are combined with AND. The default is to display
3122only tooltips in the buffer containing the overlay arrow."
3123 :type 'sexp
3124 :tag "GUD buffers predicate"
3125 :group 'tooltip)
3126
3127(defcustom gud-tooltip-echo-area nil
3128 "Use the echo area instead of frames for GUD tooltips."
3129 :type 'boolean
3130 :tag "Use echo area"
3131 :group 'tooltip)
3132
3133(define-obsolete-variable-alias 'tooltip-gud-modes
3134 'gud-tooltip-modes "22.1")
3135(define-obsolete-variable-alias 'tooltip-gud-display
3136 'gud-tooltip-display "22.1")
3137(define-obsolete-variable-alias 'tooltip-use-echo-area
3138 'gud-tooltip-echo-area "22.1")
3139
3140;;; Reacting on mouse movements
3141
3142(defun gud-tooltip-change-major-mode ()
3143 "Function added to `change-major-mode-hook' when tooltip mode is on."
3144 (add-hook 'post-command-hook 'gud-tooltip-activate-mouse-motions-if-enabled))
3145
3146(defun gud-tooltip-activate-mouse-motions-if-enabled ()
3147 "Reconsider for all buffers whether mouse motion events are desired."
3148 (remove-hook 'post-command-hook
3149 'gud-tooltip-activate-mouse-motions-if-enabled)
3150 (dolist (buffer (buffer-list))
3151 (save-excursion
3152 (set-buffer buffer)
3153 (if (and gud-tooltip-mode
3154 (memq major-mode gud-tooltip-modes))
3155 (gud-tooltip-activate-mouse-motions t)
3156 (gud-tooltip-activate-mouse-motions nil)))))
3157
3158(defvar gud-tooltip-mouse-motions-active nil
3159 "Locally t in a buffer if tooltip processing of mouse motion is enabled.")
3160
3161(defun gud-tooltip-activate-mouse-motions (activatep)
3162 "Activate/deactivate mouse motion events for the current buffer.
3163ACTIVATEP non-nil means activate mouse motion events."
3164 (if activatep
3165 (progn
3166 (make-local-variable 'gud-tooltip-mouse-motions-active)
3167 (setq gud-tooltip-mouse-motions-active t)
3168 (make-local-variable 'track-mouse)
3169 (setq track-mouse t))
3170 (when gud-tooltip-mouse-motions-active
3171 (kill-local-variable 'gud-tooltip-mouse-motions-active)
3172 (kill-local-variable 'track-mouse))))
3173
3174(defun gud-tooltip-mouse-motion (event)
3175 "Command handler for mouse movement events in `global-map'."
3176 (interactive "e")
3177 (tooltip-hide)
3178 (when (car (mouse-pixel-position))
3179 (setq tooltip-last-mouse-motion-event (copy-sequence event))
3180 (tooltip-start-delayed-tip)))
3181
3182;;; Tips for `gud'
3183
3184(defvar gud-tooltip-original-filter nil
3185 "Process filter to restore after GUD output has been received.")
3186
3187(defvar gud-tooltip-dereference nil
3188 "Non-nil means print expressions with a `*' in front of them.
3189For C this would dereference a pointer expression.")
3190
3191(defvar gud-tooltip-event nil
3192 "The mouse movement event that led to a tooltip display.
3193This event can be examined by forms in GUD-TOOLTIP-DISPLAY.")
3194
3195(defun gud-tooltip-toggle-dereference ()
3196 "Toggle whether tooltips should show `* expr' or `expr'."
3197 (interactive)
3198 (setq gud-tooltip-dereference (not gud-tooltip-dereference))
3199 (when (interactive-p)
3200 (message "Dereferencing is now %s."
3201 (if gud-tooltip-dereference "on" "off"))))
3202
3203(define-obsolete-function-alias 'tooltip-gud-toggle-dereference
3204 'gud-tooltip-toggle-dereference "22.1")
3205
3206(define-minor-mode gud-tooltip-mode
3207 "Toggle the display of GUD tooltips."
3208 :global t
3209 :group 'gud
3210 (if gud-tooltip-mode
3211 (progn
3212 (add-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode)
3213 (add-hook 'pre-command-hook 'tooltip-hide)
3214 (add-hook 'tooltip-hook 'gud-tooltip-tips)
3215 (define-key global-map [mouse-movement] 'gud-tooltip-mouse-motion))
3216 (unless tooltip-mode (remove-hook 'pre-command-hook 'tooltip-hide)
3217 (remove-hook 'change-major-mode-hook 'tooltip-change-major-mode)
3218 (remove-hook 'tooltip-hook 'gud-tooltip-tips)
3219 (define-key global-map [mouse-movement] 'ignore)))
3220 (gud-tooltip-activate-mouse-motions-if-enabled)
3221 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
3222 (if gud-tooltip-mode
3223 (progn
3224 (dolist (buffer (buffer-list))
3225 (unless (eq buffer gud-comint-buffer)
3226 (with-current-buffer buffer
3227 (when (and (memq gud-minor-mode '(gdbmi gdba))
3228 (not (string-match "\\`\\*.+\\*\\'"
3229 (buffer-name))))
3230 (make-local-variable 'gdb-define-alist)
3231 (gdb-create-define-alist)
3232 (add-hook 'after-save-hook
3233 'gdb-create-define-alist nil t))))))
3234 (kill-local-variable 'gdb-define-alist)
3235 (remove-hook 'after-save-hook 'gdb-create-define-alist t))))
3236
3237; This will only display data that comes in one chunk.
3238; Larger arrays (say 400 elements) are displayed in
3239; the tootip incompletely and spill over into the gud buffer.
3240; Switching the process-filter creates timing problems and
3241; it may be difficult to do better. Using annotations as in
3242; gdb-ui.el gets round this problem.
3243(defun gud-tooltip-process-output (process output)
3244 "Process debugger output and show it in a tooltip window."
3245 (set-process-filter process gud-tooltip-original-filter)
3246 (tooltip-show (tooltip-strip-prompt process output)
3247 gud-tooltip-echo-area))
3248
3249(defun gud-tooltip-print-command (expr)
3250 "Return a suitable command to print the expression EXPR.
3251If GUD-TOOLTIP-DEREFERENCE is t, also prepend a `*' to EXPR."
3252 (when gud-tooltip-dereference
3253 (setq expr (concat "*" expr)))
3254 (case gud-minor-mode
3255 ((gdb gdba) (concat "server print " expr))
3256 (dbx (concat "print " expr))
3257 (xdb (concat "p " expr))
3258 (sdb (concat expr "/"))
3259 (perldb expr)))
3260
3261(defun gud-tooltip-tips (event)
3262 "Show tip for identifier or selection under the mouse.
3263The mouse must either point at an identifier or inside a selected
3264region for the tip window to be shown. If gud-tooltip-dereference is t,
3265add a `*' in front of the printed expression. In the case of a C program
3266controlled by GDB, show the associated #define directives when program is
3267not executing.
3268
3269This function must return nil if it doesn't handle EVENT."
3270 (let (process)
3271 (when (and (eventp event)
3272 gud-tooltip-mode
3273 (boundp 'gud-comint-buffer)
3274 gud-comint-buffer
3275 (buffer-name gud-comint-buffer); gud-comint-buffer might be killed
3276 (setq process (get-buffer-process gud-comint-buffer))
3277 (posn-point (event-end event))
3278 (or (and (eq gud-minor-mode 'gdba) (not gdb-active-process))
3279 (progn (setq gud-tooltip-event event)
3280 (eval (cons 'and gud-tooltip-display)))))
3281 (let ((expr (tooltip-expr-to-print event)))
3282 (when expr
3283 (if (and (eq gud-minor-mode 'gdba)
3284 (not gdb-active-process))
3285 (progn
3286 (with-current-buffer
3287 (window-buffer (let ((mouse (mouse-position)))
3288 (window-at (cadr mouse)
3289 (cddr mouse))))
3290 (let ((define-elt (assoc expr gdb-define-alist)))
3291 (unless (null define-elt)
3292 (tooltip-show (cdr define-elt))
3293 expr))))
3294 (let ((cmd (gud-tooltip-print-command expr)))
3295 (unless (null cmd) ; CMD can be nil if unknown debugger
3296 (if (eq gud-minor-mode 'gdba)
3297 (gdb-enqueue-input
3298 (list (concat cmd "\n") 'gdb-tooltip-print))
3299 (setq gud-tooltip-original-filter (process-filter process))
3300 (set-process-filter process 'gud-tooltip-process-output)
3301 (gud-basic-call cmd))
3302 expr))))))))
3303
3103(provide 'gud) 3304(provide 'gud)
3104 3305
3105;;; arch-tag: 6d990948-df65-461a-be39-1c7fb83ac4c4 3306;;; arch-tag: 6d990948-df65-461a-be39-1c7fb83ac4c4
diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el
index e3da5508342..8696e1a7d63 100644
--- a/lisp/progmodes/idlw-help.el
+++ b/lisp/progmodes/idlw-help.el
@@ -36,7 +36,7 @@
36;; information, at: 36;; information, at:
37;; 37;;
38;; http://idlwave.org 38;; http://idlwave.org
39;; 39;;
40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
41 41
42 42
@@ -52,10 +52,10 @@
52 :group 'idlwave-online-help 52 :group 'idlwave-online-help
53 :type 'boolean) 53 :type 'boolean)
54 54
55(defvar idlwave-html-link-sep 55(defvar idlwave-html-link-sep
56 (if idlwave-html-help-pre-v6 "#" "#wp")) 56 (if idlwave-html-help-pre-v6 "#" "#wp"))
57 57
58(defcustom idlwave-html-help-location 58(defcustom idlwave-html-help-location
59 (if (memq system-type '(ms-dos windows-nt)) 59 (if (memq system-type '(ms-dos windows-nt))
60 nil 60 nil
61 "/usr/local/etc/") 61 "/usr/local/etc/")
@@ -83,7 +83,7 @@ Defaults to `browse-url-browser-function', which see."
83 :group 'idlwave-online-help 83 :group 'idlwave-online-help
84 :type 'string) 84 :type 'string)
85 85
86(defcustom idlwave-help-browser-generic-args 86(defcustom idlwave-help-browser-generic-args
87 (if (boundp 'browse-url-generic-args) 87 (if (boundp 'browse-url-generic-args)
88 browse-url-generic-args "") 88 browse-url-generic-args "")
89 "Program args to use if using browse-url-generic-program." 89 "Program args to use if using browse-url-generic-program."
@@ -191,7 +191,7 @@ support."
191 191
192(defvar idlwave-help-activate-links-aggressively nil 192(defvar idlwave-help-activate-links-aggressively nil
193 "Obsolete variable.") 193 "Obsolete variable.")
194 194
195(defvar idlwave-completion-help-info) 195(defvar idlwave-completion-help-info)
196 196
197(defvar idlwave-help-frame nil 197(defvar idlwave-help-frame nil
@@ -314,7 +314,7 @@ It collects and prints the diagnostics messages."
314 (setq idlwave-last-context-help-pos marker) 314 (setq idlwave-last-context-help-pos marker)
315 (idlwave-do-context-help1 arg) 315 (idlwave-do-context-help1 arg)
316 (if idlwave-help-diagnostics 316 (if idlwave-help-diagnostics
317 (message "%s" (mapconcat 'identity 317 (message "%s" (mapconcat 'identity
318 (nreverse idlwave-help-diagnostics) 318 (nreverse idlwave-help-diagnostics)
319 "; ")))))) 319 "; "))))))
320 320
@@ -323,7 +323,7 @@ It collects and prints the diagnostics messages."
323(defun idlwave-do-context-help1 (&optional arg) 323(defun idlwave-do-context-help1 (&optional arg)
324 "The work-horse version of `idlwave-context-help', which see." 324 "The work-horse version of `idlwave-context-help', which see."
325 (save-excursion 325 (save-excursion
326 (if (equal (char-after) ?/) 326 (if (equal (char-after) ?/)
327 (forward-char 1) 327 (forward-char 1)
328 (if (equal (char-before) ?=) 328 (if (equal (char-before) ?=)
329 (backward-char 1))) 329 (backward-char 1)))
@@ -333,7 +333,7 @@ It collects and prints the diagnostics messages."
333 (beg (save-excursion (skip-chars-backward chars) (point))) 333 (beg (save-excursion (skip-chars-backward chars) (point)))
334 (end (save-excursion (skip-chars-forward chars) (point))) 334 (end (save-excursion (skip-chars-forward chars) (point)))
335 (this-word (buffer-substring-no-properties beg end)) 335 (this-word (buffer-substring-no-properties beg end))
336 (st-ass (assoc (downcase this-word) 336 (st-ass (assoc (downcase this-word)
337 idlwave-help-special-topic-words)) 337 idlwave-help-special-topic-words))
338 (classtag (and (string-match "self\\." this-word) 338 (classtag (and (string-match "self\\." this-word)
339 (< beg (- end 4)))) 339 (< beg (- end 4))))
@@ -341,7 +341,7 @@ It collects and prints the diagnostics messages."
341 (string-match "\\`\\([^.]+\\)\\." this-word) 341 (string-match "\\`\\([^.]+\\)\\." this-word)
342 (< beg (- end 4)))) 342 (< beg (- end 4))))
343 module keyword cw mod1 mod2 mod3) 343 module keyword cw mod1 mod2 mod3)
344 (if (or arg 344 (if (or arg
345 (and (not st-ass) 345 (and (not st-ass)
346 (not classtag) 346 (not classtag)
347 (not structtag) 347 (not structtag)
@@ -360,15 +360,15 @@ It collects and prints the diagnostics messages."
360 (setq module (list "init" 'fun (match-string 1 str)) 360 (setq module (list "init" 'fun (match-string 1 str))
361 idlwave-current-obj_new-class (match-string 1 str)) 361 idlwave-current-obj_new-class (match-string 1 str))
362 ))))) 362 )))))
363 (cond 363 (cond
364 (arg (setq mod1 module)) 364 (arg (setq mod1 module))
365 365
366 ;; A special topic -- only system help 366 ;; A special topic -- only system help
367 (st-ass (setq mod1 (list (cdr st-ass)))) 367 (st-ass (setq mod1 (list (cdr st-ass))))
368 368
369 ;; A system variable -- only system help 369 ;; A system variable -- only system help
370 ((string-match 370 ((string-match
371 "\\`!\\([a-zA-Z0-9_]+\\)\\(\.\\([A-Za-z0-9_]+\\)\\)?" 371 "\\`!\\([a-zA-Z0-9_]+\\)\\(\.\\([A-Za-z0-9_]+\\)\\)?"
372 this-word) 372 this-word)
373 (let* ((word (match-string-no-properties 1 this-word)) 373 (let* ((word (match-string-no-properties 1 this-word))
374 (entry (assq (idlwave-sintern-sysvar word) 374 (entry (assq (idlwave-sintern-sysvar word)
@@ -380,18 +380,19 @@ It collects and prints the diagnostics messages."
380 (cdr (assq 'tags entry)))))) 380 (cdr (assq 'tags entry))))))
381 (link (nth 1 (assq 'link entry)))) 381 (link (nth 1 (assq 'link entry))))
382 (if tag-target 382 (if tag-target
383 (setq link (idlwave-substitute-link-target link 383 (setq link (idlwave-substitute-link-target link
384 tag-target))) 384 tag-target)))
385 (setq mod1 (list link)))) 385 (setq mod1 (list link))))
386 386
387 ;; An executive command -- only system help 387 ;; An executive command -- only system help
388 ((string-match "^\\.\\([A-Z_]+\\)" this-word) 388 ((string-match "^\\.\\([A-Z_]+\\)" this-word)
389 (let* ((word (match-string 1 this-word)) 389 (let* ((word (match-string 1 this-word))
390 (link (cdr (assoc-ignore-case 390 (link (cdr (assoc-string
391 word 391 word
392 idlwave-executive-commands-alist)))) 392 idlwave-executive-commands-alist
393 t))))
393 (setq mod1 (list link)))) 394 (setq mod1 (list link))))
394 395
395 ;; A class -- system OR in-text help (via class__define). 396 ;; A class -- system OR in-text help (via class__define).
396 ((and (eq cw 'class) 397 ((and (eq cw 'class)
397 (or (idlwave-in-quote) ; e.g. obj_new 398 (or (idlwave-in-quote) ; e.g. obj_new
@@ -405,28 +406,28 @@ It collects and prints the diagnostics messages."
405 (name (concat (downcase this-word) "__define")) 406 (name (concat (downcase this-word) "__define"))
406 (link (nth 1 (assq 'link entry)))) 407 (link (nth 1 (assq 'link entry))))
407 (setq mod1 (list link name 'pro)))) 408 (setq mod1 (list link name 'pro))))
408 409
409 ;; A class structure tag (self.BLAH) -- only in-text help available 410 ;; A class structure tag (self.BLAH) -- only in-text help available
410 (classtag 411 (classtag
411 (let ((tag (substring this-word (match-end 0))) 412 (let ((tag (substring this-word (match-end 0)))
412 class-with found-in) 413 class-with found-in)
413 (when (setq class-with 414 (when (setq class-with
414 (idlwave-class-or-superclass-with-tag 415 (idlwave-class-or-superclass-with-tag
415 (nth 2 (idlwave-current-routine)) 416 (nth 2 (idlwave-current-routine))
416 tag)) 417 tag))
417 (setq found-in (idlwave-class-found-in class-with)) 418 (setq found-in (idlwave-class-found-in class-with))
418 (if (assq (idlwave-sintern-class class-with) 419 (if (assq (idlwave-sintern-class class-with)
419 idlwave-system-class-info) 420 idlwave-system-class-info)
420 (error "No help available for system class tags")) 421 (error "No help available for system class tags"))
421 (setq idlwave-help-do-class-struct-tag t) 422 (setq idlwave-help-do-class-struct-tag t)
422 (setq mod1 (list nil 423 (setq mod1 (list nil
423 (if found-in 424 (if found-in
424 (cons (concat found-in "__define") class-with) 425 (cons (concat found-in "__define") class-with)
425 (concat class-with "__define")) 426 (concat class-with "__define"))
426 'pro 427 'pro
427 nil ; no class.... it's a procedure! 428 nil ; no class.... it's a procedure!
428 tag))))) 429 tag)))))
429 430
430 ;; A regular structure tag -- only in text, and if 431 ;; A regular structure tag -- only in text, and if
431 ;; optional `complete-structtag' loaded. 432 ;; optional `complete-structtag' loaded.
432 (structtag 433 (structtag
@@ -437,7 +438,7 @@ It collects and prints the diagnostics messages."
437 (setq idlwave-help-do-struct-tag 438 (setq idlwave-help-do-struct-tag
438 idlwave-structtag-struct-location 439 idlwave-structtag-struct-location
439 mod1 (list nil nil nil nil tag)))) 440 mod1 (list nil nil nil nil tag))))
440 441
441 ;; A routine keyword -- in text or system help 442 ;; A routine keyword -- in text or system help
442 ((and (memq cw '(function-keyword procedure-keyword)) 443 ((and (memq cw '(function-keyword procedure-keyword))
443 (stringp this-word) 444 (stringp this-word)
@@ -479,7 +480,7 @@ It collects and prints the diagnostics messages."
479 (setq mod1 (append (list t) module (list keyword)) 480 (setq mod1 (append (list t) module (list keyword))
480 mod2 (list t this-word 'fun nil) 481 mod2 (list t this-word 'fun nil)
481 mod3 (append (list t) module))))) 482 mod3 (append (list t) module)))))
482 483
483 ;; Everything else 484 ;; Everything else
484 (t 485 (t
485 (setq mod1 (append (list t) module)))) 486 (setq mod1 (append (list t) module))))
@@ -512,14 +513,14 @@ Needs additional info stored in global `idlwave-completion-help-info'."
512 word link) 513 word link)
513 (mouse-set-point ev) 514 (mouse-set-point ev)
514 515
515 516
516 ;; See if we can also find help somewhere, e.g. for multiple classes 517 ;; See if we can also find help somewhere, e.g. for multiple classes
517 (setq word (idlwave-this-word)) 518 (setq word (idlwave-this-word))
518 (if (string= word "") 519 (if (string= word "")
519 (error "No help item selected")) 520 (error "No help item selected"))
520 (setq link (get-text-property 0 'link word)) 521 (setq link (get-text-property 0 'link word))
521 (select-window cw) 522 (select-window cw)
522 (cond 523 (cond
523 ;; Routine name 524 ;; Routine name
524 ((memq what '(procedure function routine)) 525 ((memq what '(procedure function routine))
525 (setq name word) 526 (setq name word)
@@ -530,9 +531,9 @@ Needs additional info stored in global `idlwave-completion-help-info'."
530 type))) 531 type)))
531 (setq link t) ; No specific link valid yet 532 (setq link t) ; No specific link valid yet
532 (if sclasses 533 (if sclasses
533 (setq classes (idlwave-members-only 534 (setq classes (idlwave-members-only
534 classes (cons class sclasses)))) 535 classes (cons class sclasses))))
535 (setq class (idlwave-popup-select ev classes 536 (setq class (idlwave-popup-select ev classes
536 "Select Class" 'sort)))) 537 "Select Class" 'sort))))
537 538
538 ;; XXX is this necessary, given all-method-classes? 539 ;; XXX is this necessary, given all-method-classes?
@@ -552,7 +553,7 @@ Needs additional info stored in global `idlwave-completion-help-info'."
552 type))) 553 type)))
553 (setq link t) ; Link can't be correct yet 554 (setq link t) ; Link can't be correct yet
554 (if sclasses 555 (if sclasses
555 (setq classes (idlwave-members-only 556 (setq classes (idlwave-members-only
556 classes (cons class sclasses)))) 557 classes (cons class sclasses))))
557 (setq class (idlwave-popup-select ev classes 558 (setq class (idlwave-popup-select ev classes
558 "Select Class" 'sort)) 559 "Select Class" 'sort))
@@ -564,14 +565,14 @@ Needs additional info stored in global `idlwave-completion-help-info'."
564 (if (string= (downcase name) "obj_new") 565 (if (string= (downcase name) "obj_new")
565 (setq class idlwave-current-obj_new-class 566 (setq class idlwave-current-obj_new-class
566 name "Init")))) 567 name "Init"))))
567 568
568 ;; Class name 569 ;; Class name
569 ((eq what 'class) 570 ((eq what 'class)
570 (setq class word 571 (setq class word
571 word nil)) 572 word nil))
572 573
573 ;; A special named function to call which sets some of our variables 574 ;; A special named function to call which sets some of our variables
574 ((and (symbolp what) 575 ((and (symbolp what)
575 (fboundp what)) 576 (fboundp what))
576 (funcall what 'set word)) 577 (funcall what 'set word))
577 578
@@ -586,7 +587,7 @@ Needs additional info stored in global `idlwave-completion-help-info'."
586 "Highlight all completions for which help is available and attach link. 587 "Highlight all completions for which help is available and attach link.
587Those words in `idlwave-completion-help-links' have links. The 588Those words in `idlwave-completion-help-links' have links. The
588`idlwave-help-link-face' face is used for this." 589`idlwave-help-link-face' face is used for this."
589 (if idlwave-highlight-help-links-in-completion 590 (if idlwave-highlight-help-links-in-completion
590 (with-current-buffer (get-buffer "*Completions*") 591 (with-current-buffer (get-buffer "*Completions*")
591 (save-excursion 592 (save-excursion
592 (let* ((case-fold-search t) 593 (let* ((case-fold-search t)
@@ -602,13 +603,13 @@ Those words in `idlwave-completion-help-links' have links. The
602 (setq beg (match-beginning 1) end (match-end 1) 603 (setq beg (match-beginning 1) end (match-end 1)
603 word (match-string 1) doit nil) 604 word (match-string 1) doit nil)
604 ;; Call special completion function test 605 ;; Call special completion function test
605 (if (and (symbolp what) 606 (if (and (symbolp what)
606 (fboundp what)) 607 (fboundp what))
607 (setq doit (funcall what 'test word)) 608 (setq doit (funcall what 'test word))
608 ;; Look for special link property passed in help-links 609 ;; Look for special link property passed in help-links
609 (if idlwave-completion-help-links 610 (if idlwave-completion-help-links
610 (setq doit (assoc-ignore-case 611 (setq doit (assoc-string
611 word idlwave-completion-help-links)))) 612 word idlwave-completion-help-links t))))
612 (when doit 613 (when doit
613 (if (consp doit) 614 (if (consp doit)
614 (setq props (append props `(link ,(cdr doit))))) 615 (setq props (append props `(link ,(cdr doit)))))
@@ -633,13 +634,13 @@ Those words in `idlwave-completion-help-links' have links. The
633 ;; Try to select the return frame. 634 ;; Try to select the return frame.
634 ;; This can crash on slow network connections, obviously when 635 ;; This can crash on slow network connections, obviously when
635 ;; we kill the help frame before the return-frame is selected. 636 ;; we kill the help frame before the return-frame is selected.
636 ;; To protect the workings, we wait for up to one second 637 ;; To protect the workings, we wait for up to one second
637 ;; and check if the return-frame *is* now selected. 638 ;; and check if the return-frame *is* now selected.
638 ;; This is marked "eperimental" since we are not sure when its OK. 639 ;; This is marked "eperimental" since we are not sure when its OK.
639 (let ((maxtime 1.0) (time 0.) (step 0.1)) 640 (let ((maxtime 1.0) (time 0.) (step 0.1))
640 (select-frame idlwave-help-return-frame) 641 (select-frame idlwave-help-return-frame)
641 (while (and (sit-for step) 642 (while (and (sit-for step)
642 (not (eq (selected-frame) 643 (not (eq (selected-frame)
643 idlwave-help-return-frame)) 644 idlwave-help-return-frame))
644 (< (setq time (+ time step)) maxtime))))) 645 (< (setq time (+ time step)) maxtime)))))
645 (delete-frame idlwave-help-frame)) 646 (delete-frame idlwave-help-frame))
@@ -652,7 +653,7 @@ Those words in `idlwave-completion-help-links' have links. The
652(defvar default-toolbar-visible-p) 653(defvar default-toolbar-visible-p)
653 654
654(defun idlwave-help-display-help-window (&optional pos-or-func) 655(defun idlwave-help-display-help-window (&optional pos-or-func)
655 "Display the help window. 656 "Display the help window.
656Move window start to POS-OR-FUNC, if passed as a position, or call it 657Move window start to POS-OR-FUNC, if passed as a position, or call it
657if passed as a function. See `idlwave-help-use-dedicated-frame'." 658if passed as a function. See `idlwave-help-use-dedicated-frame'."
658 (let ((cw (selected-window)) 659 (let ((cw (selected-window))
@@ -663,13 +664,13 @@ if passed as a function. See `idlwave-help-use-dedicated-frame'."
663 (switch-to-buffer buf)) 664 (switch-to-buffer buf))
664 ;; Do it in this frame and save the window configuration 665 ;; Do it in this frame and save the window configuration
665 (if (not (get-buffer-window buf nil)) 666 (if (not (get-buffer-window buf nil))
666 (setq idlwave-help-window-configuration 667 (setq idlwave-help-window-configuration
667 (current-window-configuration))) 668 (current-window-configuration)))
668 (display-buffer buf nil (selected-frame)) 669 (display-buffer buf nil (selected-frame))
669 (select-window (get-buffer-window buf))) 670 (select-window (get-buffer-window buf)))
670 (raise-frame) 671 (raise-frame)
671 (if pos-or-func 672 (if pos-or-func
672 (if (functionp pos-or-func) 673 (if (functionp pos-or-func)
673 (funcall pos-or-func) 674 (funcall pos-or-func)
674 (goto-char pos-or-func) 675 (goto-char pos-or-func)
675 (recenter 0))) 676 (recenter 0)))
@@ -691,31 +692,31 @@ if passed as a function. See `idlwave-help-use-dedicated-frame'."
691 (select-frame idlwave-help-return-frame))) 692 (select-frame idlwave-help-return-frame)))
692 693
693(defun idlwave-online-help (link &optional name type class keyword) 694(defun idlwave-online-help (link &optional name type class keyword)
694 "Display HTML or other special help on a certain topic. 695 "Display HTML or other special help on a certain topic.
695Either loads an HTML link, if LINK is non-nil, or gets special-help on 696Either loads an HTML link, if LINK is non-nil, or gets special-help on
696the optional arguments, if any special help is defined. If LINK is 697the optional arguments, if any special help is defined. If LINK is
697`t', first look up the optional arguments in the routine info list to 698`t', first look up the optional arguments in the routine info list to
698see if a link is set for it. Try extra help functions if necessary." 699see if a link is set for it. Try extra help functions if necessary."
699 ;; Lookup link 700 ;; Lookup link
700 (if (eq link t) 701 (if (eq link t)
701 (let ((entry (idlwave-best-rinfo-assoc name type class 702 (let ((entry (idlwave-best-rinfo-assoc name type class
702 (idlwave-routines) nil t))) 703 (idlwave-routines) nil t)))
703 (cond 704 (cond
704 ;; Try keyword link 705 ;; Try keyword link
705 ((and keyword 706 ((and keyword
706 (setq link (cdr (idlwave-entry-find-keyword entry keyword))))) 707 (setq link (cdr (idlwave-entry-find-keyword entry keyword)))))
707 ;; Default, regular entry link 708 ;; Default, regular entry link
708 (t (setq link (idlwave-entry-has-help entry)))))) 709 (t (setq link (idlwave-entry-has-help entry))))))
709 710
710 (cond 711 (cond
711 ;; An explicit link 712 ;; An explicit link
712 ((stringp link) 713 ((stringp link)
713 (idlwave-help-html-link link)) 714 (idlwave-help-html-link link))
714 715
715 ;; Any extra help 716 ;; Any extra help
716 (idlwave-extra-help-function 717 (idlwave-extra-help-function
717 (idlwave-help-get-special-help name type class keyword)) 718 (idlwave-help-get-special-help name type class keyword))
718 719
719 ;; Nothing worked 720 ;; Nothing worked
720 (t (idlwave-help-error name type class keyword)))) 721 (t (idlwave-help-error name type class keyword))))
721 722
@@ -726,7 +727,7 @@ see if a link is set for it. Try extra help functions if necessary."
726 (help-pos (save-excursion 727 (help-pos (save-excursion
727 (set-buffer (idlwave-help-get-help-buffer)) 728 (set-buffer (idlwave-help-get-help-buffer))
728 (let ((buffer-read-only nil)) 729 (let ((buffer-read-only nil))
729 (funcall idlwave-extra-help-function 730 (funcall idlwave-extra-help-function
730 name type class keyword))))) 731 name type class keyword)))))
731 (if help-pos 732 (if help-pos
732 (idlwave-help-display-help-window help-pos) 733 (idlwave-help-display-help-window help-pos)
@@ -740,7 +741,7 @@ see if a link is set for it. Try extra help functions if necessary."
740 (browse-url-generic-program idlwave-help-browser-generic-program) 741 (browse-url-generic-program idlwave-help-browser-generic-program)
741 ;(browse-url-generic-args idlwave-help-browser-generic-args) 742 ;(browse-url-generic-args idlwave-help-browser-generic-args)
742 full-link) 743 full-link)
743 744
744 (if (and (memq system-type '(ms-dos windows-nt)) 745 (if (and (memq system-type '(ms-dos windows-nt))
745 idlwave-help-use-hh) 746 idlwave-help-use-hh)
746 (progn 747 (progn
@@ -755,12 +756,12 @@ see if a link is set for it. Try extra help functions if necessary."
755 ;; Just a regular file name (+ anchor name) 756 ;; Just a regular file name (+ anchor name)
756 (unless (and (stringp help-loc) 757 (unless (and (stringp help-loc)
757 (file-directory-p help-loc)) 758 (file-directory-p help-loc))
758 (error 759 (error
759 "Invalid help location; customize `idlwave-html-help-location'.")) 760 "Invalid help location; customize `idlwave-html-help-location'."))
760 (setq full-link (concat 761 (setq full-link (concat
761 "file://" 762 "file://"
762 (expand-file-name 763 (expand-file-name
763 link 764 link
764 (expand-file-name "idl_html_help" help-loc))))) 765 (expand-file-name "idl_html_help" help-loc)))))
765 766
766 ;; Check for a local browser 767 ;; Check for a local browser
@@ -796,7 +797,7 @@ This function can be used as `idlwave-extra-help-function'."
796 (if class-only ;Help with class? Using "Init" as source. 797 (if class-only ;Help with class? Using "Init" as source.
797 (setq name "Init" 798 (setq name "Init"
798 type 'fun)) 799 type 'fun))
799 (if (not struct-tag) 800 (if (not struct-tag)
800 (setq file 801 (setq file
801 (idlwave-routine-source-file 802 (idlwave-routine-source-file
802 (nth 3 (idlwave-best-rinfo-assoc 803 (nth 3 (idlwave-best-rinfo-assoc
@@ -809,7 +810,7 @@ This function can be used as `idlwave-extra-help-function'."
809 (if (or struct-tag (stringp file)) 810 (if (or struct-tag (stringp file))
810 (progn 811 (progn
811 (setq in-buf ; structure-tag completion is always in current buffer 812 (setq in-buf ; structure-tag completion is always in current buffer
812 (if struct-tag 813 (if struct-tag
813 idlwave-current-tags-buffer 814 idlwave-current-tags-buffer
814 (idlwave-get-buffer-visiting file))) 815 (idlwave-get-buffer-visiting file)))
815 ;; see if file is in a visited buffer, insert those contents 816 ;; see if file is in a visited buffer, insert those contents
@@ -831,19 +832,19 @@ This function can be used as `idlwave-extra-help-function'."
831 ;; Try to find a good place to display 832 ;; Try to find a good place to display
832 (setq def-pos 833 (setq def-pos
833 ;; Find the class structure tag if that's what we're after 834 ;; Find the class structure tag if that's what we're after
834 (cond 835 (cond
835 ;; Class structure tags: find the class or named structure 836 ;; Class structure tags: find the class or named structure
836 ;; definition 837 ;; definition
837 (class-struct-tag 838 (class-struct-tag
838 (save-excursion 839 (save-excursion
839 (setq class 840 (setq class
840 (if (string-match "[a-zA-Z0-9]\\(__\\)" name) 841 (if (string-match "[a-zA-Z0-9]\\(__\\)" name)
841 (substring name 0 (match-beginning 1)) 842 (substring name 0 (match-beginning 1))
842 idlwave-current-tags-class)) 843 idlwave-current-tags-class))
843 (and 844 (and
844 (idlwave-find-class-definition class nil real-class) 845 (idlwave-find-class-definition class nil real-class)
845 (idlwave-find-struct-tag keyword)))) 846 (idlwave-find-struct-tag keyword))))
846 847
847 ;; Generic structure tags: the structure definition 848 ;; Generic structure tags: the structure definition
848 ;; location within the file has been recorded in 849 ;; location within the file has been recorded in
849 ;; `struct-tag' 850 ;; `struct-tag'
@@ -853,14 +854,14 @@ This function can be used as `idlwave-extra-help-function'."
853 (integerp struct-tag) 854 (integerp struct-tag)
854 (goto-char struct-tag) 855 (goto-char struct-tag)
855 (idlwave-find-struct-tag keyword)))) 856 (idlwave-find-struct-tag keyword))))
856 857
857 ;; Just find the routine definition 858 ;; Just find the routine definition
858 (t 859 (t
859 (if class-only (point-min) 860 (if class-only (point-min)
860 (idlwave-help-find-routine-definition name type class keyword)))) 861 (idlwave-help-find-routine-definition name type class keyword))))
861 idlwave-help-def-pos def-pos) 862 idlwave-help-def-pos def-pos)
862 863
863 (if (and idlwave-help-source-try-header 864 (if (and idlwave-help-source-try-header
864 (not (or struct-tag class-struct-tag))) 865 (not (or struct-tag class-struct-tag)))
865 ;; Check if we can find the header 866 ;; Check if we can find the header
866 (save-excursion 867 (save-excursion
@@ -870,7 +871,7 @@ This function can be used as `idlwave-extra-help-function'."
870 idlwave-help-in-header header-pos))) 871 idlwave-help-in-header header-pos)))
871 872
872 (if (or header-pos def-pos) 873 (if (or header-pos def-pos)
873 (progn 874 (progn
874 (if (boundp 'idlwave-help-min-frame-width) 875 (if (boundp 'idlwave-help-min-frame-width)
875 (setq idlwave-help-min-frame-width 80)) 876 (setq idlwave-help-min-frame-width 80))
876 (goto-char (or header-pos def-pos))) 877 (goto-char (or header-pos def-pos)))
@@ -884,7 +885,7 @@ This function can be used as `idlwave-extra-help-function'."
884KEYWORD is ignored. Returns the point of match if successful, nil otherwise." 885KEYWORD is ignored. Returns the point of match if successful, nil otherwise."
885 (save-excursion 886 (save-excursion
886 (goto-char (point-max)) 887 (goto-char (point-max))
887 (if (re-search-backward 888 (if (re-search-backward
888 (concat "^[ \t]*" 889 (concat "^[ \t]*"
889 (if (eq type 'pro) "pro" 890 (if (eq type 'pro) "pro"
890 (if (eq type 'fun) "function" 891 (if (eq type 'fun) "function"
@@ -930,22 +931,22 @@ with spaces allowed between the keyword and the following dash or equal sign.
930If there is a match, we assume it is the keyword description." 931If there is a match, we assume it is the keyword description."
931 (let* ((case-fold-search t) 932 (let* ((case-fold-search t)
932 (rname (if (stringp class) 933 (rname (if (stringp class)
933 (concat 934 (concat
934 "\\(" 935 "\\("
935 ;; Traditional name or class::name 936 ;; Traditional name or class::name
936 "\\(" 937 "\\("
937 "\\(" (regexp-quote (downcase class)) "::\\)?" 938 "\\(" (regexp-quote (downcase class)) "::\\)?"
938 (regexp-quote (downcase name)) 939 (regexp-quote (downcase name))
939 "\\>\\)" 940 "\\>\\)"
940 (concat 941 (concat
941 "\\|" 942 "\\|"
942 ;; class__define or just class 943 ;; class__define or just class
943 (regexp-quote (downcase class)) "\\(__define\\)?") 944 (regexp-quote (downcase class)) "\\(__define\\)?")
944 "\\)") 945 "\\)")
945 (regexp-quote (downcase name)))) 946 (regexp-quote (downcase name))))
946 947
947 ;; NAME tag plus the routine name. The new version is from JD. 948 ;; NAME tag plus the routine name. The new version is from JD.
948 (name-re (concat 949 (name-re (concat
949 "\\(^;+\\*?[ \t]*" 950 "\\(^;+\\*?[ \t]*"
950 idlwave-help-doclib-name 951 idlwave-help-doclib-name
951 "\\([ \t]*:\\|[ \t]*$\\)[ \t]*\\(\n;+[ \t]*\\)*" 952 "\\([ \t]*:\\|[ \t]*$\\)[ \t]*\\(\n;+[ \t]*\\)*"
@@ -980,7 +981,7 @@ If there is a match, we assume it is the keyword description."
980 (regexp-quote (upcase keyword)) 981 (regexp-quote (upcase keyword))
981 "\\>"))) 982 "\\>")))
982 dstart dend name-pos kwds-pos kwd-pos) 983 dstart dend name-pos kwds-pos kwd-pos)
983 (catch 'exit 984 (catch 'exit
984 (save-excursion 985 (save-excursion
985 (goto-char (point-min)) 986 (goto-char (point-min))
986 (while (and (setq dstart (re-search-forward idlwave-doclib-start nil t)) 987 (while (and (setq dstart (re-search-forward idlwave-doclib-start nil t))
@@ -988,7 +989,7 @@ If there is a match, we assume it is the keyword description."
988 ;; found a routine header 989 ;; found a routine header
989 (goto-char dstart) 990 (goto-char dstart)
990 (if (setq name-pos (re-search-forward name-re dend t)) 991 (if (setq name-pos (re-search-forward name-re dend t))
991 (progn 992 (progn
992 (if keyword 993 (if keyword
993 ;; We do need a keyword 994 ;; We do need a keyword
994 (progn 995 (progn
@@ -1070,7 +1071,7 @@ When DING is non-nil, ring the bell as well."
1070 (idlwave-help-find-first-header nil) 1071 (idlwave-help-find-first-header nil)
1071 (setq idlwave-help-in-header nil) 1072 (setq idlwave-help-in-header nil)
1072 (idlwave-help-toggle-header-match-and-def arg 'top))) 1073 (idlwave-help-toggle-header-match-and-def arg 'top)))
1073 1074
1074(defun idlwave-help-toggle-header-match-and-def (arg &optional top) 1075(defun idlwave-help-toggle-header-match-and-def (arg &optional top)
1075 (interactive "P") 1076 (interactive "P")
1076 (let ((args idlwave-help-args) 1077 (let ((args idlwave-help-args)
@@ -1082,7 +1083,7 @@ When DING is non-nil, ring the bell as well."
1082 (setq pos idlwave-help-def-pos)) 1083 (setq pos idlwave-help-def-pos))
1083 ;; Try to display header 1084 ;; Try to display header
1084 (setq pos (apply 'idlwave-help-find-in-doc-header 1085 (setq pos (apply 'idlwave-help-find-in-doc-header
1085 (if top 1086 (if top
1086 (list (car args) (nth 1 args) (nth 2 args) nil) 1087 (list (car args) (nth 1 args) (nth 2 args) nil)
1087 args))) 1088 args)))
1088 (if pos 1089 (if pos
@@ -1116,7 +1117,7 @@ Useful when source code is displayed as help. See the option
1116 (font-lock-fontify-buffer)) 1117 (font-lock-fontify-buffer))
1117 (set-syntax-table syntax-table))))) 1118 (set-syntax-table syntax-table)))))
1118 1119
1119 1120
1120(defun idlwave-help-error (name type class keyword) 1121(defun idlwave-help-error (name type class keyword)
1121 (error "Can't find help on %s%s %s" 1122 (error "Can't find help on %s%s %s"
1122 (or (and (or class name) (idlwave-make-full-name class name)) 1123 (or (and (or class name) (idlwave-make-full-name class name))
diff --git a/lisp/replace.el b/lisp/replace.el
index dc8eb131b72..1cef7ecc52a 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -977,32 +977,33 @@ See also `multi-occur'."
977 (setq occur-buf (get-buffer-create buf-name)) 977 (setq occur-buf (get-buffer-create buf-name))
978 978
979 (with-current-buffer occur-buf 979 (with-current-buffer occur-buf
980 (setq buffer-read-only nil)
981 (occur-mode) 980 (occur-mode)
982 (erase-buffer) 981 (let ((inhibit-read-only t))
983 (let ((count (occur-engine 982 (erase-buffer)
984 regexp active-bufs occur-buf 983 (let ((count (occur-engine
985 (or nlines list-matching-lines-default-context-lines) 984 regexp active-bufs occur-buf
986 (and case-fold-search 985 (or nlines list-matching-lines-default-context-lines)
987 (isearch-no-upper-case-p regexp t)) 986 (and case-fold-search
988 list-matching-lines-buffer-name-face 987 (isearch-no-upper-case-p regexp t))
989 nil list-matching-lines-face t))) 988 list-matching-lines-buffer-name-face
990 (let* ((bufcount (length active-bufs)) 989 nil list-matching-lines-face t)))
991 (diff (- (length bufs) bufcount))) 990 (let* ((bufcount (length active-bufs))
992 (message "Searched %d buffer%s%s; %s match%s for `%s'" 991 (diff (- (length bufs) bufcount)))
993 bufcount (if (= bufcount 1) "" "s") 992 (message "Searched %d buffer%s%s; %s match%s for `%s'"
994 (if (zerop diff) "" (format " (%d killed)" diff)) 993 bufcount (if (= bufcount 1) "" "s")
995 (if (zerop count) "no" (format "%d" count)) 994 (if (zerop diff) "" (format " (%d killed)" diff))
996 (if (= count 1) "" "es") 995 (if (zerop count) "no" (format "%d" count))
997 regexp)) 996 (if (= count 1) "" "es")
998 (setq occur-revert-arguments (list regexp nlines bufs) 997 regexp))
999 buffer-read-only t) 998 (setq occur-revert-arguments (list regexp nlines bufs))
1000 (if (> count 0) 999 (if (> count 0)
1001 (progn 1000 (progn
1002 (display-buffer occur-buf) 1001 (display-buffer occur-buf)
1003 (setq next-error-last-buffer occur-buf)) 1002 (setq next-error-last-buffer occur-buf))
1004 (kill-buffer occur-buf))) 1003 (kill-buffer occur-buf)))
1005 (run-hooks 'occur-hook)))) 1004 (run-hooks 'occur-hook))
1005 (setq buffer-read-only t)
1006 (set-buffer-modified-p nil))))
1006 1007
1007(defun occur-engine-add-prefix (lines) 1008(defun occur-engine-add-prefix (lines)
1008 (mapcar 1009 (mapcar
@@ -1013,7 +1014,6 @@ See also `multi-occur'."
1013(defun occur-engine (regexp buffers out-buf nlines case-fold-search 1014(defun occur-engine (regexp buffers out-buf nlines case-fold-search
1014 title-face prefix-face match-face keep-props) 1015 title-face prefix-face match-face keep-props)
1015 (with-current-buffer out-buf 1016 (with-current-buffer out-buf
1016 (setq buffer-read-only nil)
1017 (let ((globalcount 0) 1017 (let ((globalcount 0)
1018 (coding nil)) 1018 (coding nil))
1019 ;; Map over all the buffers 1019 ;; Map over all the buffers
diff --git a/lisp/simple.el b/lisp/simple.el
index cfbd6d4155f..8c73c005e69 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -113,9 +113,7 @@ If `fringe-arrow', indicate the locus by the fringe arrow."
113(defvar next-error-highlight-timer nil) 113(defvar next-error-highlight-timer nil)
114 114
115(defvar next-error-overlay-arrow-position nil) 115(defvar next-error-overlay-arrow-position nil)
116;; This is nil so as not to really display anything on text 116(put 'next-error-overlay-arrow-position 'overlay-arrow-string "=>")
117;; terminals. On text terminals, it would hide part of the file name.
118(put 'next-error-overlay-arrow-position 'overlay-arrow-string "")
119(add-to-list 'overlay-arrow-variable-list 'next-error-overlay-arrow-position) 117(add-to-list 'overlay-arrow-variable-list 'next-error-overlay-arrow-position)
120 118
121(defvar next-error-last-buffer nil 119(defvar next-error-last-buffer nil
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index 9519dadeed5..64623e76ce9 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -1168,7 +1168,8 @@ This is in addition to the primary selection."
1168(defun x-select-text (text &optional push) 1168(defun x-select-text (text &optional push)
1169 (x-set-selection 'PRIMARY text) 1169 (x-set-selection 'PRIMARY text)
1170 (setq x-last-selected-text-primary text) 1170 (setq x-last-selected-text-primary text)
1171 (when x-select-enable-clipboard 1171 (if (not x-select-enable-clipboard)
1172 (setq x-last-selected-text-clipboard nil)
1172 (x-set-selection 'CLIPBOARD text) 1173 (x-set-selection 'CLIPBOARD text)
1173 (setq x-last-selected-text-clipboard text)) 1174 (setq x-last-selected-text-clipboard text))
1174 ) 1175 )
@@ -1203,20 +1204,26 @@ in `selection-converter-alist', which see."
1203 (setq data 1204 (setq data
1204 (decode-coding-string data 'utf-16))))) 1205 (decode-coding-string data 'utf-16)))))
1205 ((eq data-type 'com.apple.traditional-mac-plain-text) 1206 ((eq data-type 'com.apple.traditional-mac-plain-text)
1206 (setq data (decode-coding-string data coding)))) 1207 (setq data (decode-coding-string data coding)))
1208 ((eq data-type 'public.file-url)
1209 (setq data (decode-coding-string data 'utf-8))
1210 ;; Remove a trailing nul character.
1211 (let ((len (length data)))
1212 (if (and (> len 0) (= (aref data (1- len)) ?\0))
1213 (setq data (substring data 0 (1- len)))))))
1207 (put-text-property 0 (length data) 'foreign-selection data-type data)) 1214 (put-text-property 0 (length data) 'foreign-selection data-type data))
1208 data)) 1215 data))
1209 1216
1210(defun x-selection-value (type) 1217(defun x-selection-value (type)
1211 (let (text tiff-image) 1218 (let ((data-types '(public.utf16-plain-text
1212 (setq text (condition-case nil 1219 com.apple.traditional-mac-plain-text
1213 (x-get-selection type 'public.utf16-plain-text) 1220 public.file-url))
1214 (error nil))) 1221 text tiff-image)
1215 (if (not text) 1222 (while (and (null text) data-types)
1216 (setq text (condition-case nil 1223 (setq text (condition-case nil
1217 (x-get-selection type 1224 (x-get-selection type (car data-types))
1218 'com.apple.traditional-mac-plain-text) 1225 (error nil)))
1219 (error nil)))) 1226 (setq data-types (cdr data-types)))
1220 (if text 1227 (if text
1221 (remove-text-properties 0 (length text) '(foreign-selection nil) text)) 1228 (remove-text-properties 0 (length text) '(foreign-selection nil) text))
1222 (setq tiff-image (condition-case nil 1229 (setq tiff-image (condition-case nil
@@ -1237,7 +1244,8 @@ in `selection-converter-alist', which see."
1237;;; selection won't be added to the kill ring over and over. 1244;;; selection won't be added to the kill ring over and over.
1238(defun x-get-selection-value () 1245(defun x-get-selection-value ()
1239 (let (clip-text primary-text) 1246 (let (clip-text primary-text)
1240 (when x-select-enable-clipboard 1247 (if (not x-select-enable-clipboard)
1248 (setq x-last-selected-text-clipboard nil)
1241 (setq clip-text (x-selection-value 'CLIPBOARD)) 1249 (setq clip-text (x-selection-value 'CLIPBOARD))
1242 (if (string= clip-text "") (setq clip-text nil)) 1250 (if (string= clip-text "") (setq clip-text nil))
1243 1251
@@ -1286,11 +1294,14 @@ in `selection-converter-alist', which see."
1286 )) 1294 ))
1287 1295
1288(put 'CLIPBOARD 'mac-scrap-name "com.apple.scrap.clipboard") 1296(put 'CLIPBOARD 'mac-scrap-name "com.apple.scrap.clipboard")
1289(if (eq system-type 'darwin) 1297(when (eq system-type 'darwin)
1290 (put 'FIND 'mac-scrap-name "com.apple.scrap.find")) 1298 (put 'FIND 'mac-scrap-name "com.apple.scrap.find")
1299 (put 'PRIMARY 'mac-scrap-name
1300 (format "org.gnu.Emacs.%d.selection.PRIMARY" (emacs-pid))))
1291(put 'com.apple.traditional-mac-plain-text 'mac-ostype "TEXT") 1301(put 'com.apple.traditional-mac-plain-text 'mac-ostype "TEXT")
1292(put 'public.utf16-plain-text 'mac-ostype "utxt") 1302(put 'public.utf16-plain-text 'mac-ostype "utxt")
1293(put 'public.tiff 'mac-ostype "TIFF") 1303(put 'public.tiff 'mac-ostype "TIFF")
1304(put 'public.file-url 'mac-ostype "furl")
1294 1305
1295(defun mac-select-convert-to-string (selection type value) 1306(defun mac-select-convert-to-string (selection type value)
1296 (let ((str (cdr (xselect-convert-to-string selection nil value))) 1307 (let ((str (cdr (xselect-convert-to-string selection nil value)))
@@ -1326,6 +1337,16 @@ in `selection-converter-alist', which see."
1326 (setq next-selection-coding-system nil) 1337 (setq next-selection-coding-system nil)
1327 (cons type str)))) 1338 (cons type str))))
1328 1339
1340(defun mac-select-convert-to-file-url (selection type value)
1341 (let ((filename (xselect-convert-to-filename selection type value))
1342 (coding (or file-name-coding-system default-file-name-coding-system)))
1343 (if (and filename coding)
1344 (setq filename (encode-coding-string filename coding)))
1345 (and filename
1346 (concat "file://localhost"
1347 (mapconcat 'url-hexify-string
1348 (split-string filename "/") "/")))))
1349
1329(setq selection-converter-alist 1350(setq selection-converter-alist
1330 (nconc 1351 (nconc
1331 '((public.utf16-plain-text . mac-select-convert-to-string) 1352 '((public.utf16-plain-text . mac-select-convert-to-string)
@@ -1333,6 +1354,7 @@ in `selection-converter-alist', which see."
1333 ;; This is not enabled by default because the `Import Image' 1354 ;; This is not enabled by default because the `Import Image'
1334 ;; menu makes Emacs crash or hang for unknown reasons. 1355 ;; menu makes Emacs crash or hang for unknown reasons.
1335 ;; (public.tiff . nil) 1356 ;; (public.tiff . nil)
1357 (public.file-url . mac-select-convert-to-file-url)
1336 ) 1358 )
1337 selection-converter-alist)) 1359 selection-converter-alist))
1338 1360
@@ -1702,6 +1724,7 @@ ascii:-*-Monaco-*-*-*-*-12-*-*-*-*-*-mac-roman")
1702(setq interprogram-cut-function 'x-select-text) 1724(setq interprogram-cut-function 'x-select-text)
1703(setq interprogram-paste-function 'x-get-selection-value) 1725(setq interprogram-paste-function 'x-get-selection-value)
1704 1726
1727(defalias 'x-cut-buffer-or-selection-value 'x-get-selection-value)
1705 1728
1706;;; Turn off window-splitting optimization; Mac is usually fast enough 1729;;; Turn off window-splitting optimization; Mac is usually fast enough
1707;;; that this is only annoying. 1730;;; that this is only annoying.
@@ -1756,7 +1779,9 @@ Switch to a buffer editing the last file dropped."
1756 '(lambda () 1779 '(lambda ()
1757 (defvar mac-ready-for-drag-n-drop t))) 1780 (defvar mac-ready-for-drag-n-drop t)))
1758 1781
1759;;;; Scroll bars 1782;;;; Non-toolkit Scroll bars
1783
1784(unless x-toolkit-scroll-bars
1760 1785
1761;; for debugging 1786;; for debugging
1762;; (defun mac-handle-scroll-bar-event (event) (interactive "e") (princ event)) 1787;; (defun mac-handle-scroll-bar-event (event) (interactive "e") (princ event))
@@ -1816,6 +1841,7 @@ Switch to a buffer editing the last file dropped."
1816 (mac-scroll-ignore-events) 1841 (mac-scroll-ignore-events)
1817 (scroll-up 1))) 1842 (scroll-up 1)))
1818 1843
1844)
1819 1845
1820;;;; Others 1846;;;; Others
1821 1847
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 97bc3350b47..c8926776400 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -301,7 +301,9 @@ Must be greater than 1."
301 :type 'integer 301 :type 'integer
302 :group 'ispell) 302 :group 'ispell)
303 303
304(defcustom ispell-program-name "ispell" 304(defcustom ispell-program-name
305 (or (locate-file "aspell" exec-path exec-suffixes 'file-executable-p)
306 "ispell")
305 "Program invoked by \\[ispell-word] and \\[ispell-region] commands." 307 "Program invoked by \\[ispell-word] and \\[ispell-region] commands."
306 :type 'string 308 :type 'string
307 :group 'ispell) 309 :group 'ispell)
diff --git a/lisp/textmodes/po.el b/lisp/textmodes/po.el
index a4ec5d3ac8b..c2e58d7d582 100644
--- a/lisp/textmodes/po.el
+++ b/lisp/textmodes/po.el
@@ -80,14 +80,15 @@ Do so according to FILENAME's declared charset."
80 assoc) 80 assoc)
81 (list (cond 81 (list (cond
82 ((setq assoc 82 ((setq assoc
83 (assoc-ignore-case charset 83 (assoc-string charset
84 po-content-type-charset-alist)) 84 po-content-type-charset-alist
85 t))
85 (cdr assoc)) 86 (cdr assoc))
86 ((or (setq assoc (assoc-ignore-case charset coding-system-alist)) 87 ((or (setq assoc (assoc-string charset coding-system-alist t))
87 (setq assoc 88 (setq assoc
88 (assoc-ignore-case (subst-char-in-string ?_ ?- 89 (assoc-string (subst-char-in-string ?_ ?-
89 charset) 90 charset)
90 coding-system-alist))) 91 coding-system-alist t)))
91 (intern (car assoc))) 92 (intern (car assoc)))
92 ;; In principle we should also check the `mime-charset' 93 ;; In principle we should also check the `mime-charset'
93 ;; property of everything in the base coding system 94 ;; property of everything in the base coding system
@@ -101,10 +102,10 @@ Do so according to FILENAME's declared charset."
101 ;; to require it initially? 102 ;; to require it initially?
102 (require 'code-pages nil t) 103 (require 'code-pages nil t)
103 (if (or 104 (if (or
104 (setq assoc (assoc-ignore-case charset coding-system-alist)) 105 (setq assoc (assoc-string charset coding-system-alist t))
105 (setq assoc (assoc-ignore-case (subst-char-in-string 106 (setq assoc (assoc-string (subst-char-in-string
106 ?_ ?- charset) 107 ?_ ?- charset)
107 coding-system-alist))) 108 coding-system-alist t)))
108 (intern (car assoc)) 109 (intern (car assoc))
109 'raw-text)))))))) 110 'raw-text))))))))
110 111
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index 9bd35f05d11..7a2865b9dfa 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -27,9 +27,6 @@
27 27
28;;; Code: 28;;; Code:
29 29
30(eval-when-compile (require 'cl)) ; for case macro
31
32
33;;; Customizable settings 30;;; Customizable settings
34 31
35(defgroup tooltip nil 32(defgroup tooltip nil
@@ -116,42 +113,6 @@ position to pop up the tooltip."
116 "Face for tooltips." 113 "Face for tooltips."
117 :group 'tooltip) 114 :group 'tooltip)
118 115
119(defcustom tooltip-gud-tips-p nil
120 "*Non-nil means show tooltips in GUD sessions.
121
122This allows you to display a variable's value in a tooltip simply
123by pointing at it with the mouse. In the case of a C program
124controlled by GDB, it shows the associated #define directives
125when program is not executing."
126 :type 'boolean
127 :tag "GUD"
128 :group 'tooltip)
129
130(defcustom tooltip-gud-modes '(gud-mode c-mode c++-mode fortran-mode)
131 "List of modes for which to enable GUD tips."
132 :type 'sexp
133 :tag "GUD modes"
134 :group 'tooltip)
135
136(defcustom tooltip-gud-display
137 '((eq (tooltip-event-buffer tooltip-gud-event)
138 (marker-buffer gud-overlay-arrow-position)))
139 "List of forms determining where GUD tooltips are displayed.
140
141Forms in the list are combined with AND. The default is to display
142only tooltips in the buffer containing the overlay arrow."
143 :type 'sexp
144 :tag "GUD buffers predicate"
145 :group 'tooltip)
146
147(defcustom tooltip-gud-echo-area nil
148 "Use the echo area instead of frames for GUD tooltips."
149 :type 'boolean
150 :tag "Use echo area"
151 :group 'tooltip)
152
153(defvaralias 'tooltip-use-echo-area 'tooltip-gud-echo-area)
154(make-obsolete-variable 'tooltip-use-echo-area 'tooltip-gud-echo-area "22.1")
155 116
156;;; Variables that are not customizable. 117;;; Variables that are not customizable.
157 118
@@ -169,7 +130,6 @@ the last mouse movement event that occurred.")
169(defvar tooltip-hide-time nil 130(defvar tooltip-hide-time nil
170 "Time when the last tooltip was hidden.") 131 "Time when the last tooltip was hidden.")
171 132
172
173;;; Event accessors 133;;; Event accessors
174 134
175(defun tooltip-event-buffer (event) 135(defun tooltip-event-buffer (event)
@@ -178,7 +138,6 @@ This might return nil if the event did not occur over a buffer."
178 (let ((window (posn-window (event-end event)))) 138 (let ((window (posn-window (event-end event))))
179 (and window (window-buffer window)))) 139 (and window (window-buffer window))))
180 140
181
182;;; Switching tooltips on/off 141;;; Switching tooltips on/off
183 142
184;; We don't set track-mouse globally because this is a big redisplay 143;; We don't set track-mouse globally because this is a big redisplay
@@ -202,16 +161,15 @@ With ARG, turn tooltip mode on if and only if ARG is positive."
202 :group 'tooltip 161 :group 'tooltip
203 (unless (or (null tooltip-mode) (fboundp 'x-show-tip)) 162 (unless (or (null tooltip-mode) (fboundp 'x-show-tip))
204 (error "Sorry, tooltips are not yet available on this system")) 163 (error "Sorry, tooltips are not yet available on this system"))
205 (let ((hook-fn (if tooltip-mode 'add-hook 'remove-hook))) 164 (if tooltip-mode
206 (funcall hook-fn 'change-major-mode-hook 'tooltip-change-major-mode) 165 (progn
207 (tooltip-activate-mouse-motions-if-enabled) 166 (add-hook 'pre-command-hook 'tooltip-hide)
208 (funcall hook-fn 'pre-command-hook 'tooltip-hide) 167 (add-hook 'tooltip-hook 'tooltip-help-tips))
209 (funcall hook-fn 'tooltip-hook 'tooltip-gud-tips) 168 (unless (and (boundp 'gud-tooltip-mode) gud-tooltip-mode)
210 (funcall hook-fn 'tooltip-hook 'tooltip-help-tips) 169 (remove-hook 'pre-command-hook 'tooltip-hide))
211 (setq show-help-function (if tooltip-mode 'tooltip-show-help-function nil)) 170 (remove-hook 'tooltip-hook 'tooltip-help-tips))
212 ;; `ignore' is the default binding for mouse movements. 171 (setq show-help-function
213 (define-key global-map [mouse-movement] 172 (if tooltip-mode 'tooltip-show-help-function nil)))
214 (if tooltip-mode 'tooltip-mouse-motion 'ignore))))
215 173
216 174
217;;; Timeout for tooltip display 175;;; Timeout for tooltip display
@@ -242,49 +200,6 @@ With ARG, turn tooltip mode on if and only if ARG is positive."
242 tooltip-last-mouse-motion-event)) 200 tooltip-last-mouse-motion-event))
243 201
244 202
245;;; Reacting on mouse movements
246
247(defun tooltip-change-major-mode ()
248 "Function added to `change-major-mode-hook' when tooltip mode is on."
249 (add-hook 'post-command-hook 'tooltip-activate-mouse-motions-if-enabled))
250
251(defun tooltip-activate-mouse-motions-if-enabled ()
252 "Reconsider for all buffers whether mouse motion events are desired."
253 (remove-hook 'post-command-hook 'tooltip-activate-mouse-motions-if-enabled)
254 (dolist (buffer (buffer-list))
255 (save-excursion
256 (set-buffer buffer)
257 (if (and tooltip-mode
258 tooltip-gud-tips-p
259 (memq major-mode tooltip-gud-modes))
260 (tooltip-activate-mouse-motions t)
261 (tooltip-activate-mouse-motions nil)))))
262
263(defvar tooltip-mouse-motions-active nil
264 "Locally t in a buffer if tooltip processing of mouse motion is enabled.")
265
266(defun tooltip-activate-mouse-motions (activatep)
267 "Activate/deactivate mouse motion events for the current buffer.
268ACTIVATEP non-nil means activate mouse motion events."
269 (if activatep
270 (progn
271 (make-local-variable 'tooltip-mouse-motions-active)
272 (setq tooltip-mouse-motions-active t)
273 (make-local-variable 'track-mouse)
274 (setq track-mouse t))
275 (when tooltip-mouse-motions-active
276 (kill-local-variable 'tooltip-mouse-motions-active)
277 (kill-local-variable 'track-mouse))))
278
279(defun tooltip-mouse-motion (event)
280 "Command handler for mouse movement events in `global-map'."
281 (interactive "e")
282 (tooltip-hide)
283 (when (car (mouse-pixel-position))
284 (setq tooltip-last-mouse-motion-event (copy-sequence event))
285 (tooltip-start-delayed-tip)))
286
287
288;;; Displaying tips 203;;; Displaying tips
289 204
290(defun tooltip-set-param (alist key value) 205(defun tooltip-set-param (alist key value)
@@ -396,114 +311,6 @@ of PROCESS."
396 output)) 311 output))
397 312
398 313
399;;; Tips for `gud'
400
401(defvar tooltip-gud-original-filter nil
402 "Process filter to restore after GUD output has been received.")
403
404(defvar tooltip-gud-dereference nil
405 "Non-nil means print expressions with a `*' in front of them.
406For C this would dereference a pointer expression.")
407
408(defvar tooltip-gud-event nil
409 "The mouse movement event that led to a tooltip display.
410This event can be examined by forms in TOOLTIP-GUD-DISPLAY.")
411
412(defun tooltip-gud-toggle-dereference ()
413 "Toggle whether tooltips should show `* expr' or `expr'."
414 (interactive)
415 (setq tooltip-gud-dereference (not tooltip-gud-dereference))
416 (when (interactive-p)
417 (message "Dereferencing is now %s."
418 (if tooltip-gud-dereference "on" "off"))))
419
420(defun tooltip-toggle-gud-tips ()
421 "Toggle the display of GUD tooltips."
422 (interactive)
423 (setq tooltip-gud-tips-p (not tooltip-gud-tips-p))
424 ;; Reconsider for all buffers whether mouse motion events are desired.
425 (tooltip-change-major-mode)
426 (when (interactive-p)
427 (message (format "GUD tooltips %sabled"
428 (if tooltip-gud-tips-p "en" "dis")))))
429
430; This will only display data that comes in one chunk.
431; Larger arrays (say 400 elements) are displayed in
432; the tootip incompletely and spill over into the gud buffer.
433; Switching the process-filter creates timing problems and
434; it may be difficult to do better. Using annotations as in
435; gdb-ui.el gets round this problem.
436(defun tooltip-gud-process-output (process output)
437 "Process debugger output and show it in a tooltip window."
438 (set-process-filter process tooltip-gud-original-filter)
439 (tooltip-show (tooltip-strip-prompt process output)
440 tooltip-gud-echo-area))
441
442(defun tooltip-gud-print-command (expr)
443 "Return a suitable command to print the expression EXPR.
444If TOOLTIP-GUD-DEREFERENCE is t, also prepend a `*' to EXPR."
445 (when tooltip-gud-dereference
446 (setq expr (concat "*" expr)))
447 (case gud-minor-mode
448 ((gdb gdba) (concat "server print " expr))
449 (dbx (concat "print " expr))
450 (xdb (concat "p " expr))
451 (sdb (concat expr "/"))
452 (perldb expr)))
453
454(defun tooltip-gud-tips (event)
455 "Show tip for identifier or selection under the mouse.
456The mouse must either point at an identifier or inside a selected
457region for the tip window to be shown. If tooltip-gud-dereference is t,
458add a `*' in front of the printed expression. In the case of a C program
459controlled by GDB, show the associated #define directives when program is
460not executing.
461
462This function must return nil if it doesn't handle EVENT."
463 (let (process)
464 (when (and (eventp event)
465 tooltip-gud-tips-p
466 (boundp 'gud-comint-buffer)
467 gud-comint-buffer
468 (buffer-name gud-comint-buffer); gud-comint-buffer might be killed
469 (setq process (get-buffer-process gud-comint-buffer))
470 (posn-point (event-end event))
471 (or (eq gud-minor-mode 'gdba)
472 (progn (setq tooltip-gud-event event)
473 (eval (cons 'and tooltip-gud-display)))))
474 (let ((expr (tooltip-expr-to-print event)))
475 (when expr
476 (if (and (eq gud-minor-mode 'gdba)
477 (not gdb-active-process))
478 (progn
479 (with-current-buffer
480 (window-buffer (let ((mouse (mouse-position)))
481 (window-at (cadr mouse)
482 (cddr mouse))))
483 (let ((define-elt (assoc expr gdb-define-alist)))
484 (unless (null define-elt)
485 (tooltip-show (cdr define-elt))
486 expr))))
487 (let ((cmd (tooltip-gud-print-command expr)))
488 (unless (null cmd) ; CMD can be nil if unknown debugger
489 (case gud-minor-mode
490 (gdba (gdb-enqueue-input
491 (list (concat cmd "\n") 'gdb-tooltip-print)))
492 (t
493 (setq tooltip-gud-original-filter (process-filter process))
494 (set-process-filter process 'tooltip-gud-process-output)
495 (gud-basic-call cmd)))
496 expr))))))))
497
498(defun gdb-tooltip-print ()
499 (tooltip-show
500 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
501 (let ((string (buffer-string)))
502 ;; remove newline for tooltip-gud-echo-area
503 (substring string 0 (- (length string) 1))))
504 tooltip-gud-echo-area))
505
506
507;;; Tooltip help. 314;;; Tooltip help.
508 315
509(defvar tooltip-help-message nil 316(defvar tooltip-help-message nil