diff options
| author | Stefan Monnier | 2002-06-23 21:02:45 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2002-06-23 21:02:45 +0000 |
| commit | d24c52bbe52244103baf4e2035e9f420b94513f4 (patch) | |
| tree | 2d119050b370d1b863cef5c5689c4ef75a41b918 | |
| parent | b1b2d5152339f1ec1aa5a6178c450c0d56bfbe2e (diff) | |
| download | emacs-d24c52bbe52244103baf4e2035e9f420b94513f4.tar.gz emacs-d24c52bbe52244103baf4e2035e9f420b94513f4.zip | |
(describe-variable): Only use `buffer' is still live.
Use `delete-region' instead of save-excursion + delete-char.
Document the obsolescence of the variable, if applicable.
| -rw-r--r-- | lisp/help-fns.el | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el index af0fa9e73a9..6f4c2de54df 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; help-fns.el --- Complex help functions | 1 | ;;; help-fns.el --- Complex help functions |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1986, 1993, 1994, 1998, 1999, 2000, 2001 | 3 | ;; Copyright (C) 1985, 1986, 1993, 1994, 1998, 1999, 2000, 2001, 2002 |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Maintainer: FSF | 6 | ;; Maintainer: FSF |
| @@ -115,7 +115,7 @@ and the file name is displayed in the echo area." | |||
| 115 | (catch 'answer | 115 | (catch 'answer |
| 116 | (dolist (dir (or path load-path)) | 116 | (dolist (dir (or path load-path)) |
| 117 | (dolist (suf (append (unless nosuffix load-suffixes) '(""))) | 117 | (dolist (suf (append (unless nosuffix load-suffixes) '(""))) |
| 118 | (let ((try (expand-file-name (concat library suf) dir))) | 118 | (let ((try (expand-file-name (concat library suf) dir))) |
| 119 | (and (file-readable-p try) | 119 | (and (file-readable-p try) |
| 120 | (null (file-directory-p try)) | 120 | (null (file-directory-p try)) |
| 121 | (progn | 121 | (progn |
| @@ -215,7 +215,7 @@ and the file name is displayed in the echo area." | |||
| 215 | ;; This is necessary only for defaliases. | 215 | ;; This is necessary only for defaliases. |
| 216 | (let ((location | 216 | (let ((location |
| 217 | (condition-case nil | 217 | (condition-case nil |
| 218 | (find-function-search-for-symbol function nil "loaddefs.el") | 218 | (find-function-search-for-symbol function nil "loaddefs.el") |
| 219 | (error nil)))) | 219 | (error nil)))) |
| 220 | (when location | 220 | (when location |
| 221 | (with-current-buffer (car location) | 221 | (with-current-buffer (car location) |
| @@ -350,7 +350,7 @@ it is displayed along with the global value." | |||
| 350 | (if (symbolp v) (symbol-name v)))) | 350 | (if (symbolp v) (symbol-name v)))) |
| 351 | (list (if (equal val "") | 351 | (list (if (equal val "") |
| 352 | v (intern val))))) | 352 | v (intern val))))) |
| 353 | (unless (bufferp buffer) (setq buffer (current-buffer))) | 353 | (unless (buffer-live-p buffer) (setq buffer (current-buffer))) |
| 354 | (if (not (symbolp variable)) | 354 | (if (not (symbolp variable)) |
| 355 | (message "You did not specify a variable") | 355 | (message "You did not specify a variable") |
| 356 | (save-excursion | 356 | (save-excursion |
| @@ -392,9 +392,7 @@ it is displayed along with the global value." | |||
| 392 | (pp val) | 392 | (pp val) |
| 393 | (help-xref-on-pp from (point)) | 393 | (help-xref-on-pp from (point)) |
| 394 | (if (< (point) (+ from 20)) | 394 | (if (< (point) (+ from 20)) |
| 395 | (save-excursion | 395 | (delete-region (1- from) from)))))) |
| 396 | (goto-char from) | ||
| 397 | (delete-char -1))))))) | ||
| 398 | (terpri)) | 396 | (terpri)) |
| 399 | (terpri) | 397 | (terpri) |
| 400 | (with-current-buffer standard-output | 398 | (with-current-buffer standard-output |
| @@ -421,6 +419,14 @@ it is displayed along with the global value." | |||
| 421 | (insert "Automatically becomes buffer-local when set in any fashion.\n")))) | 419 | (insert "Automatically becomes buffer-local when set in any fashion.\n")))) |
| 422 | (princ "Documentation:") | 420 | (princ "Documentation:") |
| 423 | (terpri) | 421 | (terpri) |
| 422 | (let ((obsolete (get variable 'byte-obsolete-variable))) | ||
| 423 | (when obsolete | ||
| 424 | (princ "This variable is obsolete") | ||
| 425 | (if (cdr obsolete) (princ (format " since %s" (cdr obsolete)))) | ||
| 426 | (princ ".") (terpri) | ||
| 427 | (princ (if (stringp (car obsolete)) (car obsolete) | ||
| 428 | (format "Use `%s' instead." (car obsolete)))) | ||
| 429 | (terpri))) | ||
| 424 | (let ((doc (documentation-property variable 'variable-documentation))) | 430 | (let ((doc (documentation-property variable 'variable-documentation))) |
| 425 | (princ (or doc "not documented as a variable."))) | 431 | (princ (or doc "not documented as a variable."))) |
| 426 | 432 | ||