aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKaroly Lorentey2004-06-24 07:44:13 +0000
committerKaroly Lorentey2004-06-24 07:44:13 +0000
commit3fa701994755105d1fb4b0b802338fc04e8a6937 (patch)
tree02ec9152f5f6e95bbb0b02265f51b832e712e8b5 /lisp
parent8c8d5f3503a2fb4918414c0b0b9dacd81c50f1a9 (diff)
parentbb72b9d0b5248404a55b599d99c0be5454704e4a (diff)
downloademacs-3fa701994755105d1fb4b0b802338fc04e8a6937.tar.gz
emacs-3fa701994755105d1fb4b0b802338fc04e8a6937.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-409 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-410 Make sure image types are initialized for lookup too * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-411 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-412 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-413 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-414 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-415 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-416 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-417 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-418 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-419 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-202
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog109
-rw-r--r--lisp/autorevert.el21
-rw-r--r--lisp/comint.el33
-rw-r--r--lisp/cus-edit.el16
-rw-r--r--lisp/dired-aux.el6
-rw-r--r--lisp/emacs-lisp/ewoc.el51
-rw-r--r--lisp/files.el14
-rw-r--r--lisp/frame.el5
-rw-r--r--lisp/image.el10
-rw-r--r--lisp/isearch.el17
-rw-r--r--lisp/makefile.w32-in22
-rw-r--r--lisp/man.el3
-rw-r--r--lisp/mouse.el2
-rw-r--r--lisp/net/goto-addr.el4
-rw-r--r--lisp/newcomment.el20
-rw-r--r--lisp/progmodes/compile.el2
-rw-r--r--lisp/progmodes/grep.el12
-rw-r--r--lisp/ps-print.el4
-rw-r--r--lisp/replace.el104
19 files changed, 333 insertions, 122 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4ac29e4ddfc..4b7eb38c208 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,112 @@
12004-06-24 Daniel Pfeiffer <occitan@esperanto.org>
2
3 * progmodes/grep.el (grep-error-screen-columns): New variable.
4 (grep-regexp-alist): Give it the full functionality of gnu style
5 compilation messages with line and column ranges. Ask me for the
6 perl script I'm working on, that uses these.
7
82004-06-23 Nick Roberts <nickrob@gnu.org>
9
10 * comint.el: (comint-insert-clicked-input, comint-copy-old-input):
11 Remove.
12 (comint-insert-input, comint-mouse-insert-input): New functions
13 based on comint-insert-clicked-input for two bindings but just
14 one functionality.
15
162004-06-23 Luc Teirlinck <teirllm@auburn.edu>
17
18 * net/goto-addr.el (goto-address-fontify): Fix help-echo text.
19
202004-06-23 Lars Hansen <larsh@math.ku.dk>
21
22 * files.el (write-contents-functions): Doc fix.
23
242004-06-21 Juanma Barranquero <lektu@terra.es>
25
26 * image.el (image-library-alist): Rewrite docstring in active
27 voice.
28
292004-06-20 Richard M. Stallman <rms@gnu.org>
30
31 * mouse.el (mouse-set-region-1): Set transient-mark-mode to `only'.
32
33 * isearch.el (isearch-repeat): Avoid testing old match data.
34 (isearch-message): Display trailing space in special font
35 when search is failing.
36 (isearch-search-fun-function): Doc fix.
37
38 * autorevert.el (global-auto-revert-non-file-buffers): Doc fix.
39
402004-06-19 Luc Teirlinck <teirllm@auburn.edu>
41
42 * frame.el (show-trailing-whitespace): Doc fix.
43
44 * cus-edit.el (custom-variable-documentation): New function.
45 (custom-variable): Use it.
46
472004-06-19 Nick Roberts <nickrob@gnu.org>
48
49 * man.el (Man-getpage-in-background): Revert previous change but
50 make cygwin a special case.
51
522004-06-18 Luc Teirlinck <teirllm@auburn.edu>
53
54 * autorevert.el (global-auto-revert-non-file-buffers): Update
55 docstring.
56
572004-06-19 Daniel Pfeiffer <occitan@esperanto.org>
58
59 * progmodes/compile.el (compilation-error-properties): Store one
60 more than end-col, if present, so that transient-mark-mode will
61 highlight last char too.
62 * progmodes/grep.el (grep-regexp-alist): Match columns and column
63 ranges, if present.
64
652004-06-18 Jason Rumney <jasonr@gnu.org>
66
67 * makefile.w32-in: Double percent signs in for loops.
68
692004-06-17 David Kastrup <dak@gnu.org>
70
71 * replace.el (query-replace-read-args): Only warn about use of \n
72 and \t when we are doing a regexp replacement and the actual
73 escaped character is n or t.
74 (query-replace-regexp): Add \, and \# interpretation to
75 interactive call and document it.
76 (query-replace-regexp-eval, replace-match-string-symbols): add \#
77 as shortkey for replace-count.
78 (replace-quote): New function for doubling backslashes.
79
802004-06-17 Juanma Barranquero <lektu@terra.es>
81
82 * files.el (parse-colon-path, cd): Mention in docstring that the
83 path separator is colon in GNU-like systems.
84
85 * newcomment.el (comment-region-internal): Fix docstring.
86
87 * emacs-lisp/ewoc.el (ewoc-create, ewoc-map, ewoc-locate)
88 (ewoc-invalidate, ewoc-collect): Doc fixes.
89 (ewoc--create-node, ewoc--delete-node-internal):
90 Fix typos in docstring.
91
922004-06-15 Luc Teirlinck <teirllm@auburn.edu>
93
94 * files.el (buffer-stale-function): Add hyperlink to emacs-xtra
95 manual to docstring.
96
972004-06-15 Vinicius Jose Latorre <viniciusjl@ig.com.br>
98
99 * ps-print.el (ps-time-stamp-iso8601): Comment doc string of defalias.
100
1012004-06-15 Luc Teirlinck <teirllm@auburn.edu>
102
103 * dired-aux.el (dired-do-redisplay, dired-maybe-insert-subdir):
104 Add hyperlink to emacs-xtra manual to docstring.
105
106 * autorevert.el (global-auto-revert-non-file-buffers): Add
107 hyperlink to emacs-xtra manual to docstring, as well as an
108 info-link.
109
12004-06-14 Juanma Barranquero <lektu@terra.es> 1102004-06-14 Juanma Barranquero <lektu@terra.es>
2 111
3 * image.el (image-library-alist): New variable to map image types 112 * image.el (image-library-alist): New variable to map image types
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 7987e880ec1..7b786882cf6 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -174,20 +174,21 @@ would only waste precious space."
174 :type 'hook) 174 :type 'hook)
175 175
176(defcustom global-auto-revert-non-file-buffers nil 176(defcustom global-auto-revert-non-file-buffers nil
177 "When nil only file buffers are reverted by Global Auto-Revert Mode. 177 "When nil, Global Auto-Revert mode operates only on file-visiting buffers.
178 178
179When non-nil, both file buffers and buffers with a custom 179When non-nil, both file buffers and buffers with a custom
180`revert-buffer-function' and a `buffer-stale-function' are 180`revert-buffer-function' and a `buffer-stale-function' are
181reverted by Global Auto-Revert Mode. 181reverted by Global Auto-Revert mode. These include the Buffer
182 182List buffer, and Dired buffers showing complete local
183Use this option with care since it could lead to excessive reverts. 183directories. Dired buffers do not auto-revert as a result of
184Note also that for some non-file buffers the check whether the 184changes in subdirectories or in the contents, size, modes, etc.,
185buffer needs updating may be imperfect, due to efficiency 185of files. You may still sometimes want to revert them manually.
186considerations, and may not take all information listed in the 186
187buffer into account. Hence, a non-nil value for this option does 187Use this option with care since it could lead to excessive auto-reverts.
188not necessarily make manual updates useless for non-file buffers." 188For more information, see Info node `(emacs-xtra)Autorevert'."
189 :group 'auto-revert 189 :group 'auto-revert
190 :type 'boolean) 190 :type 'boolean
191 :link '(info-link "(emacs-xtra)Autorevert"))
191 192
192(defcustom global-auto-revert-ignore-modes '() 193(defcustom global-auto-revert-ignore-modes '()
193 "List of major modes Global Auto-Revert Mode should not check." 194 "List of major modes Global Auto-Revert Mode should not check."
diff --git a/lisp/comint.el b/lisp/comint.el
index 12d8e1fcbb7..8b5a107c7d7 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -571,7 +571,7 @@ Entry to this mode runs the hooks on `comint-mode-hook'."
571 (define-key comint-mode-map "\C-c\C-c" 'comint-interrupt-subjob) 571 (define-key comint-mode-map "\C-c\C-c" 'comint-interrupt-subjob)
572 (define-key comint-mode-map "\C-c\C-z" 'comint-stop-subjob) 572 (define-key comint-mode-map "\C-c\C-z" 'comint-stop-subjob)
573 (define-key comint-mode-map "\C-c\C-\\" 'comint-quit-subjob) 573 (define-key comint-mode-map "\C-c\C-\\" 'comint-quit-subjob)
574 (define-key comint-mode-map "\C-c\C-m" 'comint-copy-old-input) 574 (define-key comint-mode-map "\C-c\C-m" 'comint-insert-input)
575 (define-key comint-mode-map "\C-c\C-o" 'comint-delete-output) 575 (define-key comint-mode-map "\C-c\C-o" 'comint-delete-output)
576 (define-key comint-mode-map "\C-c\C-r" 'comint-show-output) 576 (define-key comint-mode-map "\C-c\C-r" 'comint-show-output)
577 (define-key comint-mode-map "\C-c\C-e" 'comint-show-maximum-output) 577 (define-key comint-mode-map "\C-c\C-e" 'comint-show-maximum-output)
@@ -582,7 +582,7 @@ Entry to this mode runs the hooks on `comint-mode-hook'."
582 (define-key comint-mode-map "\C-c\C-s" 'comint-write-output) 582 (define-key comint-mode-map "\C-c\C-s" 'comint-write-output)
583 (define-key comint-mode-map "\C-c." 'comint-insert-previous-argument) 583 (define-key comint-mode-map "\C-c." 'comint-insert-previous-argument)
584 ;; Mouse Buttons: 584 ;; Mouse Buttons:
585 (define-key comint-mode-map [mouse-2] 'comint-insert-clicked-input) 585 (define-key comint-mode-map [mouse-2] 'comint-mouse-insert-input)
586 ;; Menu bars: 586 ;; Menu bars:
587 ;; completion: 587 ;; completion:
588 (define-key comint-mode-map [menu-bar completion] 588 (define-key comint-mode-map [menu-bar completion]
@@ -615,7 +615,7 @@ Entry to this mode runs the hooks on `comint-mode-hook'."
615 (define-key comint-mode-map [menu-bar inout kill-input] 615 (define-key comint-mode-map [menu-bar inout kill-input]
616 '("Kill Current Input" . comint-kill-input)) 616 '("Kill Current Input" . comint-kill-input))
617 (define-key comint-mode-map [menu-bar inout copy-input] 617 (define-key comint-mode-map [menu-bar inout copy-input]
618 '("Copy Old Input" . comint-copy-old-input)) 618 '("Copy Old Input" . comint-insert-input))
619 (define-key comint-mode-map [menu-bar inout forward-matching-history] 619 (define-key comint-mode-map [menu-bar inout forward-matching-history]
620 '("Forward Matching Input..." . comint-forward-matching-input)) 620 '("Forward Matching Input..." . comint-forward-matching-input))
621 (define-key comint-mode-map [menu-bar inout backward-matching-history] 621 (define-key comint-mode-map [menu-bar inout backward-matching-history]
@@ -798,11 +798,10 @@ buffer. The hook `comint-exec-hook' is run after each exec."
798 (set-process-coding-system proc decoding encoding)) 798 (set-process-coding-system proc decoding encoding))
799 proc)) 799 proc))
800 800
801 801(defun comint-insert-input ()
802(defun comint-insert-clicked-input (event) 802 "In a Comint buffer, set the current input to the previous input at point."
803 "In a Comint buffer, set the current input to the clicked-on previous input." 803 (interactive)
804 (interactive "e") 804 (let ((pos (point)))
805 (let ((pos (posn-point (event-end event))))
806 (if (not (eq (get-char-property pos 'field) 'input)) 805 (if (not (eq (get-char-property pos 'field) 'input))
807 ;; No input at POS, fall back to the global definition. 806 ;; No input at POS, fall back to the global definition.
808 (let* ((keys (this-command-keys)) 807 (let* ((keys (this-command-keys))
@@ -816,11 +815,16 @@ buffer. The hook `comint-exec-hook' is run after each exec."
816 (or (marker-position comint-accum-marker) 815 (or (marker-position comint-accum-marker)
817 (process-mark (get-buffer-process (current-buffer)))) 816 (process-mark (get-buffer-process (current-buffer))))
818 (point)) 817 (point))
819 ;; Insert the clicked-upon input 818 ;; Insert the input at point
820 (insert (buffer-substring-no-properties 819 (insert (buffer-substring-no-properties
821 (previous-single-char-property-change (1+ pos) 'field) 820 (previous-single-char-property-change (1+ pos) 'field)
822 (next-single-char-property-change pos 'field)))))) 821 (next-single-char-property-change pos 'field))))))
823 822
823(defun comint-mouse-insert-input (event)
824 "In a Comint buffer, set the current input to the previous input you click on."
825 (interactive "e")
826 (mouse-set-point event)
827 (comint-insert-input))
824 828
825 829
826;; Input history processing in a buffer 830;; Input history processing in a buffer
@@ -1858,17 +1862,6 @@ the current line with any initial string matching the regexp
1858 (comint-bol) 1862 (comint-bol)
1859 (buffer-substring-no-properties (point) (line-end-position))))) 1863 (buffer-substring-no-properties (point) (line-end-position)))))
1860 1864
1861(defun comint-copy-old-input ()
1862 "Insert after prompt old input at point as new input to be edited.
1863Calls `comint-get-old-input' to get old input."
1864 (interactive)
1865 (let ((input (funcall comint-get-old-input))
1866 (process (get-buffer-process (current-buffer))))
1867 (if (not process)
1868 (error "Current buffer has no process")
1869 (goto-char (process-mark process))
1870 (insert input))))
1871
1872(defun comint-skip-prompt () 1865(defun comint-skip-prompt ()
1873 "Skip past the text matching regexp `comint-prompt-regexp'. 1866 "Skip past the text matching regexp `comint-prompt-regexp'.
1874If this takes us past the end of the current line, don't skip at all." 1867If this takes us past the end of the current line, don't skip at all."
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 5caeb78265e..9e0efc5d3d0 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -2074,11 +2074,25 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
2074 :group 'custom-buffer 2074 :group 'custom-buffer
2075 :version "20.3") 2075 :version "20.3")
2076 2076
2077(defun custom-variable-documentation (variable)
2078 "Return documentation of VARIABLE for use in Custom buffer.
2079Normally just return the docstring. But if VARIABLE automatically
2080becomes buffer local when set, append a message to that effect."
2081 (if (and (local-variable-if-set-p variable)
2082 (or (not (local-variable-p variable))
2083 (with-temp-buffer
2084 (local-variable-if-set-p variable))))
2085 (concat (documentation-property variable 'variable-documentation)
2086 "\n
2087This variable automatically becomes buffer-local when set outside Custom.
2088However, setting it through Custom sets the default value.")
2089 (documentation-property variable 'variable-documentation)))
2090
2077(define-widget 'custom-variable 'custom 2091(define-widget 'custom-variable 'custom
2078 "Customize variable." 2092 "Customize variable."
2079 :format "%v" 2093 :format "%v"
2080 :help-echo "Set or reset this variable." 2094 :help-echo "Set or reset this variable."
2081 :documentation-property 'variable-documentation 2095 :documentation-property #'custom-variable-documentation
2082 :custom-category 'option 2096 :custom-category 'option
2083 :custom-state nil 2097 :custom-state nil
2084 :custom-menu 'custom-variable-menu-create 2098 :custom-menu 'custom-variable-menu-create
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index a58b62498ca..bf7c9c00d18 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -902,7 +902,8 @@ the buffer will not reset them. However, using `dired-undo' to re-insert
902or delete subdirectories can bypass this machinery. Hence, you sometimes 902or delete subdirectories can bypass this machinery. Hence, you sometimes
903may have to reset some subdirectory switches after a `dired-undo'. 903may have to reset some subdirectory switches after a `dired-undo'.
904You can reset all subdirectory switches to the default using 904You can reset all subdirectory switches to the default using
905\\<dired-mode-map>\\[dired-reset-subdir-switches]." 905\\<dired-mode-map>\\[dired-reset-subdir-switches].
906See Info node `(emacs-xtra)Subdir switches' for more details."
906 ;; Moves point if the next ARG files are redisplayed. 907 ;; Moves point if the next ARG files are redisplayed.
907 (interactive "P\np") 908 (interactive "P\np")
908 (if (and test-for-subdir (dired-get-subdir)) 909 (if (and test-for-subdir (dired-get-subdir))
@@ -1751,7 +1752,8 @@ the buffer will not reset them. However, using `dired-undo' to re-insert
1751or delete subdirectories can bypass this machinery. Hence, you sometimes 1752or delete subdirectories can bypass this machinery. Hence, you sometimes
1752may have to reset some subdirectory switches after a `dired-undo'. 1753may have to reset some subdirectory switches after a `dired-undo'.
1753You can reset all subdirectory switches to the default using 1754You can reset all subdirectory switches to the default using
1754\\<dired-mode-map>\\[dired-reset-subdir-switches]." 1755\\<dired-mode-map>\\[dired-reset-subdir-switches].
1756See Info node `(emacs-xtra)Subdir switches' for more details."
1755 (interactive 1757 (interactive
1756 (list (dired-get-filename) 1758 (list (dired-get-filename)
1757 (if current-prefix-arg 1759 (if current-prefix-arg
diff --git a/lisp/emacs-lisp/ewoc.el b/lisp/emacs-lisp/ewoc.el
index a0c2e3c0d70..a2cb4e9fe46 100644
--- a/lisp/emacs-lisp/ewoc.el
+++ b/lisp/emacs-lisp/ewoc.el
@@ -1,6 +1,7 @@
1;;; ewoc.el --- utility to maintain a view of a list of objects in a buffer 1;;; ewoc.el --- utility to maintain a view of a list of objects in a buffer
2 2
3;; Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation 3;; Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 04
4;; Free Software Foundation
4 5
5;; Author: Per Cederqvist <ceder@lysator.liu.se> 6;; Author: Per Cederqvist <ceder@lysator.liu.se>
6;; Inge Wallin <inge@lysator.liu.se> 7;; Inge Wallin <inge@lysator.liu.se>
@@ -244,7 +245,7 @@ BUT if it is the header or the footer in EWOC return nil instead."
244 245
245(defun ewoc--create-node (data pretty-printer pos) 246(defun ewoc--create-node (data pretty-printer pos)
246 "Call PRETTY-PRINTER with point set at POS in current buffer. 247 "Call PRETTY-PRINTER with point set at POS in current buffer.
247Remember the start position. Create a wrapper containing that 248Remember the start position. Create a wrapper containing that
248start position and the element DATA." 249start position and the element DATA."
249 (save-excursion 250 (save-excursion
250 ;; Remember the position as a number so that it doesn't move 251 ;; Remember the position as a number so that it doesn't move
@@ -263,7 +264,7 @@ start position and the element DATA."
263 264
264(defun ewoc--delete-node-internal (ewoc node) 265(defun ewoc--delete-node-internal (ewoc node)
265 "Delete a data string from EWOC. 266 "Delete a data string from EWOC.
266Can not be used on the footer. Returns the wrapper that is deleted. 267Can not be used on the footer. Returns the wrapper that is deleted.
267The start-marker in the wrapper is set to nil, so that it doesn't 268The start-marker in the wrapper is set to nil, so that it doesn't
268consume any more resources." 269consume any more resources."
269 (let ((dll (ewoc--dll ewoc)) 270 (let ((dll (ewoc--dll ewoc))
@@ -303,14 +304,14 @@ The ewoc will be inserted in the current buffer at the current position.
303 304
304PRETTY-PRINTER should be a function that takes one argument, an 305PRETTY-PRINTER should be a function that takes one argument, an
305element, and inserts a string representing it in the buffer (at 306element, and inserts a string representing it in the buffer (at
306point). The string PRETTY-PRINTER inserts may be empty or span 307point). The string PRETTY-PRINTER inserts may be empty or span
307several linse. A trailing newline will always be inserted 308several lines. A trailing newline will always be inserted
308automatically. The PRETTY-PRINTER should use insert, and not 309automatically. The PRETTY-PRINTER should use `insert', and not
309insert-before-markers. 310`insert-before-markers'.
310 311
311Optional third argument HEADER is a string that will always be 312Optional second argument HEADER is a string that will always be
312present at the top of the ewoc. HEADER should end with a 313present at the top of the ewoc. HEADER should end with a
313newline. Optionaly fourth argument FOOTER is similar, and will 314newline. Optional third argument FOOTER is similar, and will
314be inserted at the bottom of the ewoc." 315be inserted at the bottom of the ewoc."
315 (let ((new-ewoc 316 (let ((new-ewoc
316 (ewoc--create (current-buffer) 317 (ewoc--create (current-buffer)
@@ -394,9 +395,9 @@ MAP-FUNCTION is applied to the first element first.
394If MAP-FUNCTION returns non-nil the element will be refreshed (its 395If MAP-FUNCTION returns non-nil the element will be refreshed (its
395pretty-printer will be called once again). 396pretty-printer will be called once again).
396 397
397Note that the buffer for EWOC will be current buffer when MAP-FUNCTION 398Note that the buffer for EWOC will be the current buffer when
398is called. MAP-FUNCTION must restore the current buffer to BUFFER before 399MAP-FUNCTION is called. MAP-FUNCTION must restore the current
399it returns, if it changes it. 400buffer before it returns, if it changes it.
400 401
401If more than two arguments are given, the remaining 402If more than two arguments are given, the remaining
402arguments will be passed to MAP-FUNCTION." 403arguments will be passed to MAP-FUNCTION."
@@ -411,9 +412,9 @@ arguments will be passed to MAP-FUNCTION."
411(defun ewoc-filter (ewoc predicate &rest args) 412(defun ewoc-filter (ewoc predicate &rest args)
412 "Remove all elements in EWOC for which PREDICATE returns nil. 413 "Remove all elements in EWOC for which PREDICATE returns nil.
413Note that the buffer for EWOC will be current-buffer when PREDICATE 414Note that the buffer for EWOC will be current-buffer when PREDICATE
414is called. PREDICATE must restore the current buffer before it returns 415is called. PREDICATE must restore the current buffer before it returns
415if it changes it. 416if it changes it.
416The PREDICATE is called with the element as its first argument. If any 417The PREDICATE is called with the element as its first argument. If any
417ARGS are given they will be passed to the PREDICATE." 418ARGS are given they will be passed to the PREDICATE."
418 (ewoc--set-buffer-bind-dll-let* ewoc 419 (ewoc--set-buffer-bind-dll-let* ewoc
419 ((node (ewoc--node-nth dll 1)) 420 ((node (ewoc--node-nth dll 1))
@@ -428,7 +429,7 @@ ARGS are given they will be passed to the PREDICATE."
428(defun ewoc-locate (ewoc &optional pos guess) 429(defun ewoc-locate (ewoc &optional pos guess)
429 "Return the node that POS (a buffer position) is within. 430 "Return the node that POS (a buffer position) is within.
430POS may be a marker or an integer. It defaults to point. 431POS may be a marker or an integer. It defaults to point.
431GUESS should be a node that it is likely that POS is near. 432GUESS should be a node that it is likely to be near POS.
432 433
433If POS points before the first element, the first node is returned. 434If POS points before the first element, the first node is returned.
434If POS points after the last element, the last node is returned. 435If POS points after the last element, the last node is returned.
@@ -497,7 +498,7 @@ If the EWOC is empty, nil is returned."
497 498
498(defun ewoc-invalidate (ewoc &rest nodes) 499(defun ewoc-invalidate (ewoc &rest nodes)
499 "Refresh some elements. 500 "Refresh some elements.
500The pretty-printer that for EWOC will be called for all NODES." 501The pretty-printer set for EWOC will be called for all NODES."
501 (ewoc--set-buffer-bind-dll ewoc 502 (ewoc--set-buffer-bind-dll ewoc
502 (dolist (node nodes) 503 (dolist (node nodes)
503 (ewoc--refresh-node (ewoc--pretty-printer ewoc) node)))) 504 (ewoc--refresh-node (ewoc--pretty-printer ewoc) node))))
@@ -564,13 +565,13 @@ number of elements needs to be refreshed."
564(defun ewoc-collect (ewoc predicate &rest args) 565(defun ewoc-collect (ewoc predicate &rest args)
565 "Select elements from EWOC using PREDICATE. 566 "Select elements from EWOC using PREDICATE.
566Return a list of all selected data elements. 567Return a list of all selected data elements.
567PREDICATE is a function that takes a data element as its first argument. 568PREDICATE is a function that takes a data element as its first
568The elements on the returned list will appear in the same order as in 569argument. The elements on the returned list will appear in the
569the buffer. You should not rely on in which order PREDICATE is 570same order as in the buffer. You should not rely on the order of
570called. 571calls to PREDICATE.
571Note that the buffer the EWOC is displayed in is current-buffer 572Note that the buffer the EWOC is displayed in is the current
572when PREDICATE is called. If PREDICATE must restore current-buffer if 573buffer when PREDICATE is called. PREDICATE must restore it if it
573it changes it. 574changes it.
574If more than two arguments are given the 575If more than two arguments are given the
575remaining arguments will be passed to PREDICATE." 576remaining arguments will be passed to PREDICATE."
576 (ewoc--set-buffer-bind-dll-let* ewoc 577 (ewoc--set-buffer-bind-dll-let* ewoc
diff --git a/lisp/files.el b/lisp/files.el
index dc84c79df84..cd11f07969f 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -393,7 +393,8 @@ updates before the buffer is saved, use `before-save-hook' .")
393(defvar write-contents-functions nil 393(defvar write-contents-functions nil
394 "List of functions to be called before writing out a buffer to a file. 394 "List of functions to be called before writing out a buffer to a file.
395If one of them returns non-nil, the file is considered already written 395If one of them returns non-nil, the file is considered already written
396and the rest are not called. 396and the rest are not called and neither are the functions in
397`write-file-functions'.
397 398
398This variable is meant to be used for hooks that pertain to the 399This variable is meant to be used for hooks that pertain to the
399buffer's contents, not to the particular visited file; thus, 400buffer's contents, not to the particular visited file; thus,
@@ -527,7 +528,8 @@ Not actually set up until the first time you use it.")
527 528
528(defun parse-colon-path (cd-path) 529(defun parse-colon-path (cd-path)
529 "Explode a search path into a list of directory names. 530 "Explode a search path into a list of directory names.
530Directories are separated by occurrences of `path-separator'." 531Directories are separated by occurrences of `path-separator'
532\(which is colon in GNU and GNU-like systems)."
531 ;; We could use split-string here. 533 ;; We could use split-string here.
532 (and cd-path 534 (and cd-path
533 (let (cd-list (cd-start 0) cd-colon) 535 (let (cd-list (cd-start 0) cd-colon)
@@ -562,7 +564,8 @@ Directories are separated by occurrences of `path-separator'."
562 "Make DIR become the current buffer's default directory. 564 "Make DIR become the current buffer's default directory.
563If your environment includes a `CDPATH' variable, try each one of 565If your environment includes a `CDPATH' variable, try each one of
564that list of directories (separated by occurrences of 566that list of directories (separated by occurrences of
565`path-separator') when resolving a relative directory name." 567`path-separator') when resolving a relative directory name.
568The path separator is colon in GNU and GNU-like systems."
566 (interactive 569 (interactive
567 (list (read-directory-name "Change default directory: " 570 (list (read-directory-name "Change default directory: "
568 default-directory default-directory 571 default-directory default-directory
@@ -3480,7 +3483,10 @@ this function is called.
3480The idea behind the NOCONFIRM argument is that it should be 3483The idea behind the NOCONFIRM argument is that it should be
3481non-nil if the buffer is going to be reverted without asking the 3484non-nil if the buffer is going to be reverted without asking the
3482user. In such situations, one has to be careful with potentially 3485user. In such situations, one has to be careful with potentially
3483time consuming operations.") 3486time consuming operations.
3487
3488For more information on how this variable is used by Auto Revert mode,
3489see Info node `(emacs-xtra)Supporting additional buffers'.")
3484 3490
3485(defvar before-revert-hook nil 3491(defvar before-revert-hook nil
3486 "Normal hook for `revert-buffer' to run before reverting. 3492 "Normal hook for `revert-buffer' to run before reverting.
diff --git a/lisp/frame.el b/lisp/frame.el
index 585d78cdc13..ad88102af65 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1244,9 +1244,8 @@ left untouched. FRAME nil or omitted means use the selected frame."
1244(make-variable-buffer-local 'show-trailing-whitespace) 1244(make-variable-buffer-local 'show-trailing-whitespace)
1245 1245
1246(defcustom show-trailing-whitespace nil 1246(defcustom show-trailing-whitespace nil
1247 "*Non-nil means highlight trailing whitespace in face `trailing-whitespace'. 1247 "*Non-nil means highlight trailing whitespace.
1248 1248This is done in the face `trailing-whitespace'."
1249Setting this variable makes it local to the current buffer."
1250 :tag "Highlight trailing whitespace." 1249 :tag "Highlight trailing whitespace."
1251 :type 'boolean 1250 :type 'boolean
1252 :group 'font-lock) 1251 :group 'font-lock)
diff --git a/lisp/image.el b/lisp/image.el
index 88e38186d7b..ad8fcafe8de 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -54,10 +54,12 @@ a non-nil value, TYPE is the image's type.")
54 54
55Each element is a list (IMAGE-TYPE LIBRARY...), where the car is a symbol 55Each element is a list (IMAGE-TYPE LIBRARY...), where the car is a symbol
56representing a supported image type, and the rest are strings giving 56representing a supported image type, and the rest are strings giving
57alternate filenames for the corresponding external libraries to load. 57alternate filenames for the corresponding external libraries.
58They are tried in the order they appear on the list; if none of them can 58
59be loaded, the running session of Emacs won't display the image type. 59Emacs tries to load the libraries in the order they appear on the
60No entries are needed for pbm and xbm images; they're always supported.") 60list; if none is loaded, the running session of Emacs won't
61support the image type. Types 'pbm and 'xbm don't need to be
62listed; they're always supported.")
61;;;###autoload (put 'image-library-alist 'risky-local-variable t) 63;;;###autoload (put 'image-library-alist 'risky-local-variable t)
62 64
63(defun image-jpeg-p (data) 65(defun image-jpeg-p (data)
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 8357527dc8c..3898aa13f61 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -999,7 +999,8 @@ Use `isearch-exit' to quit without signaling."
999 999
1000 (if (equal isearch-string "") 1000 (if (equal isearch-string "")
1001 (setq isearch-success t) 1001 (setq isearch-success t)
1002 (if (and isearch-success (equal (match-end 0) (match-beginning 0)) 1002 (if (and isearch-success
1003 (equal (point) isearch-other-end)
1003 (not isearch-just-started)) 1004 (not isearch-just-started))
1004 ;; If repeating a search that found 1005 ;; If repeating a search that found
1005 ;; an empty string, ensure we advance. 1006 ;; an empty string, ensure we advance.
@@ -1764,7 +1765,13 @@ If there is no completion possible, say so and continue searching."
1764 (let ((cursor-in-echo-area ellipsis) 1765 (let ((cursor-in-echo-area ellipsis)
1765 (m (concat 1766 (m (concat
1766 (isearch-message-prefix c-q-hack ellipsis isearch-nonincremental) 1767 (isearch-message-prefix c-q-hack ellipsis isearch-nonincremental)
1767 isearch-message 1768 (if (and (not isearch-success)
1769 (string-match " +$" isearch-message))
1770 (concat
1771 (substring isearch-message 0 (match-beginning 0))
1772 (propertize (substring isearch-message (match-beginning 0))
1773 'face 'trailing-whitespace))
1774 isearch-message)
1768 (isearch-message-suffix c-q-hack ellipsis) 1775 (isearch-message-suffix c-q-hack ellipsis)
1769 ))) 1776 )))
1770 (if c-q-hack 1777 (if c-q-hack
@@ -1811,7 +1818,11 @@ If there is no completion possible, say so and continue searching."
1811 1818
1812;; Searching 1819;; Searching
1813 1820
1814(defvar isearch-search-fun-function nil "Override `isearch-function-fun'.") 1821(defvar isearch-search-fun-function nil
1822 "Override `isearch-search-fun'.
1823This function should return the search function for isearch to use.
1824It will call this function with three arguments
1825as if it were `search-forward'.")
1815 1826
1816(defun isearch-search-fun () 1827(defun isearch-search-fun ()
1817 "Return the function to use for the search. 1828 "Return the function to use for the search.
diff --git a/lisp/makefile.w32-in b/lisp/makefile.w32-in
index 71998d403e4..826cf89bfec 100644
--- a/lisp/makefile.w32-in
+++ b/lisp/makefile.w32-in
@@ -237,7 +237,7 @@ update-subdirs-CMD: doit
237 echo ;; In load-path, after this directory should come>> subdirs.el 237 echo ;; In load-path, after this directory should come>> subdirs.el
238 echo ;; certain of its subdirectories. Here we specify them.>> subdirs.el 238 echo ;; certain of its subdirectories. Here we specify them.>> subdirs.el
239 echo (normal-top-level-add-to-load-path $(SQUOTE)(>> subdirs.el 239 echo (normal-top-level-add-to-load-path $(SQUOTE)(>> subdirs.el
240 @for %d in ($(WINS)) do if not (%d)==(term) echo "%d">> subdirs.el 240 @for %%d in ($(WINS)) do if not (%%d)==(term) echo "%%d">> subdirs.el
241 echo ))>> subdirs.el 241 echo ))>> subdirs.el
242 242
243update-subdirs-SH: doit 243update-subdirs-SH: doit
@@ -282,11 +282,11 @@ $(DONTCOMPILE:.el=.elc):
282compile: subdirs.el compile-$(SHELLTYPE) doit 282compile: subdirs.el compile-$(SHELLTYPE) doit
283 283
284compile-CMD: 284compile-CMD:
285# -for %f in ($(lisp) $(WINS)) do for %g in (%f\*.elc) do @attrib -r %g 285# -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
286 for %f in ($(COMPILE_FIRST)) do \ 286 for %%f in ($(COMPILE_FIRST)) do \
287 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %f 287 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %%f
288 for %f in (. $(WINS)) do for %g in (%f/*.el) do \ 288 for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do \
289 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %f/%g 289 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %%f/%%g
290 290
291compile-SH: 291compile-SH:
292# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done 292# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
@@ -309,9 +309,9 @@ compile-SH:
309compile-always: subdirs.el compile-always-$(SHELLTYPE) doit 309compile-always: subdirs.el compile-always-$(SHELLTYPE) doit
310 310
311compile-always-CMD: 311compile-always-CMD:
312# -for %f in ($(lisp) $(WINS)) do for %g in (%f\*.elc) do @attrib -r %g 312# -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
313 for %f in ($(COMPILE_FIRST)) do $(emacs) -f batch-byte-compile %f 313 for %%f in ($(COMPILE_FIRST)) do $(emacs) -f batch-byte-compile %%f
314 for %f in (. $(WINS)) do for %g in (%f/*.el) do $(emacs) -f batch-byte-compile %f/%g 314 for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do $(emacs) -f batch-byte-compile %%f/%%g
315 315
316compile-always-SH: 316compile-always-SH:
317# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done 317# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
@@ -329,7 +329,7 @@ compile-always-SH:
329compile-calc: compile-calc-$(SHELLTYPE) 329compile-calc: compile-calc-$(SHELLTYPE)
330 330
331compile-calc-CMD: 331compile-calc-CMD:
332 for %f in ($(lisp)/calc/*.el) do $(emacs) -f batch-byte-compile %f 332 for %%f in ($(lisp)/calc/*.el) do $(emacs) -f batch-byte-compile %%f
333 333
334compile-calc-SH: 334compile-calc-SH:
335 for el in $(lisp)/calc/*.el; do \ 335 for el in $(lisp)/calc/*.el; do \
@@ -374,7 +374,7 @@ bootstrap-clean: bootstrap-clean-$(SHELLTYPE) loaddefs.el
374bootstrap-clean-CMD: 374bootstrap-clean-CMD:
375# if exist $(EMACS) $(MAKE) $(MFLAGS) autoloads 375# if exist $(EMACS) $(MAKE) $(MFLAGS) autoloads
376 if not exist $(lisp)\loaddefs.el cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el 376 if not exist $(lisp)\loaddefs.el cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el
377 -for %f in (. $(WINS)) do for %g in (%f\*.elc) do @$(DEL) %g 377 -for %%f in (. $(WINS)) do for %%g in (%%f\*.elc) do @$(DEL) %%g
378 378
379bootstrap-clean-SH: 379bootstrap-clean-SH:
380# if test -f $(EMACS); then $(MAKE) $(MFLAGS) autoloads; fi 380# if test -f $(EMACS); then $(MAKE) $(MFLAGS) autoloads; fi
diff --git a/lisp/man.el b/lisp/man.el
index 983be4a91cc..5a07045dda9 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -733,7 +733,8 @@ all sections related to a subject, put something appropriate into the
733 (if (fboundp 'start-process) 733 (if (fboundp 'start-process)
734 (set-process-sentinel 734 (set-process-sentinel
735 (start-process manual-program buffer 735 (start-process manual-program buffer
736 shell-file-name shell-command-switch 736 (if (eq system-type 'cygwin) shell-file-name "sh")
737 shell-command-switch
737 (format (Man-build-man-command) man-args)) 738 (format (Man-build-man-command) man-args))
738 'Man-bgproc-sentinel) 739 'Man-bgproc-sentinel)
739 (let ((exit-status 740 (let ((exit-status
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 621b517e2fe..7f9d080478a 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -625,7 +625,7 @@ This should be bound to a mouse drag event."
625 625
626(defun mouse-set-region-1 () 626(defun mouse-set-region-1 ()
627 ;; Set transient-mark-mode for a little while. 627 ;; Set transient-mark-mode for a little while.
628 (setq transient-mark-mode (or transient-mark-mode 'lambda)) 628 (setq transient-mark-mode (or transient-mark-mode 'only))
629 (setq mouse-last-region-beg (region-beginning)) 629 (setq mouse-last-region-beg (region-beginning))
630 (setq mouse-last-region-end (region-end)) 630 (setq mouse-last-region-end (region-end))
631 (setq mouse-last-region-tick (buffer-modified-tick))) 631 (setq mouse-last-region-tick (buffer-modified-tick)))
diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el
index b77be84deb3..428da8cbe8a 100644
--- a/lisp/net/goto-addr.el
+++ b/lisp/net/goto-addr.el
@@ -168,7 +168,7 @@ and `goto-address-fontify-p'."
168 (overlay-put this-overlay 168 (overlay-put this-overlay
169 'mouse-face goto-address-url-mouse-face) 169 'mouse-face goto-address-url-mouse-face)
170 (overlay-put this-overlay 170 (overlay-put this-overlay
171 'help-echo "mouse-2: follow URL") 171 'help-echo "mouse-2, C-c RET: follow URL")
172 (overlay-put this-overlay 172 (overlay-put this-overlay
173 'keymap goto-address-highlight-keymap) 173 'keymap goto-address-highlight-keymap)
174 (overlay-put this-overlay 'goto-address t))) 174 (overlay-put this-overlay 'goto-address t)))
@@ -182,7 +182,7 @@ and `goto-address-fontify-p'."
182 (overlay-put this-overlay 'mouse-face 182 (overlay-put this-overlay 'mouse-face
183 goto-address-mail-mouse-face) 183 goto-address-mail-mouse-face)
184 (overlay-put this-overlay 184 (overlay-put this-overlay
185 'help-echo "mouse-2: mail this address") 185 'help-echo "mouse-2, C-c RET: mail this address")
186 (overlay-put this-overlay 186 (overlay-put this-overlay
187 'keymap goto-address-highlight-keymap) 187 'keymap goto-address-highlight-keymap)
188 (overlay-put this-overlay 'goto-address t)))))))) 188 (overlay-put this-overlay 'goto-address t))))))))
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 2b9122a8eb9..22713f87a96 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -873,17 +873,17 @@ indentation to be kept as it was before narrowing."
873 (setq ,bindent (- ,bindent n))))))))))) 873 (setq ,bindent (- ,bindent n)))))))))))
874 874
875(defun comment-region-internal (beg end cs ce 875(defun comment-region-internal (beg end cs ce
876 &optional ccs cce block lines indent) 876 &optional ccs cce block lines indent)
877 "Comment region BEG .. END. 877 "Comment region BEG .. END.
878CS and CE are the comment start resp end string. 878CS and CE are the comment start string and comment end string,
879CCS and CCE are the comment continuation strings for the start resp end 879respectively. CCS and CCE are the comment continuation strings
880of lines (default to CS and CE). 880for the start and end of lines, respectively (default to CS and CE).
881BLOCK indicates that end of lines should be marked with either CCE, CE or CS 881BLOCK indicates that end of lines should be marked with either CCE,
882\(if CE is empty) and that those markers should be aligned. 882CE or CS \(if CE is empty) and that those markers should be aligned.
883LINES indicates that an extra lines will be used at the beginning and end 883LINES indicates that an extra lines will be used at the beginning
884of the region for CE and CS. 884and end of the region for CE and CS.
885INDENT indicates to put CS and CCS at the current indentation of the region 885INDENT indicates to put CS and CCS at the current indentation of
886rather than at left margin." 886the region rather than at left margin."
887 ;;(assert (< beg end)) 887 ;;(assert (< beg end))
888 (let ((no-empty (not (or (eq comment-empty-lines t) 888 (let ((no-empty (not (or (eq comment-empty-lines t)
889 (and comment-empty-lines (zerop (length ce))))))) 889 (and comment-empty-lines (zerop (length ce)))))))
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 3a880a4c9ea..033ce883e5f 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -583,7 +583,7 @@ Faces `compilation-error-face', `compilation-warning-face',
583 (setq col (match-string-no-properties col)) 583 (setq col (match-string-no-properties col))
584 (setq col (- (string-to-number col) compilation-first-column))) 584 (setq col (- (string-to-number col) compilation-first-column)))
585 (if (and end-col (setq end-col (match-string-no-properties end-col))) 585 (if (and end-col (setq end-col (match-string-no-properties end-col)))
586 (setq end-col (- (string-to-number end-col) compilation-first-column)) 586 (setq end-col (- (string-to-number end-col) compilation-first-column -1))
587 (if end-line (setq end-col -1))) 587 (if end-line (setq end-col -1)))
588 (if (consp type) ; not a static type, check what it is. 588 (if (consp type) ; not a static type, check what it is.
589 (setq type (or (and (car type) (match-end (car type)) 1) 589 (setq type (or (and (car type) (match-end (car type)) 1)
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index aa81f8aa770..1916bde9ea1 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -146,6 +146,14 @@ The following place holders should be present in the string:
146 :type 'boolean 146 :type 'boolean
147 :group 'grep) 147 :group 'grep)
148 148
149(defcustom grep-error-screen-columns nil
150 "*If non-nil, column numbers in grep hits are screen columns.
151See `compilation-error-screen-columns'"
152 :type '(choice (const :tag "Default" nil)
153 integer)
154 :version "21.4"
155 :group 'grep)
156
149;;;###autoload 157;;;###autoload
150(defcustom grep-setup-hook nil 158(defcustom grep-setup-hook nil
151 "List of hook functions run by `grep-process-setup' (see `run-hooks')." 159 "List of hook functions run by `grep-process-setup' (see `run-hooks')."
@@ -216,7 +224,9 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
216`complation-last-buffer' rather than `grep-last-buffer'.") 224`complation-last-buffer' rather than `grep-last-buffer'.")
217 225
218(defvar grep-regexp-alist 226(defvar grep-regexp-alist
219 '(("^\\(.+?\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 2) 227 '(("^\\(.+?\\)[:( \t]+\
228\\([0-9]+\\)\\([.:]?\\)\\([0-9]+\\)?\
229\\(?:-\\(?:\\([0-9]+\\)\\3\\)?\\.?\\([0-9]+\\)?\\)?[:) \t]" 1 (2 . 5) (4 . 6))
220 ("^Binary file \\(.+\\) matches$" 1 nil nil 1)) 230 ("^Binary file \\(.+\\) matches$" 1 nil nil 1))
221 "Regexp used to match grep hits. See `compilation-error-regexp-alist'.") 231 "Regexp used to match grep hits. See `compilation-error-regexp-alist'.")
222 232
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 4f20013c134..72ba4c24eed 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -3737,8 +3737,8 @@ It can be retrieved with `(ps-get ALIST-SYM KEY)'."
3737 (format-time-string "%Y-%m-%d")) 3737 (format-time-string "%Y-%m-%d"))
3738 3738
3739 3739
3740(defalias 'ps-time-stamp-iso8601 'ps-time-stamp-yyyy-mm-dd 3740;; Alias for `ps-time-stamp-yyyy-mm-dd' (which see).
3741 "Alias for `ps-time-stamp-yyyy-mm-dd' (which see).") 3741(defalias 'ps-time-stamp-iso8601 'ps-time-stamp-yyyy-mm-dd)
3742 3742
3743 3743
3744(defun ps-time-stamp-hh:mm:ss () 3744(defun ps-time-stamp-hh:mm:ss ()
diff --git a/lisp/replace.el b/lisp/replace.el
index 014762be53e..89f55c2829e 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1,7 +1,7 @@
1;;; replace.el --- replace commands for Emacs 1;;; replace.el --- replace commands for Emacs
2 2
3;; Copyright (C) 1985, 86, 87, 92, 94, 96, 1997, 2000, 2001, 2002 3;; Copyright (C) 1985, 86, 87, 92, 94, 96, 1997, 2000, 2001, 2002,
4;; Free Software Foundation, Inc. 4;; 2003, 2004 Free Software Foundation, Inc.
5 5
6;; Maintainer: FSF 6;; Maintainer: FSF
7 7
@@ -81,14 +81,15 @@ strings or patterns."
81 query-replace-from-history-variable 81 query-replace-from-history-variable
82 nil t))) 82 nil t)))
83 ;; Warn if user types \n or \t, but don't reject the input. 83 ;; Warn if user types \n or \t, but don't reject the input.
84 (if (string-match "\\\\[nt]" from) 84 (and regexp-flag
85 (let ((match (match-string 0 from))) 85 (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from)
86 (cond 86 (let ((match (match-string 3 from)))
87 ((string= match "\\n") 87 (cond
88 (message "Note: `\\n' here doesn't match a newline; to do that, type C-q C-j instead")) 88 ((string= match "\\n")
89 ((string= match "\\t") 89 (message "Note: `\\n' here doesn't match a newline; to do that, type C-q C-j instead"))
90 (message "Note: `\\t' here doesn't match a tab; to do that, just type TAB"))) 90 ((string= match "\\t")
91 (sit-for 2)))) 91 (message "Note: `\\t' here doesn't match a tab; to do that, just type TAB")))
92 (sit-for 2))))
92 93
93 (save-excursion 94 (save-excursion
94 (setq to (read-from-minibuffer (format "%s %s with: " string from) 95 (setq to (read-from-minibuffer (format "%s %s with: " string from)
@@ -161,20 +162,62 @@ Fourth and fifth arg START and END specify the region to operate on.
161 162
162In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP, 163In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP,
163and `\\=\\N' (where N is a digit) stands for 164and `\\=\\N' (where N is a digit) stands for
164 whatever what matched the Nth `\\(...\\)' in REGEXP." 165whatever what matched the Nth `\\(...\\)' in REGEXP.
166
167When this function is called interactively, the replacement text
168can also contain `\\,' followed by a Lisp expression. The escaped
169shorthands for `query-replace-regexp-eval' are also valid
170here: within the Lisp expression, you can use `\\&' for the whole
171match string, `\\N' for partial matches, `\\#&' and `\\#N' for
172the respective numeric values, and `\\#' for `replace-count'.
173
174If your Lisp expression is an identifier and the next
175letter in the replacement string would be interpreted as part of it,
176you can wrap it with an expression like `\\,(or \\#)'. Incidentally,
177for this particular case you may also enter `\\#' in the replacement
178text directly.
179
180When you use `\\,' or `\\#' in the replacement, TO-STRING actually
181becomes a list with expanded shorthands.
182Use \\[repeat-complex-command] after this command to see details."
165 (interactive 183 (interactive
166 (let ((common 184 (let ((common
167 (query-replace-read-args "Query replace regexp" t))) 185 (query-replace-read-args "Query replace regexp" t)))
168 (list (nth 0 common) (nth 1 common) (nth 2 common) 186 (list
169 ;; These are done separately here 187 (nth 0 common)
170 ;; so that command-history will record these expressions 188 (if (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]"
171 ;; rather than the values they had this time. 189 (nth 1 common))
172 (if (and transient-mark-mode mark-active) 190 (let ((to-string (nth 1 common)) pos to-expr char prompt)
173 (region-beginning)) 191 (while (string-match
174 (if (and transient-mark-mode mark-active) 192 "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]"
175 (region-end))))) 193 to-string)
176 194 (setq pos (match-end 0))
195 (push (substring to-string 0 (- pos 2)) to-expr)
196 (setq char (aref to-string (1- pos))
197 to-string (substring to-string pos))
198 (cond ((eq char ?\#)
199 (push '(number-to-string replace-count) to-expr))
200 ((eq char ?\,)
201 (setq pos (read-from-string to-string))
202 (push `(replace-quote ,(car pos)) to-expr)
203 (setq to-string (substring to-string (cdr pos))))))
204 (setq to-expr (nreverse (delete "" (cons to-string to-expr))))
205 (replace-match-string-symbols to-expr)
206 (cons 'replace-eval-replacement
207 (if (> (length to-expr) 1)
208 (cons 'concat to-expr)
209 (car to-expr))))
210 (nth 1 common))
211 (nth 2 common)
212 ;; These are done separately here
213 ;; so that command-history will record these expressions
214 ;; rather than the values they had this time.
215 (if (and transient-mark-mode mark-active)
216 (region-beginning))
217 (if (and transient-mark-mode mark-active)
218 (region-end)))))
177 (perform-replace regexp to-string t t delimited nil nil start end)) 219 (perform-replace regexp to-string t t delimited nil nil start end))
220
178(define-key esc-map [?\C-%] 'query-replace-regexp) 221(define-key esc-map [?\C-%] 'query-replace-regexp)
179 222
180(defun query-replace-regexp-eval (regexp to-expr &optional delimited start end) 223(defun query-replace-regexp-eval (regexp to-expr &optional delimited start end)
@@ -191,6 +234,7 @@ For convenience, when entering TO-EXPR interactively, you can use `\\&' or
191`\\0' to stand for whatever matched the whole of REGEXP, and `\\N' (where 234`\\0' to stand for whatever matched the whole of REGEXP, and `\\N' (where
192N is a digit) to stand for whatever matched the Nth `\\(...\\)' in REGEXP. 235N is a digit) to stand for whatever matched the Nth `\\(...\\)' in REGEXP.
193Use `\\#&' or `\\#N' if you want a number instead of a string. 236Use `\\#&' or `\\#N' if you want a number instead of a string.
237In interactive use, `\\#' in itself stands for `replace-count'.
194 238
195In Transient Mark mode, if the mark is active, operate on the contents 239In Transient Mark mode, if the mark is active, operate on the contents
196of the region. Otherwise, operate from point to the end of the buffer. 240of the region. Otherwise, operate from point to the end of the buffer.
@@ -1012,6 +1056,7 @@ N (match-string N) (where N is a string of digits)
1012#N (string-to-number (match-string N)) 1056#N (string-to-number (match-string N))
1013& (match-string 0) 1057& (match-string 0)
1014#& (string-to-number (match-string 0)) 1058#& (string-to-number (match-string 0))
1059# replace-count
1015 1060
1016Note that these symbols must be preceeded by a backslash in order to 1061Note that these symbols must be preceeded by a backslash in order to
1017type them." 1062type them."
@@ -1031,7 +1076,9 @@ type them."
1031 ((string= "&" name) 1076 ((string= "&" name)
1032 (setcar n '(match-string 0))) 1077 (setcar n '(match-string 0)))
1033 ((string= "#&" name) 1078 ((string= "#&" name)
1034 (setcar n '(string-to-number (match-string 0)))))))) 1079 (setcar n '(string-to-number (match-string 0))))
1080 ((string= "#" name)
1081 (setcar n 'replace-count))))))
1035 (setq n (cdr n)))) 1082 (setq n (cdr n))))
1036 1083
1037(defun replace-eval-replacement (expression replace-count) 1084(defun replace-eval-replacement (expression replace-count)
@@ -1040,6 +1087,21 @@ type them."
1040 replacement 1087 replacement
1041 (prin1-to-string replacement t)))) 1088 (prin1-to-string replacement t))))
1042 1089
1090(defun replace-quote (replacement)
1091 "Quote a replacement string.
1092This just doubles all backslashes in REPLACEMENT and
1093returns the resulting string. If REPLACEMENT is not
1094a string, it is first passed through `prin1-to-string'
1095with the `noescape' argument set.
1096
1097`match-data' is preserved across the call."
1098 (save-match-data
1099 (replace-regexp-in-string "\\\\" "\\\\"
1100 (if (stringp replacement)
1101 replacement
1102 (prin1-to-string replacement t))
1103 t t)))
1104
1043(defun replace-loop-through-replacements (data replace-count) 1105(defun replace-loop-through-replacements (data replace-count)
1044 ;; DATA is a vector contaning the following values: 1106 ;; DATA is a vector contaning the following values:
1045 ;; 0 next-rotate-count 1107 ;; 0 next-rotate-count