;;; tehom-buff-menu-1.el --- View files in view-mode from Buffer-menu ;; Copyright (C) 1999 by Tom Breton ;; Author: Tom Breton ;; Keywords: local ;; This file is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; This file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: ;; Motivation: ;; When I used the Buffer menu (C-x C-b), I sometimes find I want to ;; view buffers (as in, view-mode) rather than visiting them. This is ;; a little thing I wrote to make it easy to do that. ;; Overview: ;; It's one more command in *Buffer list*. ;; Installation: ;; To install this, just add ;; (load-file "$PATH_TO_THIS_FILE/tehom-buff-menu-1.el") ;; to your .emacs ;; This will be superseded by my merging this with buff-menu.el ;; There's little point autoloading it, because it would never be ;; triggered unless you specifically call it with M-x. I also didn't ;; want it to use require/provide, because it is so small it could ;; easily just be added into buff-menu proper in the future. ;; I'd be pleased if this were adopted into buff-menu proper, which ;; would require only killing my add-hook and adding a key or two to ;; Buffer-menu-mode-map ;;; Code: (add-hook 'buffer-menu-mode-hook ( function ( lambda () (define-key Buffer-menu-mode-map "V" 'tehom-Buffer-menu-view)))) ( defun tehom-Buffer-menu-view () "View this line's buffer in view-mode." (interactive) (view-buffer (Buffer-menu-buffer t))) ( defun tehom-Buffer-menu-view-other-window () "View this line's buffer in view-mode in the other window." (interactive) (view-buffer-other-window (Buffer-menu-buffer t))) ;;; tehom-buff-menu-1.el ends here