aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2000-08-16 20:20:43 +0000
committerStefan Monnier2000-08-16 20:20:43 +0000
commitffb4b7a11d543b4d05eb998818e9d4fe06ae4fad (patch)
treeb670f3c86d9244cfb291af5a67963456ca75bf38
parent4d3a92281f7ae884a7b47900c4e899d6d7435f80 (diff)
downloademacs-ffb4b7a11d543b4d05eb998818e9d4fe06ae4fad.tar.gz
emacs-ffb4b7a11d543b4d05eb998818e9d4fe06ae4fad.zip
(grep): Provide a default set of files.
(next-error): Docstring fix. (compilation-find-file): Avoid find-file (fails in a dedicated window).
-rw-r--r--lisp/progmodes/compile.el19
1 files changed, 11 insertions, 8 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 0f192ee84e5..44556d8185f 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -597,7 +597,7 @@ or \\<compilation-minor-mode-map>\\[compile-goto-error] in the grep \
597output buffer, to go to the lines 597output buffer, to go to the lines
598where grep found matches. 598where grep found matches.
599 599
600This command uses a special history list for its arguments, so you can 600This command uses a special history list for its COMMAND-ARGS, so you can
601easily repeat a grep command. 601easily repeat a grep command.
602 602
603A prefix argument says to default the argument based upon the current 603A prefix argument says to default the argument based upon the current
@@ -617,8 +617,11 @@ if that history list is empty)."
617 'grep-tag-default)))) 617 'grep-tag-default))))
618 (setq grep-default (or (car grep-history) grep-command)) 618 (setq grep-default (or (car grep-history) grep-command))
619 ;; Replace the thing matching for with that around cursor 619 ;; Replace the thing matching for with that around cursor
620 (if (string-match "[^ ]+\\s +\\(-[^ ]+\\s +\\)*\\(\"[^\"]+\"\\|[^ ]+\\)" grep-default) 620 (when (string-match "[^ ]+\\s +\\(-[^ ]+\\s +\\)*\\(\"[^\"]+\"\\|[^ ]+\\)\\(\\s-+\\S-+\\)?" grep-default)
621 (setq grep-default (replace-match tag-default t t 621 (unless (or (match-beginning 3) (not (stringp buffer-file-name)))
622 (setq grep-default (concat grep-default "*."
623 (file-name-extension buffer-file-name))))
624 (setq grep-default (replace-match tag-default t t
622 grep-default 2))))) 625 grep-default 2)))))
623 (list (read-from-minibuffer "Run grep (like this): " 626 (list (read-from-minibuffer "Run grep (like this): "
624 (or grep-default grep-command) 627 (or grep-default grep-command)
@@ -1405,9 +1408,9 @@ other kinds of prefix arguments are ignored."
1405If all the error messages parsed so far have been processed already, 1408If all the error messages parsed so far have been processed already,
1406the message buffer is checked for new ones. 1409the message buffer is checked for new ones.
1407 1410
1408A prefix arg specifies how many error messages to move; 1411A prefix ARGP specifies how many error messages to move;
1409negative means move back to previous error messages. 1412negative means move back to previous error messages.
1410Just C-u as a prefix means reparse the error message buffer 1413Just \\[universal-argument] as a prefix means reparse the error message buffer
1411and start at the first error. 1414and start at the first error.
1412 1415
1413\\[next-error] normally uses the most recently started compilation or 1416\\[next-error] normally uses the most recently started compilation or
@@ -1647,8 +1650,8 @@ Selects a window with point at SOURCE, with another window displaying ERROR."
1647 1650
1648(defun compilation-find-file (marker filename dir &rest formats) 1651(defun compilation-find-file (marker filename dir &rest formats)
1649 "Find a buffer for file FILENAME. 1652 "Find a buffer for file FILENAME.
1650Search the directories in compilation-search-path. 1653Search the directories in `compilation-search-path'.
1651A nil in compilation-search-path means to try the 1654A nil in `compilation-search-path' means to try the
1652current directory, which is passed in DIR. 1655current directory, which is passed in DIR.
1653If FILENAME is not found at all, ask the user where to find it. 1656If FILENAME is not found at all, ask the user where to find it.
1654Pop up the buffer containing MARKER and scroll to MARKER if we ask the user." 1657Pop up the buffer containing MARKER and scroll to MARKER if we ask the user."
@@ -1670,7 +1673,7 @@ Pop up the buffer containing MARKER and scroll to MARKER if we ask the user."
1670 (while (and fmts (null buffer)) 1673 (while (and fmts (null buffer))
1671 (setq name (expand-file-name (format (car fmts) filename) thisdir) 1674 (setq name (expand-file-name (format (car fmts) filename) thisdir)
1672 buffer (and (file-exists-p name) 1675 buffer (and (file-exists-p name)
1673 (find-file name)) 1676 (find-file-noselect name))
1674 fmts (cdr fmts))) 1677 fmts (cdr fmts)))
1675 (setq dirs (cdr dirs))) 1678 (setq dirs (cdr dirs)))
1676 (or buffer 1679 (or buffer