[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r103796: Add a new command `info-disp
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r103796: Add a new command `info-display-manual'. |
Date: |
Fri, 01 Apr 2011 13:10:47 +0300 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 103796
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Fri 2011-04-01 13:10:47 +0300
message:
Add a new command `info-display-manual'.
lisp/info.el (info-display-manual): New function.
modified:
etc/NEWS
lisp/ChangeLog
lisp/info.el
=== modified file 'etc/NEWS'
--- a/etc/NEWS 2011-03-31 19:28:26 +0000
+++ b/etc/NEWS 2011-04-01 10:10:47 +0000
@@ -676,6 +676,14 @@
*** New command `nato-region' converts text to NATO phonetic alphabet.
+*** The new command `info-display-manual' will display an Info manual
+specified by its name. If that manual is already visited in some Info
+buffer within the current session, the command will display that
+buffer. Otherwise, it will load the manual and display it. This is
+handy if you have many manuals in many Info buffers, and don't
+remember the name of the buffer visiting the manual you want to
+consult.
+
* New Modes and Packages in Emacs 24.1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2011-03-31 15:17:06 +0000
+++ b/lisp/ChangeLog 2011-04-01 10:10:47 +0000
@@ -1,3 +1,7 @@
+2011-04-01 Eli Zaretskii <address@hidden>
+
+ * info.el (info-display-manual): New function.
+
2011-03-31 Stefan Monnier <address@hidden>
* loadup.el: Load minibuffer after loaddefs, to use define-minor-mode.
=== modified file 'lisp/info.el'
--- a/lisp/info.el 2011-03-19 18:49:31 +0000
+++ b/lisp/info.el 2011-04-01 10:10:47 +0000
@@ -4930,6 +4930,27 @@
(bookmark-default-handler
`("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bmk)))))
+
+;;;###autoload
+(defun info-display-manual (manual)
+ "Go to Info buffer that displays MANUAL, creating it if none already exists."
+ (interactive "sManual name: ")
+ (let ((blist (buffer-list))
+ (manual-re (concat "\\(/\\|\\`\\)" manual "\\(\\.\\|\\'\\)"))
+ (case-fold-search t)
+ found)
+ (dolist (buffer blist)
+ (with-current-buffer buffer
+ (when (and (eq major-mode 'Info-mode)
+ (stringp Info-current-file)
+ (string-match manual-re Info-current-file))
+ (setq found buffer
+ blist nil))))
+ (if found
+ (pop-to-buffer found)
+ (info-initialize)
+ (info (Info-find-file manual)))))
+
(provide 'info)
;;; info.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r103796: Add a new command `info-display-manual'.,
Eli Zaretskii <=