aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaroly Lorentey2004-09-02 07:43:01 +0000
committerKaroly Lorentey2004-09-02 07:43:01 +0000
commit5232b240359a0ee6b267e261607b80b6dc26859a (patch)
tree863fee4dab682bf9d2f5a2d2148c8f040d7a09a9
parent8328a03d0cf23b4851e22e3c45d4d24106916766 (diff)
parent6a18e4e72c2ab83d2cca8b6a6c432676ade70347 (diff)
downloademacs-5232b240359a0ee6b267e261607b80b6dc26859a.tar.gz
emacs-5232b240359a0ee6b267e261607b80b6dc26859a.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-519 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-520 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-240
-rw-r--r--etc/NEWS8
-rw-r--r--lisp/ChangeLog78
-rw-r--r--lisp/info.el120
-rw-r--r--lisp/isearch.el143
-rw-r--r--lisp/macros.el17
-rw-r--r--lisp/progmodes/compile.el19
-rw-r--r--lisp/simple.el148
-rw-r--r--lisp/x-dnd.el17
-rw-r--r--man/ChangeLog11
-rw-r--r--man/frames.texi11
-rw-r--r--man/kmacro.texi6
-rw-r--r--src/ChangeLog5
-rw-r--r--src/w32fns.c12
13 files changed, 406 insertions, 189 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 5995bf3dd97..2b4f16efa13 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -98,6 +98,10 @@ types any more. Add -DUSE_LISP_UNION_TYPE if you want union types.
98 98
99* Changes in Emacs 21.4 99* Changes in Emacs 21.4
100 100
101+++
102** `apply-macro-to-region-lines' now operates on all lines that begin
103in the region, rather than on all complete lines in the region.
104
101** global-whitespace-mode is a new alias for whitespace-global-mode. 105** global-whitespace-mode is a new alias for whitespace-global-mode.
102 106
103+++ 107+++
@@ -1858,7 +1862,9 @@ This option allows you to specify environment variables for inferior
1858compilation processes without affecting the environment that all 1862compilation processes without affecting the environment that all
1859subprocesses inherit. 1863subprocesses inherit.
1860 1864
1861*** `next-error' now temporarily highlights the corresponding source line. 1865*** New options `next-error-highlight' and `next-error-highlight-no-select'
1866specify the method of highlighting of the corresponding source line
1867in new face `next-error'.
1862 1868
1863** Grep has been decoupled from compilation mode setup. 1869** Grep has been decoupled from compilation mode setup.
1864 1870
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e6b3e1f60a7..9871aac6976 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,72 @@
12004-09-01 Juri Linkov <juri@jurta.org>
2
3 * isearch.el (isearch-wrap-function)
4 (isearch-push-state-function): New defvars.
5 (isearch-pop-fun-state): New defsubst.
6 (isearch-top-state): Call function saved in `isearch-pop-fun-state'.
7 (isearch-push-state): Set the result of calling
8 `isearch-push-state-function' to the `isearch-pop-fun-state' field.
9 (isearch-cancel): Call function saved in `isearch-pop-fun-state' to
10 restore the mode-specific starting point of terminated search.
11 (isearch-abort): Call `isearch-cancel' instead of its duplicated code.
12 (isearch-repeat): Call `isearch-wrap-function' if defined.
13 (isearch-message-prefix): Don't add prefix "over" to the message
14 for wrapped search if `isearch-wrap-function' is defined.
15 (isearch-search): Call function saved in `isearch-pop-fun-state' to
16 restore the mode-specific starting point of failed search.
17
18 * info.el (Info-search-whitespace-regexp): Fix backslashes.
19 (Info-search): Add new optional arguments for the sake of isearch.
20 Replace whitespace in Info-search-whitespace-regexp literally.
21 Add backward search. Don't call `Info-select-node' if regexp is
22 found in the same Info node. Don't add node to Info-history for
23 wrapped isearch.
24 (Info-search-backward, Info-isearch-search, Info-isearch-wrap)
25 (Info-isearch-push-state, Info-isearch-pop-state): New funs.
26 (Info-mode): Set local variables `isearch-search-fun-function',
27 `isearch-wrap-function', `isearch-push-state-function',
28 `search-whitespace-regexp'.
29
30 * isearch.el: Remove ancient Change Log section.
31 (isearch-string, isearch-message-string, isearch-point)
32 (isearch-success, isearch-forward-flag, isearch-other-end)
33 (isearch-word, isearch-invalid-regexp, isearch-wrapped)
34 (isearch-barrier, isearch-within-brackets)
35 (isearch-case-fold-search): Add suffix `-state' to state-related
36 defsubsts to avoid name clashes with other function names.
37
38 * simple.el (next-error): New defgroup and defface.
39 (next-error-highlight, next-error-highlight-no-select):
40 New defcustoms.
41 (next-error-no-select): Let-bind next-error-highlight to the value
42 of next-error-highlight-no-select before calling `next-error'.
43
44 * progmodes/compile.el (compilation-goto-locus):
45 Use `next-error' face instead of `region'. Set 4-th argument of
46 `move-overlay' to `current-buffer' to move overlay to different
47 source buffers. Use new variable `next-error-highlight'.
48
49 * simple.el (next-error-find-buffer): Move the rule
50 "if current buffer is a next-error capable buffer" after the
51 rule "if next-error-last-buffer is set to a live buffer".
52 Simplify to test all rules in one `or'.
53 (next-error): Doc fix.
54 (next-error, previous-error, first-error)
55 (next-error-no-select, previous-error-no-select):
56 Make arguments optional.
57
582004-08-31 Luc Teirlinck <teirllm@auburn.edu>
59
60 * macros.el (apply-macro-to-region-lines): Make it operate on all
61 lines that begin in the region, rather than on all complete lines
62 in the region.
63
642004-08-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
65
66 * x-dnd.el (x-dnd-protocol-alist): Document update.
67 (x-dnd-known-types): Defcustom it.
68 (x-dnd-handle-motif): Print message-atom in error message.
69
12004-08-30 John Paul Wallington <jpw@gnu.org> 702004-08-30 John Paul Wallington <jpw@gnu.org>
2 71
3 * textmodes/tex-mode.el (tex-validate-buffer): Use distinct 72 * textmodes/tex-mode.el (tex-validate-buffer): Use distinct
@@ -600,7 +669,6 @@
600 (ps-generate-string-list): Comment fix. 669 (ps-generate-string-list): Comment fix.
601 (ps-message-log-max): Code fix. 670 (ps-message-log-max): Code fix.
602 671
603
6042004-07-22 Michael Piotrowski <mxp@dynalabs.de> (tiny change) 6722004-07-22 Michael Piotrowski <mxp@dynalabs.de> (tiny change)
605 673
606 * ps-print.el (ps-begin-file): Improve the DSC compliance of the 674 * ps-print.el (ps-begin-file): Improve the DSC compliance of the
@@ -620,11 +688,9 @@
620 688
6212004-07-20 Richard M. Stallman <rms@gnu.org> 6892004-07-20 Richard M. Stallman <rms@gnu.org>
622 690
623 * textmodes/fill.el (fill-comment-paragraph): Handle indent-tabs-mode. 691 * textmodes/fill.el (fill-nobreak-p): If this break point is
624 (fill-delete-newlines): Call sentence-end as function. 692 at the end of the line, don't consider the newline which follows
625 (fill-nobreak-p, canonically-space-region): Likewise. 693 as a reason to return t.
626 (fill-nobreak-p): If this break point is at the end of the line,
627 don't consider the newline which follows as a reason to return t.
628 694
6292004-07-19 John Paul Wallington <jpw@gnu.org> 6952004-07-19 John Paul Wallington <jpw@gnu.org>
630 696
diff --git a/lisp/info.el b/lisp/info.el
index 43e1dafcc6f..13bf3901d6d 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -188,7 +188,7 @@ file, so be prepared for a few surprises if you enable this feature."
188 :type 'boolean 188 :type 'boolean
189 :group 'info) 189 :group 'info)
190 190
191(defcustom Info-search-whitespace-regexp "\\\\(?:\\\\s-+\\\\)" 191(defcustom Info-search-whitespace-regexp "\\(?:\\s-+\\)"
192 "*If non-nil, regular expression to match a sequence of whitespace chars. 192 "*If non-nil, regular expression to match a sequence of whitespace chars.
193This applies to Info search for regular expressions. 193This applies to Info search for regular expressions.
194You might want to use something like \"[ \\t\\r\\n]+\" instead. 194You might want to use something like \"[ \\t\\r\\n]+\" instead.
@@ -1442,8 +1442,9 @@ If FORK is a string, it is the name to use for the new buffer."
1442(defvar Info-search-case-fold nil 1442(defvar Info-search-case-fold nil
1443 "The value of `case-fold-search' from previous `Info-search' command.") 1443 "The value of `case-fold-search' from previous `Info-search' command.")
1444 1444
1445(defun Info-search (regexp) 1445(defun Info-search (regexp &optional bound noerror count direction)
1446 "Search for REGEXP, starting from point, and select node it's found in." 1446 "Search for REGEXP, starting from point, and select node it's found in.
1447If DIRECTION is `backward', search in the reverse direction."
1447 (interactive (list (read-string 1448 (interactive (list (read-string
1448 (if Info-search-history 1449 (if Info-search-history
1449 (format "Regexp search%s (default `%s'): " 1450 (format "Regexp search%s (default `%s'): "
@@ -1458,31 +1459,42 @@ If FORK is a string, it is the name to use for the new buffer."
1458 (setq regexp (car Info-search-history))) 1459 (setq regexp (car Info-search-history)))
1459 (when regexp 1460 (when regexp
1460 (let (found beg-found give-up 1461 (let (found beg-found give-up
1462 (backward (eq direction 'backward))
1461 (onode Info-current-node) 1463 (onode Info-current-node)
1462 (ofile Info-current-file) 1464 (ofile Info-current-file)
1463 (opoint (point)) 1465 (opoint (point))
1466 (opoint-min (point-min))
1467 (opoint-max (point-max))
1464 (ostart (window-start)) 1468 (ostart (window-start))
1465 (osubfile Info-current-subfile)) 1469 (osubfile Info-current-subfile))
1466 (when Info-search-whitespace-regexp 1470 (when Info-search-whitespace-regexp
1467 (setq regexp (replace-regexp-in-string 1471 (setq regexp
1468 "[ \t\n]+" Info-search-whitespace-regexp regexp))) 1472 (mapconcat 'identity (split-string regexp "[ \t\n]+")
1473 Info-search-whitespace-regexp)))
1469 (setq Info-search-case-fold case-fold-search) 1474 (setq Info-search-case-fold case-fold-search)
1470 (save-excursion 1475 (save-excursion
1471 (save-restriction 1476 (save-restriction
1472 (widen) 1477 (widen)
1473 (while (and (not give-up) 1478 (while (and (not give-up)
1474 (or (null found) 1479 (or (null found)
1475 (isearch-range-invisible beg-found found))) 1480 (if backward
1476 (if (re-search-forward regexp nil t) 1481 (isearch-range-invisible found beg-found)
1477 (setq found (point) beg-found (match-beginning 0)) 1482 (isearch-range-invisible beg-found found))))
1483 (if (if backward
1484 (re-search-backward regexp bound t)
1485 (re-search-forward regexp bound t))
1486 (setq found (point) beg-found (if backward (match-end 0)
1487 (match-beginning 0)))
1478 (setq give-up t))))) 1488 (setq give-up t)))))
1479 ;; If no subfiles, give error now. 1489 ;; If no subfiles, give error now.
1480 (if give-up 1490 (if give-up
1481 (if (null Info-current-subfile) 1491 (if (null Info-current-subfile)
1482 (re-search-forward regexp) 1492 (if backward
1493 (re-search-backward regexp)
1494 (re-search-forward regexp))
1483 (setq found nil))) 1495 (setq found nil)))
1484 1496
1485 (unless found 1497 (unless (or found bound)
1486 (unwind-protect 1498 (unwind-protect
1487 ;; Try other subfiles. 1499 ;; Try other subfiles.
1488 (let ((list ())) 1500 (let ((list ()))
@@ -1498,29 +1510,39 @@ If FORK is a string, it is the name to use for the new buffer."
1498 ;; Find the subfile we just searched. 1510 ;; Find the subfile we just searched.
1499 (search-forward (concat "\n" osubfile ": ")) 1511 (search-forward (concat "\n" osubfile ": "))
1500 ;; Skip that one. 1512 ;; Skip that one.
1501 (forward-line 1) 1513 (forward-line (if backward 0 1))
1502 ;; Make a list of all following subfiles. 1514 ;; Make a list of all following subfiles.
1503 ;; Each elt has the form (VIRT-POSITION . SUBFILENAME). 1515 ;; Each elt has the form (VIRT-POSITION . SUBFILENAME).
1504 (while (not (eobp)) 1516 (while (not (if backward (bobp) (eobp)))
1505 (re-search-forward "\\(^.*\\): [0-9]+$") 1517 (if backward
1518 (re-search-backward "\\(^.*\\): [0-9]+$")
1519 (re-search-forward "\\(^.*\\): [0-9]+$"))
1506 (goto-char (+ (match-end 1) 2)) 1520 (goto-char (+ (match-end 1) 2))
1507 (setq list (cons (cons (+ (point-min) 1521 (setq list (cons (cons (+ (point-min)
1508 (read (current-buffer))) 1522 (read (current-buffer)))
1509 (match-string-no-properties 1)) 1523 (match-string-no-properties 1))
1510 list)) 1524 list))
1511 (goto-char (1+ (match-end 0)))) 1525 (goto-char (if backward
1526 (1- (match-beginning 0))
1527 (1+ (match-end 0)))))
1512 ;; Put in forward order 1528 ;; Put in forward order
1513 (setq list (nreverse list)))) 1529 (setq list (nreverse list))))
1514 (while list 1530 (while list
1515 (message "Searching subfile %s..." (cdr (car list))) 1531 (message "Searching subfile %s..." (cdr (car list)))
1516 (Info-read-subfile (car (car list))) 1532 (Info-read-subfile (car (car list)))
1533 (if backward (goto-char (point-max)))
1517 (setq list (cdr list)) 1534 (setq list (cdr list))
1518 (setq give-up nil found nil) 1535 (setq give-up nil found nil)
1519 (while (and (not give-up) 1536 (while (and (not give-up)
1520 (or (null found) 1537 (or (null found)
1521 (isearch-range-invisible beg-found found))) 1538 (if backward
1522 (if (re-search-forward regexp nil t) 1539 (isearch-range-invisible found beg-found)
1523 (setq found (point) beg-found (match-beginning 0)) 1540 (isearch-range-invisible beg-found found))))
1541 (if (if backward
1542 (re-search-backward regexp nil t)
1543 (re-search-forward regexp nil t))
1544 (setq found (point) beg-found (if backward (match-end 0)
1545 (match-beginning 0)))
1524 (setq give-up t))) 1546 (setq give-up t)))
1525 (if give-up 1547 (if give-up
1526 (setq found nil)) 1548 (setq found nil))
@@ -1534,12 +1556,20 @@ If FORK is a string, it is the name to use for the new buffer."
1534 (goto-char opoint) 1556 (goto-char opoint)
1535 (Info-select-node) 1557 (Info-select-node)
1536 (set-window-start (selected-window) ostart))))) 1558 (set-window-start (selected-window) ostart)))))
1537 (widen) 1559
1538 (goto-char found) 1560 (if (and (string= osubfile Info-current-subfile)
1539 (Info-select-node) 1561 (> found opoint-min)
1562 (< found opoint-max))
1563 ;; Search landed in the same node
1564 (goto-char found)
1565 (widen)
1566 (goto-char found)
1567 (save-match-data (Info-select-node)))
1568
1540 ;; Use string-equal, not equal, to ignore text props. 1569 ;; Use string-equal, not equal, to ignore text props.
1541 (or (and (string-equal onode Info-current-node) 1570 (or (and (string-equal onode Info-current-node)
1542 (equal ofile Info-current-file)) 1571 (equal ofile Info-current-file))
1572 (and isearch-mode isearch-wrapped (eq opoint opoint-min))
1543 (setq Info-history (cons (list ofile onode opoint) 1573 (setq Info-history (cons (list ofile onode opoint)
1544 Info-history)))))) 1574 Info-history))))))
1545 1575
@@ -1556,6 +1586,48 @@ If FORK is a string, it is the name to use for the new buffer."
1556 (if Info-search-history 1586 (if Info-search-history
1557 (Info-search (car Info-search-history)) 1587 (Info-search (car Info-search-history))
1558 (call-interactively 'Info-search)))) 1588 (call-interactively 'Info-search))))
1589
1590(defun Info-search-backward (regexp &optional bound noerror count)
1591 "Search for REGEXP in the reverse direction."
1592 (interactive (list (read-string
1593 (if Info-search-history
1594 (format "Regexp search%s backward (default `%s'): "
1595 (if case-fold-search "" " case-sensitively")
1596 (car Info-search-history))
1597 (format "Regexp search%s backward: "
1598 (if case-fold-search "" " case-sensitively")))
1599 nil 'Info-search-history)))
1600 (Info-search regexp bound noerror count 'backward))
1601
1602(defun Info-isearch-search ()
1603 (cond
1604 (isearch-word
1605 (if isearch-forward 'word-search-forward 'word-search-backward))
1606 (isearch-regexp
1607 (lambda (regexp bound noerror)
1608 (condition-case nil
1609 (progn
1610 (Info-search regexp bound noerror nil
1611 (unless isearch-forward 'backward))
1612 (point))
1613 (error nil))))
1614 (t
1615 (if isearch-forward 'search-forward 'search-backward))))
1616
1617(defun Info-isearch-wrap ()
1618 (if isearch-regexp
1619 (if isearch-forward (Info-top-node) (Info-final-node))
1620 (goto-char (if isearch-forward (point-min) (point-max)))))
1621
1622(defun Info-isearch-push-state ()
1623 `(lambda (cmd)
1624 (Info-isearch-pop-state cmd ,Info-current-file ,Info-current-node)))
1625
1626(defun Info-isearch-pop-state (cmd file node)
1627 (or (and (string= Info-current-file file)
1628 (string= Info-current-node node))
1629 (progn (Info-find-node file node) (sit-for 0))))
1630
1559 1631
1560(defun Info-extract-pointer (name &optional errorname) 1632(defun Info-extract-pointer (name &optional errorname)
1561 "Extract the value of the node-pointer named NAME. 1633 "Extract the value of the node-pointer named NAME.
@@ -3064,6 +3136,14 @@ Advanced commands:
3064 (setq desktop-save-buffer 'Info-desktop-buffer-misc-data) 3136 (setq desktop-save-buffer 'Info-desktop-buffer-misc-data)
3065 (add-hook 'clone-buffer-hook 'Info-clone-buffer-hook nil t) 3137 (add-hook 'clone-buffer-hook 'Info-clone-buffer-hook nil t)
3066 (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) 3138 (add-hook 'change-major-mode-hook 'font-lock-defontify nil t)
3139 (set (make-local-variable 'isearch-search-fun-function)
3140 'Info-isearch-search)
3141 (set (make-local-variable 'isearch-wrap-function)
3142 'Info-isearch-wrap)
3143 (set (make-local-variable 'isearch-push-state-function)
3144 'Info-isearch-push-state)
3145 (set (make-local-variable 'search-whitespace-regexp)
3146 Info-search-whitespace-regexp)
3067 (Info-set-mode-line) 3147 (Info-set-mode-line)
3068 (run-hooks 'Info-mode-hook)) 3148 (run-hooks 'Info-mode-hook))
3069 3149
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 2c20d45bbd8..b8865693d0b 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -57,47 +57,6 @@
57;; keep the behavior. No point in forcing nonincremental search until 57;; keep the behavior. No point in forcing nonincremental search until
58;; the last possible moment. 58;; the last possible moment.
59 59
60;; TODO
61;; - Integrate the emacs 19 generalized command history.
62;; - Hooks and options for failed search.
63
64;;; Change Log:
65
66;; Changes before those recorded in ChangeLog:
67
68;; Revision 1.4 92/09/14 16:26:02 liberte
69;; Added prefix args to isearch-forward, etc. to switch between
70;; string and regular expression searching.
71;; Added some support for lemacs.
72;; Added general isearch-highlight option - but only for lemacs so far.
73;; Added support for frame switching in emacs 19.
74;; Added word search option to isearch-edit-string.
75;; Renamed isearch-quit to isearch-abort.
76;; Numerous changes to comments and doc strings.
77;;
78;; Revision 1.3 92/06/29 13:10:08 liberte
79;; Moved modal isearch-mode handling into isearch-mode.
80;; Got rid of buffer-local isearch variables.
81;; isearch-edit-string used by ring adjustments, completion, and
82;; nonincremental searching. C-s and C-r are additional exit commands.
83;; Renamed all regex to regexp.
84;; Got rid of found-start and found-point globals.
85;; Generalized handling of upper-case chars.
86
87;; Revision 1.2 92/05/27 11:33:57 liberte
88;; Emacs version 19 has a search ring, which is supported here.
89;; Other fixes found in the version 19 isearch are included here.
90;;
91;; Also see variables search-caps-disable-folding,
92;; search-nonincremental-instead, search-whitespace-regexp, and
93;; commands isearch-toggle-regexp, isearch-edit-string.
94;;
95;; semi-modal isearching is supported.
96
97;; Changes for 1.1
98;; 3/18/92 Fixed invalid-regexp.
99;; 3/18/92 Fixed yanking in regexps.
100
101;;; Code: 60;;; Code:
102 61
103 62
@@ -198,6 +157,15 @@ Ordinarily the text becomes invisible again at the end of the search."
198(defvar isearch-mode-end-hook nil 157(defvar isearch-mode-end-hook nil
199 "Function(s) to call after terminating an incremental search.") 158 "Function(s) to call after terminating an incremental search.")
200 159
160(defvar isearch-wrap-function nil
161 "Function to call to wrap the search when search is failed.
162If nil, move point to the beginning of the buffer for a forward search,
163or to the end of the buffer for a backward search.")
164
165(defvar isearch-push-state-function nil
166 "Function to save a function restoring the mode-specific isearch state
167to the search status stack.")
168
201;; Search ring. 169;; Search ring.
202 170
203(defvar search-ring nil 171(defvar search-ring nil
@@ -776,57 +744,62 @@ REGEXP says which ring to use."
776 744
777;; The search status structure and stack. 745;; The search status structure and stack.
778 746
779(defsubst isearch-string (frame) 747(defsubst isearch-string-state (frame)
780 "Return the search string in FRAME." 748 "Return the search string in FRAME."
781 (aref frame 0)) 749 (aref frame 0))
782(defsubst isearch-message-string (frame) 750(defsubst isearch-message-state (frame)
783 "Return the search string to display to the user in FRAME." 751 "Return the search string to display to the user in FRAME."
784 (aref frame 1)) 752 (aref frame 1))
785(defsubst isearch-point (frame) 753(defsubst isearch-point-state (frame)
786 "Return the point in FRAME." 754 "Return the point in FRAME."
787 (aref frame 2)) 755 (aref frame 2))
788(defsubst isearch-success (frame) 756(defsubst isearch-success-state (frame)
789 "Return the success flag in FRAME." 757 "Return the success flag in FRAME."
790 (aref frame 3)) 758 (aref frame 3))
791(defsubst isearch-forward-flag (frame) 759(defsubst isearch-forward-state (frame)
792 "Return the searching-forward flag in FRAME." 760 "Return the searching-forward flag in FRAME."
793 (aref frame 4)) 761 (aref frame 4))
794(defsubst isearch-other-end (frame) 762(defsubst isearch-other-end-state (frame)
795 "Return the other end of the match in FRAME." 763 "Return the other end of the match in FRAME."
796 (aref frame 5)) 764 (aref frame 5))
797(defsubst isearch-word (frame) 765(defsubst isearch-word-state (frame)
798 "Return the search-by-word flag in FRAME." 766 "Return the search-by-word flag in FRAME."
799 (aref frame 6)) 767 (aref frame 6))
800(defsubst isearch-invalid-regexp (frame) 768(defsubst isearch-invalid-regexp-state (frame)
801 "Return the regexp error message in FRAME, or nil if its regexp is valid." 769 "Return the regexp error message in FRAME, or nil if its regexp is valid."
802 (aref frame 7)) 770 (aref frame 7))
803(defsubst isearch-wrapped (frame) 771(defsubst isearch-wrapped-state (frame)
804 "Return the search-wrapped flag in FRAME." 772 "Return the search-wrapped flag in FRAME."
805 (aref frame 8)) 773 (aref frame 8))
806(defsubst isearch-barrier (frame) 774(defsubst isearch-barrier-state (frame)
807 "Return the barrier value in FRAME." 775 "Return the barrier value in FRAME."
808 (aref frame 9)) 776 (aref frame 9))
809(defsubst isearch-within-brackets (frame) 777(defsubst isearch-within-brackets-state (frame)
810 "Return the in-character-class flag in FRAME." 778 "Return the in-character-class flag in FRAME."
811 (aref frame 10)) 779 (aref frame 10))
812(defsubst isearch-case-fold-search (frame) 780(defsubst isearch-case-fold-search-state (frame)
813 "Return the case-folding flag in FRAME." 781 "Return the case-folding flag in FRAME."
814 (aref frame 11)) 782 (aref frame 11))
783(defsubst isearch-pop-fun-state (frame)
784 "Return the function restoring the mode-specific isearch state in FRAME."
785 (aref frame 12))
815 786
816(defun isearch-top-state () 787(defun isearch-top-state ()
817 (let ((cmd (car isearch-cmds))) 788 (let ((cmd (car isearch-cmds)))
818 (setq isearch-string (isearch-string cmd) 789 (setq isearch-string (isearch-string-state cmd)
819 isearch-message (isearch-message-string cmd) 790 isearch-message (isearch-message-state cmd)
820 isearch-success (isearch-success cmd) 791 isearch-success (isearch-success-state cmd)
821 isearch-forward (isearch-forward-flag cmd) 792 isearch-forward (isearch-forward-state cmd)
822 isearch-other-end (isearch-other-end cmd) 793 isearch-other-end (isearch-other-end-state cmd)
823 isearch-word (isearch-word cmd) 794 isearch-word (isearch-word-state cmd)
824 isearch-invalid-regexp (isearch-invalid-regexp cmd) 795 isearch-invalid-regexp (isearch-invalid-regexp-state cmd)
825 isearch-wrapped (isearch-wrapped cmd) 796 isearch-wrapped (isearch-wrapped-state cmd)
826 isearch-barrier (isearch-barrier cmd) 797 isearch-barrier (isearch-barrier-state cmd)
827 isearch-within-brackets (isearch-within-brackets cmd) 798 isearch-within-brackets (isearch-within-brackets-state cmd)
828 isearch-case-fold-search (isearch-case-fold-search cmd)) 799 isearch-case-fold-search (isearch-case-fold-search-state cmd))
829 (goto-char (isearch-point cmd)))) 800 (if (functionp (isearch-pop-fun-state cmd))
801 (funcall (isearch-pop-fun-state cmd) cmd))
802 (goto-char (isearch-point-state cmd))))
830 803
831(defun isearch-pop-state () 804(defun isearch-pop-state ()
832 (setq isearch-cmds (cdr isearch-cmds)) 805 (setq isearch-cmds (cdr isearch-cmds))
@@ -838,7 +811,9 @@ REGEXP says which ring to use."
838 isearch-success isearch-forward isearch-other-end 811 isearch-success isearch-forward isearch-other-end
839 isearch-word 812 isearch-word
840 isearch-invalid-regexp isearch-wrapped isearch-barrier 813 isearch-invalid-regexp isearch-wrapped isearch-barrier
841 isearch-within-brackets isearch-case-fold-search) 814 isearch-within-brackets isearch-case-fold-search
815 (if isearch-push-state-function
816 (funcall isearch-push-state-function)))
842 isearch-cmds))) 817 isearch-cmds)))
843 818
844 819
@@ -1024,10 +999,13 @@ If first char entered is \\[isearch-yank-word-or-char], then do word search inst
1024(defun isearch-cancel () 999(defun isearch-cancel ()
1025 "Terminate the search and go back to the starting point." 1000 "Terminate the search and go back to the starting point."
1026 (interactive) 1001 (interactive)
1002 (if (functionp (isearch-pop-fun-state (car (last isearch-cmds))))
1003 (funcall (isearch-pop-fun-state (car (last isearch-cmds)))
1004 (car (last isearch-cmds))))
1027 (goto-char isearch-opoint) 1005 (goto-char isearch-opoint)
1028 (isearch-done t) 1006 (isearch-done t) ; exit isearch
1029 (isearch-clean-overlays) 1007 (isearch-clean-overlays)
1030 (signal 'quit nil)) ; and pass on quit signal 1008 (signal 'quit nil)) ; and pass on quit signal
1031 1009
1032(defun isearch-abort () 1010(defun isearch-abort ()
1033 "Abort incremental search mode if searching is successful, signaling quit. 1011 "Abort incremental search mode if searching is successful, signaling quit.
@@ -1039,11 +1017,9 @@ Use `isearch-exit' to quit without signaling."
1039 (if isearch-success 1017 (if isearch-success
1040 ;; If search is successful, move back to starting point 1018 ;; If search is successful, move back to starting point
1041 ;; and really do quit. 1019 ;; and really do quit.
1042 (progn (goto-char isearch-opoint) 1020 (progn
1043 (setq isearch-success nil) 1021 (setq isearch-success nil)
1044 (isearch-done t) ; exit isearch 1022 (isearch-cancel))
1045 (isearch-clean-overlays)
1046 (signal 'quit nil)) ; and pass on quit signal
1047 ;; If search is failing, or has an incomplete regexp, 1023 ;; If search is failing, or has an incomplete regexp,
1048 ;; rub out until it is once more successful. 1024 ;; rub out until it is once more successful.
1049 (while (or (not isearch-success) isearch-invalid-regexp) 1025 (while (or (not isearch-success) isearch-invalid-regexp)
@@ -1068,7 +1044,9 @@ Use `isearch-exit' to quit without signaling."
1068 ;; If already have what to search for, repeat it. 1044 ;; If already have what to search for, repeat it.
1069 (or isearch-success 1045 (or isearch-success
1070 (progn 1046 (progn
1071 (goto-char (if isearch-forward (point-min) (point-max))) 1047 (if isearch-wrap-function
1048 (funcall isearch-wrap-function)
1049 (goto-char (if isearch-forward (point-min) (point-max))))
1072 (setq isearch-wrapped t)))) 1050 (setq isearch-wrapped t))))
1073 ;; C-s in reverse or C-r in forward, change direction. 1051 ;; C-s in reverse or C-r in forward, change direction.
1074 (setq isearch-forward (not isearch-forward))) 1052 (setq isearch-forward (not isearch-forward)))
@@ -1347,7 +1325,7 @@ barrier."
1347 ;; We have to check 2 stack frames because the last might be 1325 ;; We have to check 2 stack frames because the last might be
1348 ;; invalid just because of a backslash. 1326 ;; invalid just because of a backslash.
1349 (or (not isearch-invalid-regexp) 1327 (or (not isearch-invalid-regexp)
1350 (not (isearch-invalid-regexp (cadr isearch-cmds))) 1328 (not (isearch-invalid-regexp-state (cadr isearch-cmds)))
1351 allow-invalid)) 1329 allow-invalid))
1352 (if to-barrier 1330 (if to-barrier
1353 (progn (goto-char isearch-barrier) 1331 (progn (goto-char isearch-barrier)
@@ -1362,8 +1340,8 @@ barrier."
1362 ;; Also skip over postfix operators -- though horrid, 1340 ;; Also skip over postfix operators -- though horrid,
1363 ;; 'ab?\{5,6\}+\{1,2\}*' is perfectly legal. 1341 ;; 'ab?\{5,6\}+\{1,2\}*' is perfectly legal.
1364 (while (and previous 1342 (while (and previous
1365 (or (isearch-invalid-regexp frame) 1343 (or (isearch-invalid-regexp-state frame)
1366 (let* ((string (isearch-string frame)) 1344 (let* ((string (isearch-string-state frame))
1367 (lchar (aref string (1- (length string))))) 1345 (lchar (aref string (1- (length string)))))
1368 ;; The operators aren't always operators; check 1346 ;; The operators aren't always operators; check
1369 ;; backslashes. This doesn't handle the case of 1347 ;; backslashes. This doesn't handle the case of
@@ -1371,7 +1349,7 @@ barrier."
1371 ;; being special, but then we should fall back to 1349 ;; being special, but then we should fall back to
1372 ;; the barrier anyway because it's all optional. 1350 ;; the barrier anyway because it's all optional.
1373 (if (isearch-backslash 1351 (if (isearch-backslash
1374 (isearch-string (car previous))) 1352 (isearch-string-state (car previous)))
1375 (eq lchar ?\}) 1353 (eq lchar ?\})
1376 (memq lchar '(?* ?? ?+)))))) 1354 (memq lchar '(?* ?? ?+))))))
1377 (setq stack previous previous (cdr previous) frame (car stack))) 1355 (setq stack previous previous (cdr previous) frame (car stack)))
@@ -1379,7 +1357,7 @@ barrier."
1379 ;; `stack' now refers the most recent valid regexp that is not at 1357 ;; `stack' now refers the most recent valid regexp that is not at
1380 ;; all optional in its last term. Now dig one level deeper and find 1358 ;; all optional in its last term. Now dig one level deeper and find
1381 ;; what matched before that. 1359 ;; what matched before that.
1382 (let ((last-other-end (or (isearch-other-end (car previous)) 1360 (let ((last-other-end (or (isearch-other-end-state (car previous))
1383 isearch-barrier))) 1361 isearch-barrier)))
1384 (goto-char (if isearch-forward 1362 (goto-char (if isearch-forward
1385 (max last-other-end isearch-barrier) 1363 (max last-other-end isearch-barrier)
@@ -1918,6 +1896,7 @@ If there is no completion possible, say so and continue searching."
1918 (or isearch-success (setq ellipsis nil)) 1896 (or isearch-success (setq ellipsis nil))
1919 (let ((m (concat (if isearch-success "" "failing ") 1897 (let ((m (concat (if isearch-success "" "failing ")
1920 (if (and isearch-wrapped 1898 (if (and isearch-wrapped
1899 (not isearch-wrap-function)
1921 (if isearch-forward 1900 (if isearch-forward
1922 (> (point) isearch-opoint) 1901 (> (point) isearch-opoint)
1923 (< (point) isearch-opoint))) 1902 (< (point) isearch-opoint)))
@@ -2012,9 +1991,11 @@ Can be changed via `isearch-search-fun-function' for special needs."
2012 (if isearch-success 1991 (if isearch-success
2013 nil 1992 nil
2014 ;; Ding if failed this time after succeeding last time. 1993 ;; Ding if failed this time after succeeding last time.
2015 (and (isearch-success (car isearch-cmds)) 1994 (and (isearch-success-state (car isearch-cmds))
2016 (ding)) 1995 (ding))
2017 (goto-char (isearch-point (car isearch-cmds))))) 1996 (if (functionp (isearch-pop-fun-state (car isearch-cmds)))
1997 (funcall (isearch-pop-fun-state (car isearch-cmds)) (car isearch-cmds)))
1998 (goto-char (isearch-point-state (car isearch-cmds)))))
2018 1999
2019 2000
2020;; Called when opening an overlay, and we are still in isearch. 2001;; Called when opening an overlay, and we are still in isearch.
diff --git a/lisp/macros.el b/lisp/macros.el
index 72ba3f11721..0de5d223ee0 100644
--- a/lisp/macros.el
+++ b/lisp/macros.el
@@ -1,6 +1,6 @@
1;;; macros.el --- non-primitive commands for keyboard macros 1;;; macros.el --- non-primitive commands for keyboard macros
2 2
3;; Copyright (C) 1985, 86, 87, 92, 94, 95 Free Software Foundation, Inc. 3;; Copyright (C) 1985, 86, 87, 92, 94, 95, 04 Free Software Foundation, Inc.
4 4
5;; Maintainer: FSF 5;; Maintainer: FSF
6;; Keywords: abbrev 6;; Keywords: abbrev
@@ -151,7 +151,7 @@ use this command, and then save the file."
151 (cond ((= char ?\\) 151 (cond ((= char ?\\)
152 (insert "\\\\")) 152 (insert "\\\\"))
153 ((= char ?\") 153 ((= char ?\")
154 (insert "\\\"")) 154 (insert "\\\""))
155 ((= char ?\;) 155 ((= char ?\;)
156 (insert "\\;")) 156 (insert "\\;"))
157 ((= char 127) 157 ((= char 127)
@@ -240,8 +240,9 @@ Possibilities: \\<query-replace-map>
240 240
241;;;###autoload 241;;;###autoload
242(defun apply-macro-to-region-lines (top bottom &optional macro) 242(defun apply-macro-to-region-lines (top bottom &optional macro)
243 "For each complete line between point and mark, move to the beginning 243 "Apply last keyboard macro to all lines in the region.
244of the line, and run the last keyboard macro. 244For each line that begins in the region, move to the beginning of
245the line, and run the last keyboard macro.
245 246
246When called from lisp, this function takes two arguments TOP and 247When called from lisp, this function takes two arguments TOP and
247BOTTOM, describing the current region. TOP must be before BOTTOM. 248BOTTOM, describing the current region. TOP must be before BOTTOM.
@@ -277,8 +278,7 @@ and write a macro to massage a word into a table entry:
277 \\C-x ) 278 \\C-x )
278 279
279and then select the region of un-tablified names and use 280and then select the region of un-tablified names and use
280`\\[apply-macro-to-region-lines]' to build the table from the names. 281`\\[apply-macro-to-region-lines]' to build the table from the names."
281"
282 (interactive "r") 282 (interactive "r")
283 (or macro 283 (or macro
284 (progn 284 (progn
@@ -286,10 +286,7 @@ and then select the region of un-tablified names and use
286 (error "No keyboard macro has been defined")) 286 (error "No keyboard macro has been defined"))
287 (setq macro last-kbd-macro))) 287 (setq macro last-kbd-macro)))
288 (save-excursion 288 (save-excursion
289 (let ((end-marker (progn 289 (let ((end-marker (copy-marker bottom))
290 (goto-char bottom)
291 (beginning-of-line)
292 (point-marker)))
293 next-line-marker) 290 next-line-marker)
294 (goto-char top) 291 (goto-char top)
295 (if (not (bolp)) 292 (if (not (bolp))
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 32fa246b9f6..b890f542b8d 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1564,7 +1564,7 @@ All arguments are markers. If END-MK is non nil, mark is set there."
1564 (unless compilation-highlight-overlay 1564 (unless compilation-highlight-overlay
1565 (setq compilation-highlight-overlay 1565 (setq compilation-highlight-overlay
1566 (make-overlay (point-min) (point-min))) 1566 (make-overlay (point-min) (point-min)))
1567 (overlay-put compilation-highlight-overlay 'face 'region)) 1567 (overlay-put compilation-highlight-overlay 'face 'next-error))
1568 (with-current-buffer (marker-buffer mk) 1568 (with-current-buffer (marker-buffer mk)
1569 (save-excursion 1569 (save-excursion
1570 (end-of-line) 1570 (end-of-line)
@@ -1574,11 +1574,18 @@ All arguments are markers. If END-MK is non nil, mark is set there."
1574 (re-search-forward highlight-regexp end t)) 1574 (re-search-forward highlight-regexp end t))
1575 (progn 1575 (progn
1576 (goto-char (match-beginning 0)) 1576 (goto-char (match-beginning 0))
1577 (move-overlay compilation-highlight-overlay (match-beginning 0) (match-end 0))) 1577 (move-overlay compilation-highlight-overlay
1578 (move-overlay compilation-highlight-overlay (point) end)) 1578 (match-beginning 0) (match-end 0)
1579 (sit-for 0.5) 1579 (current-buffer)))
1580 (delete-overlay compilation-highlight-overlay))))))) 1580 (move-overlay compilation-highlight-overlay
1581 1581 (point) end (current-buffer)))
1582 (if (numberp next-error-highlight)
1583 (sit-for next-error-highlight))
1584 (if (not (eq next-error-highlight t))
1585 (delete-overlay compilation-highlight-overlay))))))
1586 (when (and (eq next-error-highlight 'fringe-arrow))
1587 (set (make-local-variable 'overlay-arrow-position)
1588 (copy-marker (line-beginning-position))))))
1582 1589
1583(defun compilation-find-file (marker filename dir &rest formats) 1590(defun compilation-find-file (marker filename dir &rest formats)
1584 "Find a buffer for file FILENAME. 1591 "Find a buffer for file FILENAME.
diff --git a/lisp/simple.el b/lisp/simple.el
index f84ab2e8d69..5de3f1b0b56 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -65,7 +65,7 @@
65 (setq found buffer))) 65 (setq found buffer)))
66 (setq list (cdr list))) 66 (setq list (cdr list)))
67 (switch-to-buffer found))) 67 (switch-to-buffer found)))
68 68
69;;; next-error support framework 69;;; next-error support framework
70(defvar next-error-last-buffer nil 70(defvar next-error-last-buffer nil
71 "The most recent next-error buffer. 71 "The most recent next-error buffer.
@@ -91,51 +91,50 @@ to navigate in it.")
91 (or (and extra-test (funcall extra-test)) 91 (or (and extra-test (funcall extra-test))
92 next-error-function))) 92 next-error-function)))
93 93
94;; Return a next-error capable buffer according to the following rules:
95;; 1. If the current buffer is a next-error capable buffer, return it.
96;; 2. If one window on the selected frame displays such buffer, return it.
97;; 3. If next-error-last-buffer is set to a live buffer, use that.
98;; 4. Otherwise, look for a next-error capable buffer in a buffer list.
99;; 5. Signal an error if there are none.
100(defun next-error-find-buffer (&optional other-buffer extra-test) 94(defun next-error-find-buffer (&optional other-buffer extra-test)
101 (if (and (not other-buffer) 95 "Return a next-error capable buffer."
102 (next-error-buffer-p (current-buffer) extra-test)) 96 (or
103 ;; The current buffer is a next-error capable buffer. 97 ;; 1. If one window on the selected frame displays such buffer, return it.
104 (current-buffer) 98 (let ((window-buffers
105 (or 99 (delete-dups
106 (let ((window-buffers 100 (delq nil (mapcar (lambda (w)
107 (delete-dups 101 (if (next-error-buffer-p
108 (delq nil 102 (window-buffer w) extra-test)
109 (mapcar (lambda (w) 103 (window-buffer w)))
110 (and (next-error-buffer-p (window-buffer w) extra-test) 104 (window-list))))))
111 (window-buffer w))) 105 (if other-buffer
112 (window-list)))))) 106 (setq window-buffers (delq (current-buffer) window-buffers)))
113 (if other-buffer 107 (if (eq (length window-buffers) 1)
114 (setq window-buffers (delq (current-buffer) window-buffers))) 108 (car window-buffers)))
115 (if (eq (length window-buffers) 1) 109 ;; 2. If next-error-last-buffer is set to a live buffer, use that.
116 (car window-buffers))) 110 (if (and next-error-last-buffer
117 (if (and next-error-last-buffer (buffer-name next-error-last-buffer) 111 (buffer-name next-error-last-buffer)
118 (next-error-buffer-p next-error-last-buffer extra-test) 112 (next-error-buffer-p next-error-last-buffer extra-test)
119 (or (not other-buffer) (not (eq next-error-last-buffer 113 (or (not other-buffer)
120 (current-buffer))))) 114 (not (eq next-error-last-buffer (current-buffer)))))
121 next-error-last-buffer 115 next-error-last-buffer)
122 (let ((buffers (buffer-list))) 116 ;; 3. If the current buffer is a next-error capable buffer, return it.
123 (while (and buffers (or (not (next-error-buffer-p (car buffers) extra-test)) 117 (if (and (not other-buffer)
124 (and other-buffer 118 (next-error-buffer-p (current-buffer) extra-test))
125 (eq (car buffers) (current-buffer))))) 119 (current-buffer))
126 (setq buffers (cdr buffers))) 120 ;; 4. Look for a next-error capable buffer in a buffer list.
127 (if buffers 121 (let ((buffers (buffer-list)))
128 (car buffers) 122 (while (and buffers
129 (or (and other-buffer 123 (or (not (next-error-buffer-p (car buffers) extra-test))
130 (next-error-buffer-p (current-buffer) extra-test) 124 (and other-buffer (eq (car buffers) (current-buffer)))))
131 ;; The current buffer is a next-error capable buffer. 125 (setq buffers (cdr buffers)))
132 (progn 126 (if buffers
133 (if other-buffer 127 (car buffers)
134 (message "This is the only next-error capable buffer.")) 128 (or (and other-buffer
135 (current-buffer))) 129 (next-error-buffer-p (current-buffer) extra-test)
136 (error "No next-error capable buffer found")))))))) 130 ;; The current buffer is a next-error capable buffer.
137 131 (progn
138(defun next-error (arg &optional reset) 132 (if other-buffer
133 (message "This is the only next-error capable buffer"))
134 (current-buffer)))
135 (error "No next-error capable buffer found"))))))
136
137(defun next-error (&optional arg reset)
139 "Visit next next-error message and corresponding source code. 138 "Visit next next-error message and corresponding source code.
140 139
141If all the error messages parsed so far have been processed already, 140If all the error messages parsed so far have been processed already,
@@ -153,9 +152,10 @@ compilation, grep, or occur buffer. It can also operate on any
153buffer with output from the \\[compile], \\[grep] commands, or, 152buffer with output from the \\[compile], \\[grep] commands, or,
154more generally, on any buffer in Compilation mode or with 153more generally, on any buffer in Compilation mode or with
155Compilation Minor mode enabled, or any buffer in which 154Compilation Minor mode enabled, or any buffer in which
156`next-error-function' is bound to an appropriate 155`next-error-function' is bound to an appropriate function.
157function. To specify use of a particular buffer for error 156To specify use of a particular buffer for error messages, type
158messages, type \\[next-error] in that buffer. 157\\[next-error] in that buffer when it is the only one displayed
158in the current frame.
159 159
160Once \\[next-error] has chosen the buffer for error messages, 160Once \\[next-error] has chosen the buffer for error messages,
161it stays with that buffer until you use it in some other buffer which 161it stays with that buffer until you use it in some other buffer which
@@ -175,7 +175,7 @@ See variables `compilation-parse-errors-function' and
175 175
176(define-key ctl-x-map "`" 'next-error) 176(define-key ctl-x-map "`" 'next-error)
177 177
178(defun previous-error (n) 178(defun previous-error (&optional n)
179 "Visit previous next-error message and corresponding source code. 179 "Visit previous next-error message and corresponding source code.
180 180
181Prefix arg N says how many error messages to move backwards (or 181Prefix arg N says how many error messages to move backwards (or
@@ -183,9 +183,9 @@ forwards, if negative).
183 183
184This operates on the output from the \\[compile] and \\[grep] commands." 184This operates on the output from the \\[compile] and \\[grep] commands."
185 (interactive "p") 185 (interactive "p")
186 (next-error (- n))) 186 (next-error (- (or n 1))))
187 187
188(defun first-error (n) 188(defun first-error (&optional n)
189 "Restart at the first error. 189 "Restart at the first error.
190Visit corresponding source code. 190Visit corresponding source code.
191With prefix arg N, visit the source code of the Nth error. 191With prefix arg N, visit the source code of the Nth error.
@@ -193,25 +193,63 @@ This operates on the output from the \\[compile] command, for instance."
193 (interactive "p") 193 (interactive "p")
194 (next-error n t)) 194 (next-error n t))
195 195
196(defun next-error-no-select (n) 196(defun next-error-no-select (&optional n)
197 "Move point to the next error in the next-error buffer and highlight match. 197 "Move point to the next error in the next-error buffer and highlight match.
198Prefix arg N says how many error messages to move forwards (or 198Prefix arg N says how many error messages to move forwards (or
199backwards, if negative). 199backwards, if negative).
200Finds and highlights the source line like \\[next-error], but does not 200Finds and highlights the source line like \\[next-error], but does not
201select the source buffer." 201select the source buffer."
202 (interactive "p") 202 (interactive "p")
203 (next-error n) 203 (let ((next-error-highlight next-error-highlight-no-select))
204 (next-error n))
204 (pop-to-buffer next-error-last-buffer)) 205 (pop-to-buffer next-error-last-buffer))
205 206
206(defun previous-error-no-select (n) 207(defun previous-error-no-select (&optional n)
207 "Move point to the previous error in the next-error buffer and highlight match. 208 "Move point to the previous error in the next-error buffer and highlight match.
208Prefix arg N says how many error messages to move backwards (or 209Prefix arg N says how many error messages to move backwards (or
209forwards, if negative). 210forwards, if negative).
210Finds and highlights the source line like \\[previous-error], but does not 211Finds and highlights the source line like \\[previous-error], but does not
211select the source buffer." 212select the source buffer."
212 (interactive "p") 213 (interactive "p")
213 (next-error-no-select (- n))) 214 (next-error-no-select (- (or n 1))))
215
216(defgroup next-error nil
217 "next-error support framework."
218 :group 'compilation
219 :version "21.4")
220
221(defface next-error
222 '((t (:inherit region)))
223 "Face used to highlight next error locus."
224 :group 'next-error
225 :version "21.4")
226
227(defcustom next-error-highlight 0.1
228 "*Highlighting of locations in selected source buffers.
229If number, highlight the locus in next-error face for given time in seconds.
230If t, use persistent overlays fontified in next-error face.
231If nil, don't highlight the locus in the source buffer.
232If `fringe-arrow', indicate the locus by the fringe arrow."
233 :type '(choice (number :tag "Delay")
234 (const :tag "Persistent overlay" t)
235 (const :tag "No highlighting" nil)
236 (const :tag "Fringe arrow" 'fringe-arrow))
237 :group 'next-error
238 :version "21.4")
214 239
240(defcustom next-error-highlight-no-select 0.1
241 "*Highlighting of locations in non-selected source buffers.
242If number, highlight the locus in next-error face for given time in seconds.
243If t, use persistent overlays fontified in next-error face.
244If nil, don't highlight the locus in the source buffer.
245If `fringe-arrow', indicate the locus by the fringe arrow."
246 :type '(choice (number :tag "Delay")
247 (const :tag "Persistent overlay" t)
248 (const :tag "No highlighting" nil)
249 (const :tag "Fringe arrow" 'fringe-arrow))
250 :group 'next-error
251 :version "21.4")
252
215;;; 253;;;
216 254
217(defun fundamental-mode () 255(defun fundamental-mode ()
diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el
index 2ed5d807c36..df902e78c9f 100644
--- a/lisp/x-dnd.el
+++ b/lisp/x-dnd.el
@@ -58,8 +58,8 @@ The default value for this variable is `x-dnd-default-test-function'."
58 ) 58 )
59 59
60 "The functions to call for different protocols when a drop is made. 60 "The functions to call for different protocols when a drop is made.
61This variable is used by `x-dnd-handle-uri-list' and `x-dnd-handle-moz-url'. 61This variable is used by `x-dnd-handle-uri-list', `x-dnd-handle-file-name'
62The list contains of (REGEXP . FUNCTION) pairs. 62and `x-dnd-handle-moz-url'. The list contains of (REGEXP . FUNCTION) pairs.
63The functions shall take two arguments, URL, which is the URL dropped and 63The functions shall take two arguments, URL, which is the URL dropped and
64ACTION which is the action to be performed for the drop (move, copy, link, 64ACTION which is the action to be performed for the drop (move, copy, link,
65private or ask). 65private or ask).
@@ -104,9 +104,7 @@ is successful, nil if not."
104 :type 'boolean 104 :type 'boolean
105 :group 'x) 105 :group 'x)
106 106
107;; Internal variables 107(defcustom x-dnd-known-types
108
109(defvar x-dnd-known-types
110 '("text/uri-list" 108 '("text/uri-list"
111 "text/x-moz-url" 109 "text/x-moz-url"
112 "_NETSCAPE_URL" 110 "_NETSCAPE_URL"
@@ -121,7 +119,12 @@ is successful, nil if not."
121 "TEXT" 119 "TEXT"
122 ) 120 )
123 "The types accepted by default for dropped data. 121 "The types accepted by default for dropped data.
124The types are chosen in the order they appear in the list.") 122The types are chosen in the order they appear in the list."
123 :type '(repeat string)
124 :group 'x
125)
126
127;; Internal variables
125 128
126(defvar x-dnd-current-state nil 129(defvar x-dnd-current-state nil
127 "The current state for a drop. 130 "The current state for a drop.
@@ -866,7 +869,7 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent."
866 timestamp) 869 timestamp)
867 (x-dnd-forget-drop frame))) 870 (x-dnd-forget-drop frame)))
868 871
869 (t (error "Unknown Motif DND message %s %s" message data))))) 872 (t (error "Unknown Motif DND message %s %s" message-atom data)))))
870 873
871 874
872;;; 875;;;
diff --git a/man/ChangeLog b/man/ChangeLog
index 8af5062c7e7..cc859cffb05 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,14 @@
12004-08-31 Luc Teirlinck <teirllm@auburn.edu>
2
3 * kmacro.texi (Basic Keyboard Macro):
4 `apply-macro-to-region-lines' now operates on all lines that begin
5 in the region, rather than on all complete lines in the region.
6
72004-08-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
8
9 * frames.texi (Drag and drop): Add documentation about
10 x-dnd-test-function and x-dnd-known-types.
11
12004-08-30 Luc Teirlinck <teirllm@auburn.edu> 122004-08-30 Luc Teirlinck <teirllm@auburn.edu>
2 13
3 * indent.texi: Various minor changes in addition to: 14 * indent.texi: Various minor changes in addition to:
diff --git a/man/frames.texi b/man/frames.texi
index 50b6a4ed398..dee050922e6 100644
--- a/man/frames.texi
+++ b/man/frames.texi
@@ -809,6 +809,17 @@ As a special case, if a file is dropped on a dired buffer the file is
809copied or moved (depends on exactly how it is dragged and the application 809copied or moved (depends on exactly how it is dragged and the application
810it was dragged from) to the directory the dired buffer is displaying. 810it was dragged from) to the directory the dired buffer is displaying.
811 811
812@vindex x-dnd-test-function
813@vindex x-dnd-known-types
814 When a user drags something from another application over Emacs, that other
815application expects Emacs to tell it if Emacs can handle the data that is
816dragged. The variable @code{x-dnd-test-function} is used by Emacs to determine
817what to reply. The default value is @code{x-dnd-default-test-function}
818which accepts drops if the type of the data to be dropped is present in
819@code{x-dnd-known-types}. You can customize @code{x-dnd-test-function} and/or
820@code{x-dnd-known-types} if you want Emacs to accept or reject drops based
821on some other criteria.
822
812@vindex x-dnd-open-file-other-window 823@vindex x-dnd-open-file-other-window
813 A file is normally opened in the window it is dropped on, but if you 824 A file is normally opened in the window it is dropped on, but if you
814prefer the file to be opened in a new window you can customize the variable 825prefer the file to be opened in a new window you can customize the variable
diff --git a/man/kmacro.texi b/man/kmacro.texi
index d3c24873cd0..bad186f88b2 100644
--- a/man/kmacro.texi
+++ b/man/kmacro.texi
@@ -71,7 +71,7 @@ Insert in the buffer a keyboard macro's definition, as Lisp code.
71@item C-x C-k e 71@item C-x C-k e
72Edit a previously defined keyboard macro (@code{edit-kbd-macro}). 72Edit a previously defined keyboard macro (@code{edit-kbd-macro}).
73@item C-x C-k r 73@item C-x C-k r
74Run the last keyboard macro on each complete line in the region 74Run the last keyboard macro on each line that begins in the region
75(@code{apply-macro-to-region-lines}). 75(@code{apply-macro-to-region-lines}).
76@end table 76@end table
77 77
@@ -174,8 +174,8 @@ before appending to it.
174@findex apply-macro-to-region-lines 174@findex apply-macro-to-region-lines
175@kindex C-x C-k r 175@kindex C-x C-k r
176 The command @kbd{C-x C-k r} (@code{apply-macro-to-region-lines}) 176 The command @kbd{C-x C-k r} (@code{apply-macro-to-region-lines})
177repeats the last defined keyboard macro on each complete line within 177repeats the last defined keyboard macro on each line that begins in
178the current region. It does this line by line, by moving point to the 178the region. It does this line by line, by moving point to the
179beginning of the line and then executing the macro. 179beginning of the line and then executing the macro.
180 180
181@node Keyboard Macro Ring 181@node Keyboard Macro Ring
diff --git a/src/ChangeLog b/src/ChangeLog
index 14eece1b04e..77a331a7802 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12004-08-31 NAKAMURA Toshikazu <nr-tkz@nifty.com> (tiny change)
2
3 * w32fns.c (w32_load_font): If a BDF font is already loaded, do not
4 reload it.
5
12004-08-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 62004-08-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 7
3 * macmenu.c (_widget_value): Added lname and lkey. 8 * macmenu.c (_widget_value): Added lname and lkey.
diff --git a/src/w32fns.c b/src/w32fns.c
index 0cb3abe91cd..e60385c8129 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -4642,6 +4642,7 @@ int size;
4642{ 4642{
4643 Lisp_Object bdf_fonts; 4643 Lisp_Object bdf_fonts;
4644 struct font_info *retval = NULL; 4644 struct font_info *retval = NULL;
4645 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
4645 4646
4646 bdf_fonts = w32_list_bdf_fonts (build_string (fontname), 1); 4647 bdf_fonts = w32_list_bdf_fonts (build_string (fontname), 1);
4647 4648
@@ -4649,11 +4650,22 @@ int size;
4649 { 4650 {
4650 char *bdf_name, *bdf_file; 4651 char *bdf_name, *bdf_file;
4651 Lisp_Object bdf_pair; 4652 Lisp_Object bdf_pair;
4653 int i;
4652 4654
4653 bdf_name = SDATA (XCAR (bdf_fonts)); 4655 bdf_name = SDATA (XCAR (bdf_fonts));
4654 bdf_pair = Fassoc (XCAR (bdf_fonts), Vw32_bdf_filename_alist); 4656 bdf_pair = Fassoc (XCAR (bdf_fonts), Vw32_bdf_filename_alist);
4655 bdf_file = SDATA (XCDR (bdf_pair)); 4657 bdf_file = SDATA (XCDR (bdf_pair));
4656 4658
4659 // If the font is already loaded, do not load it again.
4660 for (i = 0; i < dpyinfo->n_fonts; i++)
4661 {
4662 if ((dpyinfo->font_table[i].name
4663 && !strcmp (dpyinfo->font_table[i].name, bdf_name))
4664 || (dpyinfo->font_table[i].full_name
4665 && !strcmp (dpyinfo->font_table[i].full_name, bdf_name)))
4666 return dpyinfo->font_table + i;
4667 }
4668
4657 retval = w32_load_bdf_font (f, bdf_name, size, bdf_file); 4669 retval = w32_load_bdf_font (f, bdf_name, size, bdf_file);
4658 4670
4659 bdf_fonts = XCDR (bdf_fonts); 4671 bdf_fonts = XCDR (bdf_fonts);