diff options
| author | Stefan Monnier | 2008-06-08 03:48:22 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-06-08 03:48:22 +0000 |
| commit | 671c04d971c57f224d4048e786dc877c9b2ee7fb (patch) | |
| tree | 6b47647c96a61515bc5ede0c0ac21f5164f26b8f | |
| parent | 415da97ac4e3c6e9167eedf7c0aa5495e460eee4 (diff) | |
| download | emacs-671c04d971c57f224d4048e786dc877c9b2ee7fb.tar.gz emacs-671c04d971c57f224d4048e786dc877c9b2ee7fb.zip | |
Remove spurious * in docstrings.
(apropos-label-face): Use variable pitch.
(apropos-print): Use dolist and with-current-buffer.
(apropos-print-doc): Use when.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/apropos.el | 139 |
2 files changed, 73 insertions, 71 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1e351e59a06..91c276b2ba7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2008-06-08 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2008-06-08 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * apropos.el: Remove spurious * in docstrings. | ||
| 4 | (apropos-label-face): Use variable pitch. | ||
| 5 | (apropos-print): Use dolist and with-current-buffer. | ||
| 6 | (apropos-print-doc): Use when. | ||
| 7 | |||
| 3 | * window.el (special-display-p, display-buffer): | 8 | * window.el (special-display-p, display-buffer): |
| 4 | Fix up C->Elisp transcription error. | 9 | Fix up C->Elisp transcription error. |
| 5 | 10 | ||
diff --git a/lisp/apropos.el b/lisp/apropos.el index c7969afcb88..a073d293524 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el | |||
| @@ -66,7 +66,7 @@ | |||
| 66 | 66 | ||
| 67 | ;; I see a degradation of maybe 10-20% only. | 67 | ;; I see a degradation of maybe 10-20% only. |
| 68 | (defcustom apropos-do-all nil | 68 | (defcustom apropos-do-all nil |
| 69 | "*Whether the apropos commands should do more. | 69 | "Whether the apropos commands should do more. |
| 70 | 70 | ||
| 71 | Slows them down more or less. Set this non-nil if you have a fast machine." | 71 | Slows them down more or less. Set this non-nil if you have a fast machine." |
| 72 | :group 'apropos | 72 | :group 'apropos |
| @@ -74,36 +74,36 @@ Slows them down more or less. Set this non-nil if you have a fast machine." | |||
| 74 | 74 | ||
| 75 | 75 | ||
| 76 | (defcustom apropos-symbol-face 'bold | 76 | (defcustom apropos-symbol-face 'bold |
| 77 | "*Face for symbol name in Apropos output, or nil for none." | 77 | "Face for symbol name in Apropos output, or nil for none." |
| 78 | :group 'apropos | 78 | :group 'apropos |
| 79 | :type 'face) | 79 | :type 'face) |
| 80 | 80 | ||
| 81 | (defcustom apropos-keybinding-face 'underline | 81 | (defcustom apropos-keybinding-face 'underline |
| 82 | "*Face for lists of keybinding in Apropos output, or nil for none." | 82 | "Face for lists of keybinding in Apropos output, or nil for none." |
| 83 | :group 'apropos | 83 | :group 'apropos |
| 84 | :type 'face) | 84 | :type 'face) |
| 85 | 85 | ||
| 86 | (defcustom apropos-label-face 'italic | 86 | (defcustom apropos-label-face '(italic variable-pitch) |
| 87 | "*Face for label (`Command', `Variable' ...) in Apropos output. | 87 | "Face for label (`Command', `Variable' ...) in Apropos output. |
| 88 | A value of nil means don't use any special font for them, and also | 88 | A value of nil means don't use any special font for them, and also |
| 89 | turns off mouse highlighting." | 89 | turns off mouse highlighting." |
| 90 | :group 'apropos | 90 | :group 'apropos |
| 91 | :type 'face) | 91 | :type 'face) |
| 92 | 92 | ||
| 93 | (defcustom apropos-property-face 'bold-italic | 93 | (defcustom apropos-property-face 'bold-italic |
| 94 | "*Face for property name in apropos output, or nil for none." | 94 | "Face for property name in apropos output, or nil for none." |
| 95 | :group 'apropos | 95 | :group 'apropos |
| 96 | :type 'face) | 96 | :type 'face) |
| 97 | 97 | ||
| 98 | (defcustom apropos-match-face 'match | 98 | (defcustom apropos-match-face 'match |
| 99 | "*Face for matching text in Apropos documentation/value, or nil for none. | 99 | "Face for matching text in Apropos documentation/value, or nil for none. |
| 100 | This applies when you look for matches in the documentation or variable value | 100 | This applies when you look for matches in the documentation or variable value |
| 101 | for the pattern; the part that matches gets displayed in this font." | 101 | for the pattern; the part that matches gets displayed in this font." |
| 102 | :group 'apropos | 102 | :group 'apropos |
| 103 | :type 'face) | 103 | :type 'face) |
| 104 | 104 | ||
| 105 | (defcustom apropos-sort-by-scores nil | 105 | (defcustom apropos-sort-by-scores nil |
| 106 | "*Non-nil means sort matches by scores; best match is shown first. | 106 | "Non-nil means sort matches by scores; best match is shown first. |
| 107 | This applies to all `apropos' commands except `apropos-documentation'. | 107 | This applies to all `apropos' commands except `apropos-documentation'. |
| 108 | If value is `verbose', the computed score is shown for each match." | 108 | If value is `verbose', the computed score is shown for each match." |
| 109 | :group 'apropos | 109 | :group 'apropos |
| @@ -134,7 +134,7 @@ If value is `verbose', the computed score is shown for each match." | |||
| 134 | "Keymap used in Apropos mode.") | 134 | "Keymap used in Apropos mode.") |
| 135 | 135 | ||
| 136 | (defvar apropos-mode-hook nil | 136 | (defvar apropos-mode-hook nil |
| 137 | "*Hook run when mode is turned on.") | 137 | "Hook run when mode is turned on.") |
| 138 | 138 | ||
| 139 | (defvar apropos-pattern nil | 139 | (defvar apropos-pattern nil |
| 140 | "Apropos pattern as entered by user.") | 140 | "Apropos pattern as entered by user.") |
| @@ -885,12 +885,10 @@ If non-nil TEXT is a string that will be printed as a heading." | |||
| 885 | (substitute-command-keys | 885 | (substitute-command-keys |
| 886 | "and type \\[apropos-follow] to get full documentation.\n\n")) | 886 | "and type \\[apropos-follow] to get full documentation.\n\n")) |
| 887 | (if text (insert text "\n\n")) | 887 | (if text (insert text "\n\n")) |
| 888 | (while (consp p) | 888 | (dolist (apropos-item p) |
| 889 | (when (and spacing (not (bobp))) | 889 | (when (and spacing (not (bobp))) |
| 890 | (princ spacing)) | 890 | (princ spacing)) |
| 891 | (setq apropos-item (car p) | 891 | (setq symbol (car apropos-item)) |
| 892 | symbol (car apropos-item) | ||
| 893 | p (cdr p)) | ||
| 894 | ;; Insert dummy score element for backwards compatibility with 21.x | 892 | ;; Insert dummy score element for backwards compatibility with 21.x |
| 895 | ;; apropos-item format. | 893 | ;; apropos-item format. |
| 896 | (if (not (numberp (cadr apropos-item))) | 894 | (if (not (numberp (cadr apropos-item))) |
| @@ -907,50 +905,51 @@ If non-nil TEXT is a string that will be printed as a heading." | |||
| 907 | (cadr apropos-item)) | 905 | (cadr apropos-item)) |
| 908 | (insert " (" (number-to-string (cadr apropos-item)) ") ")) | 906 | (insert " (" (number-to-string (cadr apropos-item)) ") ")) |
| 909 | ;; Calculate key-bindings if we want them. | 907 | ;; Calculate key-bindings if we want them. |
| 910 | (and do-keys | 908 | (and do-keys |
| 911 | (commandp symbol) | 909 | (commandp symbol) |
| 912 | (not (eq symbol 'self-insert-command)) | 910 | (not (eq symbol 'self-insert-command)) |
| 913 | (indent-to 30 1) | 911 | (indent-to 30 1) |
| 914 | (if (let ((keys | 912 | (if (let ((keys |
| 915 | (save-excursion | 913 | (with-current-buffer old-buffer |
| 916 | (set-buffer old-buffer) | 914 | (where-is-internal symbol))) |
| 917 | (where-is-internal symbol))) | 915 | filtered) |
| 918 | filtered) | 916 | ;; Copy over the list of key sequences, |
| 919 | ;; Copy over the list of key sequences, | 917 | ;; omitting any that contain a buffer or a frame. |
| 920 | ;; omitting any that contain a buffer or a frame. | 918 | ;; FIXME: Why omit keys that contain buffers and |
| 921 | (while keys | 919 | ;; frames? This looks like a bad workaround rather |
| 922 | (let ((key (car keys)) | 920 | ;; than a proper fix. Does anybod know what problem |
| 923 | (i 0) | 921 | ;; this is trying to address? --Stef |
| 924 | loser) | 922 | (dolist (key keys) |
| 925 | (while (< i (length key)) | 923 | (let ((i 0) |
| 926 | (if (or (framep (aref key i)) | 924 | loser) |
| 927 | (bufferp (aref key i))) | 925 | (while (< i (length key)) |
| 928 | (setq loser t)) | 926 | (if (or (framep (aref key i)) |
| 929 | (setq i (1+ i))) | 927 | (bufferp (aref key i))) |
| 930 | (or loser | 928 | (setq loser t)) |
| 931 | (setq filtered (cons key filtered)))) | 929 | (setq i (1+ i))) |
| 932 | (setq keys (cdr keys))) | 930 | (or loser |
| 933 | (setq item filtered)) | 931 | (push key filtered)))) |
| 934 | ;; Convert the remaining keys to a string and insert. | 932 | (setq item filtered)) |
| 935 | (insert | 933 | ;; Convert the remaining keys to a string and insert. |
| 936 | (mapconcat | 934 | (insert |
| 937 | (lambda (key) | 935 | (mapconcat |
| 938 | (setq key (condition-case () | 936 | (lambda (key) |
| 939 | (key-description key) | 937 | (setq key (condition-case () |
| 940 | (error))) | 938 | (key-description key) |
| 941 | (if apropos-keybinding-face | 939 | (error))) |
| 942 | (put-text-property 0 (length key) | 940 | (if apropos-keybinding-face |
| 943 | 'face apropos-keybinding-face | 941 | (put-text-property 0 (length key) |
| 944 | key)) | 942 | 'face apropos-keybinding-face |
| 945 | key) | 943 | key)) |
| 946 | item ", ")) | 944 | key) |
| 947 | (insert "M-x ... RET") | 945 | item ", ")) |
| 948 | (when apropos-keybinding-face | 946 | (insert "M-x ... RET") |
| 949 | (put-text-property (- (point) 11) (- (point) 8) | 947 | (when apropos-keybinding-face |
| 950 | 'face apropos-keybinding-face) | 948 | (put-text-property (- (point) 11) (- (point) 8) |
| 951 | (put-text-property (- (point) 3) (point) | 949 | 'face apropos-keybinding-face) |
| 952 | 'face apropos-keybinding-face)))) | 950 | (put-text-property (- (point) 3) (point) |
| 953 | (terpri) | 951 | 'face apropos-keybinding-face)))) |
| 952 | (terpri) | ||
| 954 | (apropos-print-doc 2 | 953 | (apropos-print-doc 2 |
| 955 | (if (commandp symbol) | 954 | (if (commandp symbol) |
| 956 | 'apropos-command | 955 | 'apropos-command |
| @@ -967,7 +966,6 @@ If non-nil TEXT is a string that will be printed as a heading." | |||
| 967 | (prog1 apropos-accumulator | 966 | (prog1 apropos-accumulator |
| 968 | (setq apropos-accumulator ()))) ; permit gc | 967 | (setq apropos-accumulator ()))) ; permit gc |
| 969 | 968 | ||
| 970 | |||
| 971 | (defun apropos-macrop (symbol) | 969 | (defun apropos-macrop (symbol) |
| 972 | "Return t if SYMBOL is a Lisp macro." | 970 | "Return t if SYMBOL is a Lisp macro." |
| 973 | (and (fboundp symbol) | 971 | (and (fboundp symbol) |
| @@ -980,19 +978,18 @@ If non-nil TEXT is a string that will be printed as a heading." | |||
| 980 | 978 | ||
| 981 | 979 | ||
| 982 | (defun apropos-print-doc (i type do-keys) | 980 | (defun apropos-print-doc (i type do-keys) |
| 983 | (if (stringp (setq i (nth i apropos-item))) | 981 | (when (stringp (setq i (nth i apropos-item))) |
| 984 | (progn | 982 | (insert " ") |
| 985 | (insert " ") | 983 | (insert-text-button (button-type-get type 'apropos-label) |
| 986 | (insert-text-button (button-type-get type 'apropos-label) | 984 | 'type type |
| 987 | 'type type | 985 | ;; Can't use the default button face, since |
| 988 | ;; Can't use the default button face, since | 986 | ;; user may have changed the variable! |
| 989 | ;; user may have changed the variable! | 987 | ;; Just say `no' to variables containing faces! |
| 990 | ;; Just say `no' to variables containing faces! | 988 | 'face apropos-label-face |
| 991 | 'face apropos-label-face | 989 | 'apropos-symbol (car apropos-item)) |
| 992 | 'apropos-symbol (car apropos-item)) | 990 | (insert ": ") |
| 993 | (insert ": ") | 991 | (insert (if do-keys (substitute-command-keys i) i)) |
| 994 | (insert (if do-keys (substitute-command-keys i) i)) | 992 | (or (bolp) (terpri)))) |
| 995 | (or (bolp) (terpri))))) | ||
| 996 | 993 | ||
| 997 | 994 | ||
| 998 | (defun apropos-follow () | 995 | (defun apropos-follow () |