From 1486eadf7c9469f873fcd04beafd03f21564d580 Mon Sep 17 00:00:00 2001 From: Stephen Leake Date: Thu, 25 Apr 2019 15:49:38 -0700 Subject: [PATCH] Fix Bug#33618; define search path variables for grep, byte-compile * etc/NEWS: Mention new variables. * lisp/emacs-lisp/bytecomp.el (emacs-lisp-compilation-search-path): New. * lisp/progmodes/grep.el (grep-search-path): New. --- etc/NEWS | 13 +++++++++++-- lisp/emacs-lisp/bytecomp.el | 9 +++++++++ lisp/progmodes/grep.el | 9 +++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 788be7060af..721ebb2dedd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -325,8 +325,17 @@ and directory-local variables. longer. --- -** next-error-verbose controls when `next-error' outputs a message - about the error locus. +** New variable next-error-verbose controls when `next-error' outputs + a message about the error locus. + +--- +** New variable grep-search-path defines the directories searched for + grep hits (this used to be controlled by compilation-search-path). + +--- +** New variable emacs-lisp-compilation-search-path defines the + directories searched for byte-compiler error messages (this used to + be controlled by compilation-search-path). * Editing Changes in Emacs 27.1 diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 4c61e1a4471..e76baf5ed0d 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1022,6 +1022,15 @@ If STR is something like \"Buffer foo.el\", return # "The value for `compilation-parse-errors-filename-function' for when we go into emacs-lisp-compilation-mode.") +(defcustom emacs-lisp-compilation-search-path '(nil) + "Search path for byte-compile error messages. +Elements should be directory names, not file names of directories. +The value nil as an element means to try the default directory." + :group 'bytecomp + :version "27.1" + :type '(repeat (choice (const :tag "Default" nil) + (string :tag "Directory")))) + (define-compilation-mode emacs-lisp-compilation-mode "elisp-compile" "The variant of `compilation-mode' used for emacs-lisp error buffers") diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 8c7a58fd8bd..85f9078d46d 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -441,6 +441,15 @@ abbreviated part can also be toggled with :version "27.1" :group 'grep) +(defcustom grep-search-path '(nil) + "Search path for grep results. +Elements should be directory names, not file names of directories. +The value nil as an element means to try the default directory." + :group 'grep + :version "27.1" + :type '(repeat (choice (const :tag "Default" nil) + (string :tag "Directory")))) + (defvar grep-find-abbreviate-properties (let ((ellipsis (if (char-displayable-p ?…) "[…]" "[...]")) (map (make-sparse-keymap))) -- 2.39.2