[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using "Emacs Configure" **and** modifying .emacs

From: Emanuel Berg
Subject: Re: Using "Emacs Configure" **and** modifying .emacs
Date: Tue, 15 Aug 2017 04:20:26 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

> Perhaps I should add that (`custom-set') to
> mine as well...

;; The result:

;; erc-my.el, line 9: erc-user-full-name
;; erc-my.el, line 55: erc-header-line-format
;; mode-line.el, line 6: column-number-mode
;; mode-line.el, line 7: line-number-mode
;; spell-new.el, line 5: ispell-program-name
;; w3m-tabs.el, line 5: w3m-tab-width

;; 6 hits! :)

(require 'search-regexp-in-files) ;

(defun find-custom-set-vars (&optional buffer)
  (let ((bfr (or buffer (current-buffer)))
        (out-bfr (get-buffer-create "*CustomSetVariables*")) )
    (with-current-buffer bfr
        (goto-char (point-min))
        (while (re-search-forward "([[:space:]]*set[fq][[:space:]]*" nil t)
          (let ((var (variable-at-point t)) ; ANY-SYMBOL
                (line (line-number-at-pos)) )
            (when (and (custom-variable-p var)
                       (get var 'custom-set) )
              (with-current-buffer out-bfr
                 (format "%s, line %s: %s\n" bfr line var))) )))))
    (pop-to-buffer out-bfr) ))

(defun fcsv-check-all-elisp ()
  (let ((fs (files-as-list (format "%s%s" "~/.emacs.d/emacs-init/" "**/*.el"))))
    (dolist (f fs)
      (find-custom-set-vars (find-file-noselect f)))))

;; (fcsv-check-all-elisp)

underground experts united

reply via email to

[Prev in Thread] Current Thread [Next in Thread]