aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKaroly Lorentey2006-02-16 16:18:54 +0000
committerKaroly Lorentey2006-02-16 16:18:54 +0000
commit322c30faa92c5ba2accc1027893a7cc24abbde72 (patch)
tree235c1de5e7e7b71c470b326e9480e3476c483050 /lisp
parent6213d5b33cfae99e350488ab96bfd9704e0ff834 (diff)
parentb51897597a6ab40a4772d70a23421e66b3eb5048 (diff)
downloademacs-322c30faa92c5ba2accc1027893a7cc24abbde72.tar.gz
emacs-322c30faa92c5ba2accc1027893a7cc24abbde72.zip
Merged from
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-73 Merge from erc--emacs--0 * emacs@sv.gnu.org/emacs--devo--0--patch-74 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-75 Make ERC comply with the new copyright year guidelines. * emacs@sv.gnu.org/emacs--devo--0--patch-76 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-77 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-78 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-79 (rcirc-format-response-string): Fix small bugs * emacs@sv.gnu.org/emacs--devo--0--patch-80 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-81 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-82 Fix compiler error in erc-dcc.el. * emacs@sv.gnu.org/emacs--devo--0--patch-83 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-84 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-85 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-86 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-87 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-88 Merge from erc--emacs--0 * emacs@sv.gnu.org/emacs--devo--0--patch-89 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-90 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-513
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog245
-rw-r--r--lisp/bs.el19
-rw-r--r--lisp/calc/calc-arith.el2
-rw-r--r--lisp/calc/calcalg2.el8
-rw-r--r--lisp/calendar/icalendar.el10
-rw-r--r--lisp/cus-edit.el11
-rw-r--r--lisp/cus-start.el1
-rw-r--r--lisp/cus-theme.el1
-rw-r--r--lisp/dired.el1
-rw-r--r--lisp/erc/ChangeLog94
-rw-r--r--lisp/erc/erc-autoaway.el2
-rw-r--r--lisp/erc/erc-dcc.el7
-rw-r--r--lisp/erc/erc-ezbounce.el2
-rw-r--r--lisp/erc/erc-fill.el2
-rw-r--r--lisp/erc/erc-goodies.el3
-rw-r--r--lisp/erc/erc-hecomplete.el2
-rw-r--r--lisp/erc/erc-ibuffer.el2
-rw-r--r--lisp/erc/erc-identd.el2
-rw-r--r--lisp/erc/erc-imenu.el2
-rw-r--r--lisp/erc/erc-join.el2
-rw-r--r--lisp/erc/erc-lang.el2
-rw-r--r--lisp/erc/erc-list.el23
-rw-r--r--lisp/erc/erc-log.el2
-rw-r--r--lisp/erc/erc-match.el20
-rw-r--r--lisp/erc/erc-menu.el6
-rw-r--r--lisp/erc/erc-netsplit.el2
-rw-r--r--lisp/erc/erc-networks.el2
-rw-r--r--lisp/erc/erc-notify.el2
-rw-r--r--lisp/erc/erc-page.el2
-rw-r--r--lisp/erc/erc-pcomplete.el2
-rw-r--r--lisp/erc/erc-replace.el2
-rw-r--r--lisp/erc/erc-ring.el2
-rw-r--r--lisp/erc/erc-services.el2
-rw-r--r--lisp/erc/erc-sound.el2
-rw-r--r--lisp/erc/erc-speedbar.el2
-rw-r--r--lisp/erc/erc-spelling.el8
-rw-r--r--lisp/erc/erc-stamp.el60
-rw-r--r--lisp/erc/erc-track.el2
-rw-r--r--lisp/erc/erc-truncate.el2
-rw-r--r--lisp/erc/erc-xdcc.el4
-rw-r--r--lisp/erc/erc.el123
-rw-r--r--lisp/ffap.el8
-rw-r--r--lisp/files.el474
-rw-r--r--lisp/find-lisp.el4
-rw-r--r--lisp/gnus/ChangeLog9
-rw-r--r--lisp/gnus/gnus-cus.el16
-rw-r--r--lisp/gnus/html2text.el2
-rw-r--r--lisp/gnus/spam-stat.el2
-rw-r--r--lisp/help.el114
-rw-r--r--lisp/icomplete.el2
-rw-r--r--lisp/info.el10
-rw-r--r--lisp/mh-e/ChangeLog8
-rw-r--r--lisp/mh-e/mh-compat.el8
-rw-r--r--lisp/mh-e/mh-utils.el50
-rw-r--r--lisp/mouse.el17
-rw-r--r--lisp/mwheel.el4
-rw-r--r--lisp/net/rcirc.el41
-rw-r--r--lisp/net/tramp.el10
-rw-r--r--lisp/play/landmark.el4
-rw-r--r--lisp/progmodes/ebrowse.el2
-rw-r--r--lisp/progmodes/flymake.el2
-rw-r--r--lisp/progmodes/gdb-ui.el190
-rw-r--r--lisp/progmodes/gud.el11
-rw-r--r--lisp/simple.el4
-rw-r--r--lisp/subr.el6
-rw-r--r--lisp/tumme.el604
-rw-r--r--lisp/wid-edit.el17
67 files changed, 1244 insertions, 1065 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ddd50210928..670f6db6282 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,229 @@
12006-02-16 Juanma Barranquero <lekktu@gmail.com>
2
3 * calendar/icalendar.el (icalendar--get-event-property)
4 (icalendar--get-event-property-attributes): Fix typos in
5 docstrings.
6
7 * progmodes/flymake.el (flymake-fix-file-name): Fix typo in
8 docstring.
9
102006-02-15 Juanma Barranquero <lekktu@gmail.com>
11
12 * bs.el (bs-mode): Use `buffer-disable-undo'.
13 (bs--get-file-name): Simplify.
14 (bs-show-in-buffer): Mark the buffer as not modified.
15
162006-02-14 Chong Yidong <cyd@stupidchicken.com>
17
18 * wid-edit.el (widget-keymap): Bind down-mouse-1 to
19 widget-button-click.
20
21 * cus-edit.el (custom-mode-map): Remove mouse-1 binding.
22 (custom-mode): Update docstring.
23
24 * cus-theme.el (custom-new-theme-mode-map): Remove mouse-1
25 binding.
26
27 * files.el (hack-local-variables-confirm): Allow scrolling if the
28 file variable list is too long. Kill temp buffer after use.
29
302006-02-15 Nick Roberts <nickrob@snap.net.nz>
31
32 * progmodes/gud.el (gdb): Improve doc string.
33 (gdb-script-font-lock-keywords): Expand allowed character set.
34
35 * progmodes/gdb-ui.el (gdb-use-separate-io-buffer)
36 (gdb-display-separate-io-buffer, gdb-frame-separate-io-buffer)
37 (gdb-separate-io-interrupt, gdb-separate-io-quit)
38 (gdb-separate-io-stop, gdb-separate-io-eof):
39 Rename from gdb-inferior-* to gdb-separate-*.
40 (gdb-set-gud-minor-mode-existing-buffers-1): Improve doc string.
41
422006-02-14 Jay Belanger <belanger@truman.edu>
43
44 * calc/calc-arith.el (math-check-known-scalarp): Make sure
45 expression is a symbol before checking that it is bound.
46
47 * calc/calcalg2.el (math-integrate-by-parts): Do a more careful
48 test to see if equation can be solved.
49
502006-02-14 Chong Yidong <cyd@stupidchicken.com>
51
52 * wid-edit.el (widget-button-click): Use :pressed-face property
53 for overlay face, if it exists.
54
55 * cus-edit.el (custom-manual, custom-add-see-also)
56 (custom-add-parent-links, custom-group-link): Add :pressed-face
57 property to links.
58
59 * files.el (hack-local-variables): Remove ignored variables before
60 checking if any variables need setting.
61
622006-02-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
63
64 * cus-start.el (all): Add x-gtk-whole-detached-tool-bar.
65
662006-02-14 Juanma Barranquero <lekktu@gmail.com>
67
68 * help.el (where-is): Fix message for remapped commands.
69
70 * mwheel.el (mouse-wheel-click-event, mouse-wheel-mode):
71 Fix typos in docstrings.
72
732006-02-13 Chong Yidong <cyd@stupidchicken.com>
74
75 * files.el (safe-local-variable-values): New option.
76 (hack-local-variables-prop-line): Return a list of variable-value
77 pairs if MODE-ONLY is non-nil.
78 (hack-local-variables): Construct list of variable-value pairs,
79 and apply or reject them in one go. Ask for confirmation if
80 variables are not known safe.
81 (hack-local-variables-confirm): Complete rewrite. Support
82 `safe-local-variable-values'.
83 (enable-local-variables): Update docstring to reflect new
84 behavior.
85 (ignored-local-variables): Ignore ignored-local-variables and
86 safe-local-variable-values.
87 (safe-local-variable-p): New function.
88 (risky-local-variable-p): `safe-local-variable' property check
89 moved to safe-local-variable-p.
90 (hack-one-local-variable): Checks moved to hack-local-variables.
91
92 (byte-compile-dynamic, c-basic-offset, c-file-style)
93 (c-indent-level, comment-column, fill-column, fill-prefix)
94 (indent-tabs-mode, kept-new-versions, no-byte-compile)
95 (no-update-autoloads, outline-regexp, page-delimiter)
96 (paragraph-start, paragraph-separate, sentence-end)
97 (sentence-end-double-space tab-width, version-control):
98 Add `safe-local-variable' property.
99
100 * find-lisp.el: Delete nonexistent `autocompile' file variable.
101
102 * icomplete.el, play/landmark.el: Change nonexistent
103 `outline-layout' file variable to `allout-layout'.
104
1052006-02-14 Nick Roberts <nickrob@snap.net.nz>
106
107 * progmodes/gdb-ui.el (gud-watch, gdb-invalidate-registers-1)
108 (gdb-get-changed-registers): Test value of gud-minor-mode relative
109 to gud-comint-buffer.
110 (gdb-speedbar-expand-node, gdb-locals-mode): Use functions in
111 gdb-ui.el for gdb-mi.el.
112 (gdb-post-prompt, gdb-get-changed-registers): Move test for
113 registers buffer to gdb-get-changed-registers.
114 (gdb-breakpoint-regexp): New regexp. Allow toggling and
115 deletion of catchpoints (throw and catch).
116 (gdb-toggle-breakpoint, gdb-delete-breakpoint)
117 (gdb-goto-breakpoint): Use it for both gdb-ui and gdb-mi.
118 (gdb-find-file-hook, gdb-set-gud-minor-mode-existing-buffers-1)
119 (gdb-var-list-children-1, gdb-info-breakpoints-custom)
120 (gdb-var-update-1, gdb-invalidate-locals-1): Use also for gdb-mi.
121
1222006-02-13 Jay Belanger <belanger@truman.edu>
123
124 * calc/calc-arith.el (math-check-known-matrixp): Make sure
125 expression is a symbol before checking that it is bound.
126
1272006-02-13 Richard M. Stallman <rms@gnu.org>
128
129 * mouse.el (mouse-drag-mode-line-1): Use mouse-drag-move-window-bottom
130 for the minibuffer too, but not if resize-mini-windows will interfere.
131
132 * help.el (describe-key-briefly, describe-key): Do all arg-reading
133 inside `interactive' spec.
134 (describe-key-briefly-internal, describe-key-internal):
135 Functions merged back into their callers.
136
1372006-02-13 Martin Rudalics <rudalics@gmx.at> (tiny change)
138
139 * info.el (info-xref-visited): Inherit from info-xref too.
140 (Info-set-mode-line): Replace occurrences of `%' by `%%'
141 when propertizing Info-current-file and Info-current-node.
142
1432006-02-13 Juri Linkov <juri@jurta.org>
144
145 * tumme.el (tumme-thumbnail-storage): Fix docstring.
146 (tumme-thumb-name): Fix per-directory format.
147
1482006-02-13 Juanma Barranquero <lekktu@gmail.com>
149
150 * subr.el (substitute-key-definition): Doc fix (hide internal arg).
151
1522006-02-12 Miles Bader <miles@gnu.org>
153
154 * net/rcirc.el (rcirc-format-response-string): Fix small bugs.
155
1562006-02-13 Mathias Dahl <mathias.dahl@gmail.com>
157
158 * tumme.el: Remove history section. If someone needs the it, it
159 can always be found in CVS.
160
1612006-02-12 Mathias Dahl <mathias.dahl@gmail.com>
162
163 * tumme.el (tumme-thumbnail-storage): Update docstring. Add info
164 about the Thumbnail Managing Standard option.
165
1662006-02-12 Richard M. Stallman <rms@gnu.org>
167
168 * subr.el (substitute-key-definition): Doc fix.
169
170 * simple.el (blink-matching-paren-dont-ignore-comments): Doc fix.
171
172 * files.el (magic-mode-alist): Don't use `\\s ' in regexps.
173
174 * info.el (Info-mode): Doc fix.
175
176 * progmodes/ebrowse.el (ebrowse-global-prefix-key): Change to C-c C-m.
177
1782006-02-12 Michael Albinus <michael.albinus@gmx.de>
179
180 * net/tramp.el (tramp-remote-path): Add "/usr/xpg4/bin" on top,
181 because on Solaris a POSIX compatible "id" is needed. Reported by
182 Magnus Henoch <mange@freemail.hu>.
183
1842006-02-12 Juri Linkov <juri@jurta.org>
185
186 * tumme.el: Remove todo item about Thumbnail Managing Standard.
187 (tumme) <defgroup>: Change :group to `multimedia'.
188 (tumme-thumbnail-storage): Add choice `standard' for Thumbnail
189 Managing Standard.
190 (tumme-cmd-create-thumbnail-options): Use %w and %h instead of %s.
191 Fix dostring.
192 (tumme-cmd-create-temp-image-options): Use %w and %h instead of %x
193 and %y. Fix docstring.
194 (tumme-cmd-pngnq-program, tumme-cmd-pngcrush-program)
195 (tumme-cmd-create-standard-thumbnail-command): New user options.
196 (tumme-thumb-size): Set default to 128 if tumme-thumbnail-storage
197 is `standard'. Fix docstring.
198 (tumme-thumb-width, tumme-thumb-height): New user options.
199 (tumme-external-viewer): Try to find various viewers.
200 (tumme-get-thumbnail-image): Use `create-image' instead of
201 constructing the `image' structure.
202 (tumme-insert-thumbnail): Use `png' if tumme-thumbnail-storage is
203 `standard'.
204 (tumme-thumb-name): Add file name generation for standard storage.
205 Simplify code for other storages.
206 (tumme-thumb-name): Use width %w and height %h instead of size %s.
207 Add modification time %m and thumbnail-nq8 %q.
208 Use `tumme-cmd-create-standard-thumbnail-command' if
209 tumme-thumbnail-storage is `standard'.
210 (tumme-dired-insert-marked-thumbs): New autoload command.
211 (tumme-dired-after-readin-hook): New function.
212 (tumme-line-up-dynamic): Use `tumme-thumb-width' instead of
213 `tumme-thumb-size'.
214 (tumme-display-image): Replace size-x %x and size-y %y with
215 width %w and height %h.
216
217 * dired.el (dired-mode-map): Bind `\C-t\C-t' to
218 `tumme-dired-insert-marked-thumbs'.
219
2202006-02-12 Mathias Dahl <mathias.dahl@gmail.com>
221
222 * tumme.el (tumme-write-tag): Fix small bug (file name did not
223 include path).
224 (tumme-mark-tagged-files): Fix bug in regexp used to find rows
225 matching tag.
226
12006-02-12 Miles Bader <miles@gnu.org> 2272006-02-12 Miles Bader <miles@gnu.org>
2 228
3 * net/rcirc.el (rcirc-nick-abbrevs, rcirc-response-formats): 229 * net/rcirc.el (rcirc-nick-abbrevs, rcirc-response-formats):
@@ -13,19 +239,19 @@
13 239
142006-02-11 Mathias Dahl <brakjoller@hotmail.com> 2402006-02-11 Mathias Dahl <brakjoller@hotmail.com>
15 241
16 * tumme.el: Enhanced some docstrings. Added todo item about 242 * tumme.el: Enhance some docstrings. Add todo item about Thumbnail
17 Thumbnail Managing Standard. 243 Managing Standard.
18 244
192006-02-11 Kim F. Storm <storm@cua.dk> 2452006-02-11 Kim F. Storm <storm@cua.dk>
20 246
21 * ido.el (ido-buffer-internal): Set mark for ido-insert-buffer. 247 * ido.el (ido-buffer-internal): Set mark for ido-insert-buffer.
22 Don't use insert-buffer; do insert-buffer-substring directly. 248 Don't use insert-buffer; do insert-buffer-substring directly.
23 (ido-file-internal): Set mark for ido-insert-file. Use insert-file-1. 249 (ido-file-internal): Set mark for ido-insert-file. Use insert-file-1.
24 250
252006-02-11 Martin Rudalics <rudalics@gmx.at> 2512006-02-11 Martin Rudalics <rudalics@gmx.at>
26 252
27 * files.el (revert-buffer, recover-file): Replace buffer-read-only 253 * files.el (revert-buffer, recover-file): Replace buffer-read-only
28 with inhibit-read-only. Suggested by Stefan Monnier. 254 with inhibit-read-only. Suggested by Stefan Monnier.
29 (revert-buffer): Let insert-file-contents discard 255 (revert-buffer): Let insert-file-contents discard
30 buffer-undo-list. Simplify code. 256 buffer-undo-list. Simplify code.
31 (find-file, find-file-existing, revert-buffer): Doc-string fixes. 257 (find-file, find-file-existing, revert-buffer): Doc-string fixes.
@@ -54,9 +280,8 @@
54 280
552006-02-11 Mathias Dahl <brakjoller@hotmail.com> 2812006-02-11 Mathias Dahl <brakjoller@hotmail.com>
56 282
57 * tumme.el (tumme-dir): Changed default value to 283 * tumme.el (tumme-dir): Change default value to "~/.emacs.d/tumme/".
58 "~/.emacs-d/tumme" 284 (tumme-dir): New function. Copied from thumbs.el.
59 (tumme-dir): New function. Copied from thumbs.el.
60 285
612006-02-10 Juanma Barranquero <lekktu@gmail.com> 2862006-02-10 Juanma Barranquero <lekktu@gmail.com>
62 287
@@ -79,12 +304,12 @@
79 304
802006-02-10 Mathias Dahl <mathias.dahl@gmail.com> 3052006-02-10 Mathias Dahl <mathias.dahl@gmail.com>
81 306
82 * tumme.el (tumme-copy-with-exif-file-name): Tried to make 307 * tumme.el (tumme-copy-with-exif-file-name): Try to make docstring
83 docstring less `colloquial'... 308 less `colloquial'...
84 309
852006-02-09 Mathias Dahl <mathias.dahl@gmail.com> 3102006-02-09 Mathias Dahl <mathias.dahl@gmail.com>
86 311
87 * tumme.el: Added a couple of todo items. 312 * tumme.el: Add a couple of todo items.
88 313
892006-02-09 Lars Hansen <larsh@soem.dk> 3142006-02-09 Lars Hansen <larsh@soem.dk>
90 315
diff --git a/lisp/bs.el b/lisp/bs.el
index a1dfad6ac7a..f095a98dc00 100644
--- a/lisp/bs.el
+++ b/lisp/bs.el
@@ -652,6 +652,7 @@ to show always.
652 (use-local-map bs-mode-map) 652 (use-local-map bs-mode-map)
653 (make-local-variable 'font-lock-defaults) 653 (make-local-variable 'font-lock-defaults)
654 (make-local-variable 'font-lock-verbose) 654 (make-local-variable 'font-lock-verbose)
655 (buffer-disable-undo)
655 (setq major-mode 'bs-mode 656 (setq major-mode 'bs-mode
656 mode-name "Buffer-Selection-Menu" 657 mode-name "Buffer-Selection-Menu"
657 buffer-read-only t 658 buffer-read-only t
@@ -1164,7 +1165,8 @@ and move point to current buffer."
1164 (bs--set-window-height) 1165 (bs--set-window-height)
1165 (bs--goto-current-buffer) 1166 (bs--goto-current-buffer)
1166 (font-lock-fontify-buffer) 1167 (font-lock-fontify-buffer)
1167 (bs-apply-sort-faces))) 1168 (bs-apply-sort-faces)
1169 (set-buffer-modified-p nil)))
1168 1170
1169(defun bs-next-buffer (&optional buffer-list sorting-p) 1171(defun bs-next-buffer (&optional buffer-list sorting-p)
1170 "Return next buffer and buffer list for buffer cycling in BUFFER-LIST. 1172 "Return next buffer and buffer list for buffer cycling in BUFFER-LIST.
@@ -1338,16 +1340,11 @@ If current mode is `dired-mode' or `shell-mode' it returns the
1338default directory. 1340default directory.
1339START-BUFFER is the buffer where we started buffer selection. 1341START-BUFFER is the buffer where we started buffer selection.
1340ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu." 1342ALL-BUFFERS is the list of buffer appearing in Buffer Selection Menu."
1341 (let ((string (copy-sequence (if (member major-mode 1343 (propertize (if (member major-mode '(shell-mode dired-mode))
1342 '(shell-mode dired-mode)) 1344 default-directory
1343 default-directory 1345 (or buffer-file-name ""))
1344 (or buffer-file-name ""))))) 1346 'mouse-face 'highlight
1345 (add-text-properties 1347 'help-echo "mouse-2: select this buffer, mouse-3: select in other frame"))
1346 0 (length string)
1347 '(mouse-face highlight
1348 help-echo "mouse-2: select this buffer, mouse-3: select in other frame")
1349 string)
1350 string))
1351 1348
1352(defun bs--insert-one-entry (buffer) 1349(defun bs--insert-one-entry (buffer)
1353 "Generate one entry for buffer BUFFER in Buffer Selection Menu. 1350 "Generate one entry for buffer BUFFER in Buffer Selection Menu.
diff --git a/lisp/calc/calc-arith.el b/lisp/calc/calc-arith.el
index 2372b0ebbfb..ec09ae29318 100644
--- a/lisp/calc/calc-arith.el
+++ b/lisp/calc/calc-arith.el
@@ -334,6 +334,7 @@
334 ((memq 'scalar (nth 1 decl)) 334 ((memq 'scalar (nth 1 decl))
335 t) 335 t)
336 ((and (eq (car a) 'var) 336 ((and (eq (car a) 'var)
337 (symbolp (nth 2 a))
337 (boundp (nth 2 a)) 338 (boundp (nth 2 a))
338 (setq val (symbol-value (nth 2 a)))) 339 (setq val (symbol-value (nth 2 a))))
339 (math-check-known-scalarp val)) 340 (math-check-known-scalarp val))
@@ -362,6 +363,7 @@
362 ((memq 'matrix (nth 1 decl)) 363 ((memq 'matrix (nth 1 decl))
363 t) 364 t)
364 ((and (eq (car a) 'var) 365 ((and (eq (car a) 'var)
366 (symbolp (nth 2 a))
365 (boundp (nth 2 a)) 367 (boundp (nth 2 a))
366 (setq val (symbol-value (nth 2 a)))) 368 (setq val (symbol-value (nth 2 a))))
367 (math-check-known-matrixp val)) 369 (math-check-known-matrixp val))
diff --git a/lisp/calc/calcalg2.el b/lisp/calc/calcalg2.el
index facb691c08b..f71e58e223a 100644
--- a/lisp/calc/calcalg2.el
+++ b/lisp/calc/calcalg2.el
@@ -1253,9 +1253,11 @@
1253 (calcFunc-expand temp) 1253 (calcFunc-expand temp)
1254 (setq v (list 'var 'PARTS math-cur-record) 1254 (setq v (list 'var 'PARTS math-cur-record)
1255 temp (let (calc-next-why) 1255 temp (let (calc-next-why)
1256 (math-solve-for (math-sub v temp) 0 v nil))) 1256 (math-simplify-extended
1257 (and temp (not (integerp temp)) 1257 (math-solve-for (math-sub v temp) 0 v nil)))
1258 (math-simplify-extended temp))))) 1258 temp (if (and (eq (car-safe temp) '/)
1259 (math-zerop (nth 2 temp)))
1260 nil temp)))))
1259 (setcar (cdr math-cur-record) 'busy))))) 1261 (setcar (cdr math-cur-record) 'busy)))))
1260 1262
1261;;; This tries two different formulations, hoping the algebraic simplifier 1263;;; This tries two different formulations, hoping the algebraic simplifier
diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el
index e1d513ce680..b900d4c57f3 100644
--- a/lisp/calendar/icalendar.el
+++ b/lisp/calendar/icalendar.el
@@ -293,7 +293,7 @@ it finds"
293;; (car (cddr event))) 293;; (car (cddr event)))
294 294
295(defun icalendar--get-event-property (event prop) 295(defun icalendar--get-event-property (event prop)
296 "For the given EVENT return the value of the first occurence of PROP." 296 "For the given EVENT return the value of the first occurrence of PROP."
297 (catch 'found 297 (catch 'found
298 (let ((props (car (cddr event))) pp) 298 (let ((props (car (cddr event))) pp)
299 (while props 299 (while props
@@ -304,7 +304,7 @@ it finds"
304 nil)) 304 nil))
305 305
306(defun icalendar--get-event-property-attributes (event prop) 306(defun icalendar--get-event-property-attributes (event prop)
307 "For the given EVENT return attributes of the first occurence of PROP." 307 "For the given EVENT return attributes of the first occurrence of PROP."
308 (catch 'found 308 (catch 'found
309 (let ((props (car (cddr event))) pp) 309 (let ((props (car (cddr event))) pp)
310 (while props 310 (while props
@@ -705,7 +705,7 @@ would be \"pm\"."
705 "Export diary file to iCalendar format. 705 "Export diary file to iCalendar format.
706All diary entries in the file DIARY-FILENAME are converted to iCalendar 706All diary entries in the file DIARY-FILENAME are converted to iCalendar
707format. The result is appended to the file ICAL-FILENAME." 707format. The result is appended to the file ICAL-FILENAME."
708 (interactive "FExport diary data from file: 708 (interactive "FExport diary data from file:
709Finto iCalendar file: ") 709Finto iCalendar file: ")
710 (save-current-buffer 710 (save-current-buffer
711 (set-buffer (find-file diary-filename)) 711 (set-buffer (find-file diary-filename))
@@ -1449,8 +1449,8 @@ Argument ICAL-FILENAME output iCalendar file.
1449Argument DIARY-FILENAME input `diary-file'. 1449Argument DIARY-FILENAME input `diary-file'.
1450Optional argument NON-MARKING determines whether events are created as 1450Optional argument NON-MARKING determines whether events are created as
1451non-marking or not." 1451non-marking or not."
1452 (interactive "fImport iCalendar data from file: 1452 (interactive "fImport iCalendar data from file:
1453Finto diary file: 1453Finto diary file:
1454p") 1454p")
1455 ;; clean up the diary file 1455 ;; clean up the diary file
1456 (save-current-buffer 1456 (save-current-buffer
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 763b4b8c57f..3d06bd0fcae 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -1720,6 +1720,7 @@ item in another window.\n\n"))
1720 :help-echo "Read the manual entry for this option." 1720 :help-echo "Read the manual entry for this option."
1721 :button-face 'custom-link 1721 :button-face 'custom-link
1722 :mouse-face 'highlight 1722 :mouse-face 'highlight
1723 :pressed-face 'highlight
1723 :tag "Manual") 1724 :tag "Manual")
1724 1725
1725;;; The `custom-magic' Widget. 1726;;; The `custom-magic' Widget.
@@ -2201,7 +2202,8 @@ Insert PREFIX first if non-nil."
2201 (push (widget-create-child-and-convert 2202 (push (widget-create-child-and-convert
2202 widget (car links) 2203 widget (car links)
2203 :button-face 'custom-link 2204 :button-face 'custom-link
2204 :mouse-face 'highlight) 2205 :mouse-face 'highlight
2206 :pressed-face 'highlight)
2205 buttons) 2207 buttons)
2206 (setq links (cdr links)) 2208 (setq links (cdr links))
2207 (cond ((null links) 2209 (cond ((null links)
@@ -2247,7 +2249,8 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
2247 (push (widget-create-child-and-convert 2249 (push (widget-create-child-and-convert
2248 widget (car links) 2250 widget (car links)
2249 :button-face 'custom-link 2251 :button-face 'custom-link
2250 :mouse-face 'highlight) 2252 :mouse-face 'highlight
2253 :pressed-face 'highlight)
2251 buttons) 2254 buttons)
2252 (setq links (cdr links)) 2255 (setq links (cdr links))
2253 (cond ((null links) 2256 (cond ((null links)
@@ -3590,6 +3593,7 @@ restoring it to the state of a face that has never been customized."
3590 "Show parent in other window when activated." 3593 "Show parent in other window when activated."
3591 :button-face 'custom-link 3594 :button-face 'custom-link
3592 :mouse-face 'highlight 3595 :mouse-face 'highlight
3596 :pressed-face 'highlight
3593 :help-echo "Create customization buffer for this group." 3597 :help-echo "Create customization buffer for this group."
3594 :action 'custom-group-link-action) 3598 :action 'custom-group-link-action)
3595 3599
@@ -4365,7 +4369,6 @@ The format is suitable for use with `easy-menu-define'."
4365 (define-key map "u" 'Custom-goto-parent) 4369 (define-key map "u" 'Custom-goto-parent)
4366 (define-key map "n" 'widget-forward) 4370 (define-key map "n" 'widget-forward)
4367 (define-key map "p" 'widget-backward) 4371 (define-key map "p" 'widget-backward)
4368 (define-key map [mouse-1] 'widget-move-and-invoke)
4369 map) 4372 map)
4370 "Keymap for `custom-mode'.") 4373 "Keymap for `custom-mode'.")
4371 4374
@@ -4421,7 +4424,7 @@ Move to previous button, link or editable field. \\[advertised-widget-backward]
4421\\<custom-field-keymap>\ 4424\\<custom-field-keymap>\
4422Complete content of editable text field. \\[widget-complete] 4425Complete content of editable text field. \\[widget-complete]
4423\\<custom-mode-map>\ 4426\\<custom-mode-map>\
4424Invoke button under the mouse pointer. \\[widget-move-and-invoke] 4427Invoke button under the mouse pointer. \\[widget-button-click]
4425Invoke button under point. \\[widget-button-press] 4428Invoke button under point. \\[widget-button-press]
4426Set all options from current text. \\[Custom-set] 4429Set all options from current text. \\[Custom-set]
4427Make values in current text permanent. \\[Custom-save] 4430Make values in current text permanent. \\[Custom-save]
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index eaf700774df..5b4686754f0 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -359,6 +359,7 @@ since it could result in memory overflow and make Emacs crash."
359 (repeat (directory :format "%v"))) 359 (repeat (directory :format "%v")))
360 (x-use-old-gtk-file-dialog menu boolean "22.1") 360 (x-use-old-gtk-file-dialog menu boolean "22.1")
361 (x-gtk-show-hidden-files menu boolean "22.1") 361 (x-gtk-show-hidden-files menu boolean "22.1")
362 (x-gtk-whole-detached-tool-bar x boolean "22.1")
362 ;; xterm.c 363 ;; xterm.c
363 (mouse-autoselect-window display boolean "21.3") 364 (mouse-autoselect-window display boolean "21.3")
364 (x-use-underline-position-properties display boolean "21.3") 365 (x-use-underline-position-properties display boolean "21.3")
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el
index 3a89c6a664e..53f530505ae 100644
--- a/lisp/cus-theme.el
+++ b/lisp/cus-theme.el
@@ -38,7 +38,6 @@
38 (suppress-keymap map) 38 (suppress-keymap map)
39 (define-key map "n" 'widget-forward) 39 (define-key map "n" 'widget-forward)
40 (define-key map "p" 'widget-backward) 40 (define-key map "p" 'widget-backward)
41 (define-key map [mouse-1] 'widget-move-and-invoke)
42 map) 41 map)
43 "Keymap for `custom-new-theme-mode'.") 42 "Keymap for `custom-new-theme-mode'.")
44 43
diff --git a/lisp/dired.el b/lisp/dired.el
index 8433432ff09..3bcb45e06c0 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1258,6 +1258,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
1258 (define-key map "\C-t." 'tumme-display-thumb) 1258 (define-key map "\C-t." 'tumme-display-thumb)
1259 (define-key map "\C-tc" 'tumme-dired-comment-files) 1259 (define-key map "\C-tc" 'tumme-dired-comment-files)
1260 (define-key map "\C-tf" 'tumme-mark-tagged-files) 1260 (define-key map "\C-tf" 'tumme-mark-tagged-files)
1261 (define-key map "\C-t\C-t" 'tumme-dired-insert-marked-thumbs)
1261 1262
1262 ;; Make menu bar items. 1263 ;; Make menu bar items.
1263 1264
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index 50b37eb044f..ec2098c7bd3 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,97 @@
12006-02-15 Michael Olson <mwolson@gnu.org>
2
3 * erc.el (erc): Move to the end of the buffer when a continued
4 session is detected. Thanks to e1f and indio for the report and
5 testing a potential fix.
6
72006-02-14 Michael Olson <mwolson@gnu.org>
8
9 * debian/changelog: Prepare a new Debian package.
10
11 * Makefile (debprepare): New rule that creates an ERC snapshot
12 directory for use in both new Debian releases and revisions for
13 Debian packages.
14 (debrelease, debrevision-mwolson): Use debprepare.
15
16 * NEWS: Bring up-to-date.
17
18 * erc-stamp.el (erc-insert-timestamp-right): For now, put
19 timestamps before rather than after erc-fill-column when
20 erc-timestamp-right-column is nil. This way we won't surprise
21 anyone unpleasantly, or so it is hoped.
22
232006-02-13 Michael Olson <mwolson@gnu.org>
24
25 * erc-dcc.el: Use (eval-when-compile (require 'cl)).
26
272006-02-12 Michael Olson <mwolson@gnu.org>
28
29 * erc-autoaway.el, erc-dcc.el, erc-ezbounce.el, erc-fill.el,
30 erc-goodies.el, erc-hecomplete.el, erc-ibuffer.el, erc-identd.el,
31 erc-imenu.el, erc-join.el, erc-lang.el, erc-list.el, erc-log.el,
32 erc-match.el, erc-menu.el, erc-netsplit.el, erc-networks.el,
33 erc-notify.el, erc-page.el, erc-pcomplete.el, erc-replace.el,
34 erc-ring.el, erc-services.el, erc-sound.el, erc-speedbar.el,
35 erc-spelling.el, erc-track.el, erc-truncate.el, erc-xdcc.el: Add
36 2006 to copyright years, to comply with the changed guidelines.
37
382006-02-11 Michael Olson <mwolson@gnu.org>
39
40 * erc.el (erc-update-modules): Make some requirements shorter, so
41 that it's easier to see why they are needed.
42
43 * erc-stamp.el (erc-timestamp-use-align-to): Renamed from
44 `erc-timestamp-right-align-by-pixel'. Set the default based on
45 whether we are in Emacs 22, and using X. Improve documentation.
46 (erc-insert-aligned): Remove calculation of offset, since
47 :align-to pos works after all. Unlike the previous solution, this
48 one works when erc-stamp.el is compiled.
49 (erc-insert-timestamp-right): Don't add length of string, and then
50 later remove its displayed width. This puts timestamps after
51 erc-fill-column when erc-timestamp-right-column is nil, rather
52 than before it. It also fixes a subtle bug. Remove use of
53 `current-window', since there is no variable by that name in
54 Emacs21, Emacs22, or XEmacs21 beta. Check to see whether
55 `erc-fill-column' is non-nil before using it.
56
572006-02-11 Diane Murray <disumu@x3y2z1.net>
58
59 * erc-list.el: Define `list' module which sets the alias
60 `erc-cmd-LIST' to `erc-list-channels' when enabled and
61 `erc-list-channels-simple' when disabled.
62 (erc-list-channels): Was `erc-cmd-LIST', renamed.
63 (erc-list-channels-simple): New function.
64
65 * erc.el (erc-modules): Added `list' to enabled modules. Moved
66 customization options left in source code.
67
68 * erc-menu.el (erc-menu-definition): Use `erc-list-channels'.
69
70 * erc-spelling.el (define-erc-module): Make sure there's a buffer
71 before calling `with-current-buffer'.
72
732006-02-10 Michael Olson <mwolson@gnu.org>
74
75 * Makefile (debbuild): Split from debrelease.
76 (debrevision-mwolson): New rule that causes a Debian revision to
77 be built.
78
79 * erc.el (erc-migrate-modules): Use a better algorithm. Thanks to
80 Johan Bockgård.
81 (erc-modules): Change use of 'pcomplete to 'completion.
82
832006-02-09 Diane Murray <disumu@x3y2z1.net>
84
85 * erc.el (erc-get-parsed-vector, erc-get-parsed-vector-nick)
86 (erc-get-parsed-vector-type): Moved here from erc-match.el.
87
88 * erc-match.el (erc-get-parsed-vector, erc-get-parsed-vector-nick)
89 (erc-get-parsed-vector-type): Moved these functions to erc.el
90 since they can be useful outside of the text matching module.
91
92 * erc-dcc.el, erc-stamp.el, erc-xdcc.el: Changed "Emacs IRC Client"
93 to "ERC".
94
12006-02-07 Michael Olson <mwolson@gnu.org> 952006-02-07 Michael Olson <mwolson@gnu.org>
2 96
3 * ChangeLog.01, ChangeLog.02, ChangeLog.03, ChangeLog.04, 97 * ChangeLog.01, ChangeLog.02, ChangeLog.03, ChangeLog.04,
diff --git a/lisp/erc/erc-autoaway.el b/lisp/erc/erc-autoaway.el
index 41c16b82cb1..56713cba8bf 100644
--- a/lisp/erc/erc-autoaway.el
+++ b/lisp/erc/erc-autoaway.el
@@ -1,6 +1,6 @@
1;;; erc-autoaway.el --- Provides autoaway for ERC 1;;; erc-autoaway.el --- Provides autoaway for ERC
2 2
3;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Jorgen Schaefer <forcer@forcix.cx> 5;; Author: Jorgen Schaefer <forcer@forcix.cx>
6;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcAutoAway 6;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcAutoAway
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el
index d5789a51708..4b9172f06d7 100644
--- a/lisp/erc/erc-dcc.el
+++ b/lisp/erc/erc-dcc.el
@@ -1,6 +1,6 @@
1;;; erc-dcc.el --- CTCP DCC module for ERC 1;;; erc-dcc.el --- CTCP DCC module for ERC
2 2
3;; Copyright (C) 1993, 1994, 1995, 1998, 2002, 2003, 2004 3;; Copyright (C) 1993, 1994, 1995, 1998, 2002, 2003, 2004, 2006
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Ben A. Mesander <ben@gnu.ai.mit.edu> 6;; Author: Ben A. Mesander <ben@gnu.ai.mit.edu>
@@ -29,7 +29,7 @@
29 29
30;;; Commentary: 30;;; Commentary:
31 31
32;; This file provides Direct Client-to-Client support for the Emacs IRC Client. 32;; This file provides Direct Client-to-Client support for ERC.
33;; 33;;
34;; The original code was taken from zenirc-dcc.el, heavily mangled and 34;; The original code was taken from zenirc-dcc.el, heavily mangled and
35;; rewritten to support the way how ERC operates. Server socket support 35;; rewritten to support the way how ERC operates. Server socket support
@@ -55,7 +55,8 @@
55 55
56(require 'erc) 56(require 'erc)
57(eval-when-compile 57(eval-when-compile
58 (require 'pcomplete)) 58 (require 'cl)
59 (require 'pcomplete))
59 60
60(defgroup erc-dcc nil 61(defgroup erc-dcc nil
61 "DCC stands for Direct Client Communication, where you and your 62 "DCC stands for Direct Client Communication, where you and your
diff --git a/lisp/erc/erc-ezbounce.el b/lisp/erc/erc-ezbounce.el
index 59e80b60b8d..48395bf1dab 100644
--- a/lisp/erc/erc-ezbounce.el
+++ b/lisp/erc/erc-ezbounce.el
@@ -1,6 +1,6 @@
1;;; erc-ezbounce.el --- Handle EZBounce bouncer commands 1;;; erc-ezbounce.el --- Handle EZBounce bouncer commands
2 2
3;; Copyright (C) 2002, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Andreas Fuchs <asf@void.at> 5;; Author: Andreas Fuchs <asf@void.at>
6;; Keywords: comm 6;; Keywords: comm
diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el
index f945d838c2a..6a5f80f7fd8 100644
--- a/lisp/erc/erc-fill.el
+++ b/lisp/erc/erc-fill.el
@@ -1,6 +1,6 @@
1;;; erc-fill.el --- Filling IRC messages in various ways 1;;; erc-fill.el --- Filling IRC messages in various ways
2 2
3;; Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Andreas Fuchs <asf@void.at> 5;; Author: Andreas Fuchs <asf@void.at>
6;; Mario Lang <mlang@delysid.org> 6;; Mario Lang <mlang@delysid.org>
diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el
index c844af55594..f6d32ee7c06 100644
--- a/lisp/erc/erc-goodies.el
+++ b/lisp/erc/erc-goodies.el
@@ -1,6 +1,7 @@
1;; erc-goodies.el --- Collection of ERC modules 1;; erc-goodies.el --- Collection of ERC modules
2 2
3;; Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation 3;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
4;; Free Software Foundation, Inc.
4 5
5;; Author: Jorgen Schaefer <forcer@forcix.cx> 6;; Author: Jorgen Schaefer <forcer@forcix.cx>
6 7
diff --git a/lisp/erc/erc-hecomplete.el b/lisp/erc/erc-hecomplete.el
index 763d75c8fc7..85a81569782 100644
--- a/lisp/erc/erc-hecomplete.el
+++ b/lisp/erc/erc-hecomplete.el
@@ -1,6 +1,6 @@
1;;; erc-hecomplete.el --- Provides Nick name completion for ERC 1;;; erc-hecomplete.el --- Provides Nick name completion for ERC
2 2
3;; Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Alex Schroeder <alex@gnu.org> 5;; Author: Alex Schroeder <alex@gnu.org>
6;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcCompletion 6;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcCompletion
diff --git a/lisp/erc/erc-ibuffer.el b/lisp/erc/erc-ibuffer.el
index a122908ed2c..7ca843d115c 100644
--- a/lisp/erc/erc-ibuffer.el
+++ b/lisp/erc/erc-ibuffer.el
@@ -1,6 +1,6 @@
1;;; erc-ibuffer.el --- ibuffer integration with ERC 1;;; erc-ibuffer.el --- ibuffer integration with ERC
2 2
3;; Copyright (C) 2002, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Mario Lang <mlang@delysid.org> 5;; Author: Mario Lang <mlang@delysid.org>
6;; Keywords: comm 6;; Keywords: comm
diff --git a/lisp/erc/erc-identd.el b/lisp/erc/erc-identd.el
index 5cb179c7e22..e0ccfb40497 100644
--- a/lisp/erc/erc-identd.el
+++ b/lisp/erc/erc-identd.el
@@ -1,6 +1,6 @@
1;;; erc-identd.el --- RFC1413 (identd authentication protocol) server 1;;; erc-identd.el --- RFC1413 (identd authentication protocol) server
2 2
3;; Copyright (C) 2003 Free Software Foundation, Inc. 3;; Copyright (C) 2003, 2006 Free Software Foundation, Inc.
4 4
5;; Author: John Wiegley <johnw@gnu.org> 5;; Author: John Wiegley <johnw@gnu.org>
6;; Keywords: comm, processes 6;; Keywords: comm, processes
diff --git a/lisp/erc/erc-imenu.el b/lisp/erc/erc-imenu.el
index c64c9c04723..88de1cedf6e 100644
--- a/lisp/erc/erc-imenu.el
+++ b/lisp/erc/erc-imenu.el
@@ -1,6 +1,6 @@
1;;; erc-imenu.el -- Imenu support for ERC 1;;; erc-imenu.el -- Imenu support for ERC
2 2
3;; Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Mario Lang <mlang@delysid.org> 5;; Author: Mario Lang <mlang@delysid.org>
6;; Keywords: comm 6;; Keywords: comm
diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el
index da41ea77374..0d2c1f98706 100644
--- a/lisp/erc/erc-join.el
+++ b/lisp/erc/erc-join.el
@@ -1,6 +1,6 @@
1;;; erc-join.el --- autojoin channels on connect and reconnects 1;;; erc-join.el --- autojoin channels on connect and reconnects
2 2
3;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Alex Schroeder <alex@gnu.org> 5;; Author: Alex Schroeder <alex@gnu.org>
6;; Keywords: irc 6;; Keywords: irc
diff --git a/lisp/erc/erc-lang.el b/lisp/erc/erc-lang.el
index 20c89a8b0b6..04cfbe9e220 100644
--- a/lisp/erc/erc-lang.el
+++ b/lisp/erc/erc-lang.el
@@ -1,6 +1,6 @@
1;;; erc-lang.el --- provide the LANG command to ERC 1;;; erc-lang.el --- provide the LANG command to ERC
2 2
3;; Copyright (C) 2002, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Alex Schroeder <alex@gnu.org> 5;; Author: Alex Schroeder <alex@gnu.org>
6;; Maintainer: Alex Schroeder <alex@gnu.org> 6;; Maintainer: Alex Schroeder <alex@gnu.org>
diff --git a/lisp/erc/erc-list.el b/lisp/erc/erc-list.el
index 9bc561523d9..c041842429e 100644
--- a/lisp/erc/erc-list.el
+++ b/lisp/erc/erc-list.el
@@ -1,6 +1,6 @@
1;;; erc-list.el --- Provide a faster channel listing mechanism 1;;; erc-list.el --- Provide a faster channel listing mechanism
2 2
3;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
4;; Copyright (C) 2004 Brian Palmer 4;; Copyright (C) 2004 Brian Palmer
5 5
6;; Author: Mario Lang <mlang@lexx.delysid.org> 6;; Author: Mario Lang <mlang@lexx.delysid.org>
@@ -140,12 +140,19 @@ display the channel list."
140 (setq truncate-lines t) 140 (setq truncate-lines t)
141 (add-hook 'post-command-hook 'erc-chanlist-post-command-hook 'append 'local)) 141 (add-hook 'post-command-hook 'erc-chanlist-post-command-hook 'append 'local))
142 142
143;; Define module:
144;;;###autoload (autoload 'erc-list-mode "erc-list")
145(define-erc-module list nil
146 "List channels nicely in a separate buffer."
147 ((defalias 'erc-cmd-LIST 'erc-list-channels))
148 ((defalias 'erc-cmd-LIST 'erc-list-channels-simple)))
149
143;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 150;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
144;; Functions. 151;; Functions.
145;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 152;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
146 153
147;;;###autoload 154;;;###autoload
148(defun erc-cmd-LIST (&rest channel) 155(defun erc-list-channels (&rest channel)
149 "Display a buffer containing a list of channels on the current server. 156 "Display a buffer containing a list of channels on the current server.
150Optional argument CHANNEL specifies a single channel to list (instead of every 157Optional argument CHANNEL specifies a single channel to list (instead of every
151available channel)." 158available channel)."
@@ -163,6 +170,18 @@ available channel)."
163 (erc-chanlist channel)) 170 (erc-chanlist channel))
164 t) 171 t)
165 172
173(defun erc-list-channels-simple (&optional line)
174 "Send the LIST command to the current server with optional channels LINE."
175 (when (string-match "^\\s-*\\(.*\\)$" line)
176 (let ((channels (match-string 1 line)))
177 (erc-log (format "cmd: LIST: %s" channels))
178 (erc-server-send
179 (if (string= channels "")
180 "LIST"
181 (concat "LIST :" channels))))
182 t))
183(put 'erc-list-channels-simple 'do-not-parse-args t)
184
166;;;###autoload 185;;;###autoload
167(defun erc-chanlist (&optional channels) 186(defun erc-chanlist (&optional channels)
168 "Show a channel listing of the current server in a special mode. 187 "Show a channel listing of the current server in a special mode.
diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el
index d4e6e5ad3fa..db60e5629bf 100644
--- a/lisp/erc/erc-log.el
+++ b/lisp/erc/erc-log.el
@@ -1,6 +1,6 @@
1;;; erc-log.el --- Logging facilities for ERC. 1;;; erc-log.el --- Logging facilities for ERC.
2 2
3;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Lawrence Mitchell <wence@gmx.li> 5;; Author: Lawrence Mitchell <wence@gmx.li>
6;; Keywords: IRC, chat, client, Internet, logging 6;; Keywords: IRC, chat, client, Internet, logging
diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el
index a5e3bf88ccf..88c6d4c425d 100644
--- a/lisp/erc/erc-match.el
+++ b/lisp/erc/erc-match.el
@@ -1,6 +1,6 @@
1;;; erc-match.el --- Highlight messages matching certain regexps 1;;; erc-match.el --- Highlight messages matching certain regexps
2 2
3;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Andreas Fuchs <asf@void.at> 5;; Author: Andreas Fuchs <asf@void.at>
6;; Keywords: comm, faces 6;; Keywords: comm, faces
@@ -428,24 +428,6 @@ In any of the following situations, MSG is directed at an entry FOOL:
428 (or (erc-list-match fools-beg msg) 428 (or (erc-list-match fools-beg msg)
429 (erc-list-match fools-end msg)))) 429 (erc-list-match fools-end msg))))
430 430
431(defun erc-get-parsed-vector (point)
432 "Return the whole parsed vector on POINT."
433 (get-text-property point 'erc-parsed))
434
435(defun erc-get-parsed-vector-nick (vect)
436 "Return nickname in the parsed vector VECT."
437 (let* ((untreated-nick (and vect (erc-response.sender vect)))
438 (maybe-nick (when untreated-nick
439 (car (split-string untreated-nick "!")))))
440 (when (and (not (null maybe-nick))
441 (erc-is-valid-nick-p maybe-nick))
442 untreated-nick)))
443
444(defun erc-get-parsed-vector-type (vect)
445 "Return message type in the parsed vector VECT."
446 (and vect
447 (erc-response.command vect)))
448
449(defun erc-match-message () 431(defun erc-match-message ()
450 "Mark certain keywords in a region. 432 "Mark certain keywords in a region.
451Use this defun with `erc-insert-modify-hook'." 433Use this defun with `erc-insert-modify-hook'."
diff --git a/lisp/erc/erc-menu.el b/lisp/erc/erc-menu.el
index 8e1f81adf75..7040a7baeee 100644
--- a/lisp/erc/erc-menu.el
+++ b/lisp/erc/erc-menu.el
@@ -1,6 +1,6 @@
1;; erc-menu.el -- Menu-bar definitions for ERC 1;; erc-menu.el -- Menu-bar definitions for ERC
2 2
3;; Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Mario Lang <mlang@delysid.org> 5;; Author: Mario Lang <mlang@delysid.org>
6;; Keywords: comm, processes, menu 6;; Keywords: comm, processes, menu
@@ -36,8 +36,8 @@
36 ["Connect to server..." erc-select t] 36 ["Connect to server..." erc-select t]
37 ["Disconnect from server..." erc-quit-server erc-server-connected] 37 ["Disconnect from server..." erc-quit-server erc-server-connected]
38 "-" 38 "-"
39 ["List channels..." erc-cmd-LIST 39 ["List channels..." erc-list-channels
40 (and erc-server-connected (fboundp 'erc-cmd-LIST))] 40 (and erc-server-connected (fboundp 'erc-list-channels))]
41 ["Join channel..." erc-join-channel erc-server-connected] 41 ["Join channel..." erc-join-channel erc-server-connected]
42 ["Start a query..." erc-cmd-QUERY erc-server-connected] 42 ["Start a query..." erc-cmd-QUERY erc-server-connected]
43 "-" 43 "-"
diff --git a/lisp/erc/erc-netsplit.el b/lisp/erc/erc-netsplit.el
index 70ec2f2fc0d..a982b5e7c7e 100644
--- a/lisp/erc/erc-netsplit.el
+++ b/lisp/erc/erc-netsplit.el
@@ -1,6 +1,6 @@
1;;; erc-netsplit.el --- Reduce JOIN/QUIT messages on netsplits 1;;; erc-netsplit.el --- Reduce JOIN/QUIT messages on netsplits
2 2
3;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Mario Lang <mlang@delysid.org> 5;; Author: Mario Lang <mlang@delysid.org>
6;; Keywords: comm 6;; Keywords: comm
diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el
index b79a56a359c..c15f72e248f 100644
--- a/lisp/erc/erc-networks.el
+++ b/lisp/erc/erc-networks.el
@@ -1,6 +1,6 @@
1;;; erc-networks.el --- IRC networks 1;;; erc-networks.el --- IRC networks
2 2
3;; Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Mario Lang <mlang@lexx.delysid.org> 5;; Author: Mario Lang <mlang@lexx.delysid.org>
6;; Keywords: comm 6;; Keywords: comm
diff --git a/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el
index 1d2bdbd5f45..bb1c9cdceb3 100644
--- a/lisp/erc/erc-notify.el
+++ b/lisp/erc/erc-notify.el
@@ -1,6 +1,6 @@
1;;; erc-notify.el --- Online status change notification 1;;; erc-notify.el --- Online status change notification
2 2
3;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Mario Lang <mlang@lexx.delysid.org> 5;; Author: Mario Lang <mlang@lexx.delysid.org>
6;; Keywords: comm 6;; Keywords: comm
diff --git a/lisp/erc/erc-page.el b/lisp/erc/erc-page.el
index d8e677031e3..4c6b86bd564 100644
--- a/lisp/erc/erc-page.el
+++ b/lisp/erc/erc-page.el
@@ -1,6 +1,6 @@
1;; erc-page.el - CTCP PAGE support for ERC 1;; erc-page.el - CTCP PAGE support for ERC
2 2
3;; Copyright (C) 2002, 2004 Free Software Foundation 3;; Copyright (C) 2002, 2004, 2006 Free Software Foundation
4 4
5;; This file is part of GNU Emacs. 5;; This file is part of GNU Emacs.
6 6
diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el
index 110704304e2..d6d4dfdd3b3 100644
--- a/lisp/erc/erc-pcomplete.el
+++ b/lisp/erc/erc-pcomplete.el
@@ -1,6 +1,6 @@
1;;; erc-pcomplete.el --- Provides programmable completion for ERC 1;;; erc-pcomplete.el --- Provides programmable completion for ERC
2 2
3;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Sacha Chua <sacha@free.net.ph> 5;; Author: Sacha Chua <sacha@free.net.ph>
6;; Keywords: comm, convenience 6;; Keywords: comm, convenience
diff --git a/lisp/erc/erc-replace.el b/lisp/erc/erc-replace.el
index 07e8cd16138..06d3ca77f06 100644
--- a/lisp/erc/erc-replace.el
+++ b/lisp/erc/erc-replace.el
@@ -1,6 +1,6 @@
1;; erc-replace.el -- wash and massage messages inserted into the buffer 1;; erc-replace.el -- wash and massage messages inserted into the buffer
2 2
3;; Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Andreas Fuchs <asf@void.at> 5;; Author: Andreas Fuchs <asf@void.at>
6;; Maintainer: Mario Lang (mlang@delysid.org) 6;; Maintainer: Mario Lang (mlang@delysid.org)
diff --git a/lisp/erc/erc-ring.el b/lisp/erc/erc-ring.el
index cabb8e2905f..87707e65faa 100644
--- a/lisp/erc/erc-ring.el
+++ b/lisp/erc/erc-ring.el
@@ -1,6 +1,6 @@
1;; erc-ring.el -- Command history handling for erc using ring.el 1;; erc-ring.el -- Command history handling for erc using ring.el
2 2
3;; Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Alex Schroeder <alex@gnu.org> 5;; Author: Alex Schroeder <alex@gnu.org>
6;; Keywords: comm 6;; Keywords: comm
diff --git a/lisp/erc/erc-services.el b/lisp/erc/erc-services.el
index 676948752fd..c8bac7fe45c 100644
--- a/lisp/erc/erc-services.el
+++ b/lisp/erc/erc-services.el
@@ -1,6 +1,6 @@
1;;; erc-services.el --- Identify to NickServ 1;;; erc-services.el --- Identify to NickServ
2 2
3;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
4 4
5;; This file is part of GNU Emacs. 5;; This file is part of GNU Emacs.
6 6
diff --git a/lisp/erc/erc-sound.el b/lisp/erc/erc-sound.el
index c5b0f8177f2..bbcddafc231 100644
--- a/lisp/erc/erc-sound.el
+++ b/lisp/erc/erc-sound.el
@@ -1,6 +1,6 @@
1;;; erc-sound.el --- CTCP SOUND support for ERC 1;;; erc-sound.el --- CTCP SOUND support for ERC
2 2
3;; Copyright (C) 2002, 2003 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc.
4 4
5;; This file is part of GNU Emacs. 5;; This file is part of GNU Emacs.
6 6
diff --git a/lisp/erc/erc-speedbar.el b/lisp/erc/erc-speedbar.el
index 254d7fc5781..55e24782f77 100644
--- a/lisp/erc/erc-speedbar.el
+++ b/lisp/erc/erc-speedbar.el
@@ -1,6 +1,6 @@
1;;; erc-speedbar.el --- Speedbar support for ERC 1;;; erc-speedbar.el --- Speedbar support for ERC
2 2
3;; Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Mario Lang <mlang@delysid.org> 5;; Author: Mario Lang <mlang@delysid.org>
6;; Contributor: Eric M. Ludlam <eric@siege-engine.com> 6;; Contributor: Eric M. Ludlam <eric@siege-engine.com>
diff --git a/lisp/erc/erc-spelling.el b/lisp/erc/erc-spelling.el
index 41e342c0e50..3cbc786274d 100644
--- a/lisp/erc/erc-spelling.el
+++ b/lisp/erc/erc-spelling.el
@@ -1,6 +1,6 @@
1;;; erc-spelling.el --- use flyspell in ERC 1;;; erc-spelling.el --- use flyspell in ERC
2 2
3;; Copyright (C) 2005, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2005, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Jorgen Schaefer <forcer@forcix.cx> 5;; Author: Jorgen Schaefer <forcer@forcix.cx>
6;; Keywords: irc 6;; Keywords: irc
@@ -41,11 +41,13 @@
41 ;; called AFTER the server buffer is initialized. 41 ;; called AFTER the server buffer is initialized.
42 ((add-hook 'erc-connect-pre-hook 'erc-spelling-init) 42 ((add-hook 'erc-connect-pre-hook 'erc-spelling-init)
43 (mapc (lambda (buffer) 43 (mapc (lambda (buffer)
44 (with-current-buffer buffer (erc-spelling-init))) 44 (when buffer
45 (with-current-buffer buffer (erc-spelling-init))))
45 (erc-buffer-list))) 46 (erc-buffer-list)))
46 ((remove-hook 'erc-connect-pre-hook 'erc-spelling-init) 47 ((remove-hook 'erc-connect-pre-hook 'erc-spelling-init)
47 (mapc (lambda (buffer) 48 (mapc (lambda (buffer)
48 (with-current-buffer buffer (flyspell-mode 0))) 49 (when buffer
50 (with-current-buffer buffer (flyspell-mode 0))))
49 (erc-buffer-list)))) 51 (erc-buffer-list))))
50 52
51(defcustom erc-spelling-dictionaries nil 53(defcustom erc-spelling-dictionaries nil
diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el
index ead847ff73f..5d43baab6c9 100644
--- a/lisp/erc/erc-stamp.el
+++ b/lisp/erc/erc-stamp.el
@@ -1,4 +1,4 @@
1;;; erc-stamp.el --- Timestamping for Emacs IRC CLient 1;;; erc-stamp.el --- Timestamping for ERC messages
2 2
3;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
4 4
@@ -180,11 +180,17 @@ the correct column."
180 (integer :tag "Column number") 180 (integer :tag "Column number")
181 (const :tag "Unspecified" nil))) 181 (const :tag "Unspecified" nil)))
182 182
183(defcustom erc-timestamp-right-align-by-pixel nil 183(defcustom erc-timestamp-use-align-to (and (not (featurep 'xemacs))
184 "*If non-nil, insert the right timestamp based on a pixel value. 184 (>= emacs-major-version 22)
185This is needed when variable-width text precedes a timestamp. 185 (eq window-system 'x))
186 "*If non-nil, use the :align-to display property to align the stamp.
187This gives better results when variable-width characters (like
188Asian language characters and math symbols) precede a timestamp.
186Unfortunately, it only works in Emacs 22 and when using the X 189Unfortunately, it only works in Emacs 22 and when using the X
187Window System." 190Window System.
191
192A side effect of enabling this is that there will only be one
193space before a right timestamp in any saved logs."
188 :group 'erc-stamp 194 :group 'erc-stamp
189 :type 'boolean) 195 :type 'boolean)
190 196
@@ -200,18 +206,15 @@ Window System."
200 (insert s))) 206 (insert s)))
201 207
202(defun erc-insert-aligned (string pos) 208(defun erc-insert-aligned (string pos)
203 "Insert STRING based on a fraction of the width of the buffer. 209 "Insert STRING at the POSth column.
204Fraction is roughly (/ POS (window-width)).
205 210
206If `erc-timestamp-right-align-by-pixel' is nil, insert STRING at the 211If `erc-timestamp-use-align-to' is t, use the :align-to display
207POSth column, without using pixel coordinates." 212property to get to the POSth column."
208 (if (not erc-timestamp-right-align-by-pixel) 213 (if (not erc-timestamp-use-align-to)
209 (indent-to pos) 214 (indent-to pos)
210 (insert " ") 215 (insert " ")
211 (let ((offset (floor (* (/ (1- pos) (window-width) 1.0) 216 (put-text-property (1- (point)) (point) 'display
212 (nth 2 (window-inside-pixel-edges)))))) 217 (list 'space ':align-to pos)))
213 (put-text-property (1- (point)) (point) 'display
214 `(space :align-to (,offset)))))
215 (insert string)) 218 (insert string))
216 219
217(defun erc-insert-timestamp-right (string) 220(defun erc-insert-timestamp-right (string)
@@ -237,31 +240,26 @@ be printed just before the window-width."
237 (goto-char (point-max)) 240 (goto-char (point-max))
238 (forward-char -1);; before the last newline 241 (forward-char -1);; before the last newline
239 (let* ((current-window (get-buffer-window (current-buffer))) 242 (let* ((current-window (get-buffer-window (current-buffer)))
243 (str-width (string-width string))
240 (pos (cond 244 (pos (cond
241 (erc-timestamp-right-column 245 (erc-timestamp-right-column erc-timestamp-right-column)
242 (+ erc-timestamp-right-column (length string)))
243 ((and (boundp 'erc-fill-mode) 246 ((and (boundp 'erc-fill-mode)
244 erc-fill-mode 247 erc-fill-mode
245 (boundp 'erc-fill-column)) 248 (boundp 'erc-fill-column)
246 (1+ erc-fill-column)) 249 erc-fill-column)
247 (current-window 250 (1+ (- erc-fill-column str-width)))
248 (- (window-width current-window)
249 1))
250 (fill-column 251 (fill-column
251 (1+ fill-column)) 252 (1+ (- fill-column str-width)))
252 (t 253 (t
253 (- (window-width) 254 (- (window-width) str-width 1))))
254 1))))
255 (from (point)) 255 (from (point))
256 (col (current-column)) 256 (col (current-column))
257 indent) 257 indent)
258 ;; deal with variable-width characters 258 ;; The following is a kludge used to calculate whether to move
259 (setq pos (- pos (string-width string)) 259 ;; to the next line before inserting a stamp. It allows for
260 ;; The following is a kludge that works with most 260 ;; some margin of error if what is displayed on the line differs
261 ;; international input. It is now only used to calculate 261 ;; from the number of characters on the line.
262 ;; whether to move to the next line before inserting a 262 (setq col (+ col (ceiling (/ (- col (- (point) (point-at-bol))) 1.6))))
263 ;; stamp.
264 col (+ col (ceiling (/ (- col (- (point) (point-at-bol))) 1.6))))
265 (if (< col pos) 263 (if (< col pos)
266 (erc-insert-aligned string pos) 264 (erc-insert-aligned string pos)
267 (newline) 265 (newline)
diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el
index 6d760d75ba2..63005678613 100644
--- a/lisp/erc/erc-track.el
+++ b/lisp/erc/erc-track.el
@@ -1,6 +1,6 @@
1;;; erc-track.el --- Track modified channel buffers 1;;; erc-track.el --- Track modified channel buffers
2 2
3;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Mario Lang <mlang@delysid.org> 5;; Author: Mario Lang <mlang@delysid.org>
6;; Keywords: comm, faces 6;; Keywords: comm, faces
diff --git a/lisp/erc/erc-truncate.el b/lisp/erc/erc-truncate.el
index 49cd20d759c..7a1feaaedd2 100644
--- a/lisp/erc/erc-truncate.el
+++ b/lisp/erc/erc-truncate.el
@@ -1,6 +1,6 @@
1;;; erc-truncate.el --- Functions for truncating ERC buffers 1;;; erc-truncate.el --- Functions for truncating ERC buffers
2 2
3;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Andreas Fuchs <asf@void.at> 5;; Author: Andreas Fuchs <asf@void.at>
6;; Keywords: IRC, chat, client, Internet, logging 6;; Keywords: IRC, chat, client, Internet, logging
diff --git a/lisp/erc/erc-xdcc.el b/lisp/erc/erc-xdcc.el
index 7c8ee6fff62..d00dfc5e1a0 100644
--- a/lisp/erc/erc-xdcc.el
+++ b/lisp/erc/erc-xdcc.el
@@ -1,6 +1,6 @@
1;;; erc-xdcc.el --- XDCC file-server support for ERC 1;;; erc-xdcc.el --- XDCC file-server support for ERC
2 2
3;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Mario Lang <mlang@delysid.org> 5;; Author: Mario Lang <mlang@delysid.org>
6;; Keywords: comm, processes 6;; Keywords: comm, processes
@@ -24,7 +24,7 @@
24 24
25;;; Commentary: 25;;; Commentary:
26 26
27;; This file provides a very simple XDCC file server for the Emacs IRC Client. 27;; This file provides a very simple XDCC file server for ERC.
28 28
29;;; Code: 29;;; Code:
30 30
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 936fffa252f..e1dc240901b 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -1719,22 +1719,15 @@ all channel buffers on all servers."
1719(defun erc-migrate-modules (mods) 1719(defun erc-migrate-modules (mods)
1720 "Migrate old names of ERC modules to new ones." 1720 "Migrate old names of ERC modules to new ones."
1721 ;; modify `transforms' to specify what needs to be changed 1721 ;; modify `transforms' to specify what needs to be changed
1722 ;; each item is in the format '(new .old) 1722 ;; each item is in the format '(old . new)
1723 (let ((transforms '((pcomplete . completion))) 1723 (let ((transforms '((pcomplete . completion))))
1724 (modules (copy-alist mods))) 1724 (erc-delete-dups
1725 (dolist (transform transforms) 1725 (mapcar (lambda (m) (or (cdr (assoc m transforms)) m))
1726 (let ((addp nil)) 1726 mods))))
1727 (setq modules (erc-delete-if `(lambda (val) 1727
1728 (and (eq val ',(car transform)) 1728(defcustom erc-modules '(netsplit fill button match track completion readonly
1729 (setq addition t)))
1730 modules))
1731 (when addp
1732 (add-to-list 'modules (cdr transform)))))
1733 (erc-delete-dups modules)))
1734
1735(defcustom erc-modules '(netsplit fill button match track pcomplete readonly
1736 ring autojoin noncommands irccontrols 1729 ring autojoin noncommands irccontrols
1737 stamp) 1730 stamp list)
1738 "A list of modules which erc should enable. 1731 "A list of modules which erc should enable.
1739If you set the value of this without using `customize' remember to call 1732If you set the value of this without using `customize' remember to call
1740\(erc-update-modules) after you change it. When using `customize', modules 1733\(erc-update-modules) after you change it. When using `customize', modules
@@ -1755,40 +1748,42 @@ removed from the list will be disabled."
1755 ;; this test is for the case where erc hasn't been loaded yet 1748 ;; this test is for the case where erc hasn't been loaded yet
1756 (when (fboundp 'erc-update-modules) 1749 (when (fboundp 'erc-update-modules)
1757 (erc-update-modules))) 1750 (erc-update-modules)))
1758 :type '(set :greedy t 1751 :type
1759 (const :tag "Set away status automatically" autoaway) 1752 '(set
1760 (const :tag "Join channels automatically" autojoin) 1753 :greedy t
1761 (const :tag "Integrate with Big Brother Database" bbdb) 1754 (const :tag "Set away status automatically" autoaway)
1762 (const :tag "Buttonize URLs, nicknames, and other text" button) 1755 (const :tag "Join channels automatically" autojoin)
1763 (const :tag "Wrap long lines" fill) 1756 (const :tag "Integrate with Big Brother Database" bbdb)
1764 (const :tag "Highlight or remove IRC control characters" 1757 (const :tag "Buttonize URLs, nicknames, and other text" button)
1765 irccontrols) 1758 (const :tag "Wrap long lines" fill)
1766 (const :tag "Save buffers in logs" log) 1759 (const :tag "Highlight or remove IRC control characters"
1767 (const :tag "Highlight pals, fools, and other keywords" match) 1760 irccontrols)
1768 (const :tag "Detect netsplits" netsplit) 1761 (const :tag "Save buffers in logs" log)
1769 (const :tag "Don't display non-IRC commands after evaluation" 1762 (const :tag "Highlight pals, fools, and other keywords" match)
1770 noncommands) 1763 (const :tag "Detect netsplits" netsplit)
1771 (const :tag 1764 (const :tag "Don't display non-IRC commands after evaluation"
1772 "Notify when the online status of certain users changes" 1765 noncommands)
1773 notify) 1766 (const :tag
1774 (const :tag "Complete nicknames and commands (programmable)" 1767 "Notify when the online status of certain users changes"
1775 completion) 1768 notify)
1776 (const :tag "Complete nicknames and commands (old)" hecomplete) 1769 (const :tag "Complete nicknames and commands (programmable)"
1777 (const :tag "Make displayed lines read-only" readonly) 1770 completion)
1778 (const :tag "Replace text in messages" replace) 1771 (const :tag "Complete nicknames and commands (old)" hecomplete)
1779 (const :tag "Enable an input history" ring) 1772 (const :tag "Make displayed lines read-only" readonly)
1780 (const :tag "Scroll to the bottom of the buffer" scrolltobottom) 1773 (const :tag "Replace text in messages" replace)
1781 (const :tag "Identify to Nickserv (IRC Services) automatically" 1774 (const :tag "Enable an input history" ring)
1782 services) 1775 (const :tag "Scroll to the bottom of the buffer" scrolltobottom)
1783 (const :tag "Convert smileys to pretty icons" smiley) 1776 (const :tag "Identify to Nickserv (IRC Services) automatically"
1784 (const :tag "Play sounds when you receive CTCP SOUND requests" 1777 services)
1785 sound) 1778 (const :tag "Convert smileys to pretty icons" smiley)
1786 (const :tag "Add timestamps to messages" stamp) 1779 (const :tag "Play sounds when you receive CTCP SOUND requests"
1787 (const :tag "Check spelling" spelling) 1780 sound)
1788 (const :tag "Track channel activity in the mode-line" track) 1781 (const :tag "Add timestamps to messages" stamp)
1789 (const :tag "Truncate buffers to a certain size" truncate) 1782 (const :tag "Check spelling" spelling)
1790 (const :tag "Translate morse code in messages" unmorse) 1783 (const :tag "Track channel activity in the mode-line" track)
1791 (repeat :tag "Others" :inline t symbol)) 1784 (const :tag "Truncate buffers to a certain size" truncate)
1785 (const :tag "Translate morse code in messages" unmorse)
1786 (repeat :tag "Others" :inline t symbol))
1792 :group 'erc) 1787 :group 'erc)
1793 1788
1794(defun erc-update-modules () 1789(defun erc-update-modules ()
@@ -1799,14 +1794,11 @@ removed from the list will be disabled."
1799 (cond 1794 (cond
1800 ;; yuck. perhaps we should bring the filenames into sync? 1795 ;; yuck. perhaps we should bring the filenames into sync?
1801 ((string= req "erc-completion") 1796 ((string= req "erc-completion")
1802 (setq req "erc-pcomplete") 1797 (setq req "erc-pcomplete"))
1803 (setq mod 'completion))
1804 ((string= req "erc-pcomplete") 1798 ((string= req "erc-pcomplete")
1805 (setq req "erc-pcomplete")
1806 (setq mod 'completion)) 1799 (setq mod 'completion))
1807 ((string= req "erc-autojoin") 1800 ((string= req "erc-autojoin")
1808 (setq req "erc-join") 1801 (setq req "erc-join")))
1809 (setq mod 'autojoin)))
1810 (condition-case nil 1802 (condition-case nil
1811 (require (intern req)) 1803 (require (intern req))
1812 (error nil)) 1804 (error nil))
@@ -1935,7 +1927,8 @@ Returns the buffer for the given server or channel."
1935 (goto-char (point-max)) 1927 (goto-char (point-max))
1936 (insert "\n")) 1928 (insert "\n"))
1937 (set-marker (process-mark erc-server-process) (point)) 1929 (set-marker (process-mark erc-server-process) (point))
1938 (unless continued-session 1930 (if continued-session
1931 (goto-char (point-max))
1939 (set-marker erc-insert-marker (point)) 1932 (set-marker erc-insert-marker (point))
1940 (erc-display-prompt) 1933 (erc-display-prompt)
1941 (goto-char (point-max))) 1934 (goto-char (point-max)))
@@ -6143,6 +6136,26 @@ This function should be on `erc-kill-channel-hook'."
6143 (funcall erc-part-reason nil)) 6136 (funcall erc-part-reason nil))
6144 nil tgt)))) 6137 nil tgt))))
6145 6138
6139;;; Dealing with `erc-parsed'
6140
6141(defun erc-get-parsed-vector (point)
6142 "Return the whole parsed vector on POINT."
6143 (get-text-property point 'erc-parsed))
6144
6145(defun erc-get-parsed-vector-nick (vect)
6146 "Return nickname in the parsed vector VECT."
6147 (let* ((untreated-nick (and vect (erc-response.sender vect)))
6148 (maybe-nick (when untreated-nick
6149 (car (split-string untreated-nick "!")))))
6150 (when (and (not (null maybe-nick))
6151 (erc-is-valid-nick-p maybe-nick))
6152 untreated-nick)))
6153
6154(defun erc-get-parsed-vector-type (vect)
6155 "Return message type in the parsed vector VECT."
6156 (and vect
6157 (erc-response.command vect)))
6158
6146(provide 'erc) 6159(provide 'erc)
6147 6160
6148;;; Deprecated. We might eventually stop requiring the goodies automatically. 6161;;; Deprecated. We might eventually stop requiring the goodies automatically.
diff --git a/lisp/ffap.el b/lisp/ffap.el
index d487c4f67a0..1b6665d16d5 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -287,9 +287,9 @@ For a fancy alternative, get `ffap-url.el'."
287 287
288;;; Compatibility: 288;;; Compatibility:
289;; 289;;
290;; This version of ffap supports Emacs 20 only, see the ftp site 290;; This version of ffap supports only the Emacs it is distributed in.
291;; for a more general version. The following functions are necessary 291;; See the ftp site for a more general version. The following
292;; "leftovers" from the more general version. 292;; functions are necessary "leftovers" from the more general version.
293 293
294(defun ffap-mouse-event nil ; current mouse event, or nil 294(defun ffap-mouse-event nil ; current mouse event, or nil
295 (and (listp last-nonmenu-event) last-nonmenu-event)) 295 (and (listp last-nonmenu-event) last-nonmenu-event))
@@ -730,7 +730,7 @@ kpathsea, a library used by some versions of TeX."
730 path))) 730 path)))
731 731
732(defun ffap-locate-file (file &optional nosuffix path dir-ok) 732(defun ffap-locate-file (file &optional nosuffix path dir-ok)
733 ;; The Emacs 20 version of locate-library could almost replace this, 733 ;; The current version of locate-library could almost replace this,
734 ;; except it does not let us override the suffix list. The 734 ;; except it does not let us override the suffix list. The
735 ;; compression-suffixes search moved to ffap-file-exists-string. 735 ;; compression-suffixes search moved to ffap-file-exists-string.
736 "A generic path-searching function, mimics `load' by default. 736 "A generic path-searching function, mimics `load' by default.
diff --git a/lisp/files.el b/lisp/files.el
index 0a33a658d9d..a2e18522051 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -445,8 +445,13 @@ use `before-save-hook'.")
445(defcustom enable-local-variables t 445(defcustom enable-local-variables t
446 "*Control use of local variables in files you visit. 446 "*Control use of local variables in files you visit.
447The value can be t, nil or something else. 447The value can be t, nil or something else.
448A value of t means file local variables specifications are obeyed; 448
449nil means they are ignored; anything else means query. 449A value of t means file local variables specifications are obeyed
450if all the specified variables are safe. If any variables are
451not safe, you will be queries before setting them.
452A value of nil means file local variables are ignored.
453Any other value means to always query.
454
450This variable also controls use of major modes specified in 455This variable also controls use of major modes specified in
451a -*- line. 456a -*- line.
452 457
@@ -2024,18 +2029,19 @@ associated with that interpreter in `interpreter-mode-alist'.")
2024(defvar magic-mode-alist 2029(defvar magic-mode-alist
2025 `(;; The < comes before the groups (but the first) to reduce backtracking. 2030 `(;; The < comes before the groups (but the first) to reduce backtracking.
2026 ;; TODO: UTF-16 <?xml may be preceded by a BOM 0xff 0xfe or 0xfe 0xff. 2031 ;; TODO: UTF-16 <?xml may be preceded by a BOM 0xff 0xfe or 0xfe 0xff.
2032 ;; We use [ \t\n] instead of `\\s ' to make regex overflow less likely.
2027 (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)") 2033 (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")
2028 (comment-re (concat "\\(?:!--" incomment-re "*-->\\s *<\\)"))) 2034 (comment-re (concat "\\(?:!--" incomment-re "*-->[ \t\n]*<\\)")))
2029 (concat "\\(?:<\\?xml\\s +[^>]*>\\)?\\s *<" 2035 (concat "\\(?:<\\?xml[ \t\n]+[^>]*>\\)?[ \t\n]*<"
2030 comment-re "*" 2036 comment-re "*"
2031 "\\(?:!DOCTYPE\\s +[^>]*>\\s *<\\s *" comment-re "*\\)?" 2037 "\\(?:!DOCTYPE[ \t\n]+[^>]*>[ \t\n]*<[ \t\n]*" comment-re "*\\)?"
2032 "[Hh][Tt][Mm][Ll]")) 2038 "[Hh][Tt][Mm][Ll]"))
2033 . html-mode) 2039 . html-mode)
2034 ;; These two must come after html, because they are more general: 2040 ;; These two must come after html, because they are more general:
2035 ("<\\?xml " . xml-mode) 2041 ("<\\?xml " . xml-mode)
2036 (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)") 2042 (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")
2037 (comment-re (concat "\\(?:!--" incomment-re "*-->\\s *<\\)"))) 2043 (comment-re (concat "\\(?:!--" incomment-re "*-->[ \t\n]*<\\)")))
2038 (concat "\\s *<" comment-re "*!DOCTYPE ")) 2044 (concat "[ \t\n]*<" comment-re "*!DOCTYPE "))
2039 . sgml-mode) 2045 . sgml-mode)
2040 ("%![^V]" . ps-mode) 2046 ("%![^V]" . ps-mode)
2041 ("# xmcd " . conf-unix-mode)) 2047 ("# xmcd " . conf-unix-mode))
@@ -2213,42 +2219,89 @@ Otherwise, return nil; point may be changed."
2213 (goto-char beg) 2219 (goto-char beg)
2214 end)))) 2220 end))))
2215 2221
2216(defun hack-local-variables-confirm (string flag-to-check) 2222(defun hack-local-variables-confirm (vars unsafe-vars risky-vars)
2217 (or (eq flag-to-check t) 2223 (if noninteractive
2218 (and flag-to-check 2224 nil
2219 (save-window-excursion 2225 (let ((name (if buffer-file-name
2220 (condition-case nil 2226 (file-name-nondirectory buffer-file-name)
2221 (switch-to-buffer (current-buffer)) 2227 (concat "buffer " (buffer-name))))
2222 (error 2228 prompt char)
2223 ;; If we fail to switch in the selected window, 2229 (save-window-excursion
2224 ;; it is probably a minibuffer or dedicated window. 2230 (let ((buf (get-buffer-create "*Local Variables*")))
2225 ;; So try another window. 2231 (pop-to-buffer buf)
2226 (let ((pop-up-frames nil)) 2232 (set (make-local-variable 'cursor-type) nil)
2227 ;; Refrain from popping up frames since it can't 2233 (erase-buffer)
2228 ;; be undone by save-window-excursion. 2234 (if unsafe-vars
2229 (pop-to-buffer (current-buffer))))) 2235 (insert "The local variables list in " name
2230 (save-excursion 2236 "\ncontains values that may not be safe (*)"
2231 (beginning-of-line) 2237 (if risky-vars
2232 (set-window-start (selected-window) (point))) 2238 ", and variables that are risky (**)."
2233 (y-or-n-p (format string 2239 "."))
2234 (if buffer-file-name 2240 (if risky-vars
2235 (file-name-nondirectory buffer-file-name) 2241 (insert "The local variables list in " name
2236 (concat "buffer " (buffer-name))))))))) 2242 "\ncontains variables that are risky (**).")
2243 (insert "A local variables list is specified in " name ".")))
2244 (insert "\n\nDo you want to apply it? You can type
2245y -- to apply the local variables list.
2246n -- to ignore the local variables list.
2247! -- to apply the local variables list, and mark these values (*) as
2248 safe (in the future, they can be set automatically.)\n\n")
2249 (dolist (elt vars)
2250 (cond ((member elt unsafe-vars)
2251 (insert " * "))
2252 ((member elt risky-vars)
2253 (insert " ** "))
2254 (t
2255 (insert " ")))
2256 (princ (car elt) buf)
2257 (insert " : ")
2258 (princ (cdr elt) buf)
2259 (insert "\n"))
2260 (if (< (line-number-at-pos) (window-body-height))
2261 (setq prompt "Please type y, n, or !: ")
2262 (goto-char (point-min))
2263 (setq prompt "Please type y, n, or !, or C-v to scroll: "))
2264 (let ((inhibit-quit t)
2265 (cursor-in-echo-area t)
2266 done)
2267 (while (not done)
2268 (message prompt)
2269 (setq char (read-event))
2270 (if (numberp char)
2271 (if (eq char ?\C-v)
2272 (condition-case nil
2273 (scroll-up)
2274 (error (goto-char (point-min))))
2275 (setq done (memq (downcase char)
2276 '(?! ?y ?n ?\s ?\C-g))))))
2277 (if (= char ?\C-g)
2278 (setq quit-flag nil)))
2279 (setq char (downcase char))
2280 (when (and (= char ?!) unsafe-vars)
2281 (dolist (elt unsafe-vars)
2282 (add-to-list 'safe-local-variable-values elt))
2283 (customize-save-variable
2284 'safe-local-variable-values
2285 safe-local-variable-values))
2286 (kill-buffer buf)
2287 (or (= char ?!)
2288 (= char ?\s)
2289 (= char ?y)))))))
2237 2290
2238(defun hack-local-variables-prop-line (&optional mode-only) 2291(defun hack-local-variables-prop-line (&optional mode-only)
2239 "Set local variables specified in the -*- line. 2292 "Return local variables specified in the -*- line.
2240Ignore any specification for `mode:' and `coding:'; 2293Ignore any specification for `mode:' and `coding:';
2241`set-auto-mode' should already have handled `mode:', 2294`set-auto-mode' should already have handled `mode:',
2242`set-auto-coding' should already have handled `coding:'. 2295`set-auto-coding' should already have handled `coding:'.
2243If MODE-ONLY is non-nil, all we do is check whether the major mode 2296
2244is specified, returning t if it is specified." 2297If MODE-ONLY is non-nil, all we do is check whether the major
2298mode is specified, returning t if it is specified. Otherwise,
2299return an alist of elements (VAR . VAL), where VAR is a variable
2300and VAL is the specified value."
2245 (save-excursion 2301 (save-excursion
2246 (goto-char (point-min)) 2302 (goto-char (point-min))
2247 (let ((result nil) 2303 (let ((end (set-auto-mode-1))
2248 (end (set-auto-mode-1)) 2304 result mode-specified)
2249 mode-specified
2250 (enable-local-variables
2251 (and local-enable-local-variables enable-local-variables)))
2252 ;; Parse the -*- line into the RESULT alist. 2305 ;; Parse the -*- line into the RESULT alist.
2253 ;; Also set MODE-SPECIFIED if we see a spec or `mode'. 2306 ;; Also set MODE-SPECIFIED if we see a spec or `mode'.
2254 (cond ((not end) 2307 (cond ((not end)
@@ -2278,128 +2331,163 @@ is specified, returning t if it is specified."
2278 ;; so we must do that here as well. 2331 ;; so we must do that here as well.
2279 ;; That is inconsistent, but we're stuck with it. 2332 ;; That is inconsistent, but we're stuck with it.
2280 ;; The same can be said for `coding' in set-auto-coding. 2333 ;; The same can be said for `coding' in set-auto-coding.
2281 (or (equal (downcase (symbol-name key)) "mode") 2334 (or (and (equal (downcase (symbol-name key)) "mode")
2335 (setq mode-specified t))
2282 (equal (downcase (symbol-name key)) "coding") 2336 (equal (downcase (symbol-name key)) "coding")
2283 (setq result (cons (cons key val) result))) 2337 (condition-case nil
2284 (if (equal (downcase (symbol-name key)) "mode") 2338 (push (cons (if (eq key 'eval)
2285 (setq mode-specified t)) 2339 'eval
2286 (skip-chars-forward " \t;"))) 2340 (indirect-variable key))
2287 (setq result (nreverse result)))) 2341 val) result)
2288 2342 (error nil)))
2289 (if mode-only mode-specified 2343 (skip-chars-forward " \t;")))))
2290 (if (and result 2344
2291 (or mode-only 2345 (if mode-only
2292 (hack-local-variables-confirm 2346 mode-specified
2293 "Set local variables as specified in -*- line of %s? " 2347 result))))
2294 enable-local-variables)))
2295 (let ((enable-local-eval enable-local-eval))
2296 (while result
2297 (hack-one-local-variable (car (car result)) (cdr (car result)))
2298 (setq result (cdr result)))))
2299 nil))))
2300 2348
2301(defvar hack-local-variables-hook nil 2349(defvar hack-local-variables-hook nil
2302 "Normal hook run after processing a file's local variables specs. 2350 "Normal hook run after processing a file's local variables specs.
2303Major modes can use this to examine user-specified local variables 2351Major modes can use this to examine user-specified local variables
2304in order to initialize other data structure based on them.") 2352in order to initialize other data structure based on them.")
2305 2353
2354(defcustom safe-local-variable-values nil
2355 "List variable-value pairs that are considered safe.
2356Each element is a cons cell (VAR . VAL), where VAR is a variable
2357symbol and VAL is a value that is considered safe."
2358 :group 'find-file
2359 :type 'alist)
2360
2306(defun hack-local-variables (&optional mode-only) 2361(defun hack-local-variables (&optional mode-only)
2307 "Parse and put into effect this buffer's local variables spec. 2362 "Parse and put into effect this buffer's local variables spec.
2308If MODE-ONLY is non-nil, all we do is check whether the major mode 2363If MODE-ONLY is non-nil, all we do is check whether the major mode
2309is specified, returning t if it is specified." 2364is specified, returning t if it is specified."
2310 (let ((mode-specified 2365 (let ((enable-local-variables
2311 ;; If MODE-ONLY is t, we check here for specifying the mode 2366 (and local-enable-local-variables enable-local-variables))
2312 ;; in the -*- line. If MODE-ONLY is nil, we process 2367 result)
2313 ;; the -*- line here. 2368 (when (or mode-only enable-local-variables)
2314 (hack-local-variables-prop-line mode-only)) 2369 (setq result (hack-local-variables-prop-line mode-only))
2315 (enable-local-variables 2370 ;; Look for "Local variables:" line in last page.
2316 (and local-enable-local-variables enable-local-variables))) 2371 (save-excursion
2317 ;; Look for "Local variables:" line in last page. 2372 (goto-char (point-max))
2318 (save-excursion 2373 (search-backward "\n\^L" (max (- (point-max) 3000) (point-min))
2319 (goto-char (point-max)) 2374 'move)
2320 (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) 'move) 2375 (when (let ((case-fold-search t))
2321 (when (let ((case-fold-search t)) 2376 (search-forward "Local Variables:" nil t))
2322 (and (search-forward "Local Variables:" nil t) 2377 (skip-chars-forward " \t")
2323 (or mode-only 2378 ;; suffix is what comes after "local variables:" in its line.
2324 (hack-local-variables-confirm 2379 ;; prefix is what comes before "local variables:" in its line.
2325 "Set local variables as specified at end of %s? " 2380 (let ((suffix
2326 enable-local-variables)))) 2381 (concat
2327 (skip-chars-forward " \t") 2382 (regexp-quote (buffer-substring (point)
2328 (let ((enable-local-eval enable-local-eval) 2383 (line-end-position)))
2329 ;; suffix is what comes after "local variables:" in its line. 2384 "$"))
2330 (suffix 2385 (prefix
2331 (concat 2386 (concat "^" (regexp-quote
2332 (regexp-quote (buffer-substring (point) (line-end-position))) 2387 (buffer-substring (line-beginning-position)
2333 "$")) 2388 (match-beginning 0)))))
2334 ;; prefix is what comes before "local variables:" in its line. 2389 beg)
2335 (prefix 2390
2336 (concat "^" (regexp-quote 2391 (forward-line 1)
2337 (buffer-substring (line-beginning-position) 2392 (let ((startpos (point))
2338 (match-beginning 0))))) 2393 endpos
2339 beg) 2394 (thisbuf (current-buffer)))
2340 2395 (save-excursion
2341 (forward-line 1) 2396 (unless (let ((case-fold-search t))
2342 (let ((startpos (point)) 2397 (re-search-forward
2343 endpos 2398 (concat prefix "[ \t]*End:[ \t]*" suffix)
2344 (thisbuf (current-buffer))) 2399 nil t))
2345 (save-excursion 2400 (error "Local variables list is not properly terminated"))
2346 (unless (let ((case-fold-search t)) 2401 (beginning-of-line)
2347 (re-search-forward 2402 (setq endpos (point)))
2348 (concat prefix "[ \t]*End:[ \t]*" suffix) 2403
2349 nil t)) 2404 (with-temp-buffer
2350 (error "Local variables list is not properly terminated")) 2405 (insert-buffer-substring thisbuf startpos endpos)
2351 (beginning-of-line) 2406 (goto-char (point-min))
2352 (setq endpos (point))) 2407 (subst-char-in-region (point) (point-max) ?\^m ?\n)
2353 2408 (while (not (eobp))
2354 (with-temp-buffer 2409 ;; Discard the prefix.
2355 (insert-buffer-substring thisbuf startpos endpos) 2410 (if (looking-at prefix)
2356 (goto-char (point-min)) 2411 (delete-region (point) (match-end 0))
2357 (subst-char-in-region (point) (point-max) ?\^m ?\n) 2412 (error "Local variables entry is missing the prefix"))
2358 (while (not (eobp)) 2413 (end-of-line)
2359 ;; Discard the prefix. 2414 ;; Discard the suffix.
2360 (if (looking-at prefix) 2415 (if (looking-back suffix)
2361 (delete-region (point) (match-end 0)) 2416 (delete-region (match-beginning 0) (point))
2362 (error "Local variables entry is missing the prefix")) 2417 (error "Local variables entry is missing the suffix"))
2363 (end-of-line) 2418 (forward-line 1))
2364 ;; Discard the suffix. 2419 (goto-char (point-min))
2365 (if (looking-back suffix) 2420
2366 (delete-region (match-beginning 0) (point)) 2421 (while (not (eobp))
2367 (error "Local variables entry is missing the suffix")) 2422 ;; Find the variable name; strip whitespace.
2368 (forward-line 1)) 2423 (skip-chars-forward " \t")
2369 (goto-char (point-min)) 2424 (setq beg (point))
2370 2425 (skip-chars-forward "^:\n")
2371 (while (not (eobp)) 2426 (if (eolp) (error "Missing colon in local variables entry"))
2372 ;; Find the variable name; strip whitespace. 2427 (skip-chars-backward " \t")
2373 (skip-chars-forward " \t") 2428 (let* ((str (buffer-substring beg (point)))
2374 (setq beg (point)) 2429 (var (read str))
2375 (skip-chars-forward "^:\n") 2430 val)
2376 (if (eolp) (error "Missing colon in local variables entry")) 2431 ;; Read the variable value.
2377 (skip-chars-backward " \t") 2432 (skip-chars-forward "^:")
2378 (let* ((str (buffer-substring beg (point))) 2433 (forward-char 1)
2379 (var (read str)) 2434 (setq val (read (current-buffer)))
2380 val) 2435 (if mode-only
2381 ;; Read the variable value. 2436 (if (eq var 'mode)
2382 (skip-chars-forward "^:") 2437 (setq result t))
2383 (forward-char 1) 2438 (unless (eq var 'coding)
2384 (setq val (read (current-buffer))) 2439 (condition-case nil
2385 (if mode-only 2440 (push (cons (if (eq var 'eval)
2386 (if (eq var 'mode) 2441 'eval
2387 (setq mode-specified t)) 2442 (indirect-variable var))
2388 ;; Set the variable. "Variables" mode and eval are funny. 2443 val) result)
2389 (with-current-buffer thisbuf 2444 (error nil)))))
2390 (hack-one-local-variable var val)))) 2445 (forward-line 1)))))))
2391 (forward-line 1))))))) 2446
2392 (unless mode-only 2447 ;; We've read all the local variables. Now, return whether the
2393 (run-hooks 'hack-local-variables-hook)) 2448 ;; mode is specified (if MODE-ONLY is non-nil), or set the
2394 mode-specified)) 2449 ;; variables (if MODE-ONLY is nil.)
2395 2450 (if mode-only
2396(defvar ignored-local-variables () 2451 result
2452 (dolist (ignored ignored-local-variables)
2453 (setq result (assq-delete-all ignored result)))
2454 (if (null enable-local-eval)
2455 (setq result (assq-delete-all 'eval result)))
2456 (when result
2457 (setq result (nreverse result))
2458 ;; Find those variables that we may want to save to
2459 ;; `safe-local-variable-values'.
2460 (let (risky-vars unsafe-vars)
2461 (dolist (elt result)
2462 (let ((var (car elt))
2463 (val (cdr elt)))
2464 (or (eq var 'mode)
2465 (and (eq var 'eval)
2466 (or (eq enable-local-eval t)
2467 (hack-one-local-variable-eval-safep
2468 (eval (quote val)))))
2469 (safe-local-variable-p var val)
2470 (and (risky-local-variable-p var val)
2471 (push elt risky-vars))
2472 (push elt unsafe-vars))))
2473 (if (or (and (eq enable-local-variables t)
2474 (null unsafe-vars)
2475 (null risky-vars))
2476 (hack-local-variables-confirm
2477 result unsafe-vars risky-vars))
2478 (dolist (elt result)
2479 (hack-one-local-variable (car elt) (cdr elt)))))
2480 (run-hooks 'hack-local-variables-hook))))))
2481
2482(defvar ignored-local-variables
2483 '(ignored-local-variables safe-local-variable-values)
2397 "Variables to be ignored in a file's local variable spec.") 2484 "Variables to be ignored in a file's local variable spec.")
2398 2485
2399;; Get confirmation before setting these variables as locals in a file. 2486;; Get confirmation before setting these variables as locals in a file.
2400(put 'debugger 'risky-local-variable t) 2487(put 'debugger 'risky-local-variable t)
2401(put 'enable-local-eval 'risky-local-variable t) 2488(put 'enable-local-eval 'risky-local-variable t)
2402(put 'ignored-local-variables 'risky-local-variable t) 2489(put 'ignored-local-variables 'risky-local-variable t)
2490(put 'ignored-local-variables 'safe-local-variable-values t)
2403(put 'eval 'risky-local-variable t) 2491(put 'eval 'risky-local-variable t)
2404(put 'file-name-handler-alist 'risky-local-variable t) 2492(put 'file-name-handler-alist 'risky-local-variable t)
2405(put 'inhibit-quit 'risky-local-variable t) 2493(put 'inhibit-quit 'risky-local-variable t)
@@ -2452,27 +2540,68 @@ is specified, returning t if it is specified."
2452(put 'display-time-string 'risky-local-variable t) 2540(put 'display-time-string 'risky-local-variable t)
2453(put 'parse-time-rules 'risky-local-variable t) 2541(put 'parse-time-rules 'risky-local-variable t)
2454 2542
2455;; This case is safe because the user gets to check it before it is used. 2543;; Commonly-encountered local variables that are safe:
2456(put 'compile-command 'safe-local-variable 'stringp) 2544(let ((string-or-null (lambda (a) (or (stringp a) (null a)))))
2457 2545 (eval
2458(defun risky-local-variable-p (sym &optional val) 2546 `(mapc (lambda (pair)
2459 "Non-nil if SYM could be dangerous as a file-local variable with value VAL. 2547 (put (car pair) 'safe-local-variable (cdr pair)))
2460If VAL is nil or omitted, the question is whether any value might be 2548 '((byte-compile-dynamic . t)
2461dangerous." 2549 (c-basic-offset . integerp)
2550 (c-file-style . stringp)
2551 (c-indent-level . integerp)
2552 (comment-column . integerp)
2553 (compile-command . ,string-or-null)
2554 (fill-column . integerp)
2555 (fill-prefix . ,string-or-null)
2556 (indent-tabs-mode . t)
2557 (kept-new-versions . integerp)
2558 (no-byte-compile . t)
2559 (no-update-autoloads . t)
2560 (outline-regexp . ,string-or-null)
2561 (page-delimiter . ,string-or-null)
2562 (paragraph-start . ,string-or-null)
2563 (paragraph-separate . ,string-or-null)
2564 (sentence-end . ,string-or-null)
2565 (sentence-end-double-space . t)
2566 (tab-width . integerp)
2567 (version-control . t)))))
2568
2569(defun safe-local-variable-p (sym val)
2570 "Non-nil if SYM is safe as a file-local variable with value VAL.
2571It is safe if any of these conditions are met:
2572
2573 * There is a matching entry (SYM . VAL) in the
2574 `safe-local-variable-values' user option.
2575
2576 * The `safe-local-variable' property of SYM is t.
2577
2578 * The `safe-local-variable' property of SYM is a function that
2579 evaluates to a non-nil value with VAL as an argument."
2580 (or (member (cons sym val) safe-local-variable-values)
2581 (let ((safep (get sym 'safe-local-variable)))
2582 (or (eq safep t)
2583 (and (functionp safep)
2584 (funcall safep val))))))
2585
2586(defun risky-local-variable-p (sym &optional ignored)
2587 "Non-nil if SYM could be dangerous as a file-local variable.
2588It is dangerous if either of these conditions are met:
2589
2590 * Its `risky-local-variable' property is non-nil.
2591
2592 * Its name ends with \"hook(s)\", \"function(s)\", \"form(s)\", \"map\",
2593 \"program\", \"command(s)\", \"predicate(s)\", \"frame-alist\",
2594 \"mode-alist\", \"font-lock-(syntactic-)keyword*\", or
2595 \"map-alist\"."
2462 ;; If this is an alias, check the base name. 2596 ;; If this is an alias, check the base name.
2463 (condition-case nil 2597 (condition-case nil
2464 (setq sym (indirect-variable sym)) 2598 (setq sym (indirect-variable sym))
2465 (error nil)) 2599 (error nil))
2466 (let ((safep (get sym 'safe-local-variable))) 2600 (or (get sym 'risky-local-variable)
2467 (or (get sym 'risky-local-variable) 2601 (string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|\
2468 (and (string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|-commands?$\\|-predicates?$\\|font-lock-keywords$\\|font-lock-keywords-[0-9]+$\\|font-lock-syntactic-keywords$\\|-frame-alist$\\|-mode-alist$\\|-map$\\|-map-alist$" 2602-commands?$\\|-predicates?$\\|font-lock-keywords$\\|font-lock-keywords\
2469 (symbol-name sym)) 2603-[0-9]+$\\|font-lock-syntactic-keywords$\\|-frame-alist$\\|-mode-alist$\\|\
2470 (not safep)) 2604-map$\\|-map-alist$" (symbol-name sym))))
2471 ;; If the safe-local-variable property isn't t or nil,
2472 ;; then it must return non-nil on the proposed value to be safe.
2473 (and (not (memq safep '(t nil)))
2474 (or (null val)
2475 (not (funcall safep val)))))))
2476 2605
2477(defcustom safe-local-eval-forms nil 2606(defcustom safe-local-eval-forms nil
2478 "*Expressions that are considered \"safe\" in an `eval:' local variable. 2607 "*Expressions that are considered \"safe\" in an `eval:' local variable.
@@ -2529,35 +2658,12 @@ asking you for confirmation."
2529 ok))))))) 2658 ok)))))))
2530 2659
2531(defun hack-one-local-variable (var val) 2660(defun hack-one-local-variable (var val)
2532 "\"Set\" one variable in a local variables spec. 2661 "Set local variable VAR with value VAL."
2533A few patterns are specified so that any name which matches one
2534is considered risky."
2535 (cond ((eq var 'mode) 2662 (cond ((eq var 'mode)
2536 (funcall (intern (concat (downcase (symbol-name val)) 2663 (funcall (intern (concat (downcase (symbol-name val))
2537 "-mode")))) 2664 "-mode"))))
2538 ((eq var 'coding) 2665 ((eq var 'eval)
2539 ;; We have already handled coding: tag in set-auto-coding. 2666 (save-excursion (eval val)))
2540 nil)
2541 ((memq var ignored-local-variables)
2542 nil)
2543 ;; "Setting" eval means either eval it or do nothing.
2544 ;; Likewise for setting hook variables.
2545 ((risky-local-variable-p var val)
2546 ;; Permit evalling a put of a harmless property.
2547 ;; if the args do nothing tricky.
2548 (if (or (and (eq var 'eval)
2549 (hack-one-local-variable-eval-safep val))
2550 ;; Permit eval if not root and user says ok.
2551 (and (not (zerop (user-uid)))
2552 (hack-local-variables-confirm
2553 "Process `eval' or hook local variables in %s? "
2554 enable-local-eval)))
2555 (if (eq var 'eval)
2556 (save-excursion (eval val))
2557 (make-local-variable var)
2558 (set var val))
2559 (message "Ignoring risky spec in the local variables list")))
2560 ;; Ordinary variable, really set it.
2561 (t (make-local-variable var) 2667 (t (make-local-variable var)
2562 ;; Make sure the string has no text properties. 2668 ;; Make sure the string has no text properties.
2563 ;; Some text properties can get evaluated in various ways, 2669 ;; Some text properties can get evaluated in various ways,
diff --git a/lisp/find-lisp.el b/lisp/find-lisp.el
index c7527fe21f5..5cedaa60e35 100644
--- a/lisp/find-lisp.el
+++ b/lisp/find-lisp.el
@@ -359,9 +359,5 @@ It is a function which takes two arguments, the directory and its parent."
359 359
360(provide 'find-lisp) 360(provide 'find-lisp)
361 361
362;; Local Variables:
363;; autocompile: t
364;; End:
365
366;;; arch-tag: a711374c-f12a-46f6-aa18-ba7d77b9602a 362;;; arch-tag: a711374c-f12a-46f6-aa18-ba7d77b9602a
367;;; find-lisp.el ends here 363;;; find-lisp.el ends here
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index be9436d350c..adca02f5b95 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,12 @@
12006-02-16 Juanma Barranquero <lekktu@gmail.com>
2
3 * html2text.el (html2text-remove-tag-list):
4 * spam-stat.el (spam-stat-buffer-words): Fix typo in docstring.
5
62006-02-14 Chong Yidong <cyd@stupidchicken.com>
7
8 * gnus-cus.el: Revert 2005-10-17 change.
9
12006-02-10 Reiner Steib <Reiner.Steib@gmx.de> 102006-02-10 Reiner Steib <Reiner.Steib@gmx.de>
2 11
3 * gnus.el: Remove bogus comment. 12 * gnus.el: Remove bogus comment.
diff --git a/lisp/gnus/gnus-cus.el b/lisp/gnus/gnus-cus.el
index fdce8d1b665..5acad8f721b 100644
--- a/lisp/gnus/gnus-cus.el
+++ b/lisp/gnus/gnus-cus.el
@@ -36,14 +36,6 @@
36 36
37;;; Widgets: 37;;; Widgets:
38 38
39(defvar gnus-custom-map
40 (let ((map (make-keymap)))
41 (set-keymap-parent map widget-keymap)
42 (suppress-keymap map)
43 (define-key map [mouse-1] 'widget-move-and-invoke)
44 map)
45 "Keymap for editing Gnus customization buffers.")
46
47(defun gnus-custom-mode () 39(defun gnus-custom-mode ()
48 "Major mode for editing Gnus customization buffers. 40 "Major mode for editing Gnus customization buffers.
49 41
@@ -59,7 +51,7 @@ if that value is non-nil."
59 (kill-all-local-variables) 51 (kill-all-local-variables)
60 (setq major-mode 'gnus-custom-mode 52 (setq major-mode 'gnus-custom-mode
61 mode-name "Gnus Customize") 53 mode-name "Gnus Customize")
62 (use-local-map gnus-custom-map) 54 (use-local-map widget-keymap)
63 ;; Emacs 21 stuff: 55 ;; Emacs 21 stuff:
64 (when (and (facep 'custom-button-face) 56 (when (and (facep 'custom-button-face)
65 (facep 'custom-button-pressed-face)) 57 (facep 'custom-button-pressed-face))
@@ -490,7 +482,7 @@ form, but who cares?"
490 (widget-create 'sexp 482 (widget-create 'sexp
491 :tag "Method" 483 :tag "Method"
492 :value (gnus-info-method info)))) 484 :value (gnus-info-method info))))
493 (use-local-map gnus-custom-map) 485 (use-local-map widget-keymap)
494 (widget-setup) 486 (widget-setup)
495 (buffer-enable-undo) 487 (buffer-enable-undo)
496 (goto-char (point-min)))) 488 (goto-char (point-min))))
@@ -884,7 +876,7 @@ articles in the thread.
884 '(repeat :inline t 876 '(repeat :inline t
885 :tag "Unknown entries" 877 :tag "Unknown entries"
886 sexp))) 878 sexp)))
887 (use-local-map gnus-custom-map) 879 (use-local-map widget-keymap)
888 (widget-setup))) 880 (widget-setup)))
889 881
890(defun gnus-score-customize-done (&rest ignore) 882(defun gnus-score-customize-done (&rest ignore)
@@ -1061,7 +1053,7 @@ articles in the thread.
1061 1053
1062 (gnus-agent-cat-prepare-category-field agent-enable-undownloaded-faces) 1054 (gnus-agent-cat-prepare-category-field agent-enable-undownloaded-faces)
1063 1055
1064 (use-local-map gnus-custom-map) 1056 (use-local-map widget-keymap)
1065 (widget-setup) 1057 (widget-setup)
1066 (buffer-enable-undo)))) 1058 (buffer-enable-undo))))
1067 1059
diff --git a/lisp/gnus/html2text.el b/lisp/gnus/html2text.el
index ceba84decf1..68934c909e9 100644
--- a/lisp/gnus/html2text.el
+++ b/lisp/gnus/html2text.el
@@ -59,7 +59,7 @@ completely verbatim - without any use of REGEXP.")
59 59
60This is a list of tags which should be removed, without any 60This is a list of tags which should be removed, without any
61formatting. Note that tags in the list are presented *without* 61formatting. Note that tags in the list are presented *without*
62any \"<\" or \">\". All occurences of a tag appearing in this 62any \"<\" or \">\". All occurrences of a tag appearing in this
63list are removed, irrespective of whether it is a closing or 63list are removed, irrespective of whether it is a closing or
64opening tag, or if the tag has additional attributes. The 64opening tag, or if the tag has additional attributes. The
65deletion is done by the function `html2text-remove-tags'. 65deletion is done by the function `html2text-remove-tags'.
diff --git a/lisp/gnus/spam-stat.el b/lisp/gnus/spam-stat.el
index 66f302d32e5..e21372bd649 100644
--- a/lisp/gnus/spam-stat.el
+++ b/lisp/gnus/spam-stat.el
@@ -323,7 +323,7 @@ Use `spam-stat-ngood', `spam-stat-nbad', `spam-stat-good',
323 ,@body)) 323 ,@body))
324 324
325(defun spam-stat-buffer-words () 325(defun spam-stat-buffer-words ()
326 "Return a hash table of words and number of occurences in the buffer." 326 "Return a hash table of words and number of occurrences in the buffer."
327 (with-spam-stat-max-buffer-size 327 (with-spam-stat-max-buffer-size
328 (with-syntax-table spam-stat-syntax-table 328 (with-syntax-table spam-stat-syntax-table
329 (goto-char (point-min)) 329 (goto-char (point-min))
diff --git a/lisp/help.el b/lisp/help.el
index bea404f5112..02045948ecb 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -510,7 +510,7 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer."
510 (if (> (length keys) 0) 510 (if (> (length keys) 0)
511 (if remapped 511 (if remapped
512 (format "%s is remapped to %s which is on %s" 512 (format "%s is remapped to %s which is on %s"
513 definition symbol keys) 513 symbol remapped keys)
514 (format "%s is on %s" symbol keys)) 514 (format "%s is on %s" symbol keys))
515 ;; If this is the command the user asked about, 515 ;; If this is the command the user asked about,
516 ;; and it is not on any key, say so. 516 ;; and it is not on any key, say so.
@@ -565,31 +565,30 @@ the last key hit are used.
565 565
566If KEY is a menu item or a tool-bar button that is disabled, this command 566If KEY is a menu item or a tool-bar button that is disabled, this command
567temporarily enables it to allow getting help on disabled items and buttons." 567temporarily enables it to allow getting help on disabled items and buttons."
568 (interactive) 568 (interactive
569 (let ((enable-disabled-menus-and-buttons t) 569 (let ((enable-disabled-menus-and-buttons t)
570 (save-yank-menu)) 570 (cursor-in-echo-area t)
571 (if key 571 saved-yank-menu)
572 ;; Non-interactive invocation 572 (unwind-protect
573 (describe-key-briefly-internal key insert untranslated) 573 (let (key)
574 ;; If yank-menu is empty, populate it temporarily, so that 574 ;; If yank-menu is empty, populate it temporarily, so that
575 ;; "Select and Paste" menu can generate a complete event 575 ;; "Select and Paste" menu can generate a complete event.
576 (if (null (cdr yank-menu)) 576 (when (null (cdr yank-menu))
577 (unwind-protect 577 (setq saved-yank-menu (copy-sequence yank-menu))
578 (progn 578 (menu-bar-update-yank-menu "(any string)" nil))
579 (setq save-yank-menu (copy-sequence yank-menu)) 579 (setq key (read-key-sequence "Describe key (or click or menu item): "))
580 (menu-bar-update-yank-menu "(any string)" nil) 580 (list
581 (call-interactively 'describe-key-briefly-internal)) 581 key
582 (progn (setq yank-menu (copy-sequence save-yank-menu)) 582 (prefix-numeric-value current-prefix-arg)
583 (fset 'yank-menu (cons 'keymap yank-menu)))) 583 ;; If KEY is a down-event, read the corresponding up-event
584 (call-interactively 'describe-key-briefly-internal))))) 584 ;; and use it as the third argument.
585 585 (if (and (consp key) (symbolp (car key))
586(defun describe-key-briefly-internal (key &optional insert untranslated) 586 (memq 'down (cdr (get (car key) 'event-symbol-elements))))
587 "Print the name of the function KEY invokes. KEY is a string. 587 (read-event))))
588If INSERT (the prefix arg) is non-nil, insert the message in the buffer. 588 ;; Put yank-menu back as it was, if we changed it.
589If non-nil UNTRANSLATED is a vector of the untranslated events. 589 (when saved-yank-menu
590It can also be a number in which case the untranslated events from 590 (setq yank-menu (copy-sequence saved-yank-menu))
591the last key hit are used." 591 (fset 'yank-menu (cons 'keymap yank-menu))))))
592 (interactive "kDescribe key briefly: \nP\np")
593 (if (numberp untranslated) 592 (if (numberp untranslated)
594 (setq untranslated (this-single-command-raw-keys))) 593 (setq untranslated (this-single-command-raw-keys)))
595 (save-excursion 594 (save-excursion
@@ -611,6 +610,11 @@ the last key hit are used."
611 (let ((defn (or (string-key-binding key) 610 (let ((defn (or (string-key-binding key)
612 (key-binding key t))) 611 (key-binding key t)))
613 key-desc) 612 key-desc)
613 ;; Handle the case where we faked an entry in "Select and Paste" menu.
614 (if (and (eq defn nil)
615 (stringp (aref key (1- (length key))))
616 (eq (key-binding (substring key 0 -1)) 'yank-menu))
617 (setq defn 'menu-bar-select-yank))
614 ;; Don't bother user with strings from (e.g.) the select-paste menu. 618 ;; Don't bother user with strings from (e.g.) the select-paste menu.
615 (if (stringp (aref key (1- (length key)))) 619 (if (stringp (aref key (1- (length key))))
616 (aset key (1- (length key)) "(any string)")) 620 (aset key (1- (length key)) "(any string)"))
@@ -641,35 +645,30 @@ UP-EVENT is the up-event that was discarded by reading KEY, or nil.
641 645
642If KEY is a menu item or a tool-bar button that is disabled, this command 646If KEY is a menu item or a tool-bar button that is disabled, this command
643temporarily enables it to allow getting help on disabled items and buttons." 647temporarily enables it to allow getting help on disabled items and buttons."
644 (interactive) 648 (interactive
645 (let ((enable-disabled-menus-and-buttons t) 649 (let ((enable-disabled-menus-and-buttons t)
646 (save-yank-menu)) 650 (cursor-in-echo-area t)
647 (if key 651 saved-yank-menu)
648 ;; Non-interactive invocation 652 (unwind-protect
649 (describe-key-internal key untranslated up-event) 653 (let (key)
650 ;; If yank-menu is empty, populate it temporarily, so that 654 ;; If yank-menu is empty, populate it temporarily, so that
651 ;; "Select and Paste" menu can generate a complete event 655 ;; "Select and Paste" menu can generate a complete event.
652 (if (null (cdr yank-menu)) 656 (when (null (cdr yank-menu))
653 (unwind-protect 657 (setq saved-yank-menu (copy-sequence yank-menu))
654 (progn 658 (menu-bar-update-yank-menu "(any string)" nil))
655 (setq save-yank-menu (copy-sequence yank-menu)) 659 (setq key (read-key-sequence "Describe key (or click or menu item): "))
656 (menu-bar-update-yank-menu "(any string)" nil) 660 (list
657 (call-interactively 'describe-key-internal)) 661 key
658 (progn (setq yank-menu (copy-sequence save-yank-menu)) 662 (prefix-numeric-value current-prefix-arg)
659 (fset 'yank-menu (cons 'keymap yank-menu)))) 663 ;; If KEY is a down-event, read the corresponding up-event
660 (call-interactively 'describe-key-internal))))) 664 ;; and use it as the third argument.
661 665 (if (and (consp key) (symbolp (car key))
662(defun describe-key-internal (key &optional untranslated up-event) 666 (memq 'down (cdr (get (car key) 'event-symbol-elements))))
663 "Display documentation of the function invoked by KEY. 667 (read-event))))
664KEY can be any kind of a key sequence; it can include keyboard events, 668 ;; Put yank-menu back as it was, if we changed it.
665mouse events, and/or menu events. When calling from a program, 669 (when saved-yank-menu
666pass KEY as a string or a vector. 670 (setq yank-menu (copy-sequence saved-yank-menu))
667 671 (fset 'yank-menu (cons 'keymap yank-menu))))))
668If non-nil, UNTRANSLATED is a vector of the corresponding untranslated events.
669It can also be a number, in which case the untranslated events from
670the last key sequence entered are used.
671UP-EVENT is the up-event that was discarded by reading KEY, or nil."
672 (interactive "kDescribe key (or click or menu item): \np\nU")
673 (if (numberp untranslated) 672 (if (numberp untranslated)
674 (setq untranslated (this-single-command-raw-keys))) 673 (setq untranslated (this-single-command-raw-keys)))
675 (save-excursion 674 (save-excursion
@@ -686,6 +685,11 @@ UP-EVENT is the up-event that was discarded by reading KEY, or nil."
686 (set-buffer (window-buffer window)) 685 (set-buffer (window-buffer window))
687 (goto-char position)) 686 (goto-char position))
688 (let ((defn (or (string-key-binding key) (key-binding key t)))) 687 (let ((defn (or (string-key-binding key) (key-binding key t))))
688 ;; Handle the case where we faked an entry in "Select and Paste" menu.
689 (if (and (eq defn nil)
690 (stringp (aref key (1- (length key))))
691 (eq (key-binding (substring key 0 -1)) 'yank-menu))
692 (setq defn 'menu-bar-select-yank))
689 (if (or (null defn) (integerp defn) (equal defn 'undefined)) 693 (if (or (null defn) (integerp defn) (equal defn 'undefined))
690 (message "%s is undefined" (help-key-description key untranslated)) 694 (message "%s is undefined" (help-key-description key untranslated))
691 (help-setup-xref (list #'describe-function defn) (interactive-p)) 695 (help-setup-xref (list #'describe-function defn) (interactive-p))
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index f835d91ff9a..191f1d324e6 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -325,7 +325,7 @@ are exhibited within the square braces.)"
325 325
326;;;_* Local emacs vars. 326;;;_* Local emacs vars.
327;;;Local variables: 327;;;Local variables:
328;;;outline-layout: (-2 :) 328;;;allout-layout: (-2 :)
329;;;End: 329;;;End:
330 330
331;; arch-tag: 339ec25a-0741-4eb6-be63-997532e89b0f 331;; arch-tag: 339ec25a-0741-4eb6-be63-997532e89b0f
diff --git a/lisp/info.el b/lisp/info.el
index fa1e3060c10..e3514fb9729 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -134,7 +134,7 @@ The Lisp code is executed when the node is selected.")
134 :group 'info) 134 :group 'info)
135 135
136(defface info-xref-visited 136(defface info-xref-visited
137 '((t :inherit link-visited)) 137 '((t :inherit (link-visited info-xref)))
138 "Face for visited Info cross-references." 138 "Face for visited Info cross-references."
139 :version "22.1" 139 :version "22.1"
140 :group 'info) 140 :group 'info)
@@ -1407,11 +1407,13 @@ any double quotes or backslashes must be escaped (\\\",\\\\)."
1407 (concat 1407 (concat
1408 " (" 1408 " ("
1409 (if (stringp Info-current-file) 1409 (if (stringp Info-current-file)
1410 (file-name-nondirectory Info-current-file) 1410 (replace-regexp-in-string
1411 "%" "%%" (file-name-nondirectory Info-current-file))
1411 "") 1412 "")
1412 ") " 1413 ") "
1413 (if Info-current-node 1414 (if Info-current-node
1414 (propertize Info-current-node 1415 (propertize (replace-regexp-in-string
1416 "%" "%%" Info-current-node)
1415 'face 'mode-line-buffer-id 1417 'face 'mode-line-buffer-id
1416 'help-echo 1418 'help-echo
1417 "mouse-1: scroll forward, mouse-3: scroll back" 1419 "mouse-1: scroll forward, mouse-3: scroll back"
@@ -3352,7 +3354,7 @@ Advanced commands:
3352\\[Info-search-case-sensitively] Search through this Info file for specified regexp case-sensitively. 3354\\[Info-search-case-sensitively] Search through this Info file for specified regexp case-sensitively.
3353\\[Info-search-next] Search for another occurrence of regexp 3355\\[Info-search-next] Search for another occurrence of regexp
3354 from a previous \\<Info-mode-map>\\[Info-search] command. 3356 from a previous \\<Info-mode-map>\\[Info-search] command.
3355\\[Info-index] Look up a topic in this manual's Index and move to that index entry. 3357\\[Info-index] Search for a topic in this manual's Index and go to index entry.
3356\\[Info-index-next] (comma) Move to the next match from a previous \\<Info-mode-map>\\[Info-index] command. 3358\\[Info-index-next] (comma) Move to the next match from a previous \\<Info-mode-map>\\[Info-index] command.
3357\\[info-apropos] Look for a string in the indices of all manuals. 3359\\[info-apropos] Look for a string in the indices of all manuals.
3358\\[Info-goto-node] Move to node specified by name. 3360\\[Info-goto-node] Move to node specified by name.
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 349bae9f072..3dcf689767a 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,11 @@
12006-02-15 Peter S Galbraith <psg@debian.org>
2
3 * mh-compat.el (mh-image-search-load-path): Compatibility code.
4 Emacs 21 and XEmacs don't have `image-search-load-path'.
5
6 * mh-utils.el (mh-image-load-path): Don't bail out on error if the
7 images are already found.
8
12006-02-10 Bill Wohler <wohler@newt.com> 92006-02-10 Bill Wohler <wohler@newt.com>
2 10
3 * mh-search.el (mh-search): Wrap code in (block mh-search ...) 11 * mh-search.el (mh-search): Wrap code in (block mh-search ...)
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index 090ee51c5fc..4bc5fdf36f7 100644
--- a/lisp/mh-e/mh-compat.el
+++ b/lisp/mh-e/mh-compat.el
@@ -115,6 +115,12 @@ introduced in Emacs 22."
115 `(face-background ,face ,frame) 115 `(face-background ,face ,frame)
116 `(face-background ,face ,frame ,inherit))) 116 `(face-background ,face ,frame ,inherit)))
117 117
118(mh-defun-compat mh-image-search-load-path
119 image-search-load-path (file &optional path)
120 "Emacs 21 and XEmacs don't have `image-search-load-path'.
121This function returns nil on those systems."
122 nil)
123
118;; For XEmacs. 124;; For XEmacs.
119(defalias 'mh-line-beginning-position 125(defalias 'mh-line-beginning-position
120 (if (fboundp 'line-beginning-position) 126 (if (fboundp 'line-beginning-position)
@@ -131,7 +137,7 @@ introduced in Emacs 22."
131(mh-defun-compat mh-mail-abbrev-make-syntax-table 137(mh-defun-compat mh-mail-abbrev-make-syntax-table
132 mail-abbrev-make-syntax-table () 138 mail-abbrev-make-syntax-table ()
133 "Emacs 21 and XEmacs don't have `mail-abbrev-make-syntax-table'. 139 "Emacs 21 and XEmacs don't have `mail-abbrev-make-syntax-table'.
134This function does nothing on those systems." 140This function returns nil on those systems."
135 nil) 141 nil)
136 142
137(mh-defun-compat mh-match-string-no-properties 143(mh-defun-compat mh-match-string-no-properties
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index dc86d19ae77..bf0d29fd2a7 100644
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -109,21 +109,41 @@ already there.
109 109
110See also variable `mh-image-load-path-called-flag'." 110See also variable `mh-image-load-path-called-flag'."
111 (unless mh-image-load-path-called-flag 111 (unless mh-image-load-path-called-flag
112 (if (or (not mh-image-load-path) 112 (cond
113 (not (file-exists-p mh-image-load-path))) 113 ((and mh-image-load-path
114 (let (mh-library-name) 114 (file-exists-p (expand-file-name "mh-logo.xpm"
115 ;; First, find mh-e in the load-path. 115 mh-image-load-path))))
116 (setq mh-library-name (locate-library "mh-e")) 116 ;; User setting exists. We're done.
117 (if (not mh-library-name) 117 ((and mh-image-load-path
118 (error "Can not find MH-E in load-path")) 118 (not (file-exists-p (expand-file-name "mh-logo.xpm"
119 (setq mh-image-load-path 119 mh-image-load-path))))
120 (expand-file-name (concat (file-name-directory mh-library-name) 120 ;; User setting does not exist.
121 "../../etc/images"))))) 121 (message "Variable mh-image-load-path %s does not contain MH-E images"
122 (if (not (file-exists-p mh-image-load-path)) 122 mh-image-load-path))
123 (error "Can not find image directory %s" mh-image-load-path)) 123 ((mh-image-search-load-path "mh-logo.xpm")
124 (if (boundp 'image-load-path) 124 ;; Emacs 22 already knows where the images are.
125 (add-to-list 'image-load-path mh-image-load-path) 125 (setq mh-image-load-path
126 (add-to-list 'load-path mh-image-load-path)) 126 (file-name-directory (mh-image-search-load-path "mh-logo.xpm"))))
127 ((locate-library "mh-logo.xpm")
128 ;; Other Emacs already knows where the images are...
129 (setq mh-image-load-path
130 (file-name-directory (locate-library "mh-logo.xpm"))))
131 (t
132 ;; Guess `mh-image-load-path' if it wasn't provided by the user.
133 (let (mh-library-name)
134 ;; First, find mh-e in the load-path.
135 (setq mh-library-name (locate-library "mh-e"))
136 (if (not mh-library-name)
137 (error "Can not find MH-E in load-path"))
138 (setq mh-image-load-path
139 (expand-file-name (concat
140 (file-name-directory mh-library-name)
141 "../../etc/images"))))
142 (if (not (file-exists-p mh-image-load-path))
143 (error "Can not find image directory %s" mh-image-load-path))
144 (if (boundp 'image-load-path)
145 (add-to-list 'image-load-path mh-image-load-path)
146 (add-to-list 'load-path mh-image-load-path))))
127 (setq mh-image-load-path-called-flag t))) 147 (setq mh-image-load-path-called-flag t)))
128 148
129;;;###mh-autoload 149;;;###mh-autoload
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 9922b0f9aed..3a22fb49b04 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -481,21 +481,8 @@ MODE-LINE-P non-nil means dragging a mode line; nil means a header line."
481 481
482 ;; grow/shrink minibuffer? 482 ;; grow/shrink minibuffer?
483 (if should-enlarge-minibuffer 483 (if should-enlarge-minibuffer
484 (progn 484 (unless resize-mini-windows
485 ;; yes. briefly select minibuffer so 485 (mouse-drag-move-window-bottom start-event-window growth))
486 ;; enlarge-window will affect the
487 ;; correct window.
488 (select-window minibuffer)
489 ;; scale back shrinkage if it would
490 ;; make the minibuffer less than 1
491 ;; line tall.
492 (if (and (> growth 0)
493 (< (- (window-height minibuffer)
494 growth)
495 1))
496 (setq growth (1- (window-height minibuffer))))
497 (enlarge-window (- growth))
498 (select-window start-event-window))
499 ;; no. grow/shrink the selected window 486 ;; no. grow/shrink the selected window
500 ;(message "growth = %d" growth) 487 ;(message "growth = %d" growth)
501 (if mode-line-p 488 (if mode-line-p
diff --git a/lisp/mwheel.el b/lisp/mwheel.el
index aca959e8577..662b992b343 100644
--- a/lisp/mwheel.el
+++ b/lisp/mwheel.el
@@ -91,7 +91,7 @@
91 mouse-wheel-click-button)) 91 mouse-wheel-click-button))
92 "Event that should be temporarily inhibited after mouse scrolling. 92 "Event that should be temporarily inhibited after mouse scrolling.
93The mouse wheel is typically on the mouse-2 button, so it may easily 93The mouse wheel is typically on the mouse-2 button, so it may easily
94happen that text is accidentially yanked into the buffer when 94happen that text is accidentally yanked into the buffer when
95scrolling with the mouse wheel. To prevent that, this variable can be 95scrolling with the mouse wheel. To prevent that, this variable can be
96set to the event sent when clicking on the mouse wheel button." 96set to the event sent when clicking on the mouse wheel button."
97 :group 'mouse 97 :group 'mouse
@@ -220,7 +220,7 @@ This should only be bound to mouse buttons 4 and 5."
220(define-minor-mode mouse-wheel-mode 220(define-minor-mode mouse-wheel-mode
221 "Toggle mouse wheel support. 221 "Toggle mouse wheel support.
222With prefix argument ARG, turn on if positive, otherwise off. 222With prefix argument ARG, turn on if positive, otherwise off.
223Returns non-nil if the new state is enabled." 223Return non-nil if the new state is enabled."
224 :global t 224 :global t
225 :group 'mouse 225 :group 'mouse
226 (let* ((dn mouse-wheel-down-event) 226 (let* ((dn mouse-wheel-down-event)
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index c0bf8be3cf8..971b65bf25c 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -929,7 +929,7 @@ the of the following escape sequences replaced by the described values:
929 %fp Following text uses the face `rcirc-server-prefix' 929 %fp Following text uses the face `rcirc-server-prefix'
930 %fs Following text uses the face `rcirc-server' 930 %fs Following text uses the face `rcirc-server'
931 %f[FACE] Following text uses the face FACE 931 %f[FACE] Following text uses the face FACE
932 %f- Following text uses the default face 932 %f- Following text uses the default face
933 %% A literal `%' character 933 %% A literal `%' character
934" 934"
935 :type '(alist :key-type (choice (string :tag "Type") 935 :type '(alist :key-type (choice (string :tag "Type")
@@ -957,59 +957,56 @@ is found by looking up RESPONSE in `rcirc-response-formats'."
957 (setq chunk (substring chunk 1))) 957 (setq chunk (substring chunk 1)))
958 (setq repl 958 (setq repl
959 (cond ((eq key ?%) 959 (cond ((eq key ?%)
960 ;; %% -- literal % character ; 960 ;; %% -- literal % character
961 "%") 961 "%")
962 ((eq key ?n) 962 ((eq key ?n)
963 ;; %n -- nick ; 963 ;; %n -- nick
964 (rcirc-facify (concat (rcirc-abbrev-nick sender) 964 (rcirc-facify (concat (rcirc-abbrev-nick sender)
965 (and target (concat "," target))) 965 (and target (concat "," target)))
966 (if (string= sender (rcirc-nick process)) 966 (if (string= sender (rcirc-nick process))
967 'rcirc-my-nick 967 'rcirc-my-nick
968 'rcirc-other-nick))) 968 'rcirc-other-nick)))
969 ((eq key ?T) 969 ((eq key ?T)
970 ;; %T -- timestamp ; 970 ;; %T -- timestamp
971 (rcirc-facify 971 (rcirc-facify
972 (format-time-string rcirc-time-format (current-time)) 972 (format-time-string rcirc-time-format (current-time))
973 'rcirc-timestamp)) 973 'rcirc-timestamp))
974 ((eq key ?m) 974 ((eq key ?m)
975 ;; %m -- message text ; 975 ;; %m -- message text
976 ;; We add the text property `rcirc-text' to identify this ; 976 ;; We add the text property `rcirc-text' to identify this
977 ;; as the body text. ; 977 ;; as the body text.
978 (propertize 978 (propertize
979 (rcirc-mangle-text process (rcirc-facify text face)) 979 (rcirc-mangle-text process (rcirc-facify text face))
980 'rcirc-text text)) 980 'rcirc-text text))
981 ((eq key ?t) 981 ((eq key ?t)
982 ;; %t -- target ; 982 ;; %t -- target
983 (rcirc-facify (or rcirc-target "") face)) 983 (rcirc-facify (or rcirc-target "") face))
984 ((eq key ?r) 984 ((eq key ?r)
985 ;; %r -- response ; 985 ;; %r -- response
986 (rcirc-facify response face)) 986 (rcirc-facify response face))
987 ((eq key ?f) 987 ((eq key ?f)
988 ;; %f -- change face ; 988 ;; %f -- change face
989 (setq face-key (aref chunk 0)) 989 (setq face-key (aref chunk 0))
990 (setq chunk (substring chunk 1))
990 (cond ((eq face-key ?w) 991 (cond ((eq face-key ?w)
991 ;; %fw -- warning face ; 992 ;; %fw -- warning face
992 (setq face 'font-lock-warning-face)) 993 (setq face 'font-lock-warning-face))
993 ((eq face-key ?p) 994 ((eq face-key ?p)
994 ;; %fp -- server-prefix face ; 995 ;; %fp -- server-prefix face
995 (setq face 'rcirc-server-prefix)) 996 (setq face 'rcirc-server-prefix))
996 ((eq face-key ?s) 997 ((eq face-key ?s)
997 ;; %fs -- warning face ; 998 ;; %fs -- warning face
998 (setq face 'rcirc-server)) 999 (setq face 'rcirc-server))
999 ((eq face-key ?-) 1000 ((eq face-key ?-)
1000 ;; %fs -- warning face ; 1001 ;; %fs -- warning face
1001 (setq face nil)) 1002 (setq face nil))
1002 ((and (eq face-key ?\[) 1003 ((and (eq face-key ?\[)
1003 (string-match "^[[]\\([^]]*\\)[]]" chunk) 1004 (string-match "^\\([^]]*\\)[]]" chunk)
1004 (facep (match-string 1 chunk))) 1005 (facep (match-string 1 chunk)))
1005 ;; %f[...] -- named face ; 1006 ;; %f[...] -- named face
1006 (setq face (intern (match-string 1 chunk))) 1007 (setq face (intern (match-string 1 chunk)))
1007 (setq chunk (substring chunk (match-end 1))))) 1008 (setq chunk (substring chunk (match-end 0)))))
1008 (setq chunk (substring chunk 1)) 1009 "")))
1009 "")
1010 (t
1011 ;; just insert the key literally ;
1012 (rcirc-facify (substring chunk 0 1) face))))
1013 (setq result (concat result repl (rcirc-facify chunk face)))) 1010 (setq result (concat result repl (rcirc-facify chunk face))))
1014 result)) 1011 result))
1015 1012
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index afe5308a918..58f74133cd5 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -836,8 +836,10 @@ The default value is to use the same value as `tramp-rsh-end-of-line'."
836 :type 'string) 836 :type 'string)
837 837
838(defcustom tramp-remote-path 838(defcustom tramp-remote-path
839 '("/bin" "/usr/bin" "/usr/sbin" "/usr/local/bin" "/usr/ccs/bin" 839 ;; "/usr/xpg4/bin" has been placed first, because on Solaris a POSIX
840 "/local/bin" "/local/freeware/bin" "/local/gnu/bin" 840 ;; compatible "id" is needed.
841 '("/usr/xpg4/bin" "/bin" "/usr/bin" "/usr/sbin" "/usr/local/bin"
842 "/usr/ccs/bin" "/local/bin" "/local/freeware/bin" "/local/gnu/bin"
841 "/usr/freeware/bin" "/usr/pkg/bin" "/usr/contrib/bin") 843 "/usr/freeware/bin" "/usr/pkg/bin" "/usr/contrib/bin")
842 "*List of directories to search for executables on remote host. 844 "*List of directories to search for executables on remote host.
843Please notify me about other semi-standard directories to include here. 845Please notify me about other semi-standard directories to include here.
@@ -1735,7 +1737,7 @@ on the remote host.")
1735(defvar tramp-perl-encode 1737(defvar tramp-perl-encode
1736 "%s -e ' 1738 "%s -e '
1737# This script contributed by Juanma Barranquero <lektu@terra.es>. 1739# This script contributed by Juanma Barranquero <lektu@terra.es>.
1738# Copyright (C) 2006 Free Software Foundation, Inc. 1740# Copyright (C) 2002, 2006 Free Software Foundation, Inc.
1739use strict; 1741use strict;
1740 1742
1741my %%trans = do { 1743my %%trans = do {
@@ -1777,7 +1779,7 @@ This string is passed to `format', so percent characters need to be doubled.")
1777(defvar tramp-perl-decode 1779(defvar tramp-perl-decode
1778 "%s -e ' 1780 "%s -e '
1779# This script contributed by Juanma Barranquero <lektu@terra.es>. 1781# This script contributed by Juanma Barranquero <lektu@terra.es>.
1780# Copyright (C) 2006 Free Software Foundation, Inc. 1782# Copyright (C) 2002, 2006 Free Software Foundation, Inc.
1781use strict; 1783use strict;
1782 1784
1783my %%trans = do { 1785my %%trans = do {
diff --git a/lisp/play/landmark.el b/lisp/play/landmark.el
index ed4181e5b8d..63d7a9fe33a 100644
--- a/lisp/play/landmark.el
+++ b/lisp/play/landmark.el
@@ -1694,13 +1694,13 @@ Use \\[describe-mode] for more info."
1694 1694
1695;;;_ + Local variables 1695;;;_ + Local variables
1696 1696
1697;;; The following `outline-layout' local variable setting: 1697;;; The following `allout-layout' local variable setting:
1698;;; - closes all topics from the first topic to just before the third-to-last, 1698;;; - closes all topics from the first topic to just before the third-to-last,
1699;;; - shows the children of the third to last (config vars) 1699;;; - shows the children of the third to last (config vars)
1700;;; - and the second to last (code section), 1700;;; - and the second to last (code section),
1701;;; - and closes the last topic (this local-variables section). 1701;;; - and closes the last topic (this local-variables section).
1702;;;Local variables: 1702;;;Local variables:
1703;;;outline-layout: (0 : -1 -1 0) 1703;;;allout-layout: (0 : -1 -1 0)
1704;;;End: 1704;;;End:
1705 1705
1706(provide 'landmark) 1706(provide 'landmark)
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el
index 0d8d7bebbcb..29f1036b1bb 100644
--- a/lisp/progmodes/ebrowse.el
+++ b/lisp/progmodes/ebrowse.el
@@ -4236,7 +4236,7 @@ NUMBER-OF-STATIC-VARIABLES:"
4236 "*Keymap for Ebrowse commands.") 4236 "*Keymap for Ebrowse commands.")
4237 4237
4238 4238
4239(defvar ebrowse-global-prefix-key "\C-cb" 4239(defvar ebrowse-global-prefix-key "\C-cC-m"
4240 "Prefix key for Ebrowse commands.") 4240 "Prefix key for Ebrowse commands.")
4241 4241
4242 4242
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 9a6024c8e8b..4f197e34bfe 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -339,7 +339,7 @@ Return its file name if found, or nil if not found."
339 nil))))) 339 nil)))))
340 340
341(defun flymake-fix-file-name (name) 341(defun flymake-fix-file-name (name)
342 "Replace all occurences of '\' with '/'." 342 "Replace all occurrences of '\' with '/'."
343 (when name 343 (when name
344 (setq name (expand-file-name name)) 344 (setq name (expand-file-name name))
345 (setq name (abbreviate-file-name name)) 345 (setq name (abbreviate-file-name name))
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 755e83646fc..49f6c64c1a7 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -185,7 +185,6 @@ handlers.")
185 "Font lock keywords used in `gdb-local-mode'.") 185 "Font lock keywords used in `gdb-local-mode'.")
186 186
187;; Variables for GDB 6.4+ 187;; Variables for GDB 6.4+
188
189(defvar gdb-register-names nil "List of register names.") 188(defvar gdb-register-names nil "List of register names.")
190(defvar gdb-changed-registers nil 189(defvar gdb-changed-registers nil
191 "List of changed register numbers (strings).") 190 "List of changed register numbers (strings).")
@@ -203,7 +202,7 @@ other with the source file with the main routine of the inferior.
203 202
204If `gdb-many-windows' is t, regardless of the value of 203If `gdb-many-windows' is t, regardless of the value of
205`gdb-show-main', the layout below will appear unless 204`gdb-show-main', the layout below will appear unless
206`gdb-use-inferior-io-buffer' is nil when the source buffer 205`gdb-use-separate-io-buffer' is nil when the source buffer
207occupies the full width of the frame. Keybindings are given in 206occupies the full width of the frame. Keybindings are given in
208relevant buffer. 207relevant buffer.
209 208
@@ -281,26 +280,26 @@ Also display the main routine in the disassembly buffer if present."
281 :group 'gud 280 :group 'gud
282 :version "22.1") 281 :version "22.1")
283 282
284(defcustom gdb-use-inferior-io-buffer nil 283(defcustom gdb-use-separate-io-buffer nil
285 "Non-nil means display output from the inferior in a separate buffer." 284 "Non-nil means display output from the inferior in a separate buffer."
286 :type 'boolean 285 :type 'boolean
287 :group 'gud 286 :group 'gud
288 :version "22.1") 287 :version "22.1")
289 288
290(defun gdb-use-inferior-io-buffer (arg) 289(defun gdb-use-separate-io-buffer (arg)
291 "Toggle separate IO for inferior. 290 "Toggle separate IO for inferior.
292With arg, use separate IO iff arg is positive." 291With arg, use separate IO iff arg is positive."
293 (interactive "P") 292 (interactive "P")
294 (setq gdb-use-inferior-io-buffer 293 (setq gdb-use-separate-io-buffer
295 (if (null arg) 294 (if (null arg)
296 (not gdb-use-inferior-io-buffer) 295 (not gdb-use-separate-io-buffer)
297 (> (prefix-numeric-value arg) 0))) 296 (> (prefix-numeric-value arg) 0)))
298 (message (format "Separate inferior IO %sabled" 297 (message (format "Separate inferior IO %sabled"
299 (if gdb-use-inferior-io-buffer "en" "dis"))) 298 (if gdb-use-separate-io-buffer "en" "dis")))
300 (if (and gud-comint-buffer 299 (if (and gud-comint-buffer
301 (buffer-name gud-comint-buffer)) 300 (buffer-name gud-comint-buffer))
302 (condition-case nil 301 (condition-case nil
303 (if gdb-use-inferior-io-buffer 302 (if gdb-use-separate-io-buffer
304 (gdb-restore-windows) 303 (gdb-restore-windows)
305 (kill-buffer (gdb-inferior-io-name))) 304 (kill-buffer (gdb-inferior-io-name)))
306 (error nil)))) 305 (error nil))))
@@ -462,7 +461,7 @@ With arg, use separate IO iff arg is positive."
462 461
463 (setq gdb-buffer-type 'gdba) 462 (setq gdb-buffer-type 'gdba)
464 463
465 (if gdb-use-inferior-io-buffer (gdb-clear-inferior-io)) 464 (if gdb-use-separate-io-buffer (gdb-clear-inferior-io))
466 465
467 ;; Hack to see test for GDB 6.4+ (-stack-info-frame was implemented in 6.4) 466 ;; Hack to see test for GDB 6.4+ (-stack-info-frame was implemented in 6.4)
468 (setq gdb-version nil) 467 (setq gdb-version nil)
@@ -571,7 +570,7 @@ With arg, automatically raise speedbar iff arg is positive."
571 (set-text-properties 0 (length expr) nil expr) 570 (set-text-properties 0 (length expr) nil expr)
572 (gdb-enqueue-input 571 (gdb-enqueue-input
573 (list 572 (list
574 (if (eq gud-minor-mode 'gdba) 573 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
575 (concat "server interpreter mi \"-var-create - * " expr "\"\n") 574 (concat "server interpreter mi \"-var-create - * " expr "\"\n")
576 (concat"-var-create - * " expr "\n")) 575 (concat"-var-create - * " expr "\n"))
577 `(lambda () (gdb-var-create-handler ,expr)))))))) 576 `(lambda () (gdb-var-create-handler ,expr))))))))
@@ -594,8 +593,7 @@ With arg, automatically raise speedbar iff arg is positive."
594 (speedbar-change-initial-expansion-list "GUD")) 593 (speedbar-change-initial-expansion-list "GUD"))
595 (gdb-enqueue-input 594 (gdb-enqueue-input
596 (list 595 (list
597 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 596 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
598 'gdba)
599 (concat "server interpreter mi \"-var-evaluate-expression " 597 (concat "server interpreter mi \"-var-evaluate-expression "
600 (nth 1 var) "\"\n") 598 (nth 1 var) "\"\n")
601 (concat "-var-evaluate-expression " (nth 1 var) "\n")) 599 (concat "-var-evaluate-expression " (nth 1 var) "\n"))
@@ -743,13 +741,11 @@ TEXT is the text of the button we clicked on, a + or - item.
743TOKEN is data related to this node. 741TOKEN is data related to this node.
744INDENT is the current indentation depth." 742INDENT is the current indentation depth."
745 (cond ((string-match "+" text) ;expand this node 743 (cond ((string-match "+" text) ;expand this node
746 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba) 744 (if (and
747 (if (string-equal gdb-version "pre-6.4") 745 (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
748 (gdb-var-list-children token) 746 (string-equal gdb-version "pre-6.4"))
749 (gdb-var-list-children-1 token)) 747 (gdb-var-list-children token)
750 (progn 748 (gdb-var-list-children-1 token)))
751 (gdbmi-var-update)
752 (gdbmi-var-list-children token))))
753 ((string-match "-" text) ;contract this node 749 ((string-match "-" text) ;contract this node
754 (dolist (var gdb-var-list) 750 (dolist (var gdb-var-list)
755 (if (string-match (concat token "\\.") (nth 1 var)) 751 (if (string-match (concat token "\\.") (nth 1 var))
@@ -856,10 +852,10 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'."
856 (gdb-get-target-string) 852 (gdb-get-target-string)
857 "*")) 853 "*"))
858 854
859(defun gdb-display-inferior-io-buffer () 855(defun gdb-display-separate-io-buffer ()
860 "Display IO of inferior in a separate window." 856 "Display IO of inferior in a separate window."
861 (interactive) 857 (interactive)
862 (if gdb-use-inferior-io-buffer 858 (if gdb-use-separate-io-buffer
863 (gdb-display-buffer 859 (gdb-display-buffer
864 (gdb-get-create-buffer 'gdb-inferior-io)))) 860 (gdb-get-create-buffer 'gdb-inferior-io))))
865 861
@@ -870,21 +866,21 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'."
870 (menu-bar-lines . nil) 866 (menu-bar-lines . nil)
871 (minibuffer . nil))) 867 (minibuffer . nil)))
872 868
873(defun gdb-frame-inferior-io-buffer () 869(defun gdb-frame-separate-io-buffer ()
874 "Display IO of inferior in a new frame." 870 "Display IO of inferior in a new frame."
875 (interactive) 871 (interactive)
876 (if gdb-use-inferior-io-buffer 872 (if gdb-use-separate-io-buffer
877 (let ((special-display-regexps (append special-display-regexps '(".*"))) 873 (let ((special-display-regexps (append special-display-regexps '(".*")))
878 (special-display-frame-alist gdb-frame-parameters)) 874 (special-display-frame-alist gdb-frame-parameters))
879 (display-buffer (gdb-get-create-buffer 'gdb-inferior-io))))) 875 (display-buffer (gdb-get-create-buffer 'gdb-inferior-io)))))
880 876
881(defvar gdb-inferior-io-mode-map 877(defvar gdb-inferior-io-mode-map
882 (let ((map (make-sparse-keymap))) 878 (let ((map (make-sparse-keymap)))
883 (define-key map "\C-c\C-c" 'gdb-inferior-io-interrupt) 879 (define-key map "\C-c\C-c" 'gdb-separate-io-interrupt)
884 (define-key map "\C-c\C-z" 'gdb-inferior-io-stop) 880 (define-key map "\C-c\C-z" 'gdb-separate-io-stop)
885 (define-key map "\C-c\C-\\" 'gdb-inferior-io-quit) 881 (define-key map "\C-c\C-\\" 'gdb-separate-io-quit)
886 (define-key map "\C-c\C-d" 'gdb-inferior-io-eof) 882 (define-key map "\C-c\C-d" 'gdb-separate-io-eof)
887 (define-key map "\C-d" 'gdb-inferior-io-eof) 883 (define-key map "\C-d" 'gdb-separate-io-eof)
888 map)) 884 map))
889 885
890(define-derived-mode gdb-inferior-io-mode comint-mode "Inferior I/O" 886(define-derived-mode gdb-inferior-io-mode comint-mode "Inferior I/O"
@@ -905,25 +901,25 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'."
905 (process-send-string proc string) 901 (process-send-string proc string)
906 (process-send-string proc "\n"))) 902 (process-send-string proc "\n")))
907 903
908(defun gdb-inferior-io-interrupt () 904(defun gdb-separate-io-interrupt ()
909 "Interrupt the program being debugged." 905 "Interrupt the program being debugged."
910 (interactive) 906 (interactive)
911 (interrupt-process 907 (interrupt-process
912 (get-buffer-process gud-comint-buffer) comint-ptyp)) 908 (get-buffer-process gud-comint-buffer) comint-ptyp))
913 909
914(defun gdb-inferior-io-quit () 910(defun gdb-separate-io-quit ()
915 "Send quit signal to the program being debugged." 911 "Send quit signal to the program being debugged."
916 (interactive) 912 (interactive)
917 (quit-process 913 (quit-process
918 (get-buffer-process gud-comint-buffer) comint-ptyp)) 914 (get-buffer-process gud-comint-buffer) comint-ptyp))
919 915
920(defun gdb-inferior-io-stop () 916(defun gdb-separate-io-stop ()
921 "Stop the program being debugged." 917 "Stop the program being debugged."
922 (interactive) 918 (interactive)
923 (stop-process 919 (stop-process
924 (get-buffer-process gud-comint-buffer) comint-ptyp)) 920 (get-buffer-process gud-comint-buffer) comint-ptyp))
925 921
926(defun gdb-inferior-io-eof () 922(defun gdb-separate-io-eof ()
927 "Send end-of-file to the program being debugged." 923 "Send end-of-file to the program being debugged."
928 (interactive) 924 (interactive)
929 (process-send-eof 925 (process-send-eof
@@ -1119,7 +1115,7 @@ not GDB."
1119 ((eq sink 'user) 1115 ((eq sink 'user)
1120 (progn 1116 (progn
1121 (setq gud-running t) 1117 (setq gud-running t)
1122 (if gdb-use-inferior-io-buffer 1118 (if gdb-use-separate-io-buffer
1123 (setq gdb-output-sink 'inferior)))) 1119 (setq gdb-output-sink 'inferior))))
1124 (t 1120 (t
1125 (gdb-resync) 1121 (gdb-resync)
@@ -1129,7 +1125,7 @@ not GDB."
1129 "An annotation handler for `breakpoint' and other annotations. 1125 "An annotation handler for `breakpoint' and other annotations.
1130They say that I/O for the subprocess is now GDB, not the program 1126They say that I/O for the subprocess is now GDB, not the program
1131being debugged." 1127being debugged."
1132 (if gdb-use-inferior-io-buffer 1128 (if gdb-use-separate-io-buffer
1133 (let ((sink gdb-output-sink)) 1129 (let ((sink gdb-output-sink))
1134 (cond 1130 (cond
1135 ((eq sink 'inferior) 1131 ((eq sink 'inferior)
@@ -1195,7 +1191,7 @@ happens to be appropriate."
1195 1191
1196 (if (string-equal gdb-version "pre-6.4") 1192 (if (string-equal gdb-version "pre-6.4")
1197 (gdb-invalidate-registers) 1193 (gdb-invalidate-registers)
1198 (if (gdb-get-buffer 'gdb-registers-buffer) (gdb-get-changed-registers)) 1194 (gdb-get-changed-registers)
1199 (gdb-invalidate-registers-1)) 1195 (gdb-invalidate-registers-1))
1200 1196
1201 (gdb-invalidate-memory) 1197 (gdb-invalidate-memory)
@@ -1498,7 +1494,7 @@ static char *magick[] = {
1498 ;; Remove all breakpoint-icons in source buffers but not assembler buffer. 1494 ;; Remove all breakpoint-icons in source buffers but not assembler buffer.
1499 (dolist (buffer (buffer-list)) 1495 (dolist (buffer (buffer-list))
1500 (with-current-buffer buffer 1496 (with-current-buffer buffer
1501 (if (and (eq gud-minor-mode 'gdba) 1497 (if (and (memq gud-minor-mode '(gdba gdbmi))
1502 (not (string-match "\\`\\*.+\\*\\'" (buffer-name)))) 1498 (not (string-match "\\`\\*.+\\*\\'" (buffer-name))))
1503 (gdb-remove-breakpoint-icons (point-min) (point-max))))) 1499 (gdb-remove-breakpoint-icons (point-min) (point-max)))))
1504 (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer) 1500 (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer)
@@ -1633,7 +1629,7 @@ static char *magick[] = {
1633(defvar gdb-breakpoints-mode-map 1629(defvar gdb-breakpoints-mode-map
1634 (let ((map (make-sparse-keymap)) 1630 (let ((map (make-sparse-keymap))
1635 (menu (make-sparse-keymap "Breakpoints"))) 1631 (menu (make-sparse-keymap "Breakpoints")))
1636 (define-key menu [quit] '("Quit" . kill-this-buffer)) 1632 (define-key menu [quit] '("Quit" . gdb-delete-frame-or-window))
1637 (define-key menu [goto] '("Goto" . gdb-goto-breakpoint)) 1633 (define-key menu [goto] '("Goto" . gdb-goto-breakpoint))
1638 (define-key menu [delete] '("Delete" . gdb-delete-breakpoint)) 1634 (define-key menu [delete] '("Delete" . gdb-delete-breakpoint))
1639 (define-key menu [toggle] '("Toggle" . gdb-toggle-breakpoint)) 1635 (define-key menu [toggle] '("Toggle" . gdb-toggle-breakpoint))
@@ -1668,15 +1664,15 @@ static char *magick[] = {
1668 'gdb-invalidate-breakpoints 1664 'gdb-invalidate-breakpoints
1669 'gdbmi-invalidate-breakpoints)) 1665 'gdbmi-invalidate-breakpoints))
1670 1666
1667(defconst gdb-breakpoint-regexp
1668 "\\([0-9]+\\).*?\\(?:point\\|catch\\s-+\\S-+\\)\\s-+\\S-+\\s-+\\(.\\)\\s-+")
1669
1671(defun gdb-toggle-breakpoint () 1670(defun gdb-toggle-breakpoint ()
1672 "Enable/disable breakpoint at current line." 1671 "Enable/disable breakpoint at current line."
1673 (interactive) 1672 (interactive)
1674 (save-excursion 1673 (save-excursion
1675 (beginning-of-line 1) 1674 (beginning-of-line 1)
1676 (if (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba) 1675 (if (looking-at gdb-breakpoint-regexp)
1677 (looking-at "\\([0-9]+\\).*?point\\s-+\\S-+\\s-+\\(.\\)\\s-+")
1678 (looking-at
1679 "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+\\(.\\)\\s-+\\S-+\\s-+\\S-+:[0-9]+"))
1680 (gdb-enqueue-input 1676 (gdb-enqueue-input
1681 (list 1677 (list
1682 (concat gdb-server-prefix 1678 (concat gdb-server-prefix
@@ -1690,10 +1686,7 @@ static char *magick[] = {
1690 "Delete the breakpoint at current line." 1686 "Delete the breakpoint at current line."
1691 (interactive) 1687 (interactive)
1692 (beginning-of-line 1) 1688 (beginning-of-line 1)
1693 (if (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba) 1689 (if (looking-at gdb-breakpoint-regexp)
1694 (looking-at "\\([0-9]+\\).*?point\\s-+\\S-+\\s-+\\(.\\)")
1695 (looking-at
1696 "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+\\s-+\\S-+\\s-+\\S-+:[0-9]+"))
1697 (gdb-enqueue-input 1690 (gdb-enqueue-input
1698 (list 1691 (list
1699 (concat gdb-server-prefix "delete " (match-string 1) "\n") 'ignore)) 1692 (concat gdb-server-prefix "delete " (match-string 1) "\n") 'ignore))
@@ -1708,11 +1701,7 @@ static char *magick[] = {
1708 (if window (save-selected-window (select-window window)))) 1701 (if window (save-selected-window (select-window window))))
1709 (save-excursion 1702 (save-excursion
1710 (beginning-of-line 1) 1703 (beginning-of-line 1)
1711 (if (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba) 1704 (if (looking-at "\\([0-9]+\\) .+ in .+ at\\s-+\\(\\S-+\\):\\([0-9]+\\)")
1712 (looking-at "\\([0-9]+\\) .+ in .+ at\\s-+\\(\\S-+\\):\\([0-9]+\\)")
1713 (looking-at
1714 "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+.\\s-+\\S-+\\s-+\
1715\\(\\S-+\\):\\([0-9]+\\)"))
1716 (let ((bptno (match-string 1)) 1705 (let ((bptno (match-string 1))
1717 (file (match-string 2)) 1706 (file (match-string 2))
1718 (line (match-string 3))) 1707 (line (match-string 3)))
@@ -1724,7 +1713,7 @@ static char *magick[] = {
1724 (with-current-buffer buf 1713 (with-current-buffer buf
1725 (goto-line (string-to-number line)) 1714 (goto-line (string-to-number line))
1726 (set-window-point window (point)))))) 1715 (set-window-point window (point))))))
1727 (error "Not recognized as break/watchpoint line")))) 1716 (error "No location specified."))))
1728 1717
1729 1718
1730;; Frames buffer. This displays a perpetually correct bactracktrace 1719;; Frames buffer. This displays a perpetually correct bactracktrace
@@ -2416,11 +2405,10 @@ corresponding to the mode line clicked."
2416 (set (make-local-variable 'font-lock-defaults) 2405 (set (make-local-variable 'font-lock-defaults)
2417 '(gdb-locals-font-lock-keywords)) 2406 '(gdb-locals-font-lock-keywords))
2418 (run-mode-hooks 'gdb-locals-mode-hook) 2407 (run-mode-hooks 'gdb-locals-mode-hook)
2419 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba) 2408 (if (and (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
2420 (if (string-equal gdb-version "pre-6.4") 2409 (string-equal gdb-version "pre-6.4"))
2421 'gdb-invalidate-locals 2410 'gdb-invalidate-locals
2422 'gdb-invalidate-locals-1) 2411 'gdb-invalidate-locals-1))
2423 'gdbmi-invalidate-locals))
2424 2412
2425(defun gdb-locals-buffer-name () 2413(defun gdb-locals-buffer-name ()
2426 (with-current-buffer gud-comint-buffer 2414 (with-current-buffer gud-comint-buffer
@@ -2478,8 +2466,8 @@ corresponding to the mode line clicked."
2478 '("Disassembly" . gdb-display-assembler-buffer)) 2466 '("Disassembly" . gdb-display-assembler-buffer))
2479 (define-key menu [registers] '("Registers" . gdb-display-registers-buffer)) 2467 (define-key menu [registers] '("Registers" . gdb-display-registers-buffer))
2480 (define-key menu [inferior] 2468 (define-key menu [inferior]
2481 '(menu-item "Inferior IO" gdb-display-inferior-io-buffer 2469 '(menu-item "Inferior IO" gdb-display-separate-io-buffer
2482 :enable gdb-use-inferior-io-buffer)) 2470 :enable gdb-use-separate-io-buffer))
2483 (define-key menu [locals] '("Locals" . gdb-display-locals-buffer)) 2471 (define-key menu [locals] '("Locals" . gdb-display-locals-buffer))
2484 (define-key menu [frames] '("Stack" . gdb-display-stack-buffer)) 2472 (define-key menu [frames] '("Stack" . gdb-display-stack-buffer))
2485 (define-key menu [breakpoints] 2473 (define-key menu [breakpoints]
@@ -2495,8 +2483,8 @@ corresponding to the mode line clicked."
2495 (define-key menu [disassembly] '("Disassembiy" . gdb-frame-assembler-buffer)) 2483 (define-key menu [disassembly] '("Disassembiy" . gdb-frame-assembler-buffer))
2496 (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer)) 2484 (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer))
2497 (define-key menu [inferior] 2485 (define-key menu [inferior]
2498 '(menu-item "Inferior IO" gdb-frame-inferior-io-buffer 2486 '(menu-item "Inferior IO" gdb-frame-separate-io-buffer
2499 :enable gdb-use-inferior-io-buffer)) 2487 :enable gdb-use-separate-io-buffer))
2500 (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer)) 2488 (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer))
2501 (define-key menu [frames] '("Stack" . gdb-frame-stack-buffer)) 2489 (define-key menu [frames] '("Stack" . gdb-frame-stack-buffer))
2502 (define-key menu [breakpoints] 2490 (define-key menu [breakpoints]
@@ -2506,11 +2494,11 @@ corresponding to the mode line clicked."
2506 (define-key gud-menu-map [ui] 2494 (define-key gud-menu-map [ui]
2507 `(menu-item (if (eq gud-minor-mode 'gdba) "GDB-UI" "GDB-MI") 2495 `(menu-item (if (eq gud-minor-mode 'gdba) "GDB-UI" "GDB-MI")
2508 ,menu :visible (memq gud-minor-mode '(gdbmi gdba)))) 2496 ,menu :visible (memq gud-minor-mode '(gdbmi gdba))))
2509 (define-key menu [gdb-use-inferior-io] 2497 (define-key menu [gdb-use-separate-io]
2510 '(menu-item "Separate inferior IO" gdb-use-inferior-io-buffer 2498 '(menu-item "Separate inferior IO" gdb-use-separate-io-buffer
2511 :visible (eq gud-minor-mode 'gdba) 2499 :visible (eq gud-minor-mode 'gdba)
2512 :help "Toggle separate IO for inferior." 2500 :help "Toggle separate IO for inferior."
2513 :button (:toggle . gdb-use-inferior-io-buffer))) 2501 :button (:toggle . gdb-use-separate-io-buffer)))
2514 (define-key menu [gdb-many-windows] 2502 (define-key menu [gdb-many-windows]
2515 '(menu-item "Display Other Windows" gdb-many-windows 2503 '(menu-item "Display Other Windows" gdb-many-windows
2516 :help "Toggle display of locals, stack and breakpoint information" 2504 :help "Toggle display of locals, stack and breakpoint information"
@@ -2556,7 +2544,7 @@ corresponding to the mode line clicked."
2556 (if gud-last-last-frame 2544 (if gud-last-last-frame
2557 (gud-find-file (car gud-last-last-frame)) 2545 (gud-find-file (car gud-last-last-frame))
2558 (gud-find-file gdb-main-file))) 2546 (gud-find-file gdb-main-file)))
2559 (when gdb-use-inferior-io-buffer 2547 (when gdb-use-separate-io-buffer
2560 (split-window-horizontally) 2548 (split-window-horizontally)
2561 (other-window 1) 2549 (other-window 1)
2562 (gdb-set-window-buffer 2550 (gdb-set-window-buffer
@@ -2684,11 +2672,12 @@ of the current session."
2684 (if (and (buffer-name gud-comint-buffer) 2672 (if (and (buffer-name gud-comint-buffer)
2685 ;; in case gud or gdb-ui is just loaded 2673 ;; in case gud or gdb-ui is just loaded
2686 gud-comint-buffer 2674 gud-comint-buffer
2687 (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 2675 (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
2688 'gdba)) 2676 '(gdba gdbmi)))
2689 (if (member buffer-file-name gdb-source-file-list) 2677 (if (member buffer-file-name gdb-source-file-list)
2690 (with-current-buffer (find-buffer-visiting buffer-file-name) 2678 (with-current-buffer (find-buffer-visiting buffer-file-name)
2691 (set (make-local-variable 'gud-minor-mode) 'gdba) 2679 (set (make-local-variable 'gud-minor-mode)
2680 (buffer-local-value 'gud-minor-mode gud-comint-buffer))
2692 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map))))) 2681 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)))))
2693 2682
2694;;from put-image 2683;;from put-image
@@ -2967,49 +2956,23 @@ BUFFER nil or omitted means use the current buffer."
2967 (if (re-search-forward " source language \\(\\S-*\\)\." nil t) 2956 (if (re-search-forward " source language \\(\\S-*\\)\." nil t)
2968 (setq gdb-current-language (match-string 1))) 2957 (setq gdb-current-language (match-string 1)))
2969 (gdb-invalidate-assembler)) 2958 (gdb-invalidate-assembler))
2970
2971
2972;; For debugging Emacs only (assumes that usual stack buffer already exists).
2973(defun gdb-xbacktrace ()
2974 "Generate a full lisp level backtrace with arguments."
2975 (interactive)
2976 (setq my-frames nil)
2977 (with-current-buffer (get-buffer-create "xbacktrace")
2978 (erase-buffer))
2979 (let (frame-number gdb-frame-number)
2980 (with-current-buffer (gdb-get-buffer 'gdb-stack-buffer)
2981 (save-excursion
2982 (goto-char (point-min))
2983 (while (search-forward "in Ffuncall " nil t)
2984 (goto-char (line-beginning-position))
2985 (looking-at "^#\\([0-9]+\\)")
2986 (push (match-string-no-properties 1) my-frames)
2987 (forward-line 1))))
2988 (dolist (frame my-frames)
2989 (gdb-enqueue-input (list (concat "server frame " frame "\n")
2990 'ignore))
2991; (gdb-enqueue-input (list "server ppargs\n" 'gdb-get-arguments))
2992 (gud-basic-call "server ppargs")
2993)
2994 (gdb-enqueue-input (list (concat "server frame " frame-number "\n")
2995 'ignore))))
2996
2997(defun gdb-get-arguments ()
2998 (with-current-buffer "xbacktrace"
2999 (insert-buffer-substring (gdb-get-buffer 'gdb-partial-output-buffer))))
3000 2959
2960
3001;; Code specific to GDB 6.4 2961;; Code specific to GDB 6.4
3002(defconst gdb-source-file-regexp-1 "fullname=\"\\(.*?\\)\"") 2962(defconst gdb-source-file-regexp-1 "fullname=\"\\(.*?\\)\"")
3003 2963
3004(defun gdb-set-gud-minor-mode-existing-buffers-1 () 2964(defun gdb-set-gud-minor-mode-existing-buffers-1 ()
3005 "Create list of source files for current GDB session." 2965 "Create list of source files for current GDB session.
2966If buffers already exist for any of these files, gud-minor-mode
2967is set in them."
3006 (goto-char (point-min)) 2968 (goto-char (point-min))
3007 (while (re-search-forward gdb-source-file-regexp-1 nil t) 2969 (while (re-search-forward gdb-source-file-regexp-1 nil t)
3008 (push (match-string 1) gdb-source-file-list)) 2970 (push (match-string 1) gdb-source-file-list))
3009 (dolist (buffer (buffer-list)) 2971 (dolist (buffer (buffer-list))
3010 (with-current-buffer buffer 2972 (with-current-buffer buffer
3011 (when (member buffer-file-name gdb-source-file-list) 2973 (when (member buffer-file-name gdb-source-file-list)
3012 (set (make-local-variable 'gud-minor-mode) 'gdba) 2974 (set (make-local-variable 'gud-minor-mode)
2975 (buffer-local-value 'gud-minor-mode gud-comint-buffer))
3013 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) 2976 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
3014 (when gud-tooltip-mode 2977 (when gud-tooltip-mode
3015 (make-local-variable 'gdb-define-alist) 2978 (make-local-variable 'gdb-define-alist)
@@ -3019,12 +2982,12 @@ BUFFER nil or omitted means use the current buffer."
3019; Uses "-var-list-children --all-values". Needs GDB 6.1 onwards. 2982; Uses "-var-list-children --all-values". Needs GDB 6.1 onwards.
3020(defun gdb-var-list-children-1 (varnum) 2983(defun gdb-var-list-children-1 (varnum)
3021 (gdb-enqueue-input 2984 (gdb-enqueue-input
3022 (list (concat "server interpreter mi \"-var-update " varnum "\"\n") 2985 (list
3023 'ignore)) 2986 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3024 (gdb-enqueue-input 2987 (concat "server interpreter mi \"-var-list-children --all-values "
3025 (list (concat "server interpreter mi \"-var-list-children --all-values " 2988 varnum "\"\n")
3026 varnum "\"\n") 2989 (concat "-var-list-children --all-values " varnum "\n"))
3027 `(lambda () (gdb-var-list-children-handler-1 ,varnum))))) 2990 `(lambda () (gdb-var-list-children-handler-1 ,varnum)))))
3028 2991
3029(defconst gdb-var-list-children-regexp-1 2992(defconst gdb-var-list-children-regexp-1
3030 "name=\"\\(.+?\\)\",exp=\"\\(.+?\\)\",numchild=\"\\(.+?\\)\",\ 2993 "name=\"\\(.+?\\)\",exp=\"\\(.+?\\)\",numchild=\"\\(.+?\\)\",\
@@ -3059,10 +3022,10 @@ value=\\(\".*?\"\\),type=\"\\(.+?\\)\"}")
3059 (progn 3022 (progn
3060 (gdb-enqueue-input 3023 (gdb-enqueue-input
3061 (list 3024 (list
3062 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) 3025 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3063 "server interpreter mi \"-var-update --all-values *\"\n" 3026 "server interpreter mi \"-var-update --all-values *\"\n"
3064 "-var-update --all-values *\n") 3027 "-var-update --all-values *\n")
3065 'gdb-var-update-handler-1)) 3028 'gdb-var-update-handler-1))
3066 (push 'gdb-var-update gdb-pending-triggers)))) 3029 (push 'gdb-var-update gdb-pending-triggers))))
3067 3030
3068(defconst gdb-var-update-regexp-1 "name=\"\\(.*?\\)\",value=\\(\".*?\"\\),") 3031(defconst gdb-var-update-regexp-1 "name=\"\\(.*?\\)\",value=\\(\".*?\"\\),")
@@ -3098,7 +3061,7 @@ value=\\(\".*?\"\\),type=\"\\(.+?\\)\"}")
3098 3061
3099(def-gdb-auto-update-trigger gdb-invalidate-registers-1 3062(def-gdb-auto-update-trigger gdb-invalidate-registers-1
3100 (gdb-get-buffer 'gdb-registers-buffer) 3063 (gdb-get-buffer 'gdb-registers-buffer)
3101 (if (eq gud-minor-mode 'gdba) 3064 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3102 "server interpreter mi \"-data-list-register-values x\"\n" 3065 "server interpreter mi \"-data-list-register-values x\"\n"
3103 "-data-list-register-values x\n") 3066 "-data-list-register-values x\n")
3104 gdb-data-list-register-values-handler) 3067 gdb-data-list-register-values-handler)
@@ -3157,14 +3120,15 @@ value=\\(\".*?\"\\),type=\"\\(.+?\\)\"}")
3157 3120
3158;; Needs GDB 6.4 onwards (used to fail with no stack). 3121;; Needs GDB 6.4 onwards (used to fail with no stack).
3159(defun gdb-get-changed-registers () 3122(defun gdb-get-changed-registers ()
3160 (if (not (member 'gdb-get-changed-registers gdb-pending-triggers)) 3123 (if (and (gdb-get-buffer 'gdb-registers-buffer)
3124 (not (member 'gdb-get-changed-registers gdb-pending-triggers)))
3161 (progn 3125 (progn
3162 (gdb-enqueue-input 3126 (gdb-enqueue-input
3163 (list 3127 (list
3164 (if (eq gud-minor-mode 'gdba) 3128 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3165 "server interpreter mi -data-list-changed-registers\n" 3129 "server interpreter mi -data-list-changed-registers\n"
3166 "-data-list-changed-registers\n") 3130 "-data-list-changed-registers\n")
3167 'gdb-get-changed-registers-handler)) 3131 'gdb-get-changed-registers-handler))
3168 (push 'gdb-get-changed-registers gdb-pending-triggers)))) 3132 (push 'gdb-get-changed-registers gdb-pending-triggers))))
3169 3133
3170(defconst gdb-data-list-register-names-regexp "\"\\(.*?\\)\"") 3134(defconst gdb-data-list-register-names-regexp "\"\\(.*?\\)\"")
@@ -3187,7 +3151,9 @@ value=\\(\".*?\"\\),type=\"\\(.+?\\)\"}")
3187 3151
3188(def-gdb-auto-update-trigger gdb-invalidate-locals-1 3152(def-gdb-auto-update-trigger gdb-invalidate-locals-1
3189 (gdb-get-buffer 'gdb-locals-buffer) 3153 (gdb-get-buffer 'gdb-locals-buffer)
3190 "server interpreter mi -\"stack-list-locals --simple-values\"\n" 3154 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3155 "server interpreter mi -\"stack-list-locals --simple-values\"\n"
3156 "-stack-list-locals --simple-values\n")
3191 gdb-stack-list-locals-handler) 3157 gdb-stack-list-locals-handler)
3192 3158
3193(defconst gdb-stack-list-locals-regexp 3159(defconst gdb-stack-list-locals-regexp
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index b927c765476..1d5172a1a52 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -656,8 +656,13 @@ required by the caller."
656;;;###autoload 656;;;###autoload
657(defun gdb (command-line) 657(defun gdb (command-line)
658 "Run gdb on program FILE in buffer *gud-FILE*. 658 "Run gdb on program FILE in buffer *gud-FILE*.
659The directory containing FILE becomes the initial working directory 659The directory containing FILE becomes the initial working
660and source-file directory for your debugger." 660directory and source-file directory for your debugger. By
661default this command starts GDB using a graphical interface. See
662`gdba' for more information.
663
664To run GDB in text command mode, set `gud-gdb-command-name' to
665\"gdb --fullname\" and include the pathname, if necessary."
661 (interactive (list (gud-query-cmdline 'gdb))) 666 (interactive (list (gud-query-cmdline 'gdb)))
662 667
663 (if (and gud-comint-buffer 668 (if (and gud-comint-buffer
@@ -3120,7 +3125,7 @@ class of the file (using s to separate nested class ids)."
3120(defvar gdb-script-font-lock-keywords 3125(defvar gdb-script-font-lock-keywords
3121 '(("^define\\s-+\\(\\(\\w\\|\\s_\\)+\\)" (1 font-lock-function-name-face)) 3126 '(("^define\\s-+\\(\\(\\w\\|\\s_\\)+\\)" (1 font-lock-function-name-face))
3122 ("\\$\\(\\w+\\)" (1 font-lock-variable-name-face)) 3127 ("\\$\\(\\w+\\)" (1 font-lock-variable-name-face))
3123 ("^\\s-*\\([a-z]+\\)" (1 font-lock-keyword-face)))) 3128 ("^\\s-*\\(\\(\\w\\|\\s_\\)+\\)" (1 font-lock-keyword-face))))
3124 3129
3125;; FIXME: The keyword "end" associated with "document" 3130;; FIXME: The keyword "end" associated with "document"
3126;; should have font-lock-keyword-face (currently font-lock-doc-face). 3131;; should have font-lock-keyword-face (currently font-lock-doc-face).
diff --git a/lisp/simple.el b/lisp/simple.el
index b8f01680a81..fb933077b06 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -4328,7 +4328,9 @@ If nil, search stops at the beginning of the accessible portion of the buffer."
4328 :group 'paren-blinking) 4328 :group 'paren-blinking)
4329 4329
4330(defcustom blink-matching-paren-dont-ignore-comments nil 4330(defcustom blink-matching-paren-dont-ignore-comments nil
4331 "*Non-nil means `blink-matching-paren' will not ignore comments." 4331 "*nil means `blink-matching-paren' ignores comments.
4332More precisely, when looking for the matching parenthesis,
4333it skips the contents of comments that end before point."
4332 :type 'boolean 4334 :type 'boolean
4333 :group 'paren-blinking) 4335 :group 'paren-blinking)
4334 4336
diff --git a/lisp/subr.el b/lisp/subr.el
index 3aad35d05e8..15ac6b0e363 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -561,8 +561,10 @@ In other words, OLDDEF is replaced with NEWDEF where ever it appears.
561Alternatively, if optional fourth argument OLDMAP is specified, we redefine 561Alternatively, if optional fourth argument OLDMAP is specified, we redefine
562in KEYMAP as NEWDEF those keys which are defined as OLDDEF in OLDMAP. 562in KEYMAP as NEWDEF those keys which are defined as OLDDEF in OLDMAP.
563 563
564For most uses, it is simpler and safer to use command remapping like this: 564If you don't specify OLDMAP, you can usually get the same results
565 \(define-key KEYMAP [remap OLDDEF] NEWDEF)" 565in a cleaner way with command remapping, like this:
566 \(define-key KEYMAP [remap OLDDEF] NEWDEF)
567\n(fn OLDDEF NEWDEF KEYMAP &optional OLDMAP)"
566 ;; Don't document PREFIX in the doc string because we don't want to 568 ;; Don't document PREFIX in the doc string because we don't want to
567 ;; advertise it. It's meant for recursive calls only. Here's its 569 ;; advertise it. It's meant for recursive calls only. Here's its
568 ;; meaning 570 ;; meaning
diff --git a/lisp/tumme.el b/lisp/tumme.el
index 8f75da24ca2..6cec3e73a16 100644
--- a/lisp/tumme.el
+++ b/lisp/tumme.el
@@ -135,390 +135,9 @@
135;; backup of `tumme-db-file' when testing new versions. 135;; backup of `tumme-db-file' when testing new versions.
136;; 136;;
137;; 137;;
138;;; History:
139;; ========
140;;
141;; Version 0.1, 2005-04-16
142;;
143;; * First release, only browsing support for now.
144;;
145;; Version 0.2, 2005-04-21
146;;
147;; * Changed calls to dired-filename-at-point to dired-get-filename
148;;
149;; Version 0.3, 2005-04-25
150;;
151;; Quite a lot of changes:
152;;
153;; * Added basic image tagging support. No commands that make use of
154;; it yet.
155;;
156;; * Added text properties for the thumbnail images to be able to
157;; track where they came from originally. Used in `tumme-mode'.
158;;
159;; * Added `tumme-mode' to be used when navigating the thumbnail
160;; buffer. Currently, there are commands to mark, unmark, flag and
161;; jump to the original file in associated dired buffer.
162;;
163;; * When moving around in the thumbnail buffer (in `tumme-mode'), the
164;; user can turn on tracking of the movements and let them be
165;; mirrored in the associated dired buffer.
166;;
167;; * In this version I have been looking at some ideas in thumbs.el,
168;; for example the image margin and relief and the `thumbs-mode'
169;; which I copied and made the `tumme-mode' from.
170;;
171;; Version 0.4, 2005-05-02
172;;
173;; * Renamed the functions that are to be used in `tumme-mode' in the
174;; thumbnail buffer.
175;;
176;; * The mark, unmark and flag commands in `tumme-mode' now also moves
177;; to next thumbnail, like how dired normally works.
178;;
179;; * Added `tumme-mode-line-up', `tumme-display-thumbs-append' and
180;; `tumme-mode-delete-char'.
181;;
182;; * Each thumbnail's tags is now displayed when navigating among the
183;; thumbnails in the thumbnail buffer.
184;;
185;; * Added simple slideshow functionality.
186;;
187;; Version 0.4.1, 2005-05-05
188;;
189;; * Fixed bug in `tumme-flag-thumb-original-file'
190;;
191;; * Added commands to display original image in external viewer
192;; (`tumme-display-external') and in a Emacs buffer
193;; (`tumme-display-image').
194;;
195;; * Minor code clean-up
196;;
197;; * Renamed some functions back again...
198;;
199;; * Added rotation of thumbnail images (90 degrees left and right)
200;;
201;; Version 0.4.2, 2005-05-06
202;;
203;; * Removed need for `tumme-display-image-size' in
204;; `tumme-display-image'. Now, the maximum image size that fits in
205;; `tumme-display-buffer' is calculated automatically. Introduced
206;; two correction variables, `tumme-display-window-width-correction'
207;; and `tumme-display-window-height-correction' to be used to
208;; correct width and height depending on width and height of window
209;; decorations, fringes etc. This works really well!
210;;
211;; Version 0.4.3, 2005-05-07
212;;
213;; * Added menus to `dired-mode' and `tumme-mode'
214;;
215;; * Added `tumme-mark-and-display-next'
216;;
217;; * Added `tumme-jump-thumbnail-buffer'
218;;
219;; * Bound TAB in `dired-mode-map' and `tumme-mode-map' to
220;; `tumme-jump-thumbnail-buffer' and
221;; `tumme-jump-original-dired-buffer', respectively.
222;;
223;; * Changed `tumme-display-image' to be more general. Now, it can be
224;; used from both thumbnail buffer and dired buffer by calling
225;; `tumme-display-thumbnail-original-image' and
226;; `tumme-display-dired-image', respectively.
227;;
228;; Version 0.4.4, 2005-05-10
229;;
230;; * Added `tumme-get-exif-file-name' and
231;; `tumme-copy-with-exif-file-name'. These commands might not be
232;; useful for all people because they are very specific. See the
233;; documentation for each function for more information.
234;;
235;; * Added `tumme-display-next-thumbnail-original' and
236;; `tumme-display-previous-thumbnail-original' to be used for easy
237;; image browsing in thumbnail buffer.
238;;
239;; * Added support for comments. New function
240;; `tumme-comment-thumbnail' added, to be used in thumbnail buffer.
241;;
242;; * Added `tumme-mark-tagged-files'. Use it in dired buffer to mark
243;; tagged files.
244;;
245;; * Added `mouse-face' property `highlight' for mouse highlighting
246;; and had to add a space between each thumbnail to avoid whole rows
247;; to be highlighted. Doing this meant that I had to update
248;; `tumme-line-up' too...
249;;
250;; * Added `tumme-mouse-display-image'. Use mouse-2 to display image
251;; thumbnail when is highlighted.
252;;
253;; * As suggested by Ehud Karni on gnu.emacs.help, changed
254;; `tumme-window-DIMENSION-pixels' to use `frame-char-DIMENSION'
255;; instead of `frame-pixel-DIMENSION'. Feels better
256;;
257;; * Corrected a bug in `tumme-window-height-pixels'. I did not know
258;; that the mode-line consumed one line. Also, after experimenting, it
259;; seems that the only correction needed for the image display width
260;; is one single pixel. I left the corection variables in there, just
261;; in case someone has a system that differs.
262;;
263;; Version 0.4.5, 2005-05-19
264;;
265;; * Added `tumme-line-up-dynamic' that calculates the number of
266;; thumbnails that will fit in the thumbnail buffer's window and
267;; `tumme-line-up-interactive' that asks the user.
268;;
269;; * Changed `tumme-display-thumbs' to call one of the `tumme-line-up'
270;; functions instead of doing the line-up itself.
271;;
272;; * Finally! Added experimental gallery creation. See customizable
273;; variables `tumme-gallery-dir', `tumme-gallery-image-root-url' and
274;; `tumme-gallery-thumb-image-root-url' and new command
275;; `tumme-gallery-generate'. Not beatiful, but it works quite
276;; well. Probably needs some CSS-stuff in it eventually. Also, I'm not
277;; sure this is the way I want to generate my image galleries in the
278;; future. After all, static pages cannot do what dynamic pages using
279;; PHP et al can do. Serves like a proof-of-concept of the tagging
280;; though.
281;;
282;; * Added option to hide images with certain tags. See
283;; `tumme-gallery-hidden-tags'.
284;;
285;; * Added `tumme-tag-thumbnail' for tagging files from thumbnail
286;; buffer.
287;;
288;; * Added `tumme-tag-remove' and `tumme-tag-thumbnail-remove' so that
289;; you can remove tags. Sorry if I have kept you waiting for
290;; this... :)
291;;
292;; * Added option `tumme-append-when-browsing' and new command
293;; `tumme-toggle-append-browsing'.
294;;
295;; Version 0.4.6, 2005-05-21
296;;
297;; * Changed `tumme-thumb-name' to always use ".jpg" as file extension
298;; for thumbnail files, instead of using the extension from the
299;; original file's name. This was a very easy way to open up for
300;; allowing browsing of all image file types that Emacs support,
301;; assuming ImageMagick supports it too.
302;;
303;; * Fixed bug in `tumme-create-thumb' `tumme-rotate-thumbnail' and
304;; `tumme-display-image' by adding quotes around the file names. The
305;; conversion failed if the file name, or path, contained a
306;; space. Also expanded the file name, as convert (or is it bash?)
307;; does not work as expected for paths like "~/.tumme...".
308;;
309;; * Fixed another "space bug" :) in `tumme-display-external'.
310;;
311;; * In call to convert, added "jpeg:" in front of the output file
312;; name, so that all generated files becomes JPEG files. For now, only
313;; useful if `tumme-temp-image-file' does not end in .jpg.
314;;
315;; Version 0.4.7, 2005-05-26
316;;
317;; * Change header line of tumme.el so that it does not wrap and cause
318;; evaluation problems for people getting the source from Usenet.
319;;
320;; * Changed `tumme-write-tag' slightly to get better performance when
321;; tagging many files.
322;;
323;; * Fixed bug in `tumme-create-gallery-lists' that made it puke if
324;; there was empty lines in the database. Changed the code so that it
325;; does not car about that. Also, fixed `tumme-remove-tag' so that it
326;; tries not to add empty lines at the end of the database.
327;;
328;; * Changed all commands that execute shell commands to be
329;; configurable using the `tumme-cmd-x' custom variables. This makes
330;; it easier to switch among different image conversion tools which
331;; might use different syntax and options.
332;;
333;; * Added `tumme-toggle-dired-display-properties'.
334;;
335;; * Added `tumme-thumb-file-name-format' and changed
336;; `tumme-thumb-name' to make it possible to configure the format of
337;; thumbnail files. Did not make it customizable yet though. It might
338;; be a bad idea to be able to switch between formats...
339;;
340;; * Changed `tumme-display-window' so that it looks for tumme's
341;; display window in all frames. Useful if you want to create an own
342;; frame for displaying the temporary image.
343;;
344;; * After changing the call to `get-window-with-predicate' to scan
345;; all frames for tumme's special buffers in visible windows, and also
346;; changing the way tumme tracks thumbnail movement in the dired
347;; buffer (now using `set-buffer' together with `set-window-point'),
348;; tumme now works quite happily with all three buffers in different
349;; frames. This empowers the user to setup the special buffers the way
350;; that best fits his need at the time. Jumping between dired and
351;; `tumme-thumbnail-buffer' work independent on in which frames they
352;; are.
353;;
354;; * Renamed `tumme-track-movement-in-dired' to
355;; `tumme-toggle-movement-tracking'.
356;;
357;; * Added `tumme-track-thumbnail' for movement tracking from dired
358;; buffer, analoguous to the tracking done in thumbnail buffer. Both
359;; uses the same custom variable `tumme-track-movement' which can be
360;; toggled on and off with `tumme-toggle-movement-tracking'. This is
361;; neat. :) Changed `tumme-setup-dired-keybindings' to make use of
362;; this in the best way. Read more about this there.
363;;
364;; Version 0.4.8, 2005-06-05
365;;
366;; * Changed `tumme-display-dired-image' and
367;; `tumme-display-thumbnail-original-image' so that when called with a
368;; prefix argument, the image is not resized in the display
369;; buffer. This will be useful for later additions of image
370;; manipulation commands.
371;;
372;; * Added `tumme-kill-buffer-and-window' to make it easy to kill the
373;; tumme buffers.
374;;
375;; * Renamed `tumme-mode' to `tumme-thumbnail-mode'.
376;;
377;; * `tumme-tag-thumbnail' and `tumme-tag-thumbnail-remove' now
378;; updates the tags property for the thumbnail.
379;;
380;; * Added `tumme-dired-display-external' to display images in
381;; external viewer from dired buffer.
382;;
383;; * Added support for multiple files in `tumme-remove-tag' to
384;; increase performance.
385;;
386;; * Added `tumme-display-image-mode' so that we can add image
387;; manipulation commands there.
388;;
389;; * Added call to `tumme-display-thumb-properties' in
390;; `tumme-track-thumbnail'.
391;;
392;; * Added command `tumme-display-current-image-in-full-size' to be
393;; used in `tumme-display-image-mode'.
394;;
395;; * Changed `tumme-display-image' to call
396;; `tumme-create-display-image-buffer' so that we are sure that
397;; `tumme-display-image-buffer' is always available.
398;;
399;; * Added optional prefix argument to `tumme-dired-folder' that tells
400;; it to skip the window splitting and just creates the needed
401;; buffers.
402;;
403;; * Fixed bug somewhere that relied on `tumme-dired-folder' having
404;; created the `tumme-display-image-buffer'. Now `tumme-dired-folder'
405;; *should* not be necessary to call at all, just convenient.
406;;
407;; * Added tracking to `tumme-mouse-display-image'.
408;;
409;; * Added `tumme-mouse-select-thumbnail' and bound mouse-1 to it, so
410;; that selecting a thumbnail will track the original file.
411;;
412;; * Added three new custom variables, `tumme-cmd-ACTION-program' to
413;; make the command options cleaner and easier to read.
414;;
415;; * Added `tumme-display-properties-format' and
416;; `tumme-format-properties-string' to make it possible to configure
417;; the display format of the image file's properties.
418;;
419;; * Added missing (require 'format-spec)
420;;
421;; Version 0.4.9, 2005-09-25
422;;
423;; * Fixed bug in `tumme-display-thumbs'. If a thumbnail file could
424;; not be created for some reason (bad file for example), even if
425;; several other thumbnails was created sucessfully, the code
426;; generated an error and never continued doing the line-up.
427;;
428;; * Made tumme.el pass the M-x checkdoc test, phew!
429;;
430;; * Added `tumme-rotate-original', `tumme-rotate-original-left' and
431;; `tumme-rotate-original-right' to rotate the original image from
432;; thumbnail view. By default it uses JpegTRAN to rotate the images
433;; non-lossy. Only works on JPEG images. The two new commands were
434;; added to thumbnail mode. Thanks to Colin Marquardt who told me
435;; about the "-copy all" option to jpegtran.
436;;
437;; * Added the functions `tumme-get-exif-data' and
438;; `tumme-set-exif-data' for reading and writing EXIF data to image files.
439;;
440;; * Rewrote `tumme-get-exif-file-name': now uses
441;; `tumme-get-exif-data'. Slight change to replace spaces with
442;; underscores (tt seems not all cameras use the exact same format for
443;; DateTimeOriginal). Added code for handling files that has no
444;; EXIF-data (use file's timestamp instead).
445;;
446;; * Changed from using the exif program to exiftool because exiftool
447;; also handles writing of EXIF data, which is very useful.
448;;
449;; * Added the command `tumme-thumbnail-set-image-description' that
450;; can be used to set the EXIF tag ImageDescription. Thanks to Colin
451;; Marquardt for the suggestion.
452;;
453;; * Added `tumme-toggle-mark-thumb-original-file' and
454;; `tumme-mouse-toggle-mark' and changed
455;; `tumme-modify-mark-on-thumb-original-file' to support toggling of
456;; mark of original image file in dired, from
457;; `tumme-thumbnail-mode'. Bound C-down-mouse-1
458;; `tumme-mouse-toggle-mark' to in `tumme-thumbnail-mode'.
459;;
460;; * Changed `tumme-mouse-select-thumbnail' to also display properties
461;; after the file is selected.
462;;
463;; Version 0.4.10, 2005-11-07
464;;
465;; * Renamed `tumme-dired-folder' to `tumme-dired'.
466;;
467;; * Changed format of the database file slightly, now the full path
468;; and file name is used. Had to change most of the tag functions
469;; (writing, reading, searching) slightly to cope with the change. If
470;; you are an old tumme user, you have to update your database
471;; manually, probably you only need to prefix all rows with a
472;; directory name to get the full path and file name.
473;;
474;; * Removed `tumme-thumb-file-name-format'. Added
475;; `tumme-thumbnail-storage' and changed `tumme-thumb-name' to provide
476;; two different thumbnail storage schemes. It is no longer necessary
477;; to have unique image file names to use tumme fully.
478;;
479;; * As a consequence of the above, gallery generation is currently
480;; not supported if per-directory thumbnail file storage is used.
481;;
482;; * Changed parameters to `tumme-create-thumb'.
483;;
484;; * To be included in Emacs 22.
485;;
486;;
487;; Version 0.4.11, 2006-MM-DD
488;;
489;; * Changed `tumme-display-thumbs' so that it calls `display-buffer'
490;; after generating the thumbnails and changed
491;; `tumme-display-thumbnail-original-image' to display the image
492;; buffer. These small changes should make it easier for a user to
493;; start using tumme.
494;;
495;; * Added `tumme-show-all-from-dir' to mimic thumbs.el's easy-to-use
496;; `thumbs' command. A new customize option,
497;; `tumme-show-all-from-dir-max-files' was added too.
498;;
499;; * Renamed `tumme-dired' to `tumme-dired-with-window-configuration'
500;; and added code to save the window configuration before messing it
501;; up. The saved window configuration can be restored using the new
502;; command `tumme-restore-window-configuration'.
503;;
504;; * Added `tumme-get-thumbnail-image', created by Chong Yidong. His
505;; own comments: ..., that just takes the original filename and
506;; returns a thumbnail image descriptor. Then third-party libraries
507;; won't have to muck around with tumme.el's internal functions like
508;; `thumme-thumb-name', `tumme-create-thumb', etc. His code to get
509;; speedbar display tumme thumbnails, might be integrated soon.
510;;
511;; * Changed the default value of `tumme-dir' to "~/.emacs.d/tumme"
512;; and added a new function, `tumme-dir' to handle the creating of
513;; it. Code copied from thumbs.el.
514;;
515;;
516;; TODO 138;; TODO
517;; ==== 139;; ====
518;; 140;;
519;; * Look into supporting the Thumbnail Managing Standard, maybe as a
520;; configurable option.
521;;
522;; * Support gallery creation when using per-directory thumbnail 141;; * Support gallery creation when using per-directory thumbnail
523;; storage. 142;; storage.
524;; 143;;
@@ -579,7 +198,7 @@
579(defgroup tumme nil 198(defgroup tumme nil
580 "Use dired to browse your images as thumbnails, and more." 199 "Use dired to browse your images as thumbnails, and more."
581 :prefix "tumme-" 200 :prefix "tumme-"
582 :group 'files) 201 :group 'multimedia)
583 202
584(defcustom tumme-dir "~/.emacs.d/tumme/" 203(defcustom tumme-dir "~/.emacs.d/tumme/"
585 "*Directory where thumbnail images are stored." 204 "*Directory where thumbnail images are stored."
@@ -592,8 +211,12 @@ Tumme can store thumbnail files in one of two ways and this is
592controlled by this variable. \"Use tumme dir\" means that the 211controlled by this variable. \"Use tumme dir\" means that the
593thumbnails are stored in a central directory. \"Per directory\" 212thumbnails are stored in a central directory. \"Per directory\"
594means that each thumbnail is stored in a subdirectory called 213means that each thumbnail is stored in a subdirectory called
595\".tumme\" in the same directory where the image file is." 214\".tumme\" in the same directory where the image file is.
215\"Thumbnail Managing Standard\" means that the thumbnails are
216stored and generated according to the Thumbnail Managing Standard
217that allows sharing of thumbnails across different programs."
596 :type '(choice :tag "How to store thumbnail files" 218 :type '(choice :tag "How to store thumbnail files"
219 (const :tag "Thumbnail Managing Standard" standard)
597 (const :tag "Use tumme-dir" use-tumme-dir) 220 (const :tag "Use tumme-dir" use-tumme-dir)
598 (const :tag "Per-directory" per-directory)) 221 (const :tag "Per-directory" per-directory))
599 :group 'tumme) 222 :group 'tumme)
@@ -639,13 +262,13 @@ Used together with `tumme-cmd-create-thumbnail-options'."
639 :group 'tumme) 262 :group 'tumme)
640 263
641(defcustom tumme-cmd-create-thumbnail-options 264(defcustom tumme-cmd-create-thumbnail-options
642 "%p -size %sx%s \"%f\" -resize %sx%s +profile \"*\" jpeg:\"%t\"" 265 "%p -size %wx%h \"%f\" -resize %wx%h +profile \"*\" jpeg:\"%t\""
643 "*Format of command used to create thumbnail image. 266 "*Format of command used to create thumbnail image.
644Available options are %p which is replaced by 267Available options are %p which is replaced by
645`tumme-cmd-create-thumbnail-program', %s which is replaced by 268`tumme-cmd-create-thumbnail-program', %w which is replaced by
646`tumme-thumb-size', %f which is replaced by the file name of the 269`tumme-thumb-width', %h which is replaced by `tumme-thumb-height',
647original image and %t which is replaced by the file name of the 270%f which is replaced by the file name of the original image and %t
648thumbnail file." 271which is replaced by the file name of the thumbnail file."
649 :type 'string 272 :type 'string
650 :group 'tumme) 273 :group 'tumme)
651 274
@@ -657,16 +280,64 @@ Used together with `tumme-cmd-create-temp-image-options'."
657 :group 'tumme) 280 :group 'tumme)
658 281
659(defcustom tumme-cmd-create-temp-image-options 282(defcustom tumme-cmd-create-temp-image-options
660 "%p -size %xx%y \"%f\" -resize %xx%y +profile \"*\" jpeg:\"%t\"" 283 "%p -size %wx%h \"%f\" -resize %wx%h +profile \"*\" jpeg:\"%t\""
661 "*Format of command used to create temporary image for display window. 284 "*Format of command used to create temporary image for display window.
662Available options are %p which is replaced by 285Available options are %p which is replaced by
663`tumme-cmd-create-temp-image-program', %x and %y which is replaced by 286`tumme-cmd-create-temp-image-program', %w and %h which is replaced by
664the calculated max size for x and y in the image display window, %f 287the calculated max size for width and height in the image display window,
665which is replaced by the file name of the original image and %t which 288%f which is replaced by the file name of the original image and %t which
666is replaced by the file name of the temporary file." 289is replaced by the file name of the temporary file."
667 :type 'string 290 :type 'string
668 :group 'tumme) 291 :group 'tumme)
669 292
293(defcustom tumme-cmd-pngnq-program (executable-find "pngnq")
294 "*The file name of the `pngnq' program.
295It quantizes colors of PNG images down to 256 colors."
296 :type '(choice (const :tag "Not Set" nil) string)
297 :group 'tumme)
298
299(defcustom tumme-cmd-pngcrush-program (executable-find "pngcrush")
300 "*The file name of the `pngcrush' program.
301It optimizes the compression of PNG images. Also it adds PNG textual chunks
302with the information required by the Thumbnail Managing Standard."
303 :type '(choice (const :tag "Not Set" nil) string)
304 :group 'tumme)
305
306(defcustom tumme-cmd-create-standard-thumbnail-command
307 (concat
308 tumme-cmd-create-thumbnail-program " "
309 "-size %wx%h \"%f\" "
310 (unless (or tumme-cmd-pngcrush-program tumme-cmd-pngnq-program)
311 (concat
312 "-set \"Thumb::MTime\" \"%m\" "
313 "-set \"Thumb::URI\" \"file://%f\" "
314 "-set \"Description\" \"Thumbnail of file://%f\" "
315 "-set \"Software\" \"" (emacs-version) "\" "))
316 "-thumbnail %wx%h png:\"%t\""
317 (if tumme-cmd-pngnq-program
318 (concat
319 " ; " tumme-cmd-pngnq-program " -f \"%t\""
320 (unless tumme-cmd-pngcrush-program
321 " ; mv %q %t")))
322 (if tumme-cmd-pngcrush-program
323 (concat
324 (unless tumme-cmd-pngcrush-program
325 " ; cp %t %q")
326 " ; " tumme-cmd-pngcrush-program " -q "
327 "-text b \"Description\" \"Thumbnail of file://%f\" "
328 "-text b \"Software\" \"" (emacs-version) "\" "
329 ;; "-text b \"Thumb::Image::Height\" \"%oh\" "
330 ;; "-text b \"Thumb::Image::Mimetype\" \"%mime\" "
331 ;; "-text b \"Thumb::Image::Width\" \"%ow\" "
332 "-text b \"Thumb::MTime\" \"%m\" "
333 ;; "-text b \"Thumb::Size\" \"%b\" "
334 "-text b \"Thumb::URI\" \"file://%f\" "
335 "%q %t"
336 " ; rm %q")))
337 "*Command to create thumbnails according to the Thumbnail Managing Standard."
338 :type 'string
339 :group 'tumme)
340
670(defcustom tumme-cmd-rotate-thumbnail-program 341(defcustom tumme-cmd-rotate-thumbnail-program
671 "mogrify" 342 "mogrify"
672 "*Executable used to rotate thumbnail. 343 "*Executable used to rotate thumbnail.
@@ -757,8 +428,19 @@ Used by `tumme-gallery-generate' to leave out \"hidden\" images."
757 :type '(repeat string) 428 :type '(repeat string)
758 :group 'tumme) 429 :group 'tumme)
759 430
760(defcustom tumme-thumb-size 100 431(defcustom tumme-thumb-size (if (eq 'standard tumme-thumbnail-storage) 128 100)
761 "Size of thumbnails, in pixels." 432 "Size of thumbnails, in pixels.
433This is the default size for both `tumme-thumb-width' and `tumme-thumb-height'."
434 :type 'integer
435 :group 'tumme)
436
437(defcustom tumme-thumb-width tumme-thumb-size
438 "Width of thumbnails, in pixels."
439 :type 'integer
440 :group 'tumme)
441
442(defcustom tumme-thumb-height tumme-thumb-size
443 "Height of thumbnails, in pixels."
762 :type 'integer 444 :type 'integer
763 :group 'tumme) 445 :group 'tumme)
764 446
@@ -841,7 +523,11 @@ with the comment."
841 :type 'string 523 :type 'string
842 :group 'tumme) 524 :group 'tumme)
843 525
844(defcustom tumme-external-viewer "qiv -t" 526(defcustom tumme-external-viewer
527 ;; TODO: use mailcap, dired-guess-shell-alist-default, dired-view-command-alist
528 (cond ((executable-find "display"))
529 ((executable-find "xli"))
530 ((executable-find "qiv") "qiv -t"))
845 "*Name of external viewer. 531 "*Name of external viewer.
846Including parameters. Used when displaying original image from 532Including parameters. Used when displaying original image from
847`tumme-thumbnail-mode'." 533`tumme-thumbnail-mode'."
@@ -888,8 +574,11 @@ Create the thumbnails directory if it does not exist."
888 (<= (float-time (nth 5 (file-attributes file))) 574 (<= (float-time (nth 5 (file-attributes file)))
889 (float-time (nth 5 (file-attributes thumb-file))))) 575 (float-time (nth 5 (file-attributes thumb-file)))))
890 (tumme-create-thumb file thumb-file)) 576 (tumme-create-thumb file thumb-file))
891 (list 'image :type 'jpeg :file thumb-file 577 (create-image thumb-file)
892 :relief tumme-thumb-relief :margin tumme-thumb-margin))) 578;; (list 'image :type 'jpeg
579;; :file thumb-file
580;; :relief tumme-thumb-relief :margin tumme-thumb-margin)
581 ))
893 582
894(defun tumme-insert-thumbnail (file original-file-name 583(defun tumme-insert-thumbnail (file original-file-name
895 associated-dired-buffer) 584 associated-dired-buffer)
@@ -898,7 +587,9 @@ Add text properties ORIGINAL-FILE-NAME and ASSOCIATED-DIRED-BUFFER."
898 (let (beg end) 587 (let (beg end)
899 (setq beg (point)) 588 (setq beg (point))
900 (tumme-insert-image file 589 (tumme-insert-image file
901 'jpeg 590 ;; TODO: this should depend on the real file type
591 (if (eq 'standard tumme-thumbnail-storage)
592 'png 'jpeg)
902 tumme-thumb-relief 593 tumme-thumb-relief
903 tumme-thumb-margin) 594 tumme-thumb-margin)
904 (setq end (point)) 595 (setq end (point))
@@ -917,38 +608,52 @@ Depending on the value of `tumme-thumbnail-storage', the file
917name will vary. For central thumbnail file storage, make a 608name will vary. For central thumbnail file storage, make a
918MD5-hash of the image file's directory name and add that to make 609MD5-hash of the image file's directory name and add that to make
919the thumbnail file name unique. For per-directory storage, just 610the thumbnail file name unique. For per-directory storage, just
920add a subdirectory." 611add a subdirectory. For standard storage, produce the file name
921 (let ((f (expand-file-name file)) 612according to the Thumbnail Managing Standard."
922 md5-hash) 613 (cond ((eq 'standard tumme-thumbnail-storage)
923 (format "%s%s%s.thumb.%s" 614 (expand-file-name
924 (cond ((eq 'use-tumme-dir tumme-thumbnail-storage) 615 (concat "~/.thumbnails/normal/"
925 ;; Is MD5 hashes fast enough? The checksum of a 616 (md5 (concat "file://" (expand-file-name file))) ".png")))
926 ;; thumbnail file name need not be that 617 ((eq 'use-tumme-dir tumme-thumbnail-storage)
927 ;; "cryptographically" good so a faster one could 618 (let* ((f (expand-file-name file))
928 ;; be used here. 619 (md5-hash
929 (setq md5-hash (md5 (file-name-as-directory 620 ;; Is MD5 hashes fast enough? The checksum of a
930 (file-name-directory file)))) 621 ;; thumbnail file name need not be that
931 (file-name-as-directory (expand-file-name (tumme-dir)))) 622 ;; "cryptographically" good so a faster one could
932 ((eq 'per-directory tumme-thumbnail-storage) 623 ;; be used here.
933 (format "%s.tumme/" 624 (md5 (file-name-as-directory (file-name-directory f)))))
934 (file-name-directory f)))) 625 (format "%s%s%s.thumb.%s"
935 (file-name-sans-extension 626 (file-name-as-directory (expand-file-name (tumme-dir)))
936 (file-name-nondirectory f)) 627 (file-name-sans-extension (file-name-nondirectory f))
937 (if md5-hash 628 (if md5-hash (concat "_" md5-hash) "")
938 (concat "_" md5-hash) 629 (file-name-extension f))))
939 "") 630 ((eq 'per-directory tumme-thumbnail-storage)
940 (file-name-extension f)))) 631 (let ((f (expand-file-name file)))
632 (format "%s.tumme/%s.thumb.%s"
633 (file-name-directory f)
634 (file-name-sans-extension (file-name-nondirectory f))
635 (file-name-extension f))))))
941 636
942(defun tumme-create-thumb (original-file thumbnail-file) 637(defun tumme-create-thumb (original-file thumbnail-file)
943 "For ORIGINAL-FILE, create thumbnail image named THUMBNAIL-FILE." 638 "For ORIGINAL-FILE, create thumbnail image named THUMBNAIL-FILE."
944 (let* ((size (int-to-string tumme-thumb-size)) 639 (let* ((width (int-to-string tumme-thumb-width))
640 (height (int-to-string tumme-thumb-height))
641 (modif-time (format "%.0f" (float-time (nth 5 (file-attributes
642 original-file)))))
643 (thumbnail-nq8-file (replace-regexp-in-string ".png\\'" "-nq8.png"
644 thumbnail-file))
945 (command 645 (command
946 (format-spec 646 (format-spec
947 tumme-cmd-create-thumbnail-options 647 (if (eq 'standard tumme-thumbnail-storage)
648 tumme-cmd-create-standard-thumbnail-command
649 tumme-cmd-create-thumbnail-options)
948 (list 650 (list
949 (cons ?p tumme-cmd-create-thumbnail-program) 651 (cons ?p tumme-cmd-create-thumbnail-program)
950 (cons ?s size) 652 (cons ?w width)
653 (cons ?h height)
654 (cons ?m modif-time)
951 (cons ?f original-file) 655 (cons ?f original-file)
656 (cons ?q thumbnail-nq8-file)
952 (cons ?t thumbnail-file)))) 657 (cons ?t thumbnail-file))))
953 thumbnail-dir) 658 thumbnail-dir)
954 (when (not (file-exists-p 659 (when (not (file-exists-p
@@ -957,6 +662,40 @@ add a subdirectory."
957 (make-directory thumbnail-dir)) 662 (make-directory thumbnail-dir))
958 (shell-command command nil))) 663 (shell-command command nil)))
959 664
665;;;###autoload
666(defun tumme-dired-insert-marked-thumbs ()
667 "Insert thumbnails before file names of marked files in the dired buffer."
668 (interactive)
669 (dired-map-over-marks
670 (let* ((image-pos (dired-move-to-filename))
671 (image-file (dired-get-filename))
672 (thumb-file (tumme-get-thumbnail-image image-file))
673 overlay)
674 ;; If image is not already added, then add it.
675 (unless (delq nil (mapcar (lambda (o) (overlay-get o 'put-image))
676 ;; Can't use (overlays-at (point)), BUG?
677 (overlays-in (point) (1+ (point)))))
678 (put-image thumb-file image-pos)
679 (setq overlay (car (delq nil (mapcar (lambda (o) (and (overlay-get o 'put-image) o))
680 (overlays-in (point) (1+ (point)))))))
681 (overlay-put overlay 'image-file image-file)
682 (overlay-put overlay 'thumb-file thumb-file)))
683 nil)
684 (add-hook 'dired-after-readin-hook 'tumme-dired-after-readin-hook nil t))
685
686(defun tumme-dired-after-readin-hook ()
687 "Relocate existing thumbnail overlays in dired buffer after reverting.
688Move them to their corresponding files if they are still exist.
689Otherwise, delete overlays."
690 (mapc (lambda (overlay)
691 (when (overlay-get overlay 'put-image)
692 (let* ((image-file (overlay-get overlay 'image-file))
693 (image-pos (dired-goto-file image-file)))
694 (if image-pos
695 (move-overlay overlay image-pos image-pos)
696 (delete-overlay overlay)))))
697 (overlays-in (point-min) (point-max))))
698
960(defun tumme-next-line-and-display () 699(defun tumme-next-line-and-display ()
961 "Move to next dired line and display thumbnail image." 700 "Move to next dired line and display thumbnail image."
962 (interactive) 701 (interactive)
@@ -1966,7 +1705,7 @@ Calculate how many thumbnails fit."
1966 (/ width 1705 (/ width
1967 (+ (* 2 tumme-thumb-relief) 1706 (+ (* 2 tumme-thumb-relief)
1968 (* 2 tumme-thumb-margin) 1707 (* 2 tumme-thumb-margin)
1969 tumme-thumb-size char-width)))) 1708 tumme-thumb-width char-width))))
1970 (tumme-line-up))) 1709 (tumme-line-up)))
1971 1710
1972(defun tumme-line-up-interactive () 1711(defun tumme-line-up-interactive ()
@@ -2058,19 +1797,19 @@ systems it should feel snappy enough.
2058If optional argument ORIGINAL-SIZE is non-nil, display image in its 1797If optional argument ORIGINAL-SIZE is non-nil, display image in its
2059original size." 1798original size."
2060 (let ((new-file (expand-file-name tumme-temp-image-file)) 1799 (let ((new-file (expand-file-name tumme-temp-image-file))
2061 size-x size-y command ret) 1800 width height command ret)
2062 (setq file (expand-file-name file)) 1801 (setq file (expand-file-name file))
2063 (if (not original-size) 1802 (if (not original-size)
2064 (progn 1803 (progn
2065 (setq size-x (tumme-display-window-width)) 1804 (setq width (tumme-display-window-width))
2066 (setq size-y (tumme-display-window-height)) 1805 (setq height (tumme-display-window-height))
2067 (setq command 1806 (setq command
2068 (format-spec 1807 (format-spec
2069 tumme-cmd-create-temp-image-options 1808 tumme-cmd-create-temp-image-options
2070 (list 1809 (list
2071 (cons ?p tumme-cmd-create-temp-image-program) 1810 (cons ?p tumme-cmd-create-temp-image-program)
2072 (cons ?x size-x) 1811 (cons ?w width)
2073 (cons ?y size-y) 1812 (cons ?h height)
2074 (cons ?f file) 1813 (cons ?f file)
2075 (cons ?t new-file)))) 1814 (cons ?t new-file))))
2076 (setq ret (shell-command command nil)) 1815 (setq ret (shell-command command nil))
@@ -2308,12 +2047,11 @@ function. The result is a couple of new files in
2308(defun tumme-write-comment (file comment) 2047(defun tumme-write-comment (file comment)
2309 "For FILE, write comment COMMENT in database." 2048 "For FILE, write comment COMMENT in database."
2310 (save-excursion 2049 (save-excursion
2311 (let (end buf comment-beg 2050 (let (end buf comment-beg)
2312 (base-name (file-name-nondirectory file)))
2313 (setq buf (find-file tumme-db-file)) 2051 (setq buf (find-file tumme-db-file))
2314 (goto-char (point-min)) 2052 (goto-char (point-min))
2315 (if (search-forward-regexp 2053 (if (search-forward-regexp
2316 (format "^%s" base-name) nil t) 2054 (format "^%s" file) nil t)
2317 (progn 2055 (progn
2318 (end-of-line) 2056 (end-of-line)
2319 (setq end (point)) 2057 (setq end (point))
@@ -2336,7 +2074,7 @@ function. The result is a couple of new files in
2336 (insert (format "comment:%s;" comment))) 2074 (insert (format "comment:%s;" comment)))
2337 ;; File does not exist in databse - add it. 2075 ;; File does not exist in databse - add it.
2338 (goto-char (point-max)) 2076 (goto-char (point-max))
2339 (insert (format "\n%s;comment:%s" base-name comment))) 2077 (insert (format "\n%s;comment:%s" file comment)))
2340 (save-buffer) 2078 (save-buffer)
2341 (kill-buffer buf)))) 2079 (kill-buffer buf))))
2342 2080
@@ -2417,7 +2155,7 @@ matching tags will be marked in the dired buffer."
2417 (goto-char (point-min)) 2155 (goto-char (point-min))
2418 ;; Collect matches 2156 ;; Collect matches
2419 (while (search-forward-regexp 2157 (while (search-forward-regexp
2420 (concat "\\(^[^;]+\\);.*" tag ".*$") nil t) 2158 (concat "\\(^[^;\n]+\\);.*" tag ".*$") nil t)
2421 (setq files (append (list (match-string 1)) files))) 2159 (setq files (append (list (match-string 1)) files)))
2422 (kill-buffer buf) 2160 (kill-buffer buf)
2423 ;; Mark files 2161 ;; Mark files
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 720fb9929e4..659c562ea65 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -860,6 +860,7 @@ button end points."
860 (define-key map [(shift tab)] 'advertised-widget-backward) 860 (define-key map [(shift tab)] 'advertised-widget-backward)
861 (define-key map [backtab] 'widget-backward) 861 (define-key map [backtab] 'widget-backward)
862 (define-key map [down-mouse-2] 'widget-button-click) 862 (define-key map [down-mouse-2] 'widget-button-click)
863 (define-key map [down-mouse-1] 'widget-button-click)
863 (define-key map "\C-m" 'widget-button-press) 864 (define-key map "\C-m" 'widget-button-press)
864 map) 865 map)
865 "Keymap containing useful binding for buffers containing widgets. 866 "Keymap containing useful binding for buffers containing widgets.
@@ -929,6 +930,8 @@ Recommended as a parent keymap for modes using widgets.")
929 (save-excursion 930 (save-excursion
930 (goto-char (posn-point (event-start event))) 931 (goto-char (posn-point (event-start event)))
931 (let* ((overlay (widget-get button :button-overlay)) 932 (let* ((overlay (widget-get button :button-overlay))
933 (pressed-face (or (widget-get button :pressed-face)
934 widget-button-pressed-face))
932 (face (overlay-get overlay 'face)) 935 (face (overlay-get overlay 'face))
933 (mouse-face (overlay-get overlay 'mouse-face))) 936 (mouse-face (overlay-get overlay 'mouse-face)))
934 (unwind-protect 937 (unwind-protect
@@ -938,10 +941,8 @@ Recommended as a parent keymap for modes using widgets.")
938 ;; on when we move over it. 941 ;; on when we move over it.
939 (save-excursion 942 (save-excursion
940 (when face ; avoid changing around image 943 (when face ; avoid changing around image
941 (overlay-put overlay 944 (overlay-put overlay 'face pressed-face)
942 'face widget-button-pressed-face) 945 (overlay-put overlay 'mouse-face pressed-face))
943 (overlay-put overlay
944 'mouse-face widget-button-pressed-face))
945 (unless (widget-apply button :mouse-down-action event) 946 (unless (widget-apply button :mouse-down-action event)
946 (let ((track-mouse t)) 947 (let ((track-mouse t))
947 (while (not (widget-button-release-event-p event)) 948 (while (not (widget-button-release-event-p event))
@@ -951,12 +952,8 @@ Recommended as a parent keymap for modes using widgets.")
951 (eq (get-char-property pos 'button) 952 (eq (get-char-property pos 'button)
952 button)) 953 button))
953 (when face 954 (when face
954 (overlay-put overlay 955 (overlay-put overlay 'face pressed-face)
955 'face 956 (overlay-put overlay 'mouse-face pressed-face))
956 widget-button-pressed-face)
957 (overlay-put overlay
958 'mouse-face
959 widget-button-pressed-face))
960 (overlay-put overlay 'face face) 957 (overlay-put overlay 'face face)
961 (overlay-put overlay 'mouse-face mouse-face))))) 958 (overlay-put overlay 'mouse-face mouse-face)))))
962 959