> emacs -q > C-x C-f $YOUR_EMACE_SOURCE_TREE/lisp/ChangeLog RET > M-x grep RET defface */*.el RET > C-x C-w /tmp/TEST RET > C-x k TEST RET > > now open /tmp/TEST > > C-x C-f /tmp/TEST RET > now move the cursor to one of the "calendar/calendar.el" lines and > press RET > > at that point you are prompted to enter the file name where the file > "calendar.el" is found.
The first line of the grep buffer (as well as the saved grep output) contains the variable `default-directory', e.g.: -*- mode: grep; default-directory: "/usr/share/emacs/lisp/" -*- `grep-mode' uses the value of this variable to get the right absolute file name from the relative name on compilation or grep messages, and to store the absolute file name to the `message' text property. However, at the moment when it parses the grep output, the variable `default-directory' from the first line has no effect yet, because `grep-mode' from the first line is called before setting the value of `default-directory'. I see three solutions: 1. Set local variables specified in the -*- line before setting the mode from -*- mode tag. This might have an undesirable effect on existing files where reversing the order of processing -*- line will lead to unpredictable consequences. 2. Set only `default-directory' specified in the -*- line before setting the mode, and to set the remaining variables later. 3. Change only compile.el to search for `default-directory' in the first line and to set its value exlicitly before staring to parse the compilation/grep output. -- Juri Linkov http://www.jurta.org/emacs/ _______________________________________________ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug