diff options
| author | Miles Bader | 2006-06-07 18:05:10 +0000 |
|---|---|---|
| committer | Miles Bader | 2006-06-07 18:05:10 +0000 |
| commit | b883cdb2fefa8ea9c3b0d82eba7a9ee792f871bb (patch) | |
| tree | de3804210a8cd955e0d3b9abc15679480930bc82 /lisp/help.el | |
| parent | 885b7d0991bd4b4b8f4bd1d3cd21c18a697bbce2 (diff) | |
| parent | 26c9afc3239e18b03537faaea33e3e82e28099e6 (diff) | |
| download | emacs-b883cdb2fefa8ea9c3b0d82eba7a9ee792f871bb.tar.gz emacs-b883cdb2fefa8ea9c3b0d82eba7a9ee792f871bb.zip | |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 285-296)
- Update from CVS
- Merge from gnus--rel--5.10
- Update from CVS: admin/FOR-RELEASE: Update refcard section.
* gnus--rel--5.10 (patch 102-104)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-64
Diffstat (limited to 'lisp/help.el')
| -rw-r--r-- | lisp/help.el | 129 |
1 files changed, 71 insertions, 58 deletions
diff --git a/lisp/help.el b/lisp/help.el index 1661779ca74..d9a48a0a4cf 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -326,63 +326,76 @@ of the key sequence that ran this command." | |||
| 326 | ;; run describe-prefix-bindings. | 326 | ;; run describe-prefix-bindings. |
| 327 | (setq prefix-help-command 'describe-prefix-bindings) | 327 | (setq prefix-help-command 'describe-prefix-bindings) |
| 328 | 328 | ||
| 329 | (defun view-emacs-news (&optional arg) | 329 | (defun view-emacs-news (&optional version) |
| 330 | "Display info on recent changes to Emacs. | 330 | "Display info on recent changes to Emacs. |
| 331 | With argument, display info only for the selected version." | 331 | With argument, display info only for the selected version." |
| 332 | (interactive "P") | 332 | (interactive "P") |
| 333 | (if (not arg) | 333 | (unless version |
| 334 | (view-file (expand-file-name "NEWS" data-directory)) | 334 | (setq version emacs-major-version)) |
| 335 | (let* ((map (sort | 335 | (when (consp version) |
| 336 | (delete-dups | 336 | (let* ((all-versions |
| 337 | (apply | 337 | (let (res) |
| 338 | 'nconc | 338 | (mapcar |
| 339 | (mapcar | 339 | (lambda (file) |
| 340 | (lambda (file) | 340 | (with-temp-buffer |
| 341 | (with-temp-buffer | 341 | (insert-file-contents |
| 342 | (insert-file-contents | 342 | (expand-file-name file data-directory)) |
| 343 | (expand-file-name file data-directory)) | 343 | (while (re-search-forward |
| 344 | (let (res) | 344 | (if (member file '("NEWS.18" "NEWS.1-17")) |
| 345 | (while (re-search-forward | 345 | "Changes in \\(?:Emacs\\|version\\)?[ \t]*\\([0-9]+\\(?:\\.[0-9]+\\)?\\)" |
| 346 | (if (string-match "^ONEWS\\.[0-9]+$" file) | 346 | "^\* [^0-9\n]*\\([0-9]+\\.[0-9]+\\)") nil t) |
| 347 | "Changes in \\(?:Emacs\\|version\\)?[ \t]*\\([0-9]+\\(?:\\.[0-9]+\\)?\\)" | 347 | (setq res (cons (match-string-no-properties 1) res))))) |
| 348 | "^\* [^0-9\n]*\\([0-9]+\\.[0-9]+\\)") nil t) | 348 | (cons "NEWS" |
| 349 | (setq res (cons (list (match-string-no-properties 1) | 349 | (directory-files data-directory nil |
| 350 | file) res))) | 350 | "^NEWS\\.[0-9][-0-9]*$" nil))) |
| 351 | res))) | 351 | (sort (delete-dups res) (lambda (a b) (string< b a))))) |
| 352 | (append '("NEWS" "ONEWS") | 352 | (current (car all-versions)) |
| 353 | (directory-files data-directory nil | 353 | res) |
| 354 | "^ONEWS\\.[0-9]+$" nil))))) | 354 | (setq version (completing-read |
| 355 | (lambda (a b) | 355 | (format "Read NEWS for the version (default %s): " current) |
| 356 | (string< (car b) (car a))))) | 356 | all-versions nil nil nil nil current)) |
| 357 | (current (caar map)) | 357 | (if (integerp (string-to-number version)) |
| 358 | (version (completing-read | 358 | (setq version (string-to-number version)) |
| 359 | (format "Read NEWS for the version (default %s): " current) | 359 | (unless (or (member version all-versions) |
| 360 | (mapcar 'car map) nil nil nil nil current)) | 360 | (<= (string-to-number version) (string-to-number current))) |
| 361 | (file (cadr (assoc version map))) | 361 | (error "No news about version %s" version))))) |
| 362 | res) | 362 | (when (integerp version) |
| 363 | (if (not file) | 363 | (cond ((<= version 12) |
| 364 | (error "No news is good news") | 364 | (setq version (format "1.%d" version))) |
| 365 | (view-file (expand-file-name file data-directory)) | 365 | ((<= version 18) |
| 366 | (widen) | 366 | (setq version (format "%d" version))) |
| 367 | (goto-char (point-min)) | 367 | ((> version emacs-major-version) |
| 368 | (when (re-search-forward | 368 | (error "No news about emacs %d (yet)" version)))) |
| 369 | (concat (if (string-match "^ONEWS\\.[0-9]+$" file) | 369 | (let* ((vn (if (stringp version) |
| 370 | "Changes in \\(?:Emacs\\|version\\)?[ \t]*" | 370 | (string-to-number version) |
| 371 | "^\* [^0-9\n]*") version) | 371 | version)) |
| 372 | nil t) | 372 | (file (cond |
| 373 | (beginning-of-line) | 373 | ((>= vn emacs-major-version) "NEWS") |
| 374 | (narrow-to-region | 374 | ((< vn 18) "NEWS.1-17") |
| 375 | (point) | 375 | (t (format "NEWS.%d" vn))))) |
| 376 | (save-excursion | 376 | (view-file (expand-file-name file data-directory)) |
| 377 | (while (and (setq res | 377 | (widen) |
| 378 | (re-search-forward | 378 | (goto-char (point-min)) |
| 379 | (if (string-match "^ONEWS\\.[0-9]+$" file) | 379 | (when (stringp version) |
| 380 | "Changes in \\(?:Emacs\\|version\\)?[ \t]*\\([0-9]+\\(?:\\.[0-9]+\\)?\\)" | 380 | (when (re-search-forward |
| 381 | "^\* [^0-9\n]*\\([0-9]+\\.[0-9]+\\)") nil t)) | 381 | (concat (if (< vn 19) |
| 382 | (equal (match-string-no-properties 1) version))) | 382 | "Changes in Emacs[ \t]*" |
| 383 | (or res (goto-char (point-max))) | 383 | "^\* [^0-9\n]*") version "$") |
| 384 | (beginning-of-line) | 384 | nil t) |
| 385 | (point)))))))) | 385 | (beginning-of-line) |
| 386 | (narrow-to-region | ||
| 387 | (point) | ||
| 388 | (save-excursion | ||
| 389 | (while (and (setq res | ||
| 390 | (re-search-forward | ||
| 391 | (if (< vn 19) | ||
| 392 | "Changes in \\(?:Emacs\\|version\\)?[ \t]*\\([0-9]+\\(?:\\.[0-9]+\\)?\\)" | ||
| 393 | "^\* [^0-9\n]*\\([0-9]+\\.[0-9]+\\)") nil t)) | ||
| 394 | (equal (match-string-no-properties 1) version))) | ||
| 395 | (or res (goto-char (point-max))) | ||
| 396 | (beginning-of-line) | ||
| 397 | (point))))))) | ||
| 398 | |||
| 386 | 399 | ||
| 387 | (defun view-todo (&optional arg) | 400 | (defun view-todo (&optional arg) |
| 388 | "Display the Emacs TODO list." | 401 | "Display the Emacs TODO list." |
| @@ -942,11 +955,11 @@ is currently activated with completion." | |||
| 942 | 955 | ||
| 943 | (defcustom temp-buffer-max-height (lambda (buffer) (/ (- (frame-height) 2) 2)) | 956 | (defcustom temp-buffer-max-height (lambda (buffer) (/ (- (frame-height) 2) 2)) |
| 944 | "Maximum height of a window displaying a temporary buffer. | 957 | "Maximum height of a window displaying a temporary buffer. |
| 945 | This is the maximum height (in text lines) which `resize-temp-buffer-window' | 958 | This is effective only when Temp Buffer Resize mode is enabled. |
| 959 | The value is the maximum height (in lines) which `resize-temp-buffer-window' | ||
| 946 | will give to a window displaying a temporary buffer. | 960 | will give to a window displaying a temporary buffer. |
| 947 | It can also be a function which will be called with the object corresponding | 961 | 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 | 962 | It gets one argumemt, the buffer, and should return a positive integer." |
| 949 | positive number." | ||
| 950 | :type '(choice integer function) | 963 | :type '(choice integer function) |
| 951 | :group 'help | 964 | :group 'help |
| 952 | :version "20.4") | 965 | :version "20.4") |