diff options
| author | Glenn Morris | 2009-08-31 01:32:58 +0000 |
|---|---|---|
| committer | Glenn Morris | 2009-08-31 01:32:58 +0000 |
| commit | 3446bfc89c3e4b03a2a9a864f6a0e16e7a378d0a (patch) | |
| tree | 58629e07022c44d2475ba552da3f28453677b8d9 | |
| parent | 95ed0f11006d521c2146b59590f96fef2fcefc88 (diff) | |
| download | emacs-3446bfc89c3e4b03a2a9a864f6a0e16e7a378d0a.tar.gz emacs-3446bfc89c3e4b03a2a9a864f6a0e16e7a378d0a.zip | |
(describe-face): Adjust the output format to be more like
describe-variable, and to mention (obsolete) face aliases.
Adjust the whitespace so that help-setup-xref works.
| -rw-r--r-- | lisp/faces.el | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index b8d21404e87..95d52db4833 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | ;;; faces.el --- Lisp faces | 1 | ;;; faces.el --- Lisp faces |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, | 3 | ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, |
| 4 | ;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. | 4 | ;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 |
| 5 | ;; Free Software Foundation, Inc. | ||
| 5 | 6 | ||
| 6 | ;; Maintainer: FSF | 7 | ;; Maintainer: FSF |
| 7 | ;; Keywords: internal | 8 | ;; Keywords: internal |
| @@ -552,7 +553,7 @@ If FACE is a face-alias, get the documentation for the target face." | |||
| 552 | (if alias | 553 | (if alias |
| 553 | (progn | 554 | (progn |
| 554 | (setq doc (get alias 'face-documentation)) | 555 | (setq doc (get alias 'face-documentation)) |
| 555 | (format "%s is an alias for the face `%s'.%s" face alias | 556 | (format "%s is an alias for the face `%s'.%s" face alias |
| 556 | (if doc (format "\n%s" doc) | 557 | (if doc (format "\n%s" doc) |
| 557 | ""))) | 558 | ""))) |
| 558 | (get face 'face-documentation)))) | 559 | (get face 'face-documentation)))) |
| @@ -1368,10 +1369,29 @@ If FRAME is omitted or nil, use the selected frame." | |||
| 1368 | file-name) | 1369 | file-name) |
| 1369 | (insert (concat " (" (propertize "sample" 'font-lock-face f) ")")) | 1370 | (insert (concat " (" (propertize "sample" 'font-lock-face f) ")")) |
| 1370 | (princ (concat " (" customize-label ")\n")) | 1371 | (princ (concat " (" customize-label ")\n")) |
| 1371 | (insert "Documentation: " | 1372 | ;; FIXME not sure how much of this belongs here, and |
| 1372 | (or (face-documentation f) | 1373 | ;; how much in `face-documentation'. The latter is |
| 1373 | "Not documented as a face.") | 1374 | ;; not used much, but needs to return nil for |
| 1374 | "\n") | 1375 | ;; undocumented faces. |
| 1376 | (let ((alias (get f 'face-alias)) | ||
| 1377 | (face f) | ||
| 1378 | obsolete) | ||
| 1379 | (when alias | ||
| 1380 | (setq face alias) | ||
| 1381 | (insert | ||
| 1382 | (format "\n %s is an alias for the face `%s'.\n%s" | ||
| 1383 | f alias | ||
| 1384 | (if (setq obsolete (get f 'obsolete-face)) | ||
| 1385 | (format " This face is obsolete%s; use `%s' instead.\n" | ||
| 1386 | (if (stringp obsolete) | ||
| 1387 | (format " since %s" obsolete) | ||
| 1388 | "") | ||
| 1389 | alias) | ||
| 1390 | "")))) | ||
| 1391 | (insert "\nDocumentation:\n" | ||
| 1392 | (or (face-documentation face) | ||
| 1393 | "Not documented as a face.") | ||
| 1394 | "\n\n")) | ||
| 1375 | (with-current-buffer standard-output | 1395 | (with-current-buffer standard-output |
| 1376 | (save-excursion | 1396 | (save-excursion |
| 1377 | (re-search-backward | 1397 | (re-search-backward |