diff options
| author | Juri Linkov | 2004-05-23 21:05:08 +0000 |
|---|---|---|
| committer | Juri Linkov | 2004-05-23 21:05:08 +0000 |
| commit | 675254bc4b3ccb7931dda00969a08277d3967e3d (patch) | |
| tree | 3d17d5eeddfb2f373173a8821e87d2a33367f817 | |
| parent | f13cc97d68d3cf3d3fe893e484c74e7602f5944d (diff) | |
| download | emacs-675254bc4b3ccb7931dda00969a08277d3967e3d.tar.gz emacs-675254bc4b3ccb7931dda00969a08277d3967e3d.zip | |
(next-error-find-buffer): Add a rule to return next-error capable buffer
if one window on the selected frame displays such buffer.
| -rw-r--r-- | lisp/ChangeLog | 49 | ||||
| -rw-r--r-- | lisp/simple.el | 63 |
2 files changed, 84 insertions, 28 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 957e52e2b24..1533d3aae18 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,46 @@ | |||
| 1 | 2004-05-23 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * info.el (Info-index-nodes): New var and fun. | ||
| 4 | (Info-goto-index, Info-index, info-apropos) | ||
| 5 | (Info-find-emacs-command-nodes): Rewrite to use Info-index-nodes. | ||
| 6 | (Info-index): Fix docstring. Store and restore Info-history-list. | ||
| 7 | (Info-complete-nodes): New var. | ||
| 8 | (Info-complete-menu-item): Use it. | ||
| 9 | (Info-index-node): New fun. | ||
| 10 | (Info-final-node, Info-forward-node, Info-backward-node) | ||
| 11 | (Info-build-toc, Info-try-follow-nearest-node, Info-fontify-node): | ||
| 12 | Use Info-index-node. | ||
| 13 | (Info-extract-menu-item, Info-extract-menu-counting): Set second | ||
| 14 | arg of `Info-extract-menu-node-name' to non-nil for index nodes. | ||
| 15 | (Info-find-node-2): If a node with period in its name not found, | ||
| 16 | try to find a node without the name part after period. | ||
| 17 | (Info-select-node): Call Info-fontify-node only if | ||
| 18 | Info-fontify-maximum-menu-size is not nil. | ||
| 19 | (info-apropos): Set Info-fontify-maximum-menu-size to nil. | ||
| 20 | (Info-find-emacs-command-nodes, Info-goto-emacs-command-node): | ||
| 21 | Preserve Info-history-list. | ||
| 22 | (Info-toc): Set Info-current-file. | ||
| 23 | (Info-build-toc): Move point to the beginning of the buffer. | ||
| 24 | Add main-file variable. | ||
| 25 | (Info-dir-remove-duplicates, Info-history, Info-toc, info-apropos): | ||
| 26 | Use backslashed representation of the control character ^_. | ||
| 27 | |||
| 28 | * textmodes/texinfmt.el (texinfo-print-index): Print index line | ||
| 29 | numbers in the new Texinfo 4.7 format. | ||
| 30 | |||
| 31 | * add-log.el (change-log-font-lock-keywords): Remove `:' from | ||
| 32 | regexps for function and variable names. | ||
| 33 | |||
| 34 | * descr-text.el (describe-property-list): Add [show] button for | ||
| 35 | `syntax-table' property with action to pp to a separate buffer. | ||
| 36 | (describe-char): Replace search-forward by re-search-forward with | ||
| 37 | whitespace regexp after "character:" to not fail in too narrow | ||
| 38 | windows. | ||
| 39 | |||
| 40 | * simple.el (next-error-find-buffer): Add a rule to return | ||
| 41 | next-error capable buffer if one window on the selected frame | ||
| 42 | displays such buffer. | ||
| 43 | |||
| 1 | 2004-05-23 Nick Roberts <nickrob@gnu.org> | 44 | 2004-05-23 Nick Roberts <nickrob@gnu.org> |
| 2 | 45 | ||
| 3 | * progmodes/gdb-ui.el (gdb-server-prefix): New variable. | 46 | * progmodes/gdb-ui.el (gdb-server-prefix): New variable. |
| @@ -42,9 +85,9 @@ | |||
| 42 | 85 | ||
| 43 | * textmodes/bibtex.el: Use assoc-string, not assoc-ignore-case. | 86 | * textmodes/bibtex.el: Use assoc-string, not assoc-ignore-case. |
| 44 | 87 | ||
| 45 | * progmodes/idlw-shell.el (idlwave-shell-get-object-class): | 88 | * progmodes/idlw-shell.el (idlwave-shell-get-object-class): |
| 46 | Use assoc-string, not assoc-ignore-case. | 89 | Use assoc-string, not assoc-ignore-case. |
| 47 | 90 | ||
| 48 | * progmodes/ada-mode.el: Use assoc-string, not assoc-ignore-case. | 91 | * progmodes/ada-mode.el: Use assoc-string, not assoc-ignore-case. |
| 49 | 92 | ||
| 50 | * emacs-lisp/lisp.el (mark-defun, narrow-to-defun): | 93 | * emacs-lisp/lisp.el (mark-defun, narrow-to-defun): |
| @@ -2794,7 +2837,7 @@ | |||
| 2794 | 2837 | ||
| 2795 | 2004-03-21 Andre Spiegel <spiegel@gnu.org> | 2838 | 2004-03-21 Andre Spiegel <spiegel@gnu.org> |
| 2796 | 2839 | ||
| 2797 | * vc.el Add new optional BUFFER argument to vc-BACKEND-print-log | 2840 | * vc.el: Add new optional BUFFER argument to vc-BACKEND-print-log |
| 2798 | and vc-BACKEND-diff. | 2841 | and vc-BACKEND-diff. |
| 2799 | (vc-print-log): If the print-log implementation supports it, use | 2842 | (vc-print-log): If the print-log implementation supports it, use |
| 2800 | the new BUFFER argument to direct output to *vc-change-log*, not *vc*. | 2843 | the new BUFFER argument to direct output to *vc-change-log*, not *vc*. |
diff --git a/lisp/simple.el b/lisp/simple.el index f76c6662725..1cf3601b5b1 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -91,36 +91,49 @@ 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. | 94 | ;; Return a next-error capable buffer according to the following rules: |
| 95 | ;; If the current buffer is such, return it. | 95 | ;; 1. If the current buffer is a next-error capable buffer, return it. |
| 96 | ;; If next-error-last-buffer is set to a live buffer, use that. | 96 | ;; 2. If one window on the selected frame displays such buffer, return it. |
| 97 | ;; Otherwise, look for a next-error capable buffer and signal an error | 97 | ;; 3. If next-error-last-buffer is set to a live buffer, use that. |
| 98 | ;; if there are none. | 98 | ;; 4. Otherwise, look for a next-error capable buffer in a buffer list. |
| 99 | ;; 5. Signal an error if there are none. | ||
| 99 | (defun next-error-find-buffer (&optional other-buffer extra-test) | 100 | (defun next-error-find-buffer (&optional other-buffer extra-test) |
| 100 | (if (and (not other-buffer) | 101 | (if (and (not other-buffer) |
| 101 | (next-error-buffer-p (current-buffer) extra-test)) | 102 | (next-error-buffer-p (current-buffer) extra-test)) |
| 102 | ;; The current buffer is a next-error capable buffer. | 103 | ;; The current buffer is a next-error capable buffer. |
| 103 | (current-buffer) | 104 | (current-buffer) |
| 104 | (if (and next-error-last-buffer (buffer-name next-error-last-buffer) | 105 | (or |
| 105 | (next-error-buffer-p next-error-last-buffer extra-test) | 106 | (let ((window-buffers |
| 106 | (or (not other-buffer) (not (eq next-error-last-buffer | 107 | (delete-dups |
| 107 | (current-buffer))))) | 108 | (delq nil |
| 108 | next-error-last-buffer | 109 | (mapcar (lambda (w) |
| 109 | (let ((buffers (buffer-list))) | 110 | (and (next-error-buffer-p (window-buffer w) extra-test) |
| 110 | (while (and buffers (or (not (next-error-buffer-p (car buffers) extra-test)) | 111 | (window-buffer w))) |
| 111 | (and other-buffer | 112 | (window-list)))))) |
| 112 | (eq (car buffers) (current-buffer))))) | 113 | (if other-buffer |
| 113 | (setq buffers (cdr buffers))) | 114 | (setq window-buffers (delq (current-buffer) window-buffers))) |
| 114 | (if buffers | 115 | (if (eq (length window-buffers) 1) |
| 115 | (car buffers) | 116 | (car window-buffers))) |
| 116 | (or (and other-buffer | 117 | (if (and next-error-last-buffer (buffer-name next-error-last-buffer) |
| 117 | (next-error-buffer-p (current-buffer) extra-test) | 118 | (next-error-buffer-p next-error-last-buffer extra-test) |
| 118 | ;; The current buffer is a next-error capable buffer. | 119 | (or (not other-buffer) (not (eq next-error-last-buffer |
| 119 | (progn | 120 | (current-buffer))))) |
| 120 | (if other-buffer | 121 | next-error-last-buffer |
| 121 | (message "This is the only next-error capable buffer.")) | 122 | (let ((buffers (buffer-list))) |
| 122 | (current-buffer))) | 123 | (while (and buffers (or (not (next-error-buffer-p (car buffers) extra-test)) |
| 123 | (error "No next-error capable buffer found!"))))))) | 124 | (and other-buffer |
| 125 | (eq (car buffers) (current-buffer))))) | ||
| 126 | (setq buffers (cdr buffers))) | ||
| 127 | (if buffers | ||
| 128 | (car buffers) | ||
| 129 | (or (and other-buffer | ||
| 130 | (next-error-buffer-p (current-buffer) extra-test) | ||
| 131 | ;; The current buffer is a next-error capable buffer. | ||
| 132 | (progn | ||
| 133 | (if other-buffer | ||
| 134 | (message "This is the only next-error capable buffer.")) | ||
| 135 | (current-buffer))) | ||
| 136 | (error "No next-error capable buffer found!")))))))) | ||
| 124 | 137 | ||
| 125 | (defun next-error (arg &optional reset) | 138 | (defun next-error (arg &optional reset) |
| 126 | "Visit next next-error message and corresponding source code. | 139 | "Visit next next-error message and corresponding source code. |