diff options
Diffstat (limited to 'lisp/help.el')
| -rw-r--r-- | lisp/help.el | 172 |
1 files changed, 91 insertions, 81 deletions
diff --git a/lisp/help.el b/lisp/help.el index 1661779ca74..0caf018c2e9 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -182,31 +182,28 @@ specifies what to do when the user exits the help buffer." | |||
| 182 | "You have typed %THIS-KEY%, the help character. Type a Help option: | 182 | "You have typed %THIS-KEY%, the help character. Type a Help option: |
| 183 | \(Use SPC or DEL to scroll through this text. Type \\<help-map>\\[help-quit] to exit the Help command.) | 183 | \(Use SPC or DEL to scroll through this text. Type \\<help-map>\\[help-quit] to exit the Help command.) |
| 184 | 184 | ||
| 185 | a command-apropos. Give a list of words or a regexp, to get a list of | 185 | a command-apropos. Type a list of words or a regexp; it shows a list of |
| 186 | commands whose names match. See also the apropos command. | 186 | commands whose names match. See also the apropos command. |
| 187 | b describe-bindings. Display table of all key bindings. | 187 | b describe-bindings. Display a table of all key bindings. |
| 188 | c describe-key-briefly. Type a command key sequence; | 188 | c describe-key-briefly. Type a key sequence; |
| 189 | it prints the function name that sequence runs. | 189 | it displays the command name run by that key sequence. |
| 190 | C describe-coding-system. This describes either a specific coding system | 190 | C describe-coding-system. Type the name of the coding system to describe, |
| 191 | (if you type its name) or the coding systems currently in use | 191 | or just RET to describe the ones currently in use. |
| 192 | (if you type just RET). | 192 | d apropos-documentation. Type a pattern (a list of words or a regexp), and |
| 193 | d apropos-documentation. Give a pattern (a list or words or a regexp), and | 193 | it shows a list of functions, variables, and other items whose |
| 194 | see a list of functions, variables, and other items whose built-in | 194 | documentation matches that pattern. See also the apropos command. |
| 195 | doucmentation string matches that pattern. See also the apropos command. | 195 | e view-echo-area-messages. Go to the buffer that logs echo-area messages. |
| 196 | e view-echo-area-messages. Show the buffer where the echo-area messages | 196 | f describe-function. Type a function name and you see its documentation. |
| 197 | are stored. | 197 | F Info-goto-emacs-command-node. Type a command name; |
| 198 | f describe-function. Type a function name and get its documentation. | 198 | it goes to the on-line manual's section that describes the command. |
| 199 | F Info-goto-emacs-command-node. Type a function name; | ||
| 200 | it takes you to the on-line manual's section that describes | ||
| 201 | the command. | ||
| 202 | h Display the HELLO file which illustrates various scripts. | 199 | h Display the HELLO file which illustrates various scripts. |
| 203 | i info. The Info documentation reader: read on-line manuals. | 200 | i info. The Info documentation reader: read on-line manuals. |
| 204 | I describe-input-method. Describe a specific input method (if you type | 201 | I describe-input-method. Describe a specific input method (if you type |
| 205 | its name) or the current input method (if you type just RET). | 202 | its name) or the current input method (if you type just RET). |
| 206 | k describe-key. Type a command key sequence; | 203 | k describe-key. Type a key sequence; |
| 207 | it displays the full documentation for that key sequence. | 204 | it displays the full documentation for that key sequence. |
| 208 | K Info-goto-emacs-key-command-node. Type a command key sequence; | 205 | K Info-goto-emacs-key-command-node. Type a key sequence; |
| 209 | it takes you to the on-line manual's section that describes | 206 | it goes to the on-line manual's section that describes |
| 210 | the command bound to that key. | 207 | the command bound to that key. |
| 211 | l view-lossage. Show last 100 characters you typed. | 208 | l view-lossage. Show last 100 characters you typed. |
| 212 | L describe-language-environment. This describes either a | 209 | L describe-language-environment. This describes either a |
| @@ -218,12 +215,12 @@ n view-emacs-news. Display news of recent Emacs changes. | |||
| 218 | p finder-by-keyword. Find packages matching a given topic keyword. | 215 | p finder-by-keyword. Find packages matching a given topic keyword. |
| 219 | r info-emacs-manual. Display the Emacs manual in Info mode. | 216 | r info-emacs-manual. Display the Emacs manual in Info mode. |
| 220 | s describe-syntax. Display contents of syntax table, plus explanations. | 217 | s describe-syntax. Display contents of syntax table, plus explanations. |
| 221 | S info-lookup-symbol. Display the definition of a specific symbol | 218 | S info-lookup-symbol. Type a symbol; it goes to that symbol in the |
| 222 | as found in the manual for the language this buffer is written in. | 219 | on-line manual for the programming language used in this buffer. |
| 223 | t help-with-tutorial. Select the Emacs learn-by-doing tutorial. | 220 | t help-with-tutorial. Select the Emacs learn-by-doing tutorial. |
| 224 | v describe-variable. Type name of a variable; | 221 | v describe-variable. Type name of a variable; |
| 225 | it displays the variable's documentation and value. | 222 | it displays the variable's documentation and value. |
| 226 | w where-is. Type command name; it prints which keystrokes | 223 | w where-is. Type a command name; it displays which keystrokes |
| 227 | invoke that command. | 224 | invoke that command. |
| 228 | . display-local-help. Display any available local help at point | 225 | . display-local-help. Display any available local help at point |
| 229 | in the echo area. | 226 | in the echo area. |
| @@ -326,63 +323,76 @@ of the key sequence that ran this command." | |||
| 326 | ;; run describe-prefix-bindings. | 323 | ;; run describe-prefix-bindings. |
| 327 | (setq prefix-help-command 'describe-prefix-bindings) | 324 | (setq prefix-help-command 'describe-prefix-bindings) |
| 328 | 325 | ||
| 329 | (defun view-emacs-news (&optional arg) | 326 | (defun view-emacs-news (&optional version) |
| 330 | "Display info on recent changes to Emacs. | 327 | "Display info on recent changes to Emacs. |
| 331 | With argument, display info only for the selected version." | 328 | With argument, display info only for the selected version." |
| 332 | (interactive "P") | 329 | (interactive "P") |
| 333 | (if (not arg) | 330 | (unless version |
| 334 | (view-file (expand-file-name "NEWS" data-directory)) | 331 | (setq version emacs-major-version)) |
| 335 | (let* ((map (sort | 332 | (when (consp version) |
| 336 | (delete-dups | 333 | (let* ((all-versions |
| 337 | (apply | 334 | (let (res) |
| 338 | 'nconc | 335 | (mapcar |
| 339 | (mapcar | 336 | (lambda (file) |
| 340 | (lambda (file) | 337 | (with-temp-buffer |
| 341 | (with-temp-buffer | 338 | (insert-file-contents |
| 342 | (insert-file-contents | 339 | (expand-file-name file data-directory)) |
| 343 | (expand-file-name file data-directory)) | 340 | (while (re-search-forward |
| 344 | (let (res) | 341 | (if (member file '("NEWS.18" "NEWS.1-17")) |
| 345 | (while (re-search-forward | 342 | "Changes in \\(?:Emacs\\|version\\)?[ \t]*\\([0-9]+\\(?:\\.[0-9]+\\)?\\)" |
| 346 | (if (string-match "^ONEWS\\.[0-9]+$" file) | 343 | "^\* [^0-9\n]*\\([0-9]+\\.[0-9]+\\)") nil t) |
| 347 | "Changes in \\(?:Emacs\\|version\\)?[ \t]*\\([0-9]+\\(?:\\.[0-9]+\\)?\\)" | 344 | (setq res (cons (match-string-no-properties 1) res))))) |
| 348 | "^\* [^0-9\n]*\\([0-9]+\\.[0-9]+\\)") nil t) | 345 | (cons "NEWS" |
| 349 | (setq res (cons (list (match-string-no-properties 1) | 346 | (directory-files data-directory nil |
| 350 | file) res))) | 347 | "^NEWS\\.[0-9][-0-9]*$" nil))) |
| 351 | res))) | 348 | (sort (delete-dups res) (lambda (a b) (string< b a))))) |
| 352 | (append '("NEWS" "ONEWS") | 349 | (current (car all-versions)) |
| 353 | (directory-files data-directory nil | 350 | res) |
| 354 | "^ONEWS\\.[0-9]+$" nil))))) | 351 | (setq version (completing-read |
| 355 | (lambda (a b) | 352 | (format "Read NEWS for the version (default %s): " current) |
| 356 | (string< (car b) (car a))))) | 353 | all-versions nil nil nil nil current)) |
| 357 | (current (caar map)) | 354 | (if (integerp (string-to-number version)) |
| 358 | (version (completing-read | 355 | (setq version (string-to-number version)) |
| 359 | (format "Read NEWS for the version (default %s): " current) | 356 | (unless (or (member version all-versions) |
| 360 | (mapcar 'car map) nil nil nil nil current)) | 357 | (<= (string-to-number version) (string-to-number current))) |
| 361 | (file (cadr (assoc version map))) | 358 | (error "No news about version %s" version))))) |
| 362 | res) | 359 | (when (integerp version) |
| 363 | (if (not file) | 360 | (cond ((<= version 12) |
| 364 | (error "No news is good news") | 361 | (setq version (format "1.%d" version))) |
| 365 | (view-file (expand-file-name file data-directory)) | 362 | ((<= version 18) |
| 366 | (widen) | 363 | (setq version (format "%d" version))) |
| 367 | (goto-char (point-min)) | 364 | ((> version emacs-major-version) |
| 368 | (when (re-search-forward | 365 | (error "No news about emacs %d (yet)" version)))) |
| 369 | (concat (if (string-match "^ONEWS\\.[0-9]+$" file) | 366 | (let* ((vn (if (stringp version) |
| 370 | "Changes in \\(?:Emacs\\|version\\)?[ \t]*" | 367 | (string-to-number version) |
| 371 | "^\* [^0-9\n]*") version) | 368 | version)) |
| 372 | nil t) | 369 | (file (cond |
| 373 | (beginning-of-line) | 370 | ((>= vn emacs-major-version) "NEWS") |
| 374 | (narrow-to-region | 371 | ((< vn 18) "NEWS.1-17") |
| 375 | (point) | 372 | (t (format "NEWS.%d" vn))))) |
| 376 | (save-excursion | 373 | (view-file (expand-file-name file data-directory)) |
| 377 | (while (and (setq res | 374 | (widen) |
| 378 | (re-search-forward | 375 | (goto-char (point-min)) |
| 379 | (if (string-match "^ONEWS\\.[0-9]+$" file) | 376 | (when (stringp version) |
| 380 | "Changes in \\(?:Emacs\\|version\\)?[ \t]*\\([0-9]+\\(?:\\.[0-9]+\\)?\\)" | 377 | (when (re-search-forward |
| 381 | "^\* [^0-9\n]*\\([0-9]+\\.[0-9]+\\)") nil t)) | 378 | (concat (if (< vn 19) |
| 382 | (equal (match-string-no-properties 1) version))) | 379 | "Changes in Emacs[ \t]*" |
| 383 | (or res (goto-char (point-max))) | 380 | "^\* [^0-9\n]*") version "$") |
| 384 | (beginning-of-line) | 381 | nil t) |
| 385 | (point)))))))) | 382 | (beginning-of-line) |
| 383 | (narrow-to-region | ||
| 384 | (point) | ||
| 385 | (save-excursion | ||
| 386 | (while (and (setq res | ||
| 387 | (re-search-forward | ||
| 388 | (if (< vn 19) | ||
| 389 | "Changes in \\(?:Emacs\\|version\\)?[ \t]*\\([0-9]+\\(?:\\.[0-9]+\\)?\\)" | ||
| 390 | "^\* [^0-9\n]*\\([0-9]+\\.[0-9]+\\)") nil t)) | ||
| 391 | (equal (match-string-no-properties 1) version))) | ||
| 392 | (or res (goto-char (point-max))) | ||
| 393 | (beginning-of-line) | ||
| 394 | (point))))))) | ||
| 395 | |||
| 386 | 396 | ||
| 387 | (defun view-todo (&optional arg) | 397 | (defun view-todo (&optional arg) |
| 388 | "Display the Emacs TODO list." | 398 | "Display the Emacs TODO list." |
| @@ -942,11 +952,11 @@ is currently activated with completion." | |||
| 942 | 952 | ||
| 943 | (defcustom temp-buffer-max-height (lambda (buffer) (/ (- (frame-height) 2) 2)) | 953 | (defcustom temp-buffer-max-height (lambda (buffer) (/ (- (frame-height) 2) 2)) |
| 944 | "Maximum height of a window displaying a temporary buffer. | 954 | "Maximum height of a window displaying a temporary buffer. |
| 945 | This is the maximum height (in text lines) which `resize-temp-buffer-window' | 955 | This is effective only when Temp Buffer Resize mode is enabled. |
| 956 | The value is the maximum height (in lines) which `resize-temp-buffer-window' | ||
| 946 | will give to a window displaying a temporary buffer. | 957 | will give to a window displaying a temporary buffer. |
| 947 | It can also be a function which will be called with the object corresponding | 958 | It can also be a function to be called to choose the height for such a buffer. |
| 948 | to the buffer to be displayed as argument and should return an integer | 959 | It gets one argumemt, the buffer, and should return a positive integer." |
| 949 | positive number." | ||
| 950 | :type '(choice integer function) | 960 | :type '(choice integer function) |
| 951 | :group 'help | 961 | :group 'help |
| 952 | :version "20.4") | 962 | :version "20.4") |