Function: grep-apply-setting

grep-apply-setting is a byte-compiled function defined in grep.el.gz.

Signature

(grep-apply-setting SYMBOL VALUE)

Documentation

Set SYMBOL to VALUE, and update grep-host-defaults-alist.

SYMBOL should be one of grep-command, grep-template, grep-use-null-device, grep-find-command grep-find-template, grep-find-use-xargs, grep-use-null-filename-separator, grep-highlight-matches, or grep-quoting-style.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/grep.el.gz
(defun grep-apply-setting (symbol value)
  "Set SYMBOL to VALUE, and update `grep-host-defaults-alist'.
SYMBOL should be one of `grep-command', `grep-template',
`grep-use-null-device', `grep-find-command' `grep-find-template',
`grep-find-use-xargs', `grep-use-null-filename-separator',
`grep-highlight-matches', or `grep-quoting-style'."
  (when grep-host-defaults-alist
    (let* ((host-id
	    (intern (or (file-remote-p default-directory) "localhost")))
	   (host-defaults (assq host-id grep-host-defaults-alist))
	   (defaults (assq nil grep-host-defaults-alist)))
      (setcar (cdr (assq symbol host-defaults)) value)
      (setcar (cdr (assq symbol defaults)) value)))
  (set-default symbol value))