aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMiles Bader2004-06-29 16:46:06 +0000
committerMiles Bader2004-06-29 16:46:06 +0000
commit12483a9413619e286efc673a2b277d85cebf3b0c (patch)
treed489e0fa758c0d51d792d42140cbeafa4aede31b /lisp
parentc786a8ae1c5e84d0f0903d516dd0fc190dc1193c (diff)
parent619b6adbd2b96accbbf18051bf69149a029557ee (diff)
downloademacs-12483a9413619e286efc673a2b277d85cebf3b0c.tar.gz
emacs-12483a9413619e286efc673a2b277d85cebf3b0c.zip
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-17
Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-417 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-419 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-420 Tweak permissions * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-421 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-430 Update from CVS
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog109
-rw-r--r--lisp/add-log.el11
-rw-r--r--lisp/comint.el33
-rw-r--r--lisp/emacs-lisp/pp.el1
-rw-r--r--lisp/files.el29
-rw-r--r--lisp/font-lock.el91
-rw-r--r--lisp/gnus/ChangeLog7
-rw-r--r--lisp/gnus/nnimap.el6
-rw-r--r--lisp/gnus/nntp.el9
-rw-r--r--lisp/image.el10
-rw-r--r--lisp/man.el4
-rw-r--r--lisp/net/ange-ftp.el2
-rw-r--r--lisp/net/goto-addr.el4
-rw-r--r--lisp/net/tramp.el9
-rw-r--r--lisp/progmodes/ada-xref.el7
-rw-r--r--lisp/progmodes/gdb-ui.el45
-rw-r--r--lisp/progmodes/grep.el12
-rw-r--r--lisp/replace.el318
-rw-r--r--lisp/vc-arch.el3
-rw-r--r--lisp/woman.el2
20 files changed, 501 insertions, 211 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 70f7255782a..effae29fc8f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,112 @@
12004-06-29 Kim F. Storm <storm@cua.dk>
2
3 * progmodes/gdb-ui.el (breakpoint-enabled-bitmap-face)
4 (breakpoint-disabled-bitmap-face): Add :group 'gud.
5
6 * progmodes/ada-xref.el (ada-tight-gvd-integration):
7 Add :group 'ada.
8
9 * vc-arch.el (vc-arch-mode-line-rewrite): Add :group 'vc.
10
112004-06-29 Juri Linkov <juri@jurta.org>
12
13 * replace.el (query-replace-read-args): Swallow a space after
14 everything except )]" which in most cases means after a symbol.
15
16 * emacs-lisp/pp.el (pp-buffer): Add autoload.
17
182004-06-26 David Kastrup <dak@gnu.org>
19
20 * replace.el (perform-replace): Highlight the match even in
21 non-query mode if there is potential replace string editing.
22
232004-06-26 Kai Grossjohann <kai.grossjohann@gmx.net>
24
25 * net/tramp.el (tramp-handle-file-remote-p): New implementation to
26 agree with new return value of `file-remote-p'.
27 This syncs with Tramp 2.0.42.
28
29 * net/ange-ftp.el (ange-ftp-file-remote-p): New return value,
30 according to new documentation of `file-remote-p'.
31
32 * files.el (file-remote-p): Fix doc to say that return value is
33 identification of remote system, if not nil.
34 (file-relative-name): Use new return value of `file-remote-p'.
35
362004-06-26 Nick Roberts <nickrob@gnu.org>
37
38 * progmodes/gdb-ui.el (gdb-toggle-breakpoint)
39 (gdb-goto-breakpoint): Fix breakage.
40
412004-06-26 Eli Zaretskii <eliz@gnu.org>
42
43 * man.el (Man-getpage-in-background): Add windows-nt to the list
44 of systems where shell-file-name should be used instead of
45 literal "sh".
46
472004-06-25 Sam Steingold <sds@gnu.org>
48
49 * add-log.el (change-log-font-lock-keywords): Support Common Lisp
50 function names `(setf symbol)'.
51
522004-06-24 Richard M. Stallman <rms@gnu.org>
53
54 * replace.el (query-replace-read-args): Swallow space after \,SYMBOL.
55
56 * font-lock.el (font-lock-keywords): Change format of compiled values.
57 Document it.
58 (font-lock-add-keywords): If font-lock-keywords is compiled,
59 extract the uncompiled version, modify, then recompile.
60 (font-lock-remove-keywords): Likewise.
61 (font-lock-fontify-keywords-region): Handle changed format.
62 (font-lock-compile-keywords): Handle changed format.
63 (font-lock-set-defaults): Compile the keywords explicitly here.
64
652004-06-24 David Kastrup <dak@gnu.org>
66
67 * replace.el (query-replace-read-args): Implement `\,' and `\#'
68 replacements here.
69 (query-replace-regexp): Doc string explaining this and the new
70 `\?' replacement. Remove `\,' and `\#' implementation here, as it
71 is better placed in `query-replace-read-args'.
72 (replace-regexp): Explain `\,', `\#' and `\?'.
73 (replace-match-data): New function for thorough reuse/destruction
74 of old match-data.
75 (replace-match-maybe-edit): Function for implementing `\?'
76 editing.
77 (perform-replace): Fix maintaining of the match stack including
78 already matched regions, implement `\?', fix various problems
79 with regions while editing and other stuff.
80 (replace-highlight): Simplified.
81
822004-06-24 Daniel Pfeiffer <occitan@esperanto.org>
83
84 * progmodes/grep.el (grep-error-screen-columns): New variable.
85 (grep-regexp-alist): Give it the full functionality of gnu style
86 compilation messages with line and column ranges. Ask me for the
87 perl script I'm working on, that uses these.
88
892004-06-23 Nick Roberts <nickrob@gnu.org>
90
91 * comint.el: (comint-insert-clicked-input, comint-copy-old-input):
92 Remove.
93 (comint-insert-input, comint-mouse-insert-input): New functions
94 based on comint-insert-clicked-input for two bindings but just
95 one functionality.
96
972004-06-23 Luc Teirlinck <teirllm@auburn.edu>
98
99 * net/goto-addr.el (goto-address-fontify): Fix help-echo text.
100
1012004-06-23 Lars Hansen <larsh@math.ku.dk>
102
103 * files.el (write-contents-functions): Doc fix.
104
1052004-06-21 Juanma Barranquero <lektu@terra.es>
106
107 * image.el (image-library-alist): Rewrite docstring in active
108 voice.
109
12004-06-20 Richard M. Stallman <rms@gnu.org> 1102004-06-20 Richard M. Stallman <rms@gnu.org>
2 111
3 * mouse.el (mouse-set-region-1): Set transient-mark-mode to `only'. 112 * mouse.el (mouse-set-region-1): Set transient-mark-mode to `only'.
diff --git a/lisp/add-log.el b/lisp/add-log.el
index 3c29e8a465e..26faea2ddc3 100644
--- a/lisp/add-log.el
+++ b/lisp/add-log.el
@@ -230,13 +230,16 @@ Note: The search is conducted only within 10%, at the beginning of the file."
230 ;; Possibly further names in a list: 230 ;; Possibly further names in a list:
231 ("\\=, \\([^ ,:([\n]+\\)" nil nil (1 'change-log-file-face)) 231 ("\\=, \\([^ ,:([\n]+\\)" nil nil (1 'change-log-file-face))
232 ;; Possibly a parenthesized list of names: 232 ;; Possibly a parenthesized list of names:
233 ("\\= (\\([^) ,\n]+\\)" nil nil (1 'change-log-list-face)) 233 ("\\= (\\([^() ,\n]+\\|(\\(setf\\|SETF\\) [^() ,\n]+)\\)"
234 ("\\=, *\\([^) ,\n]+\\)" nil nil (1 'change-log-list-face))) 234 nil nil (1 'change-log-list-face))
235 ("\\=, *\\([^() ,\n]+\\|(\\(setf\\|SETF\\) [^() ,\n]+)\\)"
236 nil nil (1 'change-log-list-face)))
235 ;; 237 ;;
236 ;; Function or variable names. 238 ;; Function or variable names.
237 ("^\t(\\([^) ,\n]+\\)" 239 ("^\t(\\([^() ,\n]+\\|(\\(setf\\|SETF\\) [^() ,\n]+)\\)"
238 (1 'change-log-list-face) 240 (1 'change-log-list-face)
239 ("\\=, *\\([^) ,\n]+\\)" nil nil (1 'change-log-list-face))) 241 ("\\=, *\\([^() ,\n]+\\|(\\(setf\\|SETF\\) [^() ,\n]+)\\)" nil nil
242 (1 'change-log-list-face)))
240 ;; 243 ;;
241 ;; Conditionals. 244 ;; Conditionals.
242 ("\\[!?\\([^]\n]+\\)\\]\\(:\\| (\\)" (1 'change-log-conditionals-face)) 245 ("\\[!?\\([^]\n]+\\)\\]\\(:\\| (\\)" (1 'change-log-conditionals-face))
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/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el
index 61d31921e57..93e30fb0f55 100644
--- a/lisp/emacs-lisp/pp.el
+++ b/lisp/emacs-lisp/pp.el
@@ -54,6 +54,7 @@ to make output that `read' can handle, whenever this is possible."
54 (buffer-string)) 54 (buffer-string))
55 (kill-buffer (current-buffer))))) 55 (kill-buffer (current-buffer)))))
56 56
57;;;###autoload
57(defun pp-buffer () 58(defun pp-buffer ()
58 "Prettify the current buffer with printed representation of a Lisp object." 59 "Prettify the current buffer with printed representation of a Lisp object."
59 (goto-char (point-min)) 60 (goto-char (point-min))
diff --git a/lisp/files.el b/lisp/files.el
index 1804432ee45..1d500379925 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,
@@ -649,7 +650,13 @@ This is an interface to the function `load'."
649 (load library)) 650 (load library))
650 651
651(defun file-remote-p (file) 652(defun file-remote-p (file)
652 "Test whether FILE specifies a location on a remote system." 653 "Test whether FILE specifies a location on a remote system.
654Return an identification of the system if the location is indeed
655remote. The identification of the system may comprise a method
656to access the system and its hostname, amongst other things.
657
658For example, the filename \"/user@host:/foo\" specifies a location
659on the system \"/user@host:\"."
653 (let ((handler (find-file-name-handler file 'file-remote-p))) 660 (let ((handler (find-file-name-handler file 'file-remote-p)))
654 (if handler 661 (if handler
655 (funcall handler 'file-remote-p file) 662 (funcall handler 'file-remote-p file)
@@ -2915,8 +2922,8 @@ on a DOS/Windows machine, it returns FILENAME on expanded form."
2915 (file-name-as-directory (expand-file-name (or directory 2922 (file-name-as-directory (expand-file-name (or directory
2916 default-directory)))) 2923 default-directory))))
2917 (setq filename (expand-file-name filename)) 2924 (setq filename (expand-file-name filename))
2918 (let ((hf (find-file-name-handler filename 'file-remote-p)) 2925 (let ((fremote (file-remote-p filename))
2919 (hd (find-file-name-handler directory 'file-remote-p))) 2926 (dremote (file-remote-p directory)))
2920 (if ;; Conditions for separate trees 2927 (if ;; Conditions for separate trees
2921 (or 2928 (or
2922 ;; Test for different drives on DOS/Windows 2929 ;; Test for different drives on DOS/Windows
@@ -2924,20 +2931,8 @@ on a DOS/Windows machine, it returns FILENAME on expanded form."
2924 ;; Should `cygwin' really be included here? --stef 2931 ;; Should `cygwin' really be included here? --stef
2925 (memq system-type '(ms-dos cygwin windows-nt)) 2932 (memq system-type '(ms-dos cygwin windows-nt))
2926 (not (eq t (compare-strings filename 0 2 directory 0 2)))) 2933 (not (eq t (compare-strings filename 0 2 directory 0 2))))
2927 ;; Test for different remote file handlers
2928 (not (eq hf hd))
2929 ;; Test for different remote file system identification 2934 ;; Test for different remote file system identification
2930 (and 2935 (not (equal fremote dremote)))
2931 hf
2932 (let ((re (car (rassq hf file-name-handler-alist))))
2933 (not
2934 (equal
2935 (and
2936 (string-match re filename)
2937 (substring filename 0 (match-end 0)))
2938 (and
2939 (string-match re directory)
2940 (substring directory 0 (match-end 0))))))))
2941 filename 2936 filename
2942 (let ((ancestor ".") 2937 (let ((ancestor ".")
2943 (filename-dir (file-name-as-directory filename))) 2938 (filename-dir (file-name-as-directory filename)))
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 1f6127f3ea5..9d3fdd6de5f 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -340,7 +340,15 @@ If a number, only buffers greater than this size have fontification messages."
340 340
341(defvar font-lock-keywords nil 341(defvar font-lock-keywords nil
342 "A list of the keywords to highlight. 342 "A list of the keywords to highlight.
343Each element should have one of these forms: 343There are two kinds of values: user-level, and compiled.
344
345A user-level keywords list is what a major mode or the user would
346set up. Normally the list would come from `font-lock-defaults'.
347through selection of a fontification level and evaluation of any
348contained expressions. You can also alter it by calling
349`font-lock-add-keywords' or `font-lock-remove-keywords' with MODE = nil.
350
351Each element in a user-level keywords list should have one of these forms:
344 352
345 MATCHER 353 MATCHER
346 (MATCHER . MATCH) 354 (MATCHER . MATCH)
@@ -438,7 +446,14 @@ support modes like jit-lock or lazy-lock.
438 446
439This variable is set by major modes via the variable `font-lock-defaults'. 447This variable is set by major modes via the variable `font-lock-defaults'.
440Be careful when composing regexps for this list; a poorly written pattern can 448Be careful when composing regexps for this list; a poorly written pattern can
441dramatically slow things down!") 449dramatically slow things down!
450
451A compiled keywords list starts with t. It is produced internal
452by `font-lock-compile-keywords' from a user-level keywords list.
453Its second element is the user-level keywords list that was
454compiled. The remaining elements have the same form as
455user-level keywords, but normally their values have been
456optimized.")
442 457
443(defvar font-lock-keywords-alist nil 458(defvar font-lock-keywords-alist nil
444 "*Alist of `font-lock-keywords' local to a `major-mode'. 459 "*Alist of `font-lock-keywords' local to a `major-mode'.
@@ -659,16 +674,26 @@ see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types',
659 (font-lock-update-removed-keyword-alist mode keywords append)) 674 (font-lock-update-removed-keyword-alist mode keywords append))
660 (t 675 (t
661 ;; Otherwise set or add the keywords now. 676 ;; Otherwise set or add the keywords now.
677 ;; This is a no-op if it has been done already in this buffer.
662 (font-lock-set-defaults) 678 (font-lock-set-defaults)
663 (if (eq append 'set) 679 (let ((was-compiled (eq (car font-lock-keywords) t)))
664 (setq font-lock-keywords keywords) 680 ;; Bring back the user-level (uncompiled) keywords.
665 (font-lock-remove-keywords nil keywords) ;to avoid duplicates 681 (if was-compiled
666 (let ((old (if (eq (car-safe font-lock-keywords) t) 682 (setq font-lock-keywords (cadr font-lock-keywords)))
667 (cdr font-lock-keywords) 683 ;; Now modify or replace them.
668 font-lock-keywords))) 684 (if (eq append 'set)
669 (setq font-lock-keywords (if append 685 (setq font-lock-keywords keywords)
670 (append old keywords) 686 (font-lock-remove-keywords nil keywords) ;to avoid duplicates
671 (append keywords old)))))))) 687 (let ((old (if (eq (car-safe font-lock-keywords) t)
688 (cdr font-lock-keywords)
689 font-lock-keywords)))
690 (setq font-lock-keywords (if append
691 (append old keywords)
692 (append keywords old)))))
693 ;; If the keywords were compiled before, compile them again.
694 (if was-compiled
695 (set (make-local-variable 'font-lock-keywords)
696 (font-lock-compile-keywords keywords t)))))))
672 697
673(defun font-lock-update-removed-keyword-alist (mode keywords append) 698(defun font-lock-update-removed-keyword-alist (mode keywords append)
674 ;; Update `font-lock-removed-keywords-alist' when adding new 699 ;; Update `font-lock-removed-keywords-alist' when adding new
@@ -762,13 +787,21 @@ subtle problems due to details of the implementation."
762 (t 787 (t
763 ;; Otherwise remove it immediately. 788 ;; Otherwise remove it immediately.
764 (font-lock-set-defaults) 789 (font-lock-set-defaults)
765 (setq font-lock-keywords (copy-sequence font-lock-keywords)) 790 (let ((was-compiled (eq (car font-lock-keywords) t)))
766 (dolist (keyword keywords) 791 ;; Bring back the user-level (uncompiled) keywords.
767 (setq font-lock-keywords 792 (if was-compiled
768 (delete keyword 793 (setq font-lock-keywords (cadr font-lock-keywords)))
769 ;; The keywords might be compiled. 794
770 (delete (font-lock-compile-keyword keyword) 795 ;; Edit them.
771 font-lock-keywords))))))) 796 (setq font-lock-keywords (copy-sequence font-lock-keywords))
797 (dolist (keyword keywords)
798 (setq font-lock-keywords
799 (delete keyword font-lock-keywords)))
800
801 ;; If the keywords were compiled before, compile them again.
802 (if was-compiled
803 (set (make-local-variable 'font-lock-keywords)
804 (font-lock-compile-keywords keywords t)))))))
772 805
773;;; Font Lock Support mode. 806;;; Font Lock Support mode.
774 807
@@ -1224,7 +1257,7 @@ START should be at the beginning of a line."
1224 font-lock-syntactic-keywords))) 1257 font-lock-syntactic-keywords)))
1225 ;; Get down to business. 1258 ;; Get down to business.
1226 (let ((case-fold-search font-lock-keywords-case-fold-search) 1259 (let ((case-fold-search font-lock-keywords-case-fold-search)
1227 (keywords (cdr font-lock-syntactic-keywords)) 1260 (keywords (cddr font-lock-syntactic-keywords))
1228 keyword matcher highlights) 1261 keyword matcher highlights)
1229 (while keywords 1262 (while keywords
1230 ;; Find an occurrence of `matcher' from `start' to `end'. 1263 ;; Find an occurrence of `matcher' from `start' to `end'.
@@ -1349,7 +1382,7 @@ LOUDLY, if non-nil, allows progress-meter bar."
1349 (setq font-lock-keywords 1382 (setq font-lock-keywords
1350 (font-lock-compile-keywords font-lock-keywords t))) 1383 (font-lock-compile-keywords font-lock-keywords t)))
1351 (let ((case-fold-search font-lock-keywords-case-fold-search) 1384 (let ((case-fold-search font-lock-keywords-case-fold-search)
1352 (keywords (cdr font-lock-keywords)) 1385 (keywords (cddr font-lock-keywords))
1353 (bufname (buffer-name)) (count 0) 1386 (bufname (buffer-name)) (count 0)
1354 keyword matcher highlights) 1387 keyword matcher highlights)
1355 ;; 1388 ;;
@@ -1394,14 +1427,16 @@ LOUDLY, if non-nil, allows progress-meter bar."
1394;; Various functions. 1427;; Various functions.
1395 1428
1396(defun font-lock-compile-keywords (keywords &optional regexp) 1429(defun font-lock-compile-keywords (keywords &optional regexp)
1397 "Compile KEYWORDS into the form (t KEYWORD ...). 1430 "Compile KEYWORDS into the form (t KEYWORDS COMPILED...)
1398Here KEYWORD is of the form (MATCHER HIGHLIGHT ...) as shown in the 1431Here each COMPILED is of the form (MATCHER HIGHLIGHT ...) as shown in the
1399`font-lock-keywords' doc string. 1432`font-lock-keywords' doc string.
1400If REGEXP is non-nil, it means these keywords are used for 1433If REGEXP is non-nil, it means these keywords are used for
1401`font-lock-keywords' rather than for `font-lock-syntactic-keywords'." 1434`font-lock-keywords' rather than for `font-lock-syntactic-keywords'."
1402 (if (eq (car-safe keywords) t) 1435 (if (eq (car-safe keywords) t)
1403 keywords 1436 keywords
1404 (setq keywords (cons t (mapcar 'font-lock-compile-keyword keywords))) 1437 (setq keywords
1438 (cons t (cons keywords
1439 (mapcar 'font-lock-compile-keyword keywords))))
1405 (if (and regexp 1440 (if (and regexp
1406 (eq (or syntax-begin-function 1441 (eq (or syntax-begin-function
1407 font-lock-beginning-of-syntax-function) 1442 font-lock-beginning-of-syntax-function)
@@ -1512,17 +1547,21 @@ Sets various variables using `font-lock-defaults' (or, if nil, using
1512 ;; Variable alist? 1547 ;; Variable alist?
1513 (dolist (x (nthcdr 5 defaults)) 1548 (dolist (x (nthcdr 5 defaults))
1514 (set (make-local-variable (car x)) (cdr x))) 1549 (set (make-local-variable (car x)) (cdr x)))
1515 ;; Setup `font-lock-keywords' last because its value might depend 1550 ;; Set up `font-lock-keywords' last because its value might depend
1516 ;; on other settings (e.g. font-lock-compile-keywords uses 1551 ;; on other settings (e.g. font-lock-compile-keywords uses
1517 ;; font-lock-beginning-of-syntax-function). 1552 ;; font-lock-beginning-of-syntax-function).
1518 (set (make-local-variable 'font-lock-keywords) 1553 (set (make-local-variable 'font-lock-keywords)
1519 (font-lock-compile-keywords (font-lock-eval-keywords keywords) t)) 1554 (font-lock-eval-keywords keywords))
1520 ;; Local fontification? 1555 ;; Local fontification?
1521 (while local 1556 (while local
1522 (font-lock-add-keywords nil (car (car local)) (cdr (car local))) 1557 (font-lock-add-keywords nil (car (car local)) (cdr (car local)))
1523 (setq local (cdr local))) 1558 (setq local (cdr local)))
1524 (when removed-keywords 1559 (when removed-keywords
1525 (font-lock-remove-keywords nil removed-keywords))))) 1560 (font-lock-remove-keywords nil removed-keywords))
1561 ;; Now compile the keywords.
1562 (unless (eq (car font-lock-keywords) t)
1563 (set (make-local-variable 'font-lock-keywords)
1564 (font-lock-compile-keywords font-lock-keywords t))))))
1526 1565
1527;;; Colour etc. support. 1566;;; Colour etc. support.
1528 1567
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 78c9f15f912..8169b014e16 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,10 @@
12004-06-29 Kim F. Storm <storm@cua.dk>
2
3 * nntp.el (nntp-authinfo-file): Add :group 'nntp.
4
5 * nnimap.el (nnimap-authinfo-file, nnimap-prune-cache):
6 Add :group 'nnimap.
7
12004-05-18 Stefan Monnier <monnier@iro.umontreal.ca> 82004-05-18 Stefan Monnier <monnier@iro.umontreal.ca>
2 9
3 * mm-view.el (mm-insert-inline): Make it work in read-only buffer. 10 * mm-view.el (mm-insert-inline): Make it work in read-only buffer.
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index a7cf82317b5..ec9d42ee042 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -271,11 +271,13 @@ use this to make replies go directly to the group.")
271 (string :format "Login: %v")) 271 (string :format "Login: %v"))
272 (cons :format "%v" 272 (cons :format "%v"
273 (const :format "" "password") 273 (const :format "" "password")
274 (string :format "Password: %v"))))))) 274 (string :format "Password: %v"))))))
275 :group 'nnimap)
275 276
276(defcustom nnimap-prune-cache t 277(defcustom nnimap-prune-cache t
277 "If non-nil, nnimap check whether articles still exist on server before using data stored in NOV cache." 278 "If non-nil, nnimap check whether articles still exist on server before using data stored in NOV cache."
278 :type 'boolean) 279 :type 'boolean
280 :group 'nnimap)
279 281
280(defvar nnimap-request-list-method 'imap-mailbox-list 282(defvar nnimap-request-list-method 'imap-mailbox-list
281 "Method to use to request a list of all folders from the server. 283 "Method to use to request a list of all folders from the server.
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index 8791c652a45..5722ba8456a 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -174,7 +174,8 @@ server there that you can connect to. See also
174 (string :format "Login: %v")) 174 (string :format "Login: %v"))
175 (cons :format "%v" 175 (cons :format "%v"
176 (const :format "" "password") 176 (const :format "" "password")
177 (string :format "Password: %v"))))))) 177 (string :format "Password: %v"))))))
178 :group 'nntp)
178 179
179 180
180 181
@@ -223,7 +224,7 @@ noticing asynchronous data.")
223(defvar nntp-async-timer nil) 224(defvar nntp-async-timer nil)
224(defvar nntp-async-process-list nil) 225(defvar nntp-async-process-list nil)
225 226
226(defvar nntp-ssl-program 227(defvar nntp-ssl-program
227 "openssl s_client -quiet -ssl3 -connect %s:%p" 228 "openssl s_client -quiet -ssl3 -connect %s:%p"
228"A string containing commands for SSL connections. 229"A string containing commands for SSL connections.
229Within a string, %s is replaced with the server address and %p with 230Within a string, %s is replaced with the server address and %p with
@@ -928,10 +929,10 @@ password contained in '~/.nntp-authinfo'."
928 929
929(defun nntp-open-ssl-stream (buffer) 930(defun nntp-open-ssl-stream (buffer)
930 (let* ((process-connection-type nil) 931 (let* ((process-connection-type nil)
931 (proc (start-process "nntpd" buffer 932 (proc (start-process "nntpd" buffer
932 shell-file-name 933 shell-file-name
933 shell-command-switch 934 shell-command-switch
934 (format-spec nntp-ssl-program 935 (format-spec nntp-ssl-program
935 (format-spec-make 936 (format-spec-make
936 ?s nntp-address 937 ?s nntp-address
937 ?p nntp-port-number))))) 938 ?p nntp-port-number)))))
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/man.el b/lisp/man.el
index 5a07045dda9..cbfae21e44b 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -733,7 +733,9 @@ 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 (if (eq system-type 'cygwin) shell-file-name "sh") 736 (if (memq system-type '(cygwin windows-nt))
737 shell-file-name
738 "sh")
737 shell-command-switch 739 shell-command-switch
738 (format (Man-build-man-command) man-args)) 740 (format (Man-build-man-command) man-args))
739 'Man-bgproc-sentinel) 741 'Man-bgproc-sentinel)
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index 09448e87329..8e9d0bda5af 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -4117,7 +4117,7 @@ directory, so that Emacs will know its current contents."
4117 tmp1)))) 4117 tmp1))))
4118 4118
4119(defun ange-ftp-file-remote-p (file) 4119(defun ange-ftp-file-remote-p (file)
4120 (when (ange-ftp-ftp-name file) t)) 4120 (ange-ftp-replace-name-component file ""))
4121 4121
4122(defun ange-ftp-load (file &optional noerror nomessage nosuffix) 4122(defun ange-ftp-load (file &optional noerror nomessage nosuffix)
4123 (if (ange-ftp-ftp-name file) 4123 (if (ange-ftp-ftp-name file)
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/net/tramp.el b/lisp/net/tramp.el
index 769ad3f51f6..0414859c7eb 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3542,7 +3542,14 @@ This will break if COMMAND prints a newline, followed by the value of
3542 3542
3543(defun tramp-handle-file-remote-p (filename) 3543(defun tramp-handle-file-remote-p (filename)
3544 "Like `file-remote-p' for tramp files." 3544 "Like `file-remote-p' for tramp files."
3545 (when (tramp-tramp-file-p filename) t)) 3545 (when (tramp-tramp-file-p filename)
3546 (with-parsed-tramp-file-name filename nil
3547 (make-tramp-file-name
3548 :multi-method multi-method
3549 :method method
3550 :user user
3551 :host host
3552 :localname ""))))
3546 3553
3547(defun tramp-handle-insert-file-contents 3554(defun tramp-handle-insert-file-contents
3548 (filename &optional visit beg end replace) 3555 (filename &optional visit beg end replace)
diff --git a/lisp/progmodes/ada-xref.el b/lisp/progmodes/ada-xref.el
index c7b5717a1bb..c9bfbd76c23 100644
--- a/lisp/progmodes/ada-xref.el
+++ b/lisp/progmodes/ada-xref.el
@@ -143,7 +143,8 @@ Otherwise, ask the user for the name of the project file to use."
143 143
144(defcustom ada-tight-gvd-integration nil 144(defcustom ada-tight-gvd-integration nil
145 "*If non-nil, a new Emacs frame will be swallowed in GVD when debugging. 145 "*If non-nil, a new Emacs frame will be swallowed in GVD when debugging.
146If GVD is not the debugger used, nothing happens.") 146If GVD is not the debugger used, nothing happens."
147 :type 'boolean :group 'ada)
147 148
148(defcustom ada-xref-search-with-egrep t 149(defcustom ada-xref-search-with-egrep t
149 "*If non-nil, use egrep to find the possible declarations for an entity. 150 "*If non-nil, use egrep to find the possible declarations for an entity.
@@ -506,12 +507,12 @@ All the directories are returned as absolute directories."
506 (equal ada-prj-default-project-file 507 (equal ada-prj-default-project-file
507 (car x)) 508 (car x))
508 )))) 509 ))))
509 510
510 ;; Parses all the known project files, and insert at 511 ;; Parses all the known project files, and insert at
511 ;; least the default one (in case 512 ;; least the default one (in case
512 ;; ada-xref-project-files is nil) 513 ;; ada-xref-project-files is nil)
513 (or ada-xref-project-files '(nil)))))) 514 (or ada-xref-project-files '(nil))))))
514 515
515 (easy-menu-add-item ada-mode-menu '() submenu))) 516 (easy-menu-add-item ada-mode-menu '() submenu)))
516 517
517 518
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 2f267787707..1e2ef00580e 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -29,10 +29,9 @@
29;; GDB through the GUD buffer in the usual way, but there are also further 29;; GDB through the GUD buffer in the usual way, but there are also further
30;; buffers which control the execution and describe the state of your program. 30;; buffers which control the execution and describe the state of your program.
31;; It separates the input/output of your program from that of GDB, if 31;; It separates the input/output of your program from that of GDB, if
32;; required, and displays expressions and their current values in their own 32;; required, and watches expressions in the speedbar. It also uses features of
33;; buffers. It also uses features of Emacs 21 such as the display margin for 33;; Emacs 21 such as the fringe/display margin for breakpoints, and the toolbar
34;; breakpoints, and the toolbar (see the GDB Graphical Interface section in 34;; (see the GDB Graphical Interface section in the Emacs info manual).
35;; the Emacs info manual).
36 35
37;; Start the debugger with M-x gdba. 36;; Start the debugger with M-x gdba.
38 37
@@ -40,7 +39,7 @@
40;; Kingdon and uses GDB's annotation interface. You don't need to know about 39;; Kingdon and uses GDB's annotation interface. You don't need to know about
41;; annotations to use this mode as a debugger, but if you are interested 40;; annotations to use this mode as a debugger, but if you are interested
42;; developing the mode itself, then see the Annotations section in the GDB 41;; developing the mode itself, then see the Annotations section in the GDB
43;; info manual. 42;; info manual.
44;; 43;;
45;; GDB developers plan to make the annotation interface obsolete. A new 44;; GDB developers plan to make the annotation interface obsolete. A new
46;; interface called GDB/MI (machine interface) has been designed to replace 45;; interface called GDB/MI (machine interface) has been designed to replace
@@ -71,7 +70,7 @@
71(defvar gdb-variables '() 70(defvar gdb-variables '()
72 "A list of variables that are local to the GUD buffer.") 71 "A list of variables that are local to the GUD buffer.")
73(defvar gdb-server-prefix nil) 72(defvar gdb-server-prefix nil)
74 73
75;;;###autoload 74;;;###autoload
76(defun gdba (command-line) 75(defun gdba (command-line)
77 "Run gdb on program FILE in buffer *gud-FILE*. 76 "Run gdb on program FILE in buffer *gud-FILE*.
@@ -228,7 +227,7 @@ speedbar."
228 (if (string-equal expr (car var)) (throw 'already-watched nil))) 227 (if (string-equal expr (car var)) (throw 'already-watched nil)))
229 (set-text-properties 0 (length expr) nil expr) 228 (set-text-properties 0 (length expr) nil expr)
230 (gdb-enqueue-input 229 (gdb-enqueue-input
231 (list 230 (list
232 (if (eq gud-minor-mode 'gdba) 231 (if (eq gud-minor-mode 'gdba)
233 (concat "server interpreter mi \"-var-create - * " expr "\"\n") 232 (concat "server interpreter mi \"-var-create - * " expr "\"\n")
234 (concat"-var-create - * " expr "\n")) 233 (concat"-var-create - * " expr "\n"))
@@ -327,7 +326,7 @@ speedbar."
327 (if (not (member 'gdb-var-update gdb-pending-triggers)) 326 (if (not (member 'gdb-var-update gdb-pending-triggers))
328 (progn 327 (progn
329 (gdb-enqueue-input 328 (gdb-enqueue-input
330 (list 329 (list
331 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) 330 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
332 "server interpreter mi \"-var-update *\"\n" 331 "server interpreter mi \"-var-update *\"\n"
333 "-var-update *\n") 332 "-var-update *\n")
@@ -363,7 +362,7 @@ speedbar."
363 (varnum (cadr var))) 362 (varnum (cadr var)))
364 (unless (string-match "\\." varnum) 363 (unless (string-match "\\." varnum)
365 (gdb-enqueue-input 364 (gdb-enqueue-input
366 (list 365 (list
367 (if (with-current-buffer gud-comint-buffer 366 (if (with-current-buffer gud-comint-buffer
368 (eq gud-minor-mode 'gdba)) 367 (eq gud-minor-mode 'gdba))
369 (concat "server interpreter mi \"-var-delete " varnum "\"\n") 368 (concat "server interpreter mi \"-var-delete " varnum "\"\n")
@@ -487,7 +486,7 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'."
487 (set (make-local-variable 'gdb-buffer-type) key) 486 (set (make-local-variable 'gdb-buffer-type) key)
488 (if (cdr (cdr rules)) 487 (if (cdr (cdr rules))
489 (funcall (car (cdr (cdr rules))))) 488 (funcall (car (cdr (cdr rules)))))
490 (set (make-local-variable 'gud-minor-mode) 489 (set (make-local-variable 'gud-minor-mode)
491 (with-current-buffer gud-comint-buffer gud-minor-mode)) 490 (with-current-buffer gud-comint-buffer gud-minor-mode))
492 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) 491 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
493 new)))) 492 new))))
@@ -1077,13 +1076,15 @@ static char *magick[] = {
1077 '((t 1076 '((t
1078 :inherit fringe 1077 :inherit fringe
1079 :foreground "red")) 1078 :foreground "red"))
1080 "Face for enabled breakpoint icon in fringe.") 1079 "Face for enabled breakpoint icon in fringe."
1080 :group 'gud)
1081 1081
1082(defface breakpoint-disabled-bitmap-face 1082(defface breakpoint-disabled-bitmap-face
1083 '((t 1083 '((t
1084 :inherit fringe 1084 :inherit fringe
1085 :foreground "grey60")) 1085 :foreground "grey60"))
1086 "Face for disabled breakpoint icon in fringe.") 1086 "Face for disabled breakpoint icon in fringe."
1087 :group 'gud)
1087 1088
1088 1089
1089;;-put breakpoint icons in relevant margins (even those set in the GUD buffer) 1090;;-put breakpoint icons in relevant margins (even those set in the GUD buffer)
@@ -1207,8 +1208,8 @@ static char *magick[] = {
1207 (list 1208 (list
1208 (concat 1209 (concat
1209 (if (eq ?y (char-after (match-beginning 2))) 1210 (if (eq ?y (char-after (match-beginning 2)))
1210 gdb-server-prefix "disable " 1211 (concat gdb-server-prefix "disable ")
1211 gdb-server-prefix "enable ") 1212 (concat gdb-server-prefix "enable "))
1212 (match-string 1) "\n") 1213 (match-string 1) "\n")
1213 'ignore))))) 1214 'ignore)))))
1214 1215
@@ -1226,10 +1227,12 @@ static char *magick[] = {
1226 (interactive) 1227 (interactive)
1227 (save-excursion 1228 (save-excursion
1228 (beginning-of-line 1) 1229 (beginning-of-line 1)
1229 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdbmi)) 1230 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
1230 (looking-at "[0-9]*\\s-*\\S-*\\s-*\\S-*\\s-*.\\s-*\\S-*\\s-*\\(\\S-*\\):\\([0-9]+\\)") 1231 (progn
1231 (re-search-forward "in\\s-+\\S-+\\s-+at\\s-+" nil t) 1232 (re-search-forward "in\\s-+\\S-+\\s-+at\\s-+" nil t)
1232 (looking-at "\\(\\S-*\\):\\([0-9]+\\)"))) 1233 (looking-at "\\(\\S-*\\):\\([0-9]+\\)"))
1234 (looking-at
1235 "[0-9]*\\s-*\\S-*\\s-*\\S-*\\s-*.\\s-*\\S-*\\s-*\\(\\S-*\\):\\([0-9]+\\)")))
1233 (if (match-string 2) 1236 (if (match-string 2)
1234 (let ((line (match-string 2)) 1237 (let ((line (match-string 2))
1235 (file (match-string 1))) 1238 (file (match-string 1)))
@@ -1836,7 +1839,7 @@ BUFFER nil or omitted means use the current buffer."
1836 (save-current-buffer 1839 (save-current-buffer
1837 (setq left-margin-width 2) 1840 (setq left-margin-width 2)
1838 (if (get-buffer-window (current-buffer) 'visible) 1841 (if (get-buffer-window (current-buffer) 'visible)
1839 (set-window-margins 1842 (set-window-margins
1840 (get-buffer-window (current-buffer) 'visible) 1843 (get-buffer-window (current-buffer) 'visible)
1841 left-margin-width right-margin-width)))) 1844 left-margin-width right-margin-width))))
1842 (put-image 1845 (put-image
@@ -1863,7 +1866,7 @@ BUFFER nil or omitted means use the current buffer."
1863 (save-current-buffer 1866 (save-current-buffer
1864 (setq left-margin-width 2) 1867 (setq left-margin-width 2)
1865 (if (get-buffer-window (current-buffer) 'visible) 1868 (if (get-buffer-window (current-buffer) 'visible)
1866 (set-window-margins 1869 (set-window-margins
1867 (get-buffer-window (current-buffer) 'visible) 1870 (get-buffer-window (current-buffer) 'visible)
1868 left-margin-width right-margin-width)))) 1871 left-margin-width right-margin-width))))
1869 (gdb-put-string (if enabled "B" "b") (1+ start))))) 1872 (gdb-put-string (if enabled "B" "b") (1+ start)))))
@@ -1875,7 +1878,7 @@ BUFFER nil or omitted means use the current buffer."
1875 (when remove-margin 1878 (when remove-margin
1876 (setq left-margin-width 0) 1879 (setq left-margin-width 0)
1877 (if (get-buffer-window (current-buffer) 'visible) 1880 (if (get-buffer-window (current-buffer) 'visible)
1878 (set-window-margins 1881 (set-window-margins
1879 (get-buffer-window (current-buffer) 'visible) 1882 (get-buffer-window (current-buffer) 'visible)
1880 left-margin-width right-margin-width)))) 1883 left-margin-width right-margin-width))))
1881 1884
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index aa9a50a2580..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]\\)\\(?:\\([0-9]+\\)\\(?:-\\([0-9]+\\)\\)?\\3\\)?" 1 2 (4 . 5)) 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/replace.el b/lisp/replace.el
index 89f55c2829e..c2305cdecc6 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -95,6 +95,35 @@ strings or patterns."
95 (setq to (read-from-minibuffer (format "%s %s with: " string from) 95 (setq to (read-from-minibuffer (format "%s %s with: " string from)
96 nil nil nil 96 nil nil nil
97 query-replace-to-history-variable from t))) 97 query-replace-to-history-variable from t)))
98 (when (and regexp-flag
99 (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to))
100 (let (pos list char)
101 (while
102 (progn
103 (setq pos (match-end 0))
104 (push (substring to 0 (- pos 2)) list)
105 (setq char (aref to (1- pos))
106 to (substring to pos))
107 (cond ((eq char ?\#)
108 (push '(number-to-string replace-count) list))
109 ((eq char ?\,)
110 (setq pos (read-from-string to))
111 (push `(replace-quote ,(car pos)) list)
112 (setq to (substring
113 to (+ (cdr pos)
114 ;; Swallow a space after a symbol
115 ;; if there is a space.
116 (if (string-match
117 "^[^])\"] "
118 (substring to (1- (cdr pos))))
119 1 0))))))
120 (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to)))
121 (setq to (nreverse (delete "" (cons to list)))))
122 (replace-match-string-symbols to)
123 (setq to (cons 'replace-eval-replacement
124 (if (> (length to) 1)
125 (cons 'concat to)
126 (car to)))))
98 (list from to current-prefix-arg))) 127 (list from to current-prefix-arg)))
99 128
100(defun query-replace (from-string to-string &optional delimited start end) 129(defun query-replace (from-string to-string &optional delimited start end)
@@ -163,59 +192,35 @@ Fourth and fifth arg START and END specify the region to operate on.
163In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP, 192In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP,
164and `\\=\\N' (where N is a digit) stands for 193and `\\=\\N' (where N is a digit) stands for
165whatever what matched the Nth `\\(...\\)' in REGEXP. 194whatever what matched the Nth `\\(...\\)' in REGEXP.
166 195`\\?' lets you edit the replacement text in the minibuffer
167When this function is called interactively, the replacement text 196at the given position for each replacement.
168can also contain `\\,' followed by a Lisp expression. The escaped 197
169shorthands for `query-replace-regexp-eval' are also valid 198In interactive calls, the replacement text can contain `\\,'
170here: within the Lisp expression, you can use `\\&' for the whole 199followed by a Lisp expression. Each
171match string, `\\N' for partial matches, `\\#&' and `\\#N' for 200replacement evaluates that expression to compute the replacement
172the respective numeric values, and `\\#' for `replace-count'. 201string. Inside of that expression, `\\&' is a string denoting the
173 202whole match as a sting, `\\N' for a partial match, `\\#&' and `\\#N'
174If your Lisp expression is an identifier and the next 203for the whole or a partial match converted to a number with
175letter in the replacement string would be interpreted as part of it, 204`string-to-number', and `\\#' itself for the number of replacements
176you can wrap it with an expression like `\\,(or \\#)'. Incidentally, 205done so far (starting with zero).
177for this particular case you may also enter `\\#' in the replacement 206
178text directly. 207If the replacement expression is a symbol, write a space after it
179 208to terminate it. One space there, if any, will be discarded.
180When you use `\\,' or `\\#' in the replacement, TO-STRING actually 209
181becomes a list with expanded shorthands. 210When using those Lisp features interactively in the replacement
182Use \\[repeat-complex-command] after this command to see details." 211text, TO-STRING is actually made a list instead of a string.
212Use \\[repeat-complex-command] after this command for details."
183 (interactive 213 (interactive
184 (let ((common 214 (let ((common
185 (query-replace-read-args "Query replace regexp" t))) 215 (query-replace-read-args "Query replace regexp" t)))
186 (list 216 (list (nth 0 common) (nth 1 common) (nth 2 common)
187 (nth 0 common) 217 ;; These are done separately here
188 (if (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" 218 ;; so that command-history will record these expressions
189 (nth 1 common)) 219 ;; rather than the values they had this time.
190 (let ((to-string (nth 1 common)) pos to-expr char prompt) 220 (if (and transient-mark-mode mark-active)
191 (while (string-match 221 (region-beginning))
192 "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" 222 (if (and transient-mark-mode mark-active)
193 to-string) 223 (region-end)))))
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)))))
219 (perform-replace regexp to-string t t delimited nil nil start end)) 224 (perform-replace regexp to-string t t delimited nil nil start end))
220 225
221(define-key esc-map [?\C-%] 'query-replace-regexp) 226(define-key esc-map [?\C-%] 'query-replace-regexp)
@@ -374,7 +379,27 @@ Fourth and fifth arg START and END specify the region to operate on.
374 379
375In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP, 380In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP,
376and `\\=\\N' (where N is a digit) stands for 381and `\\=\\N' (where N is a digit) stands for
377 whatever what matched the Nth `\\(...\\)' in REGEXP. 382whatever what matched the Nth `\\(...\\)' in REGEXP.
383`\\?' lets you edit the replacement text in the minibuffer
384at the given position for each replacement.
385
386In interactive calls, the replacement text may contain `\\,'
387followed by a Lisp expression used as part of the replacement
388text. Inside of that expression, `\\&' is a string denoting the
389whole match, `\\N' a partial matches, `\\#&' and `\\#N' the
390respective numeric values from `string-to-number', and `\\#'
391itself for `replace-count', the number of replacements occured so
392far.
393
394If your Lisp expression is an identifier and the next letter in
395the replacement string would be interpreted as part of it, you
396can wrap it with an expression like `\\,(or \\#)'. Incidentally,
397for this particular case you may also enter `\\#' in the
398replacement text directly.
399
400When using those Lisp features interactively in the replacement
401text, TO-STRING is actually made a list instead of a string.
402Use \\[repeat-complex-command] after this command for details.
378 403
379If `query-replace-interactive' is non-nil, the last incremental search 404If `query-replace-interactive' is non-nil, the last incremental search
380regexp is used as REGEXP--you don't have to specify it with the minibuffer. 405regexp is used as REGEXP--you don't have to specify it with the minibuffer.
@@ -1115,6 +1140,49 @@ with the `noescape' argument set.
1115 (aset data 2 (if (consp next) next (aref data 3)))))) 1140 (aset data 2 (if (consp next) next (aref data 3))))))
1116 (car (aref data 2))) 1141 (car (aref data 2)))
1117 1142
1143(defun replace-match-data (integers reuse &optional new)
1144 "Like `match-data', but markers in REUSE get invalidated.
1145If NEW is non-NIL, it is set and returned instead of fresh data,
1146but coerced to the correct value of INTEGERS."
1147 (or (and new
1148 (progn
1149 (set-match-data new)
1150 (and (eq new reuse)
1151 (eq (null integers) (markerp (car reuse)))
1152 new)))
1153 (match-data integers
1154 (prog1 reuse
1155 (while reuse
1156 (if (markerp (car reuse))
1157 (set-marker (car reuse) nil))
1158 (setq reuse (cdr reuse)))))))
1159
1160(defun replace-match-maybe-edit (newtext fixedcase literal noedit match-data)
1161 "Make a replacement with `replace-match', editing `\\?'.
1162NEXTEXT, FIXEDCASE, LITERAL are just passed on. If NOEDIT is true, no
1163check for `\\?' is made to save time. MATCH-DATA is used for the
1164replacement. In case editing is done, it is changed to use markers.
1165
1166The return value is non-NIL if there has been no `\\?' or NOEDIT was
1167passed in. If LITERAL is set, no checking is done, anyway."
1168 (unless (or literal noedit)
1169 (setq noedit t)
1170 (while (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\\\?\\)"
1171 newtext)
1172 (setq newtext
1173 (read-input "Edit replacement string: "
1174 (prog1
1175 (cons
1176 (replace-match "" t t newtext 3)
1177 (1+ (match-beginning 3)))
1178 (setq match-data
1179 (replace-match-data
1180 nil match-data match-data))))
1181 noedit nil)))
1182 (set-match-data match-data)
1183 (replace-match newtext fixedcase literal)
1184 noedit)
1185
1118(defun perform-replace (from-string replacements 1186(defun perform-replace (from-string replacements
1119 query-flag regexp-flag delimited-flag 1187 query-flag regexp-flag delimited-flag
1120 &optional repeat-count map start end) 1188 &optional repeat-count map start end)
@@ -1145,6 +1213,7 @@ make, or the user didn't cancel the call."
1145 (search-string from-string) 1213 (search-string from-string)
1146 (real-match-data nil) ; the match data for the current match 1214 (real-match-data nil) ; the match data for the current match
1147 (next-replacement nil) 1215 (next-replacement nil)
1216 (noedit nil)
1148 (keep-going t) 1217 (keep-going t)
1149 (stack nil) 1218 (stack nil)
1150 (replace-count 0) 1219 (replace-count 0)
@@ -1201,7 +1270,9 @@ make, or the user didn't cancel the call."
1201 (setq real-match-data 1270 (setq real-match-data
1202 (if (consp match-again) 1271 (if (consp match-again)
1203 (progn (goto-char (nth 1 match-again)) 1272 (progn (goto-char (nth 1 match-again))
1204 match-again) 1273 (replace-match-data t
1274 real-match-data
1275 match-again))
1205 (and (or match-again 1276 (and (or match-again
1206 ;; MATCH-AGAIN non-nil means we 1277 ;; MATCH-AGAIN non-nil means we
1207 ;; accept an adjacent match. If 1278 ;; accept an adjacent match. If
@@ -1217,7 +1288,7 @@ make, or the user didn't cancel the call."
1217 (funcall search-function search-string limit t) 1288 (funcall search-function search-string limit t)
1218 ;; For speed, use only integers and 1289 ;; For speed, use only integers and
1219 ;; reuse the list used last time. 1290 ;; reuse the list used last time.
1220 (match-data t real-match-data))))) 1291 (replace-match-data t real-match-data)))))
1221 ;; Optionally ignore matches that have a read-only property. 1292 ;; Optionally ignore matches that have a read-only property.
1222 (unless (and query-replace-skip-read-only 1293 (unless (and query-replace-skip-read-only
1223 (text-property-not-all 1294 (text-property-not-all
@@ -1249,16 +1320,27 @@ make, or the user didn't cancel the call."
1249 (set-match-data real-match-data) 1320 (set-match-data real-match-data)
1250 (setq next-replacement 1321 (setq next-replacement
1251 (funcall (car replacements) (cdr replacements) 1322 (funcall (car replacements) (cdr replacements)
1252 replace-count))) 1323 replace-count)
1324 noedit nil))
1253 (if (not query-flag) 1325 (if (not query-flag)
1254 (let ((inhibit-read-only query-replace-skip-read-only)) 1326 (let ((inhibit-read-only
1255 (set-match-data real-match-data) 1327 query-replace-skip-read-only))
1256 (replace-match next-replacement nocasify literal) 1328 (unless noedit
1257 (setq replace-count (1+ replace-count))) 1329 (replace-highlight (nth 0 real-match-data)
1330 (nth 1 real-match-data)))
1331 (setq noedit
1332 (replace-match-maybe-edit
1333 next-replacement nocasify literal
1334 noedit real-match-data)
1335 replace-count (1+ replace-count)))
1258 (undo-boundary) 1336 (undo-boundary)
1259 (let (done replaced key def) 1337 (let (done replaced key def)
1260 ;; Loop reading commands until one of them sets done, 1338 ;; Loop reading commands until one of them sets done,
1261 ;; which means it has finished handling this occurrence. 1339 ;; which means it has finished handling this
1340 ;; occurrence. Any command that sets `done' should
1341 ;; leave behind proper match data for the stack.
1342 ;; Commands not setting `done' need to adjust
1343 ;; `real-match-data'.
1262 (while (not done) 1344 (while (not done)
1263 (set-match-data real-match-data) 1345 (set-match-data real-match-data)
1264 (replace-highlight (match-beginning 0) (match-end 0)) 1346 (replace-highlight (match-beginning 0) (match-end 0))
@@ -1290,37 +1372,49 @@ make, or the user didn't cancel the call."
1290 ((eq def 'backup) 1372 ((eq def 'backup)
1291 (if stack 1373 (if stack
1292 (let ((elt (pop stack))) 1374 (let ((elt (pop stack)))
1293 (goto-char (car elt)) 1375 (goto-char (nth 0 elt))
1294 (setq replaced (eq t (cdr elt))) 1376 (setq replaced (nth 1 elt)
1295 (or replaced 1377 real-match-data
1296 (set-match-data (cdr elt)))) 1378 (replace-match-data
1379 t real-match-data
1380 (nth 2 elt))))
1297 (message "No previous match") 1381 (message "No previous match")
1298 (ding 'no-terminate) 1382 (ding 'no-terminate)
1299 (sit-for 1))) 1383 (sit-for 1)))
1300 ((eq def 'act) 1384 ((eq def 'act)
1301 (or replaced 1385 (or replaced
1302 (progn 1386 (setq noedit
1303 (replace-match next-replacement nocasify literal) 1387 (replace-match-maybe-edit
1304 (setq replace-count (1+ replace-count)))) 1388 next-replacement nocasify literal
1389 noedit real-match-data)
1390 replace-count (1+ replace-count)))
1305 (setq done t replaced t)) 1391 (setq done t replaced t))
1306 ((eq def 'act-and-exit) 1392 ((eq def 'act-and-exit)
1307 (or replaced 1393 (or replaced
1308 (progn 1394 (setq noedit
1309 (replace-match next-replacement nocasify literal) 1395 (replace-match-maybe-edit
1310 (setq replace-count (1+ replace-count)))) 1396 next-replacement nocasify literal
1397 noedit real-match-data)
1398 replace-count (1+ replace-count)))
1311 (setq keep-going nil) 1399 (setq keep-going nil)
1312 (setq done t replaced t)) 1400 (setq done t replaced t))
1313 ((eq def 'act-and-show) 1401 ((eq def 'act-and-show)
1314 (if (not replaced) 1402 (if (not replaced)
1315 (progn 1403 (setq noedit
1316 (replace-match next-replacement nocasify literal) 1404 (replace-match-maybe-edit
1317 (setq replace-count (1+ replace-count)) 1405 next-replacement nocasify literal
1318 (setq replaced t)))) 1406 noedit real-match-data)
1407 replace-count (1+ replace-count)
1408 real-match-data (replace-match-data
1409 t real-match-data)
1410 replaced t)))
1319 ((eq def 'automatic) 1411 ((eq def 'automatic)
1320 (or replaced 1412 (or replaced
1321 (progn 1413 (setq noedit
1322 (replace-match next-replacement nocasify literal) 1414 (replace-match-maybe-edit
1323 (setq replace-count (1+ replace-count)))) 1415 next-replacement nocasify literal
1416 noedit real-match-data)
1417 replace-count (1+ replace-count)))
1324 (setq done t query-flag nil replaced t)) 1418 (setq done t query-flag nil replaced t))
1325 ((eq def 'skip) 1419 ((eq def 'skip)
1326 (setq done t)) 1420 (setq done t))
@@ -1328,36 +1422,45 @@ make, or the user didn't cancel the call."
1328 (recenter nil)) 1422 (recenter nil))
1329 ((eq def 'edit) 1423 ((eq def 'edit)
1330 (let ((opos (point-marker))) 1424 (let ((opos (point-marker)))
1425 (setq real-match-data (replace-match-data
1426 nil real-match-data
1427 real-match-data))
1331 (goto-char (match-beginning 0)) 1428 (goto-char (match-beginning 0))
1332 (save-excursion 1429 (save-excursion
1333 (funcall search-function search-string limit t)
1334 (setq real-match-data (match-data)))
1335 (save-excursion
1336 (save-window-excursion 1430 (save-window-excursion
1337 (recursive-edit))) 1431 (recursive-edit)))
1338 (goto-char opos)) 1432 (goto-char opos)
1339 (set-match-data real-match-data) 1433 (set-marker opos nil))
1340 ;; Before we make the replacement, 1434 ;; Before we make the replacement,
1341 ;; decide whether the search string 1435 ;; decide whether the search string
1342 ;; can match again just after this match. 1436 ;; can match again just after this match.
1343 (if (and regexp-flag nonempty-match) 1437 (if (and regexp-flag nonempty-match)
1344 (setq match-again (and (looking-at search-string) 1438 (setq match-again (and (looking-at search-string)
1345 (match-data))))) 1439 (match-data)))))
1346
1347 ;; Edit replacement. 1440 ;; Edit replacement.
1348 ((eq def 'edit-replacement) 1441 ((eq def 'edit-replacement)
1349 (setq next-replacement 1442 (setq real-match-data (replace-match-data
1443 nil real-match-data
1444 real-match-data)
1445 next-replacement
1350 (read-input "Edit replacement string: " 1446 (read-input "Edit replacement string: "
1351 next-replacement)) 1447 next-replacement)
1352 (or replaced 1448 noedit nil)
1353 (replace-match next-replacement nocasify literal)) 1449 (if replaced
1450 (set-match-data real-match-data)
1451 (setq noedit
1452 (replace-match-maybe-edit
1453 next-replacement nocasify literal noedit
1454 real-match-data)
1455 replaced t))
1354 (setq done t)) 1456 (setq done t))
1355 1457
1356 ((eq def 'delete-and-edit) 1458 ((eq def 'delete-and-edit)
1357 (delete-region (match-beginning 0) (match-end 0)) 1459 (replace-match "" t t)
1358 (set-match-data 1460 (setq real-match-data (replace-match-data
1359 (prog1 (match-data) 1461 nil real-match-data))
1360 (save-excursion (recursive-edit)))) 1462 (replace-dehighlight)
1463 (save-excursion (recursive-edit))
1361 (setq replaced t)) 1464 (setq replaced t))
1362 ;; Note: we do not need to treat `exit-prefix' 1465 ;; Note: we do not need to treat `exit-prefix'
1363 ;; specially here, since we reread 1466 ;; specially here, since we reread
@@ -1372,10 +1475,23 @@ make, or the user didn't cancel the call."
1372 ;; Record previous position for ^ when we move on. 1475 ;; Record previous position for ^ when we move on.
1373 ;; Change markers to numbers in the match data 1476 ;; Change markers to numbers in the match data
1374 ;; since lots of markers slow down editing. 1477 ;; since lots of markers slow down editing.
1375 (setq stack 1478 (push (list (point) replaced
1376 (cons (cons (point) 1479;;; If the replacement has already happened, all we need is the
1377 (or replaced (match-data t))) 1480;;; current match start and end. We could get this with a trivial
1378 stack)))))) 1481;;; match like
1482;;; (save-excursion (goto-char (match-beginning 0))
1483;;; (search-forward (match-string 0))
1484;;; (match-data t))
1485;;; if we really wanted to avoid manually constructing match data.
1486;;; Adding current-buffer is necessary so that match-data calls can
1487;;; return markers which are appropriate for editing.
1488 (if replaced
1489 (list
1490 (match-beginning 0)
1491 (match-end 0)
1492 (current-buffer))
1493 (match-data t)))
1494 stack)))))
1379 1495
1380 ;; The code preventing adjacent regexp matches in the condition 1496 ;; The code preventing adjacent regexp matches in the condition
1381 ;; of the while-loop above will haven taken us one character 1497 ;; of the while-loop above will haven taken us one character
@@ -1405,14 +1521,12 @@ make, or the user didn't cancel the call."
1405 1521
1406(defun replace-highlight (start end) 1522(defun replace-highlight (start end)
1407 (and query-replace-highlight 1523 (and query-replace-highlight
1408 (progn 1524 (if replace-overlay
1409 (or replace-overlay 1525 (move-overlay replace-overlay start end (current-buffer))
1410 (progn 1526 (setq replace-overlay (make-overlay start end))
1411 (setq replace-overlay (make-overlay start end)) 1527 (overlay-put replace-overlay 'face
1412 (overlay-put replace-overlay 'face 1528 (if (facep 'query-replace)
1413 (if (facep 'query-replace) 1529 'query-replace 'region)))))
1414 'query-replace 'region))))
1415 (move-overlay replace-overlay start end (current-buffer)))))
1416 1530
1417;;; arch-tag: 16b4cd61-fd40-497b-b86f-b667c4cf88e4 1531;;; arch-tag: 16b4cd61-fd40-497b-b86f-b667c4cf88e4
1418;;; replace.el ends here 1532;;; replace.el ends here
diff --git a/lisp/vc-arch.el b/lisp/vc-arch.el
index a439174556e..5f24599241c 100644
--- a/lisp/vc-arch.el
+++ b/lisp/vc-arch.el
@@ -309,7 +309,8 @@ Return non-nil if FILE is unchanged."
309(defcustom vc-arch-mode-line-rewrite 309(defcustom vc-arch-mode-line-rewrite
310 '(("\\`.*--\\(.*--.*\\)--\\(v?\\).*-\\([0-9]+\\)\\'" . "\\2\\3[\\1]")) 310 '(("\\`.*--\\(.*--.*\\)--\\(v?\\).*-\\([0-9]+\\)\\'" . "\\2\\3[\\1]"))
311 "Rewrite rules to shorten Arch's revision names on the mode-line." 311 "Rewrite rules to shorten Arch's revision names on the mode-line."
312 :type '(repeat (cons regexp string))) 312 :type '(repeat (cons regexp string))
313 :group 'vc)
313 314
314(defun vc-arch-mode-line-string (file) 315(defun vc-arch-mode-line-string (file)
315 "Return string for placement in modeline by `vc-mode-line' for FILE." 316 "Return string for placement in modeline by `vc-mode-line' for FILE."
diff --git a/lisp/woman.el b/lisp/woman.el
index ba511bca1ae..cea1c61bcc4 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -5,7 +5,7 @@
5;; Author: Francis J. Wright <F.J.Wright@qmul.ac.uk> 5;; Author: Francis J. Wright <F.J.Wright@qmul.ac.uk>
6;; Maintainer: Francis J. Wright <F.J.Wright@qmul.ac.uk> 6;; Maintainer: Francis J. Wright <F.J.Wright@qmul.ac.uk>
7;; Keywords: help, unix 7;; Keywords: help, unix
8;; Adapted-By: Eli Zaretskii <eliz@is.elta.co.il> 8;; Adapted-By: Eli Zaretskii <eliz@gnu.org>
9;; Version: see `woman-version' 9;; Version: see `woman-version'
10;; URL: http://centaur.maths.qmul.ac.uk/Emacs/WoMan/ 10;; URL: http://centaur.maths.qmul.ac.uk/Emacs/WoMan/
11 11