aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2009-01-11 17:27:37 +0000
committerChong Yidong2009-01-11 17:27:37 +0000
commit0d3b1f4e84c70c73e7af29db128039948ab46cf3 (patch)
treea50624625aa0fe1cadd5b60b72a31779c849a5ba
parent4a6f62a1b525943b802730acc45f3ca6be037019 (diff)
downloademacs-0d3b1f4e84c70c73e7af29db128039948ab46cf3.tar.gz
emacs-0d3b1f4e84c70c73e7af29db128039948ab46cf3.zip
(describe-face): Ignore anonymous faces.
-rw-r--r--lisp/faces.el84
1 files changed, 44 insertions, 40 deletions
diff --git a/lisp/faces.el b/lisp/faces.el
index bbc7d32e3ac..d1a716994eb 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1357,46 +1357,50 @@ If FRAME is omitted or nil, use the selected frame."
1357 (set-buffer standard-output) 1357 (set-buffer standard-output)
1358 (dolist (f face) 1358 (dolist (f face)
1359 (if (stringp f) (setq f (intern f))) 1359 (if (stringp f) (setq f (intern f)))
1360 (insert "Face: " (symbol-name f)) 1360 ;; We may get called for anonymous faces (i.e., faces
1361 (if (not (facep f)) 1361 ;; expressed using prop-value plists). Those can't be
1362 (insert " undefined face.\n") 1362 ;; usefully customized, so ignore them.
1363 (let ((customize-label "customize this face") 1363 (when (symbolp f)
1364 file-name) 1364 (insert "Face: " (symbol-name f))
1365 (insert (concat " (" (propertize "sample" 'font-lock-face f) ")")) 1365 (if (not (facep f))
1366 (princ (concat " (" customize-label ")\n")) 1366 (insert " undefined face.\n")
1367 (insert "Documentation: " 1367 (let ((customize-label "customize this face")
1368 (or (face-documentation f) 1368 file-name)
1369 "Not documented as a face.") 1369 (insert (concat " (" (propertize "sample" 'font-lock-face f) ")"))
1370 "\n") 1370 (princ (concat " (" customize-label ")\n"))
1371 (with-current-buffer standard-output 1371 (insert "Documentation: "
1372 (save-excursion 1372 (or (face-documentation f)
1373 (re-search-backward 1373 "Not documented as a face.")
1374 (concat "\\(" customize-label "\\)") nil t) 1374 "\n")
1375 (help-xref-button 1 'help-customize-face f))) 1375 (with-current-buffer standard-output
1376 (setq file-name (find-lisp-object-file-name f 'defface)) 1376 (save-excursion
1377 (when file-name 1377 (re-search-backward
1378 (princ "Defined in `") 1378 (concat "\\(" customize-label "\\)") nil t)
1379 (princ (file-name-nondirectory file-name)) 1379 (help-xref-button 1 'help-customize-face f)))
1380 (princ "'") 1380 (setq file-name (find-lisp-object-file-name f 'defface))
1381 ;; Make a hyperlink to the library. 1381 (when file-name
1382 (save-excursion 1382 (princ "Defined in `")
1383 (re-search-backward "`\\([^`']+\\)'" nil t) 1383 (princ (file-name-nondirectory file-name))
1384 (help-xref-button 1 'help-face-def f file-name)) 1384 (princ "'")
1385 (princ ".") 1385 ;; Make a hyperlink to the library.
1386 (terpri) 1386 (save-excursion
1387 (terpri)) 1387 (re-search-backward "`\\([^`']+\\)'" nil t)
1388 (dolist (a attrs) 1388 (help-xref-button 1 'help-face-def f file-name))
1389 (let ((attr (face-attribute f (car a) frame))) 1389 (princ ".")
1390 (insert (make-string (- max-width (length (cdr a))) ?\s) 1390 (terpri)
1391 (cdr a) ": " (format "%s" attr)) 1391 (terpri))
1392 (if (and (eq (car a) :inherit) 1392 (dolist (a attrs)
1393 (not (eq attr 'unspecified))) 1393 (let ((attr (face-attribute f (car a) frame)))
1394 ;; Make a hyperlink to the parent face. 1394 (insert (make-string (- max-width (length (cdr a))) ?\s)
1395 (save-excursion 1395 (cdr a) ": " (format "%s" attr))
1396 (re-search-backward ": \\([^:]+\\)" nil t) 1396 (if (and (eq (car a) :inherit)
1397 (help-xref-button 1 'help-face attr))) 1397 (not (eq attr 'unspecified)))
1398 (insert "\n"))))) 1398 ;; Make a hyperlink to the parent face.
1399 (terpri)))))) 1399 (save-excursion
1400 (re-search-backward ": \\([^:]+\\)" nil t)
1401 (help-xref-button 1 'help-face attr)))
1402 (insert "\n")))))
1403 (terpri)))))))
1400 1404
1401 1405
1402;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1406;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;