summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog181
-rw-r--r--lisp/abbrev.el2
-rw-r--r--lisp/allout.el2
-rw-r--r--lisp/bindings.el4
-rw-r--r--lisp/calc/calc-embed.el17
-rw-r--r--lisp/calendar/cal-tex.el20
-rw-r--r--lisp/cvs-status.el2
-rw-r--r--lisp/diff-mode.el170
-rw-r--r--lisp/emacs-lisp/warnings.el3
-rw-r--r--lisp/files.el26
-rw-r--r--lisp/gnus/ChangeLog33
-rw-r--r--lisp/gnus/mm-uu.el17
-rw-r--r--lisp/gnus/mml1991.el25
-rw-r--r--lisp/gnus/mml2015.el2
-rw-r--r--lisp/help-fns.el6
-rw-r--r--lisp/help-mode.el5
-rw-r--r--lisp/log-edit.el2
-rw-r--r--lisp/log-view.el2
-rw-r--r--lisp/mh-e/ChangeLog6
-rw-r--r--lisp/mh-e/mh-e.el4
-rw-r--r--lisp/msb.el5
-rw-r--r--lisp/net/tramp.el166
-rw-r--r--lisp/pcvs-defs.el2
-rw-r--r--lisp/pcvs-info.el2
-rw-r--r--lisp/pcvs-parse.el2
-rw-r--r--lisp/pcvs-util.el2
-rw-r--r--lisp/progmodes/gdb-ui.el13
-rw-r--r--lisp/progmodes/grep.el471
-rw-r--r--lisp/progmodes/gud.el23
-rw-r--r--lisp/replace.el1
-rw-r--r--lisp/reveal.el2
-rw-r--r--lisp/simple.el4
-rw-r--r--lisp/smerge-mode.el2
-rw-r--r--lisp/startup.el2
-rw-r--r--lisp/subr.el42
-rw-r--r--lisp/term/mac-win.el5
-rw-r--r--lisp/textmodes/fill.el2
-rw-r--r--lisp/textmodes/paragraphs.el26
-rw-r--r--lisp/textmodes/reftex-vars.el2
-rw-r--r--lisp/tool-bar.el27
40 files changed, 820 insertions, 510 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0b384c6d8c3..2a402f88c01 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,170 @@
+2006-05-03 Nick Roberts <nickrob@snap.net.nz>
+
+ * progmodes/gdb-ui.el (gud-watch): Let user select an expression.
+ (menu): Fix typo.
+
+2006-05-02 Miles Bader <miles@gnu.org>
+
+ * replace.el (occur-engine): Bind `inhibit-field-text-motion' to t.
+
+2006-05-02 Jay Belanger <belanger@truman.edu>
+
+ * calc/calc-embed.el: (calc-override-minor-modes-map)
+ (calc-override-minor-modes): New variables.
+ (calc-do-embedded): Make sure that Calc keystrokes aren't
+ overwritten by minor modes.
+
+2006-05-02 Chong Yidong <cyd@mit.edu>
+
+ * msb.el (msb): If EVENT is a down event, read and discard the up
+ event.
+
+2006-05-02 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * startup.el (command-line-1): Refer to Lisp manual when
+ pure-space-overflow occurs.
+
+ * files.el (byte-compile-dynamic)
+ (byte-compile-dynamic-docstrings, byte-compile-warnings)
+ (find-file-visit-truename, indent-tabs-mode, left-margin)
+ (no-byte-compile no-update-autoloads, truncate-lines)
+ (version-control): Don't use `t' for safe-local-variable
+ declarations.
+
+2006-05-01 Richard Stallman <rms@gnu.org>
+
+ * diff-mode.el (diff-mode-shared-map): Don't bind M-W, M-U, M-C,
+ M-r, M-R, M-A, M-SPC or M-DEL.
+ (diff-mode-map): diff-refine-hunk now on C-c C-w
+ (diff-mode-map): Bind C-c C-e, C-c C-n, C-c C-r, C-c C-u.
+
+ * help-mode.el (help-mode): view-exit-action calls delete-window
+ only when it is safe and possible.
+
+ * simple.el (undo-outer-limit-truncate): Put quotes around buffer name
+ in messages.
+
+ * emacs-lisp/warnings.el (display-warning, lwarn): Doc fixes.
+
+ * tool-bar.el (tool-bar-setup): Put Help and Preferences items
+ in the default tool-bar-map.
+
+2006-05-01 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-completion-file-name-handler-alist)
+ (tramp-run-real-handler, tramp-completion-run-real-handler)
+ (tramp-completion-handle-file-name-all-completions)
+ (tramp-completion-handle-file-name-completion): Autoload them.
+ (tramp-completion-handle-file-exists-p)
+ (tramp-completion-handle-file-name-directory)
+ (tramp-completion-handle-file-name-nondirectory)
+ (tramp-completion-handle-expand-file-name): Remove them.
+ (tramp-handle-file-name-directory): Return the real directory name.
+ Returning "/" only doesn't need to be necessary any longer.
+ (tramp-file-name-handler): Make special attention when in hostname
+ completion mode.
+ (tramp-completion-file-name-handler): Revert patch from 2006-04-28.
+ (tramp-register-file-name-handlers): Register
+ `tramp-completion-file-name-handler' only when
+ `partial-completion-mode is enabled.
+ (tramp-completion-handle-file-name-all-completions):
+ Delete directory part from results.
+ (tramp-get-completion-methods, tramp-get-completion-user-host):
+ Discard deleting "/", it doesn't work after the change of
+ `tramp-handle-file-name-directory' above.
+
+2006-05-01 Kim F. Storm <storm@cua.dk>
+
+ * progmodes/grep.el (grep-expand-template): Use save-match-data
+ and symbol-value.
+
+2006-05-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * term/mac-win.el (mac-ae-open-documents, mac-drag-n-drop): Use
+ select-frame-set-input-focus instead of raise-frame.
+ (global-map): Bind M-drag-n-drop to mac-drag-n-drop.
+
+2006-05-01 Nick Roberts <nickrob@snap.net.nz>
+
+ * progmodes/gud.el (gud-def): Add %c case.
+ (gud-speedbar-buttons): Don't bind case-fold-search unnecessarily.
+ (gud-format-command): Make match case sensitive. Match on %F.
+
+2006-04-30 Glenn Morris <rgm@gnu.org>
+
+ * calendar/cal-tex.el (cal-tex-preamble-extra): New variable.
+ (cal-tex-preamble): Use cal-tex-preamble-extra.
+ (cal-tex-list-diary-entries): Refer to `diary-list-entries' rather
+ than alias `list-diary-entries'.
+
+2006-04-29 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * help-fns.el (describe-variable): Add info about safe local variables.
+
+2006-04-29 Richard Stallman <rms@gnu.org>
+
+ * bindings.el (mode-line-format): help-echo doc fixes.
+
+ * net/tramp.el (tramp-file-name-handler-alist): Delete
+ expand-file-name and other operations that can cause spurious loading.
+
+2006-04-29 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * files.el (safe-local-variable-p): Remove support for the special
+ value t.
+
+ * textmodes/paragraphs.el (sentence-end-without-space):
+ Fix safety predicate.
+ (sentence-end-double-space, sentence-end-without-period)
+ (paragraph-ignore-fill-prefix):
+ * textmodes/fill.el (colon-double-space):
+ * abbrev.el (abbrev-mode): Tighten the safety predicate.
+
+ * subr.el (booleanp): New fun.
+
+ * textmodes/reftex-vars.el (reftex-guess-label-type):
+ Tighten the safety predicate.
+
+2006-04-28 Kim F. Storm <storm@cua.dk>
+
+ * progmodes/grep.el (defgroup grep): Doc fix.
+ (grep-auto-highlight): Remove.
+ (grep-template): New defcustom.
+ (grep-find-template): Rename from grep-tree-template.
+ (grep-files-aliases): Rename from grep-tree-files-aliases.
+ Remove "all" alias, add "l" alias.
+ (grep-tree-ignore-case, grep-tree-ignore-CVS-directories): Remove.
+ (grep-find-ignored-directories): New defcustom to replace
+ grep-tree-ignore-CVS-directories, to facilitate ignoring
+ subdirectories for multiple version control systems.
+ (grep-mode-map): Add Recursive grep item to GREP menu.
+ (grep-regexp-history, grep-files-history): New defvars.
+ (grep-probe): New helper function.
+ (grep-compute-defaults): Use it to simplify code.
+ Adapt to name changes.
+ Use `.' as base in grep-find-template rather than <D>.
+ (grep): Remove superfluous highlight-regexp arg. Fix doc.
+ Call grep-compute-defaults unconditionally.
+ (grep-expand-keywords): New defconst.
+ (grep-expand-template): Rename from grep-expand-command-macros.
+ Simplify via grep-expand-keywords. Look at case-fold-search instead
+ of grep-tree-ignore-case to add -i option.
+ Bind case-fold-search to nil while matching keywords.
+ (grep-tree-last-regexp, grep-tree-last-files): Remove.
+ (grep-read-regexp, grep-read-files): New helper functions.
+ (rgrep): Rename from grep-tree. Rework to use proper histories.
+ Adapt to changes in defcustoms and functions above.
+ (lgrep): New command, as grep, but using same interactive UI as rgrep.
+
+2006-04-28 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-completion-file-name-handler):
+ Disable Tramp's functionality while loading Tramp itself.
+ (tramp-register-file-name-handlers): That's a defsubst now.
+ Code from `tramp-repair-jka-compr' moved here. Apply it via
+ `after-init-hook'.
+ (tramp-repair-jka-compr): Remove.
+
2006-04-27 Jay Belanger <belanger@truman.edu>
* calc-embed.el (calc-embedded-make-info): Use `math-read-expr' to
@@ -2598,7 +2765,7 @@
(describe-key-briefly-internal, describe-key-internal):
Functions merged back into their callers.
-2006-02-13 Martin Rudalics <rudalics@gmx.at> (tiny change)
+2006-02-13 Martin Rudalics <rudalics@gmx.at>
* info.el (info-xref-visited): Inherit from info-xref too.
(Info-set-mode-line): Replace occurrences of `%' by `%%'
@@ -3746,7 +3913,7 @@
* add-log.el (add-change-log-entry, change-log-merge):
Conditionally use `hard-newline'.
-2006-01-13 Martin Rudalics <rudalics@gmx.at> (tiny change)
+2006-01-13 Martin Rudalics <rudalics@gmx.at>
* wid-edit.el (widget-field-end): If the overlay is no longer
associated with a buffer, behave as if the overlay didn't exist.
@@ -4836,7 +5003,7 @@
* emacs-lisp/edebug.el (edebug-safe-prin1-to-string):
Capture error from printing circular structures.
-2005-12-17 Martin Rudalics <rudalics@gmx.at> (tiny change)
+2005-12-17 Martin Rudalics <rudalics@gmx.at>
* wid-edit.el (widget-checkbox-action): Clear undo info.
@@ -6819,7 +6986,7 @@
scrolling the help window. Doc fix.
(help-return-method): Doc fix.
-2005-12-03 Martin Rudalics <rudalics@gmx.at> (tiny change)
+2005-12-03 Martin Rudalics <rudalics@gmx.at>
* emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Fix bug
whereby names of length one or names starting with a
@@ -7373,7 +7540,7 @@
* custom.el (defcustom): Update link types in docstring.
-2005-11-20 Martin Rudalics <rudalics@gmx.at> (tiny change)
+2005-11-20 Martin Rudalics <rudalics@gmx.at>
* custom.el (defgroup): Add doc-string-elt info.
@@ -7646,7 +7813,7 @@
* apropos.el (apropos-calc-scores): Use apropos-pattern.
-2005-11-16 Martin Rudalics <rudalics@gmx.at> (tiny change)
+2005-11-16 Martin Rudalics <rudalics@gmx.at>
* wid-edit.el (color): Enclose %t in %{...%}.
@@ -14577,7 +14744,7 @@
* emulation/edt-mapper.el (edt-save-function-key-map)
(EDT-key-name): `defvar' to silence the byte-compiler.
-2005-07-02 Martin Rudalics <rudalics@gmx.at> (tiny change)
+2005-07-02 Martin Rudalics <rudalics@gmx.at>
* font-lock.el (font-lock-regexp-grouping-backslash): Rename from
font-lock-regexp-backslash. Doc fix.
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index c0380058b53..234b8230587 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -58,7 +58,7 @@ Interactively, use the command `abbrev-mode'
to enable or disable Abbrev mode in the current buffer."
:type 'boolean
:group 'abbrev-mode)
-;;;###autoload(put 'abbrev-mode 'safe-local-variable 'symbolp)
+;;;###autoload(put 'abbrev-mode 'safe-local-variable 'booleanp)
(defvar edit-abbrevs-map
diff --git a/lisp/allout.el b/lisp/allout.el
index b6542c1a5dc..dc19c1fa15a 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -301,7 +301,7 @@ alist, then use comment-start string, if any, then use default \(`.').
Set to the symbol for either of `allout-mode-leaders' or
`comment-start' to use only one of them, respectively.
-Value nil means to always use the default \(`.').t
+Value nil means to always use the default \(`.').
comment-start strings that do not end in spaces are tripled, and an
`_' underscore is tacked on the end, to distinguish them from regular
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 6cbec4a1a86..d965abada6f 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -319,13 +319,13 @@ Keymap to display on minor modes.")
(list
(propertize "%[(" 'help-echo help-echo)
`(:propertize ("" mode-name)
- help-echo "mouse-1: major-mode-menu mouse-2: help for current major mode"
+ help-echo "mouse-1: major mode, mouse-2: major mode help, mouse-3: toggle minor modes"
mouse-face mode-line-highlight
local-map ,mode-line-major-mode-keymap)
'("" mode-line-process)
`(:propertize ("" minor-mode-alist)
mouse-face mode-line-highlight
- help-echo "mouse-2: help for minor modes, mouse-3: minor mode menu"
+ help-echo "mouse-2: minor mode help, mouse-3: toggle minor modes"
local-map ,mode-line-minor-mode-keymap)
(propertize "%n" 'help-echo "mouse-2: widen"
'mouse-face 'mode-line-highlight
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el
index adb94ef7381..e54a94e4d39 100644
--- a/lisp/calc/calc-embed.el
+++ b/lisp/calc/calc-embed.el
@@ -206,6 +206,18 @@
(defvar calc-embedded-firsttime-buf)
(defvar calc-embedded-firsttime-formula)
+;; The following is to take care of any minor modes which override
+;; a Calc command.
+(defvar calc-override-minor-modes-map
+ (make-sparse-keymap)
+ "A list of keybindings that might be overwritten by minor modes.")
+
+;; Add any keys that might be overwritten here.
+(define-key calc-override-minor-modes-map "`" 'calc-edit)
+
+(defvar calc-override-minor-modes
+ (cons t calc-override-minor-modes-map))
+
(defun calc-do-embedded (calc-embed-arg end obeg oend)
(if calc-embedded-info
@@ -237,6 +249,8 @@
truncate-lines (nth 2 mode)
buffer-read-only nil)
(use-local-map (nth 1 mode))
+ (setq minor-mode-overriding-map-alist
+ (remq calc-override-minor-modes minor-mode-overriding-map-alist))
(set-buffer-modified-p (buffer-modified-p))
(calc-embedded-restore-original-modes)
(or calc-embedded-quiet
@@ -297,6 +311,9 @@
buffer-read-only t)
(set-buffer-modified-p (buffer-modified-p))
(use-local-map calc-mode-map)
+ (setq minor-mode-overriding-map-alist
+ (cons calc-override-minor-modes
+ minor-mode-overriding-map-alist))
(setq calc-no-refresh-evaltos nil)
(and chg calc-any-evaltos (calc-wrapper (calc-refresh-evaltos)))
(let (str)
diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el
index a67d90c832e..1fd85513230 100644
--- a/lisp/calendar/cal-tex.el
+++ b/lisp/calendar/cal-tex.el
@@ -45,7 +45,7 @@
(require 'calendar)
-(autoload 'list-diary-entries "diary-lib" nil t)
+(autoload 'diary-list-entries "diary-lib" nil t)
(autoload 'calendar-holiday-list "holidays" nil t)
(autoload 'calendar-iso-from-absolute "cal-iso" nil t)
@@ -121,6 +121,14 @@ will put the Hebrew date at the bottom of each day."
:type 'integer
:group 'calendar-tex)
+(defcustom cal-tex-preamble-extra nil
+ "A string giving extra LaTeX commands to insert in the calendar preamble.
+For example, to include extra packages:
+\"\\\\usepackage{foo}\\n\\\\usepackage{bar}\\n\"."
+ :type 'string
+ :group 'calendar-tex
+ :version "22.1")
+
(defcustom cal-tex-hook nil
"*List of functions called after any LaTeX calendar buffer is generated.
You can use this to do postprocessing on the buffer. For example, to change
@@ -240,7 +248,7 @@ This definition is the heart of the calendar!")
"Generate a list of all diary-entries from absolute date D1 to D2."
(let ((diary-list-include-blanks nil)
(diary-display-hook 'ignore))
- (list-diary-entries
+ (diary-list-entries
(calendar-gregorian-from-absolute d1)
(1+ (- d2 d1)))))
@@ -253,8 +261,10 @@ Optional ARGS are included."
(insert "\\documentclass")
(if args
(insert "[" args "]"))
- (insert "{article}\n"
- "\\hbadness 20000
+ (insert "{article}\n")
+ (if (stringp cal-tex-preamble-extra)
+ (insert cal-tex-preamble-extra "\n"))
+ (insert "\\hbadness 20000
\\hfuzz=1000pt
\\vbadness 20000
\\lineskip 0pt
@@ -357,6 +367,8 @@ Optional parameter specifies number of years."
(cal-tex-noindent)
(cal-tex-nl)
(let ((month-names; don't use default in case user changed it
+ ;; These are only used to define the command names, not
+ ;; the names of the months they insert.
["January" "February" "March" "April" "May" "June"
"July" "August" "September" "October" "November" "December"]))
(calendar-for-loop i from 1 to 12 do
diff --git a/lisp/cvs-status.el b/lisp/cvs-status.el
index cf0ee85db23..477914293a7 100644
--- a/lisp/cvs-status.el
+++ b/lisp/cvs-status.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1999, 2000, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: pcl-cvs cvs status tree tools
;; This file is part of GNU Emacs.
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index 7c7f7902d82..cc89aad6ca3 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: convenience patch diff
;; This file is part of GNU Emacs.
@@ -118,7 +118,8 @@ when editing big diffs)."
("\C-m" . diff-goto-source)
([mouse-2] . diff-goto-source)
;; From XEmacs' diff-mode.
- ("W" . widen)
+;; Standard M-w is useful, so don't change M-W.
+;; ("W" . widen)
;;("." . diff-goto-source) ;display-buffer
;;("f" . diff-goto-source) ;find-file
("o" . diff-goto-source) ;other-window
@@ -127,14 +128,14 @@ when editing big diffs)."
;;("h" . diff-show-header)
;;("j" . diff-show-difference) ;jump to Nth diff
;;("q" . diff-quit)
- (" " . scroll-up)
- ("\177" . scroll-down)
- ;; Our very own bindings.
- ("A" . diff-ediff-patch)
- ("r" . diff-restrict-view)
- ("R" . diff-reverse-direction)
- ("U" . diff-context->unified)
- ("C" . diff-unified->context)
+;; Not useful if you have to metafy them.
+;; (" " . scroll-up)
+;; ("\177" . scroll-down)
+;; Standard M-a is useful, so don't change M-A.
+;; ("A" . diff-ediff-patch)
+;; Standard M-r is useful, so don't change M-r or M-R.
+;; ("r" . diff-restrict-view)
+;; ("R" . diff-reverse-direction)
("q" . quit-window))
"Basic keymap for `diff-mode', bound to various prefix keys.")
@@ -143,10 +144,14 @@ when editing big diffs)."
;; From compilation-minor-mode.
("\C-c\C-c" . diff-goto-source)
;; Misc operations.
- ("\C-c\C-r" . diff-refine-hunk)
- ("\C-c\C-s" . diff-split-hunk)
("\C-c\C-a" . diff-apply-hunk)
+ ("\C-c\C-e" . diff-ediff-patch)
+ ("\C-c\C-n" . diff-restrict-view)
+ ("\C-c\C-r" . diff-reverse-direction)
+ ("\C-c\C-s" . diff-split-hunk)
("\C-c\C-t" . diff-test-hunk)
+ ("\C-c\C-u" . diff-context->unified)
+ ("\C-c\C-w" . diff-refine-hunk)
("\C-c\C-f" . next-error-follow-minor-mode))
"Keymap for `diff-mode'. See also `diff-mode-shared-map'.")
@@ -711,77 +716,80 @@ else cover the whole bufer."
(delete-region last-pt (point))
(setq delete nil)))))))))))))))
-(defun diff-context->unified (start end)
+(defun diff-context->unified (start end &optional to-context)
"Convert context diffs to unified diffs.
-START and END are either taken from the region (if a prefix arg is given) or
-else cover the whole bufer."
- (interactive (if current-prefix-arg
- (list (mark) (point))
- (list (point-min) (point-max))))
- (unless (markerp end) (setq end (copy-marker end)))
- (let (;;(diff-inhibit-after-change t)
- (inhibit-read-only t))
- (save-excursion
- (goto-char start)
- (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)$" nil t)
- (< (point) end))
- (combine-after-change-calls
- (if (match-beginning 2)
- ;; we matched a file header
- (progn
- ;; use reverse order to make sure the indices are kept valid
- (replace-match "+++" t t nil 3)
- (replace-match "---" t t nil 2))
- ;; we matched a hunk header
- (let ((line1s (match-string 4))
- (line1e (match-string 5))
- (pt1 (match-beginning 0)))
- (replace-match "")
- (unless (re-search-forward
- "^--- \\([0-9]+\\),\\(-?[0-9]+\\) ----$" nil t)
- (error "Can't find matching `--- n1,n2 ----' line"))
- (let ((line2s (match-string 1))
- (line2e (match-string 2))
- (pt2 (progn
- (delete-region (progn (beginning-of-line) (point))
- (progn (forward-line 1) (point)))
- (point-marker))))
- (goto-char pt1)
- (forward-line 1)
- (while (< (point) pt2)
- (case (char-after)
- ((?! ?-) (delete-char 2) (insert "-") (forward-line 1))
- (?\s ;merge with the other half of the chunk
- (let* ((endline2
- (save-excursion
- (goto-char pt2) (forward-line 1) (point)))
- (c (char-after pt2)))
- (case c
- ((?! ?+)
- (insert "+"
- (prog1 (buffer-substring (+ pt2 2) endline2)
- (delete-region pt2 endline2))))
- (?\s ;FIXME: check consistency
- (delete-region pt2 endline2)
- (delete-char 1)
- (forward-line 1))
- (?\\ (forward-line 1))
- (t (delete-char 1) (forward-line 1)))))
- (t (forward-line 1))))
- (while (looking-at "[+! ] ")
- (if (/= (char-after) ?!) (forward-char 1)
- (delete-char 1) (insert "+"))
- (delete-char 1) (forward-line 1))
- (save-excursion
+START and END are either taken from the region
+\(when it is highlighted) or else cover the whole buffer.
+With a prefix argument, convert unified format to context format."
+ (interactive (if (and transient-mark-mode mark-active)
+ (list (mark) (point) current-prefix-arg)
+ (list (point-min) (point-max) current-prefix-arg)))
+ (if to-context
+ (diff-unified->context start end)
+ (unless (markerp end) (setq end (copy-marker end)))
+ (let ( ;;(diff-inhibit-after-change t)
+ (inhibit-read-only t))
+ (save-excursion
+ (goto-char start)
+ (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)$" nil t)
+ (< (point) end))
+ (combine-after-change-calls
+ (if (match-beginning 2)
+ ;; we matched a file header
+ (progn
+ ;; use reverse order to make sure the indices are kept valid
+ (replace-match "+++" t t nil 3)
+ (replace-match "---" t t nil 2))
+ ;; we matched a hunk header
+ (let ((line1s (match-string 4))
+ (line1e (match-string 5))
+ (pt1 (match-beginning 0)))
+ (replace-match "")
+ (unless (re-search-forward
+ "^--- \\([0-9]+\\),\\(-?[0-9]+\\) ----$" nil t)
+ (error "Can't find matching `--- n1,n2 ----' line"))
+ (let ((line2s (match-string 1))
+ (line2e (match-string 2))
+ (pt2 (progn
+ (delete-region (progn (beginning-of-line) (point))
+ (progn (forward-line 1) (point)))
+ (point-marker))))
(goto-char pt1)
- (insert "@@ -" line1s ","
- (number-to-string (- (string-to-number line1e)
- (string-to-number line1s)
- -1))
- " +" line2s ","
- (number-to-string (- (string-to-number line2e)
- (string-to-number line2s)
- -1)) " @@"))))))))))
+ (forward-line 1)
+ (while (< (point) pt2)
+ (case (char-after)
+ ((?! ?-) (delete-char 2) (insert "-") (forward-line 1))
+ (?\s ;merge with the other half of the chunk
+ (let* ((endline2
+ (save-excursion
+ (goto-char pt2) (forward-line 1) (point)))
+ (c (char-after pt2)))
+ (case c
+ ((?! ?+)
+ (insert "+"
+ (prog1 (buffer-substring (+ pt2 2) endline2)
+ (delete-region pt2 endline2))))
+ (?\s ;FIXME: check consistency
+ (delete-region pt2 endline2)
+ (delete-char 1)
+ (forward-line 1))
+ (?\\ (forward-line 1))
+ (t (delete-char 1) (forward-line 1)))))
+ (t (forward-line 1))))
+ (while (looking-at "[+! ] ")
+ (if (/= (char-after) ?!) (forward-char 1)
+ (delete-char 1) (insert "+"))
+ (delete-char 1) (forward-line 1))
+ (save-excursion
+ (goto-char pt1)
+ (insert "@@ -" line1s ","
+ (number-to-string (- (string-to-number line1e)
+ (string-to-number line1s)
+ -1))
+ " +" line2s ","
+ (number-to-string (- (string-to-number line2e)
+ (string-to-number line2s)
+ -1)) " @@")))))))))))
(defun diff-reverse-direction (start end)
"Reverse the direction of the diffs.
diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index 133c4c42f2a..a02a8c14eba 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -209,6 +209,7 @@ only, and you can use whatever symbols you like.)
LEVEL should be either :debug, :warning, :error, or :emergency
\(but see `warning-minimum-level' and `warning-minimum-log-level').
+Default is :warning.
:emergency -- a problem that will seriously impair Emacs operation soon
if you do not attend to it promptly.
@@ -292,7 +293,7 @@ See also `warning-series', `warning-prefix-function' and
Aside from generating the message with `format',
this is equivalent to `display-warning'.
-TYPE is the warning type: either a custom group name (a symbol).
+TYPE is the warning type: either a custom group name (a symbol),
or a list of symbols whose first element is a custom group name.
\(The rest of the symbols represent subcategories and
can be whatever you like.)
diff --git a/lisp/files.el b/lisp/files.el
index 10cdb473045..16c0f1288a1 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2354,27 +2354,27 @@ asking you for confirmation."
(eval
`(mapc (lambda (pair)
(put (car pair) 'safe-local-variable (cdr pair)))
- '((byte-compile-dynamic . t)
- (byte-compile-dynamic-docstrings . t)
- (byte-compile-warnings . t)
+ '((byte-compile-dynamic . booleanp)
+ (byte-compile-dynamic-docstrings . booleanp)
+ (byte-compile-warnings . booleanp)
(c-basic-offset . integerp)
(c-file-style . stringp)
(c-indent-level . integerp)
(comment-column . integerp)
(compile-command . string-or-null-p)
- (find-file-visit-truename . t)
+ (find-file-visit-truename . booleanp)
(fill-column . integerp)
(fill-prefix . string-or-null-p)
- (indent-tabs-mode . t)
+ (indent-tabs-mode . booleanp) ;; C source code
(kept-old-versions . integerp)
(kept-new-versions . integerp)
- (left-margin . t)
- (no-byte-compile . t)
- (no-update-autoloads . t)
+ (left-margin . integerp)
+ (no-byte-compile . booleanp)
+ (no-update-autoloads . booleanp)
(outline-regexp . string-or-null-p)
(tab-width . integerp) ;; C source code
- (truncate-lines . t) ;; C source code
- (version-control . t)))))
+ (truncate-lines . booleanp) ;; C source code
+ (version-control . symbolp)))))
(put 'c-set-style 'safe-local-eval-function t)
@@ -2653,15 +2653,11 @@ It is safe if any of these conditions are met:
* There is a matching entry (SYM . VAL) in the
`safe-local-variable-values' user option.
- * The `safe-local-variable' property of SYM is t.
-
* The `safe-local-variable' property of SYM is a function that
evaluates to a non-nil value with VAL as an argument."
(or (member (cons sym val) safe-local-variable-values)
(let ((safep (get sym 'safe-local-variable)))
- (or (eq safep t)
- (and (functionp safep)
- (funcall safep val))))))
+ (and (functionp safep) (funcall safep val)))))
(defun risky-local-variable-p (sym &optional ignored)
"Non-nil if SYM could be dangerous as a file-local variable.
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 2976d0db3e4..cecc180f522 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,17 @@
+2006-04-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mm-uu.el (mm-uu-pgp-encrypted-extract-1): Assume buffer is made
+ unibyte after clear-decrypt function runs.
+
+ * mml2015.el (mml2015-pgg-clear-decrypt): Treat data which pgg
+ returns as a unibyte string.
+
+2006-04-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mml1991.el (mml1991-pgg-sign): No need to load pgg.el, which is
+ always loaded by way of gnus-art.el -> mm-uu.el -> mml2015.el.
+ (mml1991-pgg-encrypt): Ditto.
+
2006-04-26 Reiner Steib <Reiner.Steib@gmx.de>
* deuglify.el (gnus-outlook-deuglify-unwrap-min)
@@ -21,6 +35,18 @@
(mml-attach-file, mml-attach-buffer, mml-attach-external): Sync
DND support and use of message-in-body-p from the trunk.
+2006-04-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mml1991.el (mml1991-pgg-sign): Make sure to load pgg.el before
+ binding pgg-* variables; reimplement the section which prevents
+ MIME header from being signed.
+ (mml1991-pgg-encrypt): Make sure to load pgg.el before binding
+ pgg-text-mode; remove a blank line at the top of body.
+
+ * mm-uu.el (mm-uu-pgp-encrypted-extract-1): Don't remove blank
+ lines at the top of body; use gnus-newsgroup-charset if there's no
+ Charset header.
+
2006-04-25 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de>
* nnweb.el (nnweb-google-wash-article): Sync up to new Google
@@ -458,13 +484,6 @@
2006-02-09 Daiki Ueno <ueno@unixuser.org>
- * pgg-gpg.el (pgg-gpg-encrypt-region): Don't convert line-endings
- in elisp.
- (pgg-gpg-encrypt-symmetric-region): Ditto.
- (pgg-gpg-sign-region): Ditto.
-
- * pgg-def.el (pgg-text-mode): New variable.
-
* mml2015.el (mml2015-pgg-sign): Enable pgg-text-mode.
(mml2015-pgg-encrypt): Ditto.
diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el
index 944e40bc964..9d9d87a3670 100644
--- a/lisp/gnus/mm-uu.el
+++ b/lisp/gnus/mm-uu.el
@@ -436,11 +436,18 @@ Return that buffer."
"OK")))
(progn
;; Decode charset.
- (when (and (or charset
- (setq charset gnus-newsgroup-charset))
- (setq charset (mm-charset-to-coding-system charset))
- (not (eq charset 'ascii)))
- (mm-decode-coding-region (point-min) (point-max) charset))
+ (if (and (or charset
+ (setq charset gnus-newsgroup-charset))
+ (setq charset (mm-charset-to-coding-system charset))
+ (not (eq charset 'ascii)))
+ ;; Assume that buffer's multibyteness is turned off.
+ ;; See `mml2015-pgg-clear-decrypt'.
+ (insert (mm-decode-coding-string (prog1
+ (buffer-string)
+ (erase-buffer)
+ (mm-enable-multibyte))
+ charset))
+ (mm-enable-multibyte))
(list (mm-make-handle buf mm-uu-text-plain-type)))
(list (mm-make-handle buf '("application/pgp-encrypted")))))))
diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el
index 23953cd6208..4db3540aec1 100644
--- a/lisp/gnus/mml1991.el
+++ b/lisp/gnus/mml1991.el
@@ -229,8 +229,6 @@
(defvar pgg-output-buffer))
(defun mml1991-pgg-sign (cont)
- ;; Make sure to load pgg.el before binding pgg-* variables.
- (require 'pgg)
(let ((pgg-text-mode t)
(pgg-default-user-id (or (message-options-get 'mml-sender)
pgg-default-user-id))
@@ -275,19 +273,16 @@
(delete-region (point-min) (point))
(when cte
(mm-decode-content-transfer-encoding (intern (downcase cte))))))
- (unless (progn
- ;; Make sure to load pgg.el before binding `pgg-text-mode'.
- (require 'pgg)
- (let ((pgg-text-mode t))
- (pgg-encrypt-region
- (point-min) (point-max)
- (split-string
- (or
- (message-options-get 'message-recipients)
- (message-options-set 'message-recipients
- (read-string "Recipients: ")))
- "[ \f\t\n\r\v,]+")
- sign)))
+ (unless (let ((pgg-text-mode t))
+ (pgg-encrypt-region
+ (point-min) (point-max)
+ (split-string
+ (or
+ (message-options-get 'message-recipients)
+ (message-options-set 'message-recipients
+ (read-string "Recipients: ")))
+ "[ \f\t\n\r\v,]+")
+ sign))
(pop-to-buffer pgg-errors-buffer)
(error "Encrypt error"))
(delete-region (point-min) (point-max))
diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el
index 80dd5b26597..591ef647678 100644
--- a/lisp/gnus/mml2015.el
+++ b/lisp/gnus/mml2015.el
@@ -707,6 +707,8 @@
(buffer-string))))
(progn
(erase-buffer)
+ ;; Treat data which pgg returns as a unibyte string.
+ (mm-disable-multibyte)
(insert-buffer-substring pgg-output-buffer)
(goto-char (point-min))
(while (search-forward "\r\n" nil t)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 0a78ed8d68b..12a4b4bdbf2 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -638,6 +638,7 @@ it is displayed along with the global value."
(indirect-variable variable)
(error variable)))
(obsolete (get variable 'byte-obsolete-variable))
+ (safe-var (get variable 'safe-local-variable))
(doc (or (documentation-property variable 'variable-documentation)
(documentation-property alias 'variable-documentation))))
(unless (eq alias variable)
@@ -649,6 +650,11 @@ it is displayed along with the global value."
(princ (if (stringp (car obsolete)) (car obsolete)
(format "use `%s' instead." (car obsolete))))
(terpri))
+ (when safe-var
+ (princ "This variable is safe to use as a file local variable")
+ (princ (format " only if its value\nsatisfies the predicate `%s'.\n"
+ safe-var))
+ (terpri))
(princ "Documentation:\n")
(princ (or doc "Not documented as a variable.")))
;; Make a link to customize if this variable can be customized.
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index a5cdf1f4d72..0c6e0f47453 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -197,7 +197,10 @@ Commands:
(view-mode)
(make-local-variable 'view-no-disable-on-exit)
(setq view-no-disable-on-exit t)
- (setq view-exit-action (lambda (buffer) (delete-window)))
+ (setq view-exit-action (lambda (buffer)
+ (or (window-minibuffer-p (selected-window))
+ (one-window-p t)
+ (delete-window))))
(run-mode-hooks 'help-mode-hook))
;;;###autoload
diff --git a/lisp/log-edit.el b/lisp/log-edit.el
index 0c7a655a237..611bab0a247 100644
--- a/lisp/log-edit.el
+++ b/lisp/log-edit.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1999, 2000, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: pcl-cvs cvs commit log
;; This file is part of GNU Emacs.
diff --git a/lisp/log-view.el b/lisp/log-view.el
index 8a6f88650d2..dbee454b7d6 100644
--- a/lisp/log-view.el
+++ b/lisp/log-view.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005,
;; 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: rcs sccs cvs log version-control
;; This file is part of GNU Emacs.
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 2f84e2e8222..f7846394638 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,9 @@
+2006-04-28 Bill Wohler <wohler@newt.com>
+
+ Release MH-E version 7.95.
+
+ * mh-e.el (Version, mh-version): Update for release 7.95.
+
2006-04-26 Eric Ding <ericding@alum.mit.edu>
* mh-e.el (mh-invisible-header-fields-internal): Add entry
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 4b7627562f0..88b8c5bac09 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -6,7 +6,7 @@
;; Author: Bill Wohler <wohler@newt.com>
;; Maintainer: Bill Wohler <wohler@newt.com>
-;; Version: 7.94+cvs
+;; Version: 7.95
;; Keywords: mail
;; This file is part of GNU Emacs.
@@ -136,7 +136,7 @@
;; Try to keep variables local to a single file. Provide accessors if
;; variables are shared. Use this section as a last resort.
-(defconst mh-version "7.94+cvs" "Version number of MH-E.")
+(defconst mh-version "7.95" "Version number of MH-E.")
;; Variants
diff --git a/lisp/msb.el b/lisp/msb.el
index 95cbfc85df4..61ddce5dae0 100644
--- a/lisp/msb.el
+++ b/lisp/msb.el
@@ -473,6 +473,11 @@ selects that window.
See the function `mouse-select-buffer' and the variable
`msb-menu-cond' for more information about how the menus are split."
(interactive "e")
+ ;; If EVENT is a down-event, read and discard the
+ ;; corresponding up-event.
+ (and (eventp event)
+ (memq 'down (event-modifiers event))
+ (read-event))
(let ((old-window (selected-window))
(window (posn-window (event-start event))))
(unless (framep window) (select-window window))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 5f3ab41e5cb..6e166aa2393 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1821,8 +1821,6 @@ while (my $data = <STDIN>) {
Escape sequence %s is replaced with name of Perl binary.
This string is passed to `format', so percent characters need to be doubled.")
-; These values conform to `file-attributes' from XEmacs 21.2.
-; GNU Emacs and other tools not checked.
(defconst tramp-file-mode-type-map '((0 . "-") ; Normal file (SVID-v2 and XPG2)
(1 . "p") ; fifo
(2 . "c") ; character device
@@ -1927,17 +1925,12 @@ on the FILENAME argument, even if VISIT was a string.")
"Alist of handler functions.
Operations not mentioned here will be handled by the normal Emacs functions.")
-;; Handlers for partial tramp file names. For GNU Emacs just
-;; `file-name-all-completions' is needed. The other ones are necessary
-;; for XEmacs.
+;; Handlers for partial tramp file names. For Emacs just
+;; `file-name-all-completions' is needed.
+;;;###autoload
(defconst tramp-completion-file-name-handler-alist
- '(
- (file-name-directory . tramp-completion-handle-file-name-directory)
- (file-name-nondirectory . tramp-completion-handle-file-name-nondirectory)
- (file-exists-p . tramp-completion-handle-file-exists-p)
- (file-name-all-completions . tramp-completion-handle-file-name-all-completions)
- (file-name-completion . tramp-completion-handle-file-name-completion)
- (expand-file-name . tramp-completion-handle-expand-file-name))
+ '((file-name-all-completions . tramp-completion-handle-file-name-all-completions)
+ (file-name-completion . tramp-completion-handle-file-name-completion))
"Alist of completion handler functions.
Used for file names matching `tramp-file-name-regexp'. Operations not
mentioned here will be handled by `tramp-file-name-handler-alist' or the
@@ -2172,28 +2165,11 @@ target of the symlink differ."
;; Localname manipulation functions that grok TRAMP localnames...
(defun tramp-handle-file-name-directory (file)
"Like `file-name-directory' but aware of TRAMP files."
- ;; everything except the last filename thing is the directory
+ ;; Everything except the last filename thing is the directory.
(with-parsed-tramp-file-name file nil
- ;; For the following condition, two possibilities should be tried:
- ;; (1) (string= localname "")
- ;; (2) (or (string= localname "") (string= localname "/"))
- ;; The second variant fails when completing a "/" directory on
- ;; the remote host, that is a filename which looks like
- ;; "/user@host:/". But maybe wildcards fail with the first variant.
- ;; We should do some investigation.
- (if (string= localname "")
- ;; For a filename like "/[foo]", we return "/". The `else'
- ;; case would return "/[foo]" unchanged. But if we do that,
- ;; then `file-expand-wildcards' ceases to work. It's not
- ;; quite clear to me what's the intuition that tells that this
- ;; behavior is the right behavior, but oh, well.
- "/"
- ;; run the command on the localname portion only
- ;; CCC: This should take into account the remote machine type, no?
- ;; --daniel <daniel@danann.net>
- (tramp-make-tramp-file-name multi-method method user host
- ;; This will not recurse...
- (or (file-name-directory localname) "")))))
+ ;; Run the command on the localname portion only.
+ (tramp-make-tramp-file-name
+ multi-method method user host (file-name-directory (or localname "")))))
(defun tramp-handle-file-name-nondirectory (file)
"Like `file-name-nondirectory' but aware of TRAMP files."
@@ -4144,7 +4120,8 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
;; (inhibit-file-name-operation operation))
;; (apply operation args)))
-(defun tramp-run-real-handler (operation args)
+;;;###autoload
+(progn (defun tramp-run-real-handler (operation args)
"Invoke normal file name handler for OPERATION.
First arg specifies the OPERATION, second arg is a list of arguments to
pass to the OPERATION."
@@ -4157,13 +4134,14 @@ pass to the OPERATION."
,(and (eq inhibit-file-name-operation operation)
inhibit-file-name-handlers)))
(inhibit-file-name-operation operation))
- (apply operation args)))
+ (apply operation args))))
;; This function is used from `tramp-completion-file-name-handler' functions
;; only, if `tramp-completion-mode' is true. But this cannot be checked here
;; because the check is based on a full filename, not available for all
;; basic I/O operations.
-(defun tramp-completion-run-real-handler (operation args)
+;;;###autoload
+(progn (defun tramp-completion-run-real-handler (operation args)
"Invoke `tramp-file-name-handler' for OPERATION.
First arg specifies the OPERATION, second arg is a list of arguments to
pass to the OPERATION."
@@ -4175,7 +4153,7 @@ pass to the OPERATION."
,(and (eq inhibit-file-name-operation operation)
inhibit-file-name-handlers)))
(inhibit-file-name-operation operation))
- (apply operation args)))
+ (apply operation args))))
;; We handle here all file primitives. Most of them have the file
;; name as first parameter; nevertheless we check for them explicitly
@@ -4272,12 +4250,25 @@ ARGS are the arguments OPERATION has been called with."
(defun tramp-file-name-handler (operation &rest args)
"Invoke Tramp file name handler.
Falls back to normal file name handler if no tramp file name handler exists."
+;; (setq edebug-trace t)
+;; (edebug-trace "%s" (with-output-to-string (backtrace)))
(save-match-data
(let* ((filename (apply 'tramp-file-name-for-operation operation args))
+ (completion (tramp-completion-mode filename))
(foreign (tramp-find-foreign-file-name-handler filename)))
- (cond
- (foreign (apply foreign operation args))
- (t (tramp-run-real-handler operation args))))))
+ (with-parsed-tramp-file-name filename nil
+ (cond
+ ;; When we are in completion mode, some operations shouldn' be
+ ;; handled by backend.
+ ((and completion (memq operation '(expand-file-name)))
+ (tramp-run-real-handler operation args))
+ ((and completion (zerop (length localname))
+ (memq operation '(file-exists-p file-directory-p)))
+ t)
+ ;; Call the backend function.
+ (foreign (apply foreign operation args))
+ ;; Nothing to do for us.
+ (t (tramp-run-real-handler operation args)))))))
;; In Emacs, there is some concurrency due to timers. If a timer
@@ -4325,42 +4316,39 @@ Fall back to normal file name handler if no Tramp handler exists."
(setq tramp-locked tl))))
;;;###autoload
-(defun tramp-completion-file-name-handler (operation &rest args)
+(progn (defun tramp-completion-file-name-handler (operation &rest args)
"Invoke tramp file name completion handler.
Falls back to normal file name handler if no tramp file name handler exists."
-;; (setq tramp-debug-buffer t)
-;; (tramp-message 1 "%s %s" operation args)
-;; (tramp-message 1 "%s %s\n%s"
-;; operation args (with-output-to-string (backtrace)))
+;; (setq edebug-trace t)
+;; (edebug-trace "%s" (with-output-to-string (backtrace)))
(let ((fn (assoc operation tramp-completion-file-name-handler-alist)))
(if fn
(save-match-data (apply (cdr fn) args))
- (tramp-completion-run-real-handler operation args))))
+ (tramp-completion-run-real-handler operation args)))))
-;; Register in `file-name-handler-alist'.
-;; `tramp-completion-file-name-handler' must not be active when temacs
-;; dumps. And it makes no sense in batch mode anyway.
;;;###autoload
-(defun tramp-register-file-name-handlers ()
+(defsubst tramp-register-file-name-handlers ()
"Add tramp file name handlers to `file-name-handler-alist'."
- (unless noninteractive
- (add-to-list 'file-name-handler-alist
- (cons tramp-file-name-regexp 'tramp-file-name-handler))
+ (add-to-list 'file-name-handler-alist
+ (cons tramp-file-name-regexp 'tramp-file-name-handler))
+ (when partial-completion-mode
(add-to-list 'file-name-handler-alist
(cons tramp-completion-file-name-regexp
'tramp-completion-file-name-handler))
- (put 'tramp-completion-file-name-handler 'safe-magic t)))
+ (put 'tramp-completion-file-name-handler 'safe-magic t))
+ ;; If jka-compr is already loaded, move it to the front of
+ ;; `file-name-handler-alist'.
+ (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist)))
+ (when jka
+ (setq file-name-handler-alist
+ (cons jka (delete jka file-name-handler-alist))))))
-;; LAMBDA function used temporarily, because older/other versions of
-;; Tramp don't know of `tramp-register-file-name-handlers'. Can be
-;; replaced once that DEFUN is established. Relevant for Emacs 22 only.
-;;;###;autoload(add-hook 'emacs-startup-hook 'tramp-register-file-name-handlers)
+;; During autoload, it shall be checked whether
+;; `partial-completion-mode' is active. Therefore registering will be
+;; delayed.
;;;###autoload(add-hook
-;;;###autoload 'emacs-startup-hook
-;;;###autoload '(lambda ()
-;;;###autoload (condition-case nil
-;;;###autoload (funcall 'tramp-register-file-name-handlers)
-;;;###autoload (error nil))))
+;;;###autoload 'after-init-hook
+;;;###autoload '(lambda () (tramp-register-file-name-handlers)))
(tramp-register-file-name-handlers)
;;;###autoload
@@ -4374,16 +4362,6 @@ Falls back to normal file name handler if no tramp file name handler exists."
(add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers)
-(defun tramp-repair-jka-compr ()
- "If jka-compr is already loaded, move it to the front of
-`file-name-handler-alist'. On Emacs 22 or so this will not be
-necessary anymore."
- (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist)))
- (when jka
- (setq file-name-handler-alist
- (cons jka (delete jka file-name-handler-alist))))))
-(tramp-repair-jka-compr)
-
;;; Interactions with other packages:
@@ -4497,31 +4475,10 @@ necessary anymore."
last-input-event) ?\ ))))))
t)))
-(defun tramp-completion-handle-file-exists-p (filename)
- "Like `file-exists-p' for tramp files."
- (if (tramp-completion-mode filename)
- (tramp-run-real-handler
- 'file-exists-p (list filename))
- (tramp-completion-run-real-handler
- 'file-exists-p (list filename))))
-
-;; Localname manipulation in case of partial TRAMP file names.
-(defun tramp-completion-handle-file-name-directory (file)
- "Like `file-name-directory' but aware of TRAMP files."
- (if (tramp-completion-mode file)
- "/"
- (tramp-completion-run-real-handler
- 'file-name-directory (list file))))
-
-;; Localname manipulation in case of partial TRAMP file names.
-(defun tramp-completion-handle-file-name-nondirectory (file)
- "Like `file-name-nondirectory' but aware of TRAMP files."
- (substring
- file (length (tramp-completion-handle-file-name-directory file))))
-
;; Method, host name and user name completion.
;; `tramp-completion-dissect-file-name' returns a list of
;; tramp-file-name structures. For all of them we return possible completions.
+;;;###autoload
(defun tramp-completion-handle-file-name-all-completions (filename directory)
"Like `file-name-all-completions' for partial tramp files."
@@ -4576,7 +4533,8 @@ necessary anymore."
;; unify list, remove nil elements
(while result
(let ((car (car result)))
- (when car (add-to-list 'result1 car))
+ (when car (add-to-list
+ 'result1 (substring car (length directory))))
(setq result (cdr result))))
;; Complete local parts
@@ -4595,6 +4553,7 @@ necessary anymore."
(setq tramp-completion-mode nil)))
;; Method, host name and user name completion for a file.
+;;;###autoload
(defun tramp-completion-handle-file-name-completion (filename directory)
"Like `file-name-completion' for tramp files."
(try-completion filename
@@ -4721,8 +4680,7 @@ remote host and localname (filename on remote host)."
(lambda (method)
(and method
(string-match (concat "^" (regexp-quote partial-method)) method)
- ;; we must remove leading "/".
- (substring (tramp-make-tramp-file-name nil method nil nil nil) 1)))
+ (tramp-make-tramp-file-name nil method nil nil nil)))
(delete "multi" (mapcar 'car tramp-methods))))
;; Compares partial user and host names with possible completions.
@@ -4755,8 +4713,7 @@ PARTIAL-USER must match USER, PARTIAL-HOST must match HOST."
host nil)))
(unless (zerop (+ (length user) (length host)))
- ;; we must remove leading "/".
- (substring (tramp-make-tramp-file-name nil method user host nil) 1)))
+ (tramp-make-tramp-file-name nil method user host nil)))
(defun tramp-parse-rhosts (filename)
"Return a list of (user host) tuples allowed to access.
@@ -4975,15 +4932,6 @@ User may be nil."
(forward-line 1)
result))
-(defun tramp-completion-handle-expand-file-name (name &optional dir)
- "Like `expand-file-name' for tramp files."
- (let ((fullname (concat (or dir default-directory) name)))
- (if (tramp-completion-mode fullname)
- (tramp-run-real-handler
- 'expand-file-name (list name dir))
- (tramp-completion-run-real-handler
- 'expand-file-name (list name dir)))))
-
;;; Internal Functions:
(defun tramp-maybe-send-perl-script (multi-method method user host script name)
diff --git a/lisp/pcvs-defs.el b/lisp/pcvs-defs.el
index 8f7de913261..127a550b28c 100644
--- a/lisp/pcvs-defs.el
+++ b/lisp/pcvs-defs.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: pcl-cvs
;; This file is part of GNU Emacs.
diff --git a/lisp/pcvs-info.el b/lisp/pcvs-info.el
index 7d1a11ccb68..4aaa5add58d 100644
--- a/lisp/pcvs-info.el
+++ b/lisp/pcvs-info.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: pcl-cvs
;; This file is part of GNU Emacs.
diff --git a/lisp/pcvs-parse.el b/lisp/pcvs-parse.el
index 892dc962767..0193939606c 100644
--- a/lisp/pcvs-parse.el
+++ b/lisp/pcvs-parse.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: pcl-cvs
;; This file is part of GNU Emacs.
diff --git a/lisp/pcvs-util.el b/lisp/pcvs-util.el
index b04f3c121a1..cb18fc83d59 100644
--- a/lisp/pcvs-util.el
+++ b/lisp/pcvs-util.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
;; 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: pcl-cvs
;; This file is part of GNU Emacs.
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index a5163319fbf..4b3202c6e41 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -690,10 +690,13 @@ With arg, enter name of variable to be watched in the minibuffer."
(if event (posn-set-point (event-end event)))
(require 'tooltip)
(save-selected-window
- (let ((expr (if arg
- (completing-read "Name of variable: "
- 'gud-gdb-complete-command)
- (tooltip-identifier-from-point (point)))))
+ (let ((expr
+ (if arg
+ (completing-read "Name of variable: "
+ 'gud-gdb-complete-command)
+ (if (and transient-mark-mode mark-active)
+ (buffer-substring (region-beginning) (region-end))
+ (tooltip-identifier-from-point (point))))))
(catch 'already-watched
(dolist (var gdb-var-list)
(unless (string-match "\\." (car var))
@@ -2691,7 +2694,7 @@ corresponding to the mode line clicked."
'(menu-item "Inferior IO" gdb-frame-separate-io-buffer
:enable gdb-use-separate-io-buffer))
(define-key menu [registers] '("Registers" . gdb-frame-registers-buffer))
- (define-key menu [disassembly] '("Disassembiy" . gdb-frame-assembler-buffer))
+ (define-key menu [disassembly] '("Disassembly" . gdb-frame-assembler-buffer))
(define-key menu [breakpoints]
'("Breakpoints" . gdb-frame-breakpoints-buffer))
(define-key menu [locals] '("Locals" . gdb-frame-locals-buffer))
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 6afa3f29348..c695272e92b 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -35,7 +35,7 @@
(defgroup grep nil
- "Run compiler as inferior of Emacs, parse error messages."
+ "Run grep as inferior of Emacs, parse error messages."
:group 'tools
:group 'processes)
@@ -48,23 +48,6 @@
:version "22.1"
:group 'grep)
-(defcustom grep-auto-highlight t
- "*Specify how many grep matches to highlight (and parse) initially.
-\(Highlighting applies to an grep match when the mouse is over it.)
-If this is a number N, all grep matches in the first N lines
-are highlighted and parsed as soon as they arrive in Emacs.
-If t, highlight and parse the whole grep output as soon as it arrives.
-If nil, don't highlight or parse any of the grep buffer until you try to
-move to the error messages.
-
-Those grep matches which are not parsed and highlighted initially
-will be parsed and highlighted as soon as you try to move to them."
- :type '(choice (const :tag "All" t)
- (const :tag "None" nil)
- (integer :tag "First N lines"))
- :version "22.1"
- :group 'grep)
-
(defcustom grep-highlight-matches 'auto-detect
"If t, use special markers to highlight grep matches.
@@ -108,6 +91,20 @@ call that function before using this variable in your program."
(const :tag "Not Set" nil))
:group 'grep)
+(defcustom grep-template nil
+ "The default command to run for \\[lgrep].
+The default value of this variable is set up by `grep-compute-defaults';
+call that function before using this variable in your program.
+The following place holders should be present in the string:
+ <C> - place to put -i if case insensitive grep.
+ <F> - file names and wildcards to search.
+ <R> - the regular expression searched for.
+ <N> - place to insert null-device."
+ :type '(choice string
+ (const :tag "Not Set" nil))
+ :version "22.1"
+ :group 'grep)
+
(defcustom grep-use-null-device 'auto-detect
"If t, append the value of `null-device' to `grep' commands.
This is done to ensure that the output of grep includes the filename of
@@ -130,8 +127,8 @@ call that function before using this variable in your program."
(const :tag "Not Set" nil))
:group 'grep)
-(defcustom grep-tree-command nil
- "The default find command for \\[grep-tree].
+(defcustom grep-find-template nil
+ "The default command to run for \\[rgrep].
The default value of this variable is set up by `grep-compute-defaults';
call that function before using this variable in your program.
The following place holders should be present in the string:
@@ -145,27 +142,22 @@ The following place holders should be present in the string:
:version "22.1"
:group 'grep)
-(defcustom grep-tree-files-aliases '(
+(defcustom grep-files-aliases '(
+ ("el" . "*.el")
("ch" . "*.[ch]")
("c" . "*.c")
("h" . "*.h")
- ("m" . "[Mm]akefile*")
("asm" . "*.[sS]")
- ("all" . "*")
- ("el" . "*.el")
+ ("m" . "[Mm]akefile*")
+ ("l" . "[Cc]hange[Ll]og*")
)
- "*Alist of aliases for the FILES argument to `grep-tree'."
+ "*Alist of aliases for the FILES argument to `lgrep' and `rgrep'."
:type 'alist
:group 'grep)
-(defcustom grep-tree-ignore-case t
- "*If non-nil, `grep-tree' ignores case in matches."
- :type 'boolean
- :group 'grep)
-
-(defcustom grep-tree-ignore-CVS-directories t
- "*If non-nil, `grep-tree' does no recurse into CVS directories."
- :type 'boolean
+(defcustom grep-find-ignored-directories '("CVS" ".hg" "{arch}")
+ "*List of names of sub-directories which `rgrep' shall not recurse into."
+ :type '(repeat string)
:group 'grep)
(defcustom grep-error-screen-columns nil
@@ -208,6 +200,8 @@ See `compilation-error-screen-columns'"
'("Compile..." . compile))
(define-key map [menu-bar grep compilation-grep]
'("Another grep..." . grep))
+ (define-key map [menu-bar grep compilation-grep-find]
+ '("Recursive grep..." . grep-find))
(define-key map [menu-bar grep compilation-recompile]
'("Repeat grep" . recompile))
(define-key map [menu-bar grep compilation-separator2]
@@ -353,6 +347,11 @@ This variable's value takes effect when `grep-compute-defaults' is called.")
;;;###autoload
(defvar grep-find-history nil)
+;; History of lgrep and rgrep regexp and files args.
+(defvar grep-regexp-history nil)
+(defvar grep-files-history '("ch" "el"))
+
+
;;;###autoload
(defun grep-process-setup ()
"Setup compilation variables and buffer for `grep'.
@@ -378,6 +377,12 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
(cons msg code))))
(run-hooks 'grep-setup-hook))
+(defun grep-probe (command args &optional func result)
+ (equal (condition-case nil
+ (apply (or func 'call-process) command args)
+ (error nil))
+ (or result 0)))
+
;;;###autoload
(defun grep-compute-defaults ()
(unless (or (not grep-use-null-device) (eq grep-use-null-device t))
@@ -385,73 +390,67 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
(with-temp-buffer
(let ((hello-file (expand-file-name "HELLO" data-directory)))
(not
- (and (equal (condition-case nil
- (if grep-command
- ;; `grep-command' is already set, so
- ;; use that for testing.
- (call-process-shell-command
- grep-command nil t nil
- "^English" hello-file)
- ;; otherwise use `grep-program'
- (call-process grep-program nil t nil
- "-nH" "^English" hello-file))
- (error nil))
- 0)
+ (and (if grep-command
+ ;; `grep-command' is already set, so
+ ;; use that for testing.
+ (grep-probe grep-command
+ `(nil t nil "^English" ,hello-file)
+ #'call-process-shell-command)
+ ;; otherwise use `grep-program'
+ (grep-probe grep-program
+ `(nil t nil "-nH" "^English" ,hello-file)))
(progn
(goto-char (point-min))
(looking-at
(concat (regexp-quote hello-file)
":[0-9]+:English")))))))))
- (unless grep-command
- (setq grep-command
- (let ((required-options (if grep-use-null-device "-n" "-nH")))
- (if (equal (condition-case nil ; in case "grep" isn't in exec-path
- (call-process grep-program nil nil nil
- "-e" "foo" null-device)
- (error nil))
- 1)
- (format "%s %s -e " grep-program required-options)
- (format "%s %s " grep-program required-options)))))
- (unless grep-find-use-xargs
- (setq grep-find-use-xargs
- (if (and
- (equal (call-process "find" nil nil nil
- null-device "-print0")
- 0)
- (equal (call-process "xargs" nil nil nil
- "-0" "-e" "echo")
- 0))
- 'gnu)))
- (unless grep-find-command
- (setq grep-find-command
- (cond ((eq grep-find-use-xargs 'gnu)
- (format "%s . -type f -print0 | xargs -0 -e %s"
- find-program grep-command))
- (grep-find-use-xargs
- (format "%s . -type f -print | xargs %s"
- find-program grep-command))
- (t (cons (format "%s . -type f -exec %s {} %s \\;"
- find-program grep-command null-device)
- (+ 22 (length grep-command)))))))
- (unless grep-tree-command
- (setq grep-tree-command
- (let* ((glen (length grep-program))
- (gcmd (concat grep-program " <C>" (substring grep-command glen))))
- (cond ((eq grep-find-use-xargs 'gnu)
- (format "%s <D> <X> -type f <F> -print0 | xargs -0 -e %s <R>"
- find-program gcmd))
- (grep-find-use-xargs
- (format "%s <D> <X> -type f <F> -print | xargs %s <R>"
- find-program gcmd))
- (t (format "%s <D> <X> -type f <F> -exec %s <R> {} %s \\;"
- find-program gcmd null-device))))))
+ (unless (and grep-command grep-find-command
+ grep-template grep-find-template)
+ (let ((grep-options
+ (concat (if grep-use-null-device "-n" "-nH")
+ (if (grep-probe grep-program
+ `(nil nil nil "-e" "foo" ,null-device)
+ nil 1)
+ " -e"))))
+ (unless grep-command
+ (setq grep-command
+ (format "%s %s " grep-program grep-options)))
+ (unless grep-template
+ (setq grep-template
+ (format "%s <C> %s <R> <F>" grep-program grep-options)))
+ (unless grep-find-use-xargs
+ (setq grep-find-use-xargs
+ (if (and
+ (grep-probe find-program `(nil nil nil ,null-device "-print0"))
+ (grep-probe "xargs" `(nil nil nil "-0" "-e" "echo")))
+ 'gnu)))
+ (unless grep-find-command
+ (setq grep-find-command
+ (cond ((eq grep-find-use-xargs 'gnu)
+ (format "%s . -type f -print0 | xargs -0 -e %s"
+ find-program grep-command))
+ (grep-find-use-xargs
+ (format "%s . -type f -print | xargs %s"
+ find-program grep-command))
+ (t (cons (format "%s . -type f -exec %s {} %s \\;"
+ find-program grep-command null-device)
+ (+ 22 (length grep-command)))))))
+ (unless grep-find-template
+ (setq grep-find-template
+ (let ((gcmd (format "%s <C> %s <R>"
+ grep-program grep-options)))
+ (cond ((eq grep-find-use-xargs 'gnu)
+ (format "%s . <X> -type f <F> -print0 | xargs -0 -e %s"
+ find-program gcmd))
+ (grep-find-use-xargs
+ (format "%s . <X> -type f <F> -print | xargs %s"
+ find-program gcmd))
+ (t (format "%s . <X> -type f <F> -exec %s {} %s \\;"
+ find-program gcmd null-device))))))))
(unless (or (not grep-highlight-matches) (eq grep-highlight-matches t))
(setq grep-highlight-matches
(with-temp-buffer
- (and (equal (condition-case nil
- (call-process grep-program nil t nil "--help")
- (error nil))
- 0)
+ (and (grep-probe grep-program '(nil t nil "--help"))
(progn
(goto-char (point-min))
(search-forward "--color" nil t))
@@ -487,8 +486,22 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
(file-name-extension buffer-file-name))))
(replace-match tag-default t t grep-default 1))))
+
;;;###autoload
-(defun grep (command-args &optional highlight-regexp)
+(define-compilation-mode grep-mode "Grep"
+ "Sets `grep-last-buffer' and `compilation-window-height'."
+ (setq grep-last-buffer (current-buffer))
+ (set (make-local-variable 'compilation-error-face)
+ grep-hit-face)
+ (set (make-local-variable 'compilation-error-regexp-alist)
+ grep-regexp-alist)
+ (set (make-local-variable 'compilation-process-setup-function)
+ 'grep-process-setup)
+ (set (make-local-variable 'compilation-disable-input) t))
+
+
+;;;###autoload
+(defun grep (command-args)
"Run grep, with user-specified args, and collect output in a buffer.
While grep runs asynchronously, you can use \\[next-error] (M-x next-error),
or \\<grep-mode-map>\\[compile-goto-error] in the grep \
@@ -501,15 +514,10 @@ easily repeat a grep command.
A prefix argument says to default the argument based upon the current
tag the cursor is over, substituting it into the last grep command
in the grep command history (or into `grep-command'
-if that history list is empty).
-
-If specified, optional second arg HIGHLIGHT-REGEXP is the regexp to
-temporarily highlight in visited source lines."
+if that history list is empty)."
(interactive
(progn
- (unless (and grep-command
- (or (not grep-use-null-device) (eq grep-use-null-device t)))
- (grep-compute-defaults))
+ (grep-compute-defaults)
(let ((default (grep-default-command)))
(list (read-from-minibuffer "Run grep (like this): "
(if current-prefix-arg
@@ -522,19 +530,8 @@ temporarily highlight in visited source lines."
(compilation-start (if (and grep-use-null-device null-device)
(concat command-args " " null-device)
command-args)
- 'grep-mode nil highlight-regexp))
+ 'grep-mode))
-;;;###autoload
-(define-compilation-mode grep-mode "Grep"
- "Sets `grep-last-buffer' and `compilation-window-height'."
- (setq grep-last-buffer (current-buffer))
- (set (make-local-variable 'compilation-error-face)
- grep-hit-face)
- (set (make-local-variable 'compilation-error-regexp-alist)
- grep-regexp-alist)
- (set (make-local-variable 'compilation-process-setup-function)
- 'grep-process-setup)
- (set (make-local-variable 'compilation-disable-input) t))
;;;###autoload
(defun grep-find (command-args)
@@ -547,9 +544,7 @@ This command uses a special history list for its arguments, so you can
easily repeat a find command."
(interactive
(progn
- (unless (and grep-command
- (or (not grep-use-null-device) (eq grep-use-null-device t)))
- (grep-compute-defaults))
+ (grep-compute-defaults)
(if grep-find-command
(list (read-from-minibuffer "Run find (like this): "
grep-find-command nil nil
@@ -565,84 +560,190 @@ easily repeat a find command."
;;;###autoload
(defalias 'find-grep 'grep-find)
-(defun grep-expand-command-macros (command &optional regexp files dir excl case-fold)
- "Patch grep COMMAND replacing <D>, etc."
- (setq command
- (replace-regexp-in-string "<D>"
- (or dir ".") command t t))
- (setq command
- (replace-regexp-in-string "<X>"
- (or excl "") command t t))
- (setq command
- (replace-regexp-in-string "<F>"
- (or files "") command t t))
- (setq command
- (replace-regexp-in-string "<C>"
- (if case-fold "-i" "") command t t))
- (setq command
- (replace-regexp-in-string "<R>"
- (or regexp "") command t t))
- command)
-
-(defvar grep-tree-last-regexp "")
-(defvar grep-tree-last-files (car (car grep-tree-files-aliases)))
+
+;; User-friendly interactive API.
+
+(defconst grep-expand-keywords
+ '(("<C>" . (and cf (isearch-no-upper-case-p regexp t) "-i"))
+ ("<D>" . dir)
+ ("<F>" . files)
+ ("<N>" . null-device)
+ ("<X>" . excl)
+ ("<R>" . (shell-quote-argument (or regexp ""))))
+ "List of substitutions performed by `grep-expand-template'.
+If car of an element matches, the cdr is evalled in to get the
+substitution string. Note dynamic scoping of variables.")
+
+(defun grep-expand-template (template &optional regexp files dir excl)
+ "Patch grep COMMAND string replacing <C>, <D>, <F>, <R>, and <X>."
+ (let ((command template)
+ (cf case-fold-search)
+ (case-fold-search nil))
+ (dolist (kw grep-expand-keywords command)
+ (if (string-match (car kw) command)
+ (setq command
+ (replace-match
+ (or (if (symbolp (cdr kw))
+ (symbol-value (cdr kw))
+ (save-match-data (eval (cdr kw))))
+ "")
+ t t command))))))
+
+(defun grep-read-regexp ()
+ "Read regexp arg for interactive grep."
+ (let ((default
+ (or (funcall (or find-tag-default-function
+ (get major-mode 'find-tag-default-function)
+ 'find-tag-default))
+ "")))
+ (read-string
+ (concat "Search for"
+ (if (and default (> (length default) 0))
+ (format " (default %s): " default) ": "))
+ nil 'grep-regexp-history default)))
+
+(defun grep-read-files (regexp)
+ "Read files arg for interactive grep."
+ (let* ((bn (or (buffer-file-name) (buffer-name)))
+ (fn (and bn
+ (stringp bn)
+ (file-name-nondirectory bn)))
+ (default
+ (or (and fn
+ (let ((aliases grep-files-aliases)
+ alias)
+ (while aliases
+ (setq alias (car aliases)
+ aliases (cdr aliases))
+ (if (string-match (wildcard-to-regexp (cdr alias)) fn)
+ (setq aliases nil)
+ (setq alias nil)))
+ (cdr alias)))
+ (and fn
+ (let ((ext (file-name-extension fn)))
+ (and ext (concat "*." ext))))))
+ (files (read-string
+ (concat "Search for \"" regexp
+ "\" in files"
+ (if default (concat " (default " default ")"))
+ ": ")
+ nil 'grep-files-history default)))
+ (and files
+ (or (cdr (assoc files grep-files-aliases))
+ files))))
;;;###autoload
-(defun grep-tree (regexp files dir &optional subdirs)
- "Grep for REGEXP in FILES in directory tree rooted at DIR.
-Collect output in a buffer.
-Interactively, prompt separately for each search parameter.
-With prefix arg, reuse previous REGEXP.
+(defun lgrep (regexp &optional files)
+ "Run grep, searching for REGEXP in FILES in current directory.
The search is limited to file names matching shell pattern FILES.
-FILES may use abbreviations defined in `grep-tree-files-aliases', e.g.
+FILES may use abbreviations defined in `grep-files-aliases', e.g.
entering `ch' is equivalent to `*.[ch]'.
-While find runs asynchronously, you can use the \\[next-error] command
-to find the text that grep hits refer to.
+With \\[universal-argument] prefix, allow user to edit the constructed
+shell command line before it is executed.
+With two \\[universal-argument] prefixes, edit and run grep shell command.
-This command uses a special history list for its arguments, so you can
-easily repeat a find command.
+Collect output in a buffer. While grep runs asynchronously, you
+can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error]
+in the grep output buffer, to go to the lines where grep found matches.
-When used non-interactively, optional arg SUBDIRS limits the search to
-those sub directories of DIR."
+This command shares argument histories with \\[rgrep] and \\[grep]."
(interactive
- (let* ((regexp
- (if current-prefix-arg
- grep-tree-last-regexp
- (let* ((default (current-word))
- (spec (read-string
- (concat "Search for"
- (if (and default (> (length default) 0))
- (format " (default %s): " default) ": ")))))
- (if (equal spec "") default spec))))
- (files
- (read-string (concat "Search for \"" regexp "\" in files (default " grep-tree-last-files "): ")))
- (dir
- (read-directory-name "Base directory: " nil default-directory t)))
- (list regexp files dir)))
- (unless grep-tree-command
- (grep-compute-defaults))
- (unless (and (stringp files) (> (length files) 0))
- (setq files grep-tree-last-files))
- (when files
- (setq grep-tree-last-files files)
- (let ((mf (assoc files grep-tree-files-aliases)))
- (if mf
- (setq files (cdr mf)))))
- (let ((command-args (grep-expand-command-macros
- grep-tree-command
- (setq grep-tree-last-regexp regexp)
- (and files (concat "-name '" files "'"))
- (if subdirs
- (if (stringp subdirs)
- subdirs
- (mapconcat 'identity subdirs " "))
- nil) ;; we change default-directory to dir
- (and grep-tree-ignore-CVS-directories "-path '*/CVS' -prune -o ")
- grep-tree-ignore-case))
- (default-directory (file-name-as-directory (expand-file-name dir)))
- (null-device nil)) ; see grep
- (grep command-args regexp)))
+ (progn
+ (grep-compute-defaults)
+ (cond
+ ((and grep-command (equal current-prefix-arg '(16)))
+ (list (read-from-minibuffer "Run: " grep-command
+ nil nil 'grep-history)
+ nil))
+ ((not grep-template)
+ (list nil
+ (read-string "grep.el: No `grep-template' available. Press RET.")))
+ (t (let* ((regexp (grep-read-regexp))
+ (files (grep-read-files regexp)))
+ (list regexp files))))))
+ (when (and (stringp regexp) (> (length regexp) 0))
+ (let ((command regexp))
+ (if (null files)
+ (if (string= command grep-command)
+ (setq command nil))
+ (setq command (grep-expand-template
+ grep-template
+ regexp
+ files))
+ (when command
+ (if (equal current-prefix-arg '(4))
+ (setq command
+ (read-from-minibuffer "Confirm: "
+ command nil nil 'grep-history))
+ (push command grep-history))))
+ (when command
+ ;; Setting process-setup-function makes exit-message-function work
+ ;; even when async processes aren't supported.
+ (compilation-start (if (and grep-use-null-device null-device)
+ (concat command " " null-device)
+ command) 'grep-mode)))))
+
+
+;;;###autoload
+(defun rgrep (regexp &optional files dir)
+ "Recusively grep for REGEXP in FILES in directory tree rooted at DIR.
+The search is limited to file names matching shell pattern FILES.
+FILES may use abbreviations defined in `grep-files-aliases', e.g.
+entering `ch' is equivalent to `*.[ch]'.
+
+With \\[universal-argument] prefix, allow user to edit the constructed
+shell command line before it is executed.
+With two \\[universal-argument] prefixes, edit and run grep-find shell command.
+
+Collect output in a buffer. While find runs asynchronously, you
+can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error]
+in the grep output buffer, to go to the lines where grep found matches.
+
+This command shares argument histories with \\[lgrep] and \\[grep-find]."
+ (interactive
+ (progn
+ (grep-compute-defaults)
+ (cond
+ ((and grep-find-command (equal current-prefix-arg '(16)))
+ (list (read-from-minibuffer "Run: " grep-find-command
+ nil nil 'grep-find-history)
+ nil))
+ ((not grep-find-template)
+ (list nil nil
+ (read-string "grep.el: No `grep-find-template' available. Press RET.")))
+ (t (let* ((regexp (grep-read-regexp))
+ (files (grep-read-files regexp))
+ (dir (read-directory-name "Base directory: "
+ nil default-directory t)))
+ (list regexp files dir))))))
+ (when (and (stringp regexp) (> (length regexp) 0))
+ (if (null files)
+ (if (not (string= regexp grep-find-command))
+ (compilation-start regexp 'grep-mode))
+ (let* ((default-directory (file-name-as-directory (expand-file-name dir)))
+ (command (grep-expand-template
+ grep-find-template
+ regexp
+ (concat "\\( -name "
+ (mapconcat #'shell-quote-argument
+ (split-string files)
+ " -o -name ")
+ " \\)")
+ default-directory
+ (and grep-find-ignored-directories
+ (concat "\\( -path '*/"
+ (mapconcat #'identity
+ grep-find-ignored-directories
+ "' -o -path '*/")
+ "' \\) -prune -o ")))))
+ (when command
+ (if current-prefix-arg
+ (setq command
+ (read-from-minibuffer "Confirm: "
+ command nil nil 'grep-find-history))
+ (push command grep-find-history))
+ (compilation-start command 'grep-mode))))))
(provide 'grep)
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 1549150dfa8..11259aa3965 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -303,13 +303,15 @@ Uses `gud-<MINOR-MODE>-directories' to find the source files."
optional doc string DOC. Certain %-escapes in the string arguments
are interpreted specially if present. These are:
- %f name (without directory) of current source file.
- %F name (without directory or extension) of current source file.
- %d directory of current source file.
- %l number of current source line
- %e text of the C lvalue or function-call expression surrounding point.
- %a text of the hexadecimal address surrounding point
- %p prefix argument to the command (if any) as a number
+ %f -- Name (without directory) of current source file.
+ %F -- Name (without directory or extension) of current source file.
+ %d -- Directory of current source file.
+ %l -- Number of current source line.
+ %e -- Text of the C lvalue or function-call expression surrounding point.
+ %a -- Text of the hexadecimal address surrounding point.
+ %p -- Prefix argument to the command (if any) as a number.
+ %c -- Fully qualified class name derived from the expression
+ surrounding point (jdb only).
The `current' source file is the file of the current buffer (if
we're in a C file) or the source file current at the last break or
@@ -446,8 +448,7 @@ required by the caller."
(when (or gdb-force-update
(not (save-excursion
(goto-char (point-min))
- (let ((case-fold-search t))
- (looking-at "Watch Expressions:")))))
+ (looking-at "Watch Expressions:"))))
(erase-buffer)
(insert "Watch Expressions:\n")
(if gdb-speedbar-auto-raise
@@ -2804,7 +2805,9 @@ Obeying it means displaying in another window the specified file and line."
(let ((insource (not (eq (current-buffer) gud-comint-buffer)))
(frame (or gud-last-frame gud-last-last-frame))
result)
- (while (and str (string-match "\\([^%]*\\)%\\([adeflpc]\\)" str))
+ (while (and str
+ (let ((case-fold-search nil))
+ (string-match "\\([^%]*\\)%\\([adefFlpc]\\)" str)))
(let ((key (string-to-char (match-string 2 str)))
subst)
(cond
diff --git a/lisp/replace.el b/lisp/replace.el
index 3187bbbbd36..f1792b499fc 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1098,6 +1098,7 @@ See also `multi-occur'."
(endpt nil)
(marker nil)
(curstring "")
+ (inhibit-field-text-motion t)
(headerpt (with-current-buffer out-buf (point))))
(with-current-buffer buf
(or coding
diff --git a/lisp/reveal.el b/lisp/reveal.el
index 4120f9331b3..84411f98658 100644
--- a/lisp/reveal.el
+++ b/lisp/reveal.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: outlines
;; This file is part of GNU Emacs.
diff --git a/lisp/simple.el b/lisp/simple.el
index 99192d79ec0..bf620c2533d 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1697,7 +1697,7 @@ This variable only matters if `undo-ask-before-discard' is non-nil.")
;; but we don't want to ask the question again.
(setq undo-extra-outer-limit (+ size 50000))
(if (let (use-dialog-box track-mouse executing-kbd-macro )
- (yes-or-no-p (format "Buffer %s undo info is %d bytes long; discard it? "
+ (yes-or-no-p (format "Buffer `%s' undo info is %d bytes long; discard it? "
(buffer-name) size)))
(progn (setq buffer-undo-list nil)
(setq undo-extra-outer-limit nil)
@@ -1705,7 +1705,7 @@ This variable only matters if `undo-ask-before-discard' is non-nil.")
nil))
(display-warning '(undo discard-info)
(concat
- (format "Buffer %s undo info was %d bytes long.\n"
+ (format "Buffer `%s' undo info was %d bytes long.\n"
(buffer-name) size)
"The undo info was discarded because it exceeded \
`undo-outer-limit'.
diff --git a/lisp/smerge-mode.el b/lisp/smerge-mode.el
index 9fddc4b1a05..8d9df188875 100644
--- a/lisp/smerge-mode.el
+++ b/lisp/smerge-mode.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1999, 2000, 2001, 2002, 2003,
;; 2004, 2005, 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: tools revision-control merge diff3 cvs conflict
;; This file is part of GNU Emacs.
diff --git a/lisp/startup.el b/lisp/startup.el
index 695cdf4410f..07039fa8c18 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1623,7 +1623,7 @@ normal otherwise."
(not noninteractive))
(display-warning
'initialization
- "Building Emacs overflowed pure space."
+ "Building Emacs overflowed pure space. See \"(elisp)Building Emacs\" for more information."
;; FIXME: Tell the user what kind of problems are possible and how to fix
;; the overflow.
:warning))
diff --git a/lisp/subr.el b/lisp/subr.el
index 6bd25f12dde..43f1d5e57b1 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1262,25 +1262,25 @@ If TOGGLE has a `:menu-tag', that is used for the menu item's label."
;;; Load history
-;;; (defvar symbol-file-load-history-loaded nil
-;;; "Non-nil means we have loaded the file `fns-VERSION.el' in `exec-directory'.
-;;; That file records the part of `load-history' for preloaded files,
-;;; which is cleared out before dumping to make Emacs smaller.")
-
-;;; (defun load-symbol-file-load-history ()
-;;; "Load the file `fns-VERSION.el' in `exec-directory' if not already done.
-;;; That file records the part of `load-history' for preloaded files,
-;;; which is cleared out before dumping to make Emacs smaller."
-;;; (unless symbol-file-load-history-loaded
-;;; (load (expand-file-name
-;;; ;; fns-XX.YY.ZZ.el does not work on DOS filesystem.
-;;; (if (eq system-type 'ms-dos)
-;;; "fns.el"
-;;; (format "fns-%s.el" emacs-version))
-;;; exec-directory)
-;;; ;; The file name fns-%s.el already has a .el extension.
-;;; nil nil t)
-;;; (setq symbol-file-load-history-loaded t)))
+;; (defvar symbol-file-load-history-loaded nil
+;; "Non-nil means we have loaded the file `fns-VERSION.el' in `exec-directory'.
+;; That file records the part of `load-history' for preloaded files,
+;; which is cleared out before dumping to make Emacs smaller.")
+
+;; (defun load-symbol-file-load-history ()
+;; "Load the file `fns-VERSION.el' in `exec-directory' if not already done.
+;; That file records the part of `load-history' for preloaded files,
+;; which is cleared out before dumping to make Emacs smaller."
+;; (unless symbol-file-load-history-loaded
+;; (load (expand-file-name
+;; ;; fns-XX.YY.ZZ.el does not work on DOS filesystem.
+;; (if (eq system-type 'ms-dos)
+;; "fns.el"
+;; (format "fns-%s.el" emacs-version))
+;; exec-directory)
+;; ;; The file name fns-%s.el already has a .el extension.
+;; nil nil t)
+;; (setq symbol-file-load-history-loaded t)))
(defun symbol-file (symbol &optional type)
"Return the input source in which SYMBOL was defined.
@@ -1927,6 +1927,10 @@ a system-dependent default device name is used."
Otherwise, return nil."
(or (stringp object) (null object)))
+(defun booleanp (object)
+ "Return non-nil if OBJECT is one of the two canonical boolean values: t or nil."
+ (memq object '(nil t)))
+
;;;; Support for yanking and text properties.
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index ef5e8648b5c..4ab0606c18a 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -1480,7 +1480,7 @@ in `selection-converter-alist', which see."
(re-search-forward
(mapconcat 'regexp-quote (split-string search-text) "\\|")
nil t)))))
- (raise-frame))
+ (select-frame-set-input-focus (selected-frame)))
(defun mac-ae-text (ae)
(or (cdr (mac-ae-parameter ae nil "TEXT"))
@@ -2039,9 +2039,10 @@ Switch to a buffer editing the last file dropped."
(dolist (file-name (nth 2 event))
(dnd-handle-one-url window 'private
(concat "file:" file-name))))
- (raise-frame))
+ (select-frame-set-input-focus (selected-frame)))
(global-set-key [drag-n-drop] 'mac-drag-n-drop)
+(global-set-key [M-drag-n-drop] 'mac-drag-n-drop)
;;;; Non-toolkit Scroll bars
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 545e9fe14b5..9218c565c97 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -48,7 +48,7 @@ A value of nil means that any change in indentation starts a new paragraph."
"*Non-nil means put two spaces after a colon when filling."
:type 'boolean
:group 'fill)
-;;;###autoload(put 'colon-double-space 'safe-local-variable 'symbolp)
+;;;###autoload(put 'colon-double-space 'safe-local-variable 'booleanp)
(defvar fill-paragraph-function nil
"Mode-specific function to fill a paragraph, or nil if there is none.
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index 9e7d02182ef..aac4cee4dd7 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -81,7 +81,7 @@ to paragraphs. The fill functions insert and delete only soft newlines."
(set-hard-newline-properties (point) (1+ (point)))))))))))
(defcustom paragraph-start "\f\\|[ \t]*$" "\
-*Regexp for beginning of a line that starts OR separates paragraphs.
+Regexp for beginning of a line that starts OR separates paragraphs.
This regexp should match lines that separate paragraphs
and should also match lines that start a paragraph
\(and are part of that paragraph).
@@ -107,7 +107,7 @@ hard newline are considered to match."
;; start a new paragraph).
(defcustom paragraph-separate "[ \t\f]*$"
- "*Regexp for beginning of a line that separates paragraphs.
+ "Regexp for beginning of a line that separates paragraphs.
If you change this, you may have to change `paragraph-start' also.
This is matched against the text at the left margin, which is not necessarily
@@ -119,7 +119,7 @@ text indented by a margin setting."
;;;###autoload(put 'paragraph-separate 'safe-local-variable 'stringp)
(defcustom sentence-end-double-space t
- "*Non-nil means a single space does not end a sentence.
+ "Non-nil means a single space does not end a sentence.
This is relevant for filling. See also `sentence-end-without-period'
and `colon-double-space'.
@@ -128,10 +128,10 @@ regexp describing the end of a sentence, when the value of the variable
`sentence-end' is nil. See Info node `(elisp)Standard Regexps'."
:type 'boolean
:group 'fill)
-;;;###autoload(put 'sentence-end-double-space 'safe-local-variable 'symbolp)
+;;;###autoload(put 'sentence-end-double-space 'safe-local-variable 'booleanp)
(defcustom sentence-end-without-period nil
- "*Non-nil means a sentence will end without a period.
+ "Non-nil means a sentence will end without a period.
For example, a sentence in Thai text ends with double space but
without a period.
@@ -140,21 +140,21 @@ regexp describing the end of a sentence, when the value of the variable
`sentence-end' is nil. See Info node `(elisp)Standard Regexps'."
:type 'boolean
:group 'fill)
-;;;###autoload(put 'sentence-end-without-period 'safe-local-variable 'symbolp)
+;;;###autoload(put 'sentence-end-without-period 'safe-local-variable 'booleanp)
(defcustom sentence-end-without-space
"$B!#!%!)!*$A!##.#?#!$(0!$!%!)!*$(G!$!%!)!*(B"
- "*String of characters that end sentence without following spaces.
+ "String of characters that end sentence without following spaces.
This value is used by the function `sentence-end' to construct the
regexp describing the end of a sentence, when the value of the variable
`sentence-end' is nil. See Info node `(elisp)Standard Regexps'."
:group 'paragraphs
:type 'string)
-;;;###autoload(put 'sentence-end-without-space 'safe-local-variable 'symbolp)
+;;;###autoload(put 'sentence-end-without-space 'safe-local-variable 'stringp)
(defcustom sentence-end nil
- "*Regexp describing the end of a sentence.
+ "Regexp describing the end of a sentence.
The value includes the whitespace following the sentence.
All paragraph boundaries also end sentences, regardless.
@@ -166,7 +166,7 @@ to obtain the value of this variable."
;;;###autoload(put 'sentence-end 'safe-local-variable 'string-or-null-p)
(defcustom sentence-end-base "[.?!][]\"'$B!I$,1r}(B)}]*"
- "*Regexp matching the basic end of a sentence, not including following space."
+ "Regexp matching the basic end of a sentence, not including following space."
:group 'paragraphs
:type 'string
:version "22.1")
@@ -195,17 +195,17 @@ in between. See Info node `(elisp)Standard Regexps'."
"[ \t\n]*")))
(defcustom page-delimiter "^\014"
- "*Regexp describing line-beginnings that separate pages."
+ "Regexp describing line-beginnings that separate pages."
:group 'paragraphs
:type 'regexp)
;;;###autoload(put 'page-delimiter 'safe-local-variable 'stringp)
(defcustom paragraph-ignore-fill-prefix nil
- "*Non-nil means the paragraph commands are not affected by `fill-prefix'.
+ "Non-nil means the paragraph commands are not affected by `fill-prefix'.
This is desirable in modes where blank lines are the paragraph delimiters."
:group 'paragraphs
:type 'boolean)
-;;;###autoload(put 'paragraph-ignore-fill-prefix 'safe-local-variable 'symbolp)
+;;;###autoload(put 'paragraph-ignore-fill-prefix 'safe-local-variable 'booleanp)
(defun forward-paragraph (&optional arg)
"Move forward to end of paragraph.
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index 026336c301e..f4334fbbd70 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -975,7 +975,7 @@ immediately offer the correct label menu - otherwise it will prompt you for
a label type. If you set this variable to nil, RefTeX will always prompt."
:group 'reftex-referencing-labels
:type 'boolean)
-;;;###autoload(put 'reftex-guess-label-type 'safe-local-variable 'symbolp)
+;;;###autoload(put 'reftex-guess-label-type 'safe-local-variable (lambda (x) (memq x '(nil t))))
(defcustom reftex-format-ref-function nil
"Function which produces the string to insert as a reference.
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index 023b90af5d9..e58114e5b26 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -269,21 +269,26 @@ holds a keymap."
;; There's no icon appropriate for News and we need a command rather
;; than a lambda for Read Mail.
- ;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose")
+ ;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose")
- (tool-bar-add-item-from-menu 'print-buffer "print")
- (tool-bar-add-item "preferences" 'customize 'customize
- :help "Edit preferences (customize)")
+ (tool-bar-add-item-from-menu 'print-buffer "print")
- (tool-bar-add-item "help" (lambda ()
- (interactive)
- (popup-menu menu-bar-help-menu))
- 'help
- :help "Pop up the Help menu")
+ ;; tool-bar-add-item-from-menu itself operates on
+ ;; (default-value 'tool-bar-map), but when we don't use that function,
+ ;; we must explicitly operate on the default value.
- (setq tool-bar-setup t))))
+ (let ((tool-bar-map (default-value 'tool-bar-map)))
+ (tool-bar-add-item "preferences" 'customize 'customize
+ :help "Edit preferences (customize)")
+
+ (tool-bar-add-item "help" (lambda ()
+ (interactive)
+ (popup-menu menu-bar-help-menu))
+ 'help
+ :help "Pop up the Help menu"))
+ (setq tool-bar-setup t))))
-(provide 'tool-bar)
+(provide 'tool-bar)
;;; arch-tag: 15f30f0a-d0d7-4d50-bbb7-f48fd0c8582f
;;; tool-bar.el ends here