comparison lisp/emacs-lisp/shadow.el @ 110807:3c97e9b7b34f

Rename some more shadow.el stuff. * lisp/emacs-lisp/shadow.el (load-path-shadows-font-lock-keywords) (load-path-shadows-find-file): Rename variable and button. (list-load-path-shadows): Update button caller.
author Glenn Morris <rgm@gnu.org>
date Thu, 07 Oct 2010 10:22:51 -0700
parents 62865a8e7f58
children bec49af30c2f
comparison
equal deleted inserted replaced
110806:62865a8e7f58 110807:3c97e9b7b34f
150 ;; sizes. 150 ;; sizes.
151 (and (= (nth 7 (file-attributes f1)) 151 (and (= (nth 7 (file-attributes f1))
152 (nth 7 (file-attributes f2))) 152 (nth 7 (file-attributes f2)))
153 (eq 0 (call-process "cmp" nil nil nil "-s" f1 f2)))))))) 153 (eq 0 (call-process "cmp" nil nil nil "-s" f1 f2))))))))
154 154
155 (defvar shadow-font-lock-keywords 155 (defvar load-path-shadows-font-lock-keywords
156 `((,(format "hides \\(%s.*\\)" 156 `((,(format "hides \\(%s.*\\)"
157 (file-name-directory (locate-library "simple.el"))) 157 (file-name-directory (locate-library "simple.el")))
158 . (1 font-lock-warning-face))) 158 . (1 font-lock-warning-face)))
159 "Keywords to highlight in `load-path-shadows-mode'.") 159 "Keywords to highlight in `load-path-shadows-mode'.")
160 160
161 (define-derived-mode load-path-shadows-mode fundamental-mode "LP-Shadows" 161 (define-derived-mode load-path-shadows-mode fundamental-mode "LP-Shadows"
162 "Major mode for load-path shadows buffer." 162 "Major mode for load-path shadows buffer."
163 (set (make-local-variable 'font-lock-defaults) 163 (set (make-local-variable 'font-lock-defaults)
164 '((shadow-font-lock-keywords))) 164 '((load-path-shadows-font-lock-keywords)))
165 (setq buffer-undo-list t 165 (setq buffer-undo-list t
166 buffer-read-only t)) 166 buffer-read-only t))
167 167
168 ;; TODO use text-properties instead, a la dired. 168 ;; TODO use text-properties instead, a la dired.
169 (require 'button) 169 (require 'button)
170 (define-button-type 'shadow-find-file 170 (define-button-type 'load-path-shadows-find-file
171 'follow-link t 171 'follow-link t
172 ;; 'face 'default 172 ;; 'face 'default
173 'action (lambda (button) 173 'action (lambda (button)
174 (let ((file (concat (button-get button 'shadow-file) ".el"))) 174 (let ((file (concat (button-get button 'shadow-file) ".el")))
175 (or (file-exists-p file) 175 (or (file-exists-p file)
271 (while (re-search-backward "\\(^.*\\) hides \\(.*$\\)" 271 (while (re-search-backward "\\(^.*\\) hides \\(.*$\\)"
272 nil t) 272 nil t)
273 (dotimes (i 2) 273 (dotimes (i 2)
274 (make-button (match-beginning (1+ i)) 274 (make-button (match-beginning (1+ i))
275 (match-end (1+ i)) 275 (match-end (1+ i))
276 'type 'shadow-find-file 'shadow-file 276 'type 'load-path-shadows-find-file
277 'shadow-file
277 (match-string (1+ i))))) 278 (match-string (1+ i)))))
278 (goto-char (point-max))))) 279 (goto-char (point-max)))))
279 ;; We are non-interactive, print shadows via message. 280 ;; We are non-interactive, print shadows via message.
280 (unless (zerop n) 281 (unless (zerop n)
281 (message "This site has duplicate Lisp libraries with the same name. 282 (message "This site has duplicate Lisp libraries with the same name.