From: Glenn Morris Date: Fri, 31 Aug 2007 08:11:26 +0000 (+0000) Subject: James Wright X-Git-Tag: emacs-pretest-23.0.90~11170 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4596901f3f22d52ed3fb232dabdbf7f1f78e6630;p=emacs.git James Wright (eshell/info): New function. --- diff --git a/etc/NEWS b/etc/NEWS index 4f9204c7b75..175a908a9db 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -191,6 +191,8 @@ on the corresponding remote system. and C-x C-q in wdired-mode exits it with asking a question about saving changes. +*** The new command `eshell/info' runs info in an eshell buffer. + * Changes in Emacs 23.1 on non-free operating systems diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 390fd60555a..21084348139 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-08-31 James Wright + + * eshell/em-unix.el (eshell/info): New function. + 2007-08-31 Stefan Monnier * frame.el (frame-initialize, make-frame): diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 6dc02517ec1..ae65c7205b1 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -168,6 +168,35 @@ Otherwise, Emacs will attempt to use rsh to invoke du on the remote machine." (put 'eshell/man 'eshell-no-numeric-conversions t) +(defun eshell/info (&rest args) + "Runs the info command in-frame with the same behaviour as command-line `info', ie: + 'info' => goes to top info window + 'info arg1' => IF arg1 is a file, then visits arg1 + 'info arg1' => OTHERWISE goes to top info window and then menu item arg1 + 'info arg1 arg2' => does action for arg1 (either visit-file or menu-item) and then menu item arg2 + etc." + (require 'info) + (let ((file (cond + ((not (stringp (car args))) + nil) + ((file-exists-p (expand-file-name (car args))) + (expand-file-name (car args))) + ((file-exists-p (concat (expand-file-name (car args)) ".info")) + (concat (expand-file-name (car args)) ".info"))))) + + ;; If the first arg is a file, then go to that file's Top node + ;; Otherwise, go to the global directory + (if file + (progn + (setq args (cdr args)) + (Info-find-node file "Top")) + (Info-directory)) + + ;; Treat all remaining args as menu references + (while args + (Info-menu (car args)) + (setq args (cdr args))))) + (defun eshell-remove-entries (path files &optional top-level) "From PATH, remove all of the given FILES, perhaps interactively." (while files