(require (quote electric)) (defvar electric-buffer-menu-mode-map nil) (defun electric-buffer-list (arg) "\ Vaguely like ITS lunar select buffer; combining typeoutoid buffer listing with menuoid buffer selection. This pops up a buffer describing the set of emacs buffers. If the very next character typed is a space then the buffer list window disappears. Otherwise, one may move around in the buffer list window, marking buffers to be selected, saved or deleted. To exit and select a new buffer, type Space when the cursor is on the appropriate line of the buffer-list window. Other commands are much like those of buffer-menu-mode. Calls value of electric-buffer-menu-mode-hook on entry if non-nil. \\{electric-buffer-menu-mode-map}" (interactive "P") (byte-code "ĈƋ7 q  eb# b \". 3!!)8*" [select buffer arg opoint nil t ((byte-code "Ë!!ǎ q ʍ)" [arg buffer select ((byte-code "!" [arg list-buffers] 2)) window-buffer Electric-pop-up-window "*Buffer List*" ((byte-code "q !!" [buffer Buffer-menu-mode bury-buffer message ""] 4)) Electric-buffer-menu-mode electric-buffer-menu-select (byte-code "!rUɉ\"eb!`db!` b B%+" [unread-command-char nil first last goal-column t message "<<< Press Space to bury the buffer list >>>" 32 -1 throw electric-buffer-menu-select forward-line 2 0 Electric-command-loop electric-buffer-menu-looper] 11)] 5)) point-marker Buffer-menu-execute search-forward " >" set-marker Buffer-menu-select switch-to-buffer Buffer-menu-buffer] 8)) (defun electric-buffer-menu-looper (state condition) (byte-code " @>?@A\"@` @W%eb!@` AV@db!d!?!@ɇ" [condition state (buffer-read-only end-of-buffer beginning-of-buffer) signal forward-line 2 -1 pos-visible-in-window-p recenter nil] 6)) (put (quote Electric-buffer-menu-mode) (quote mode-class) (quote special)) (defun Electric-buffer-menu-mode nil "\ Major mode for editing a list of buffers. Each line describes one of the buffers in Emacs. Letters do not insert themselves; instead, they are commands. \\{electric-buffer-menu-mode-map} C-g or C-c C-c -- exit buffer menu, returning to previous window and buffer configuration. If the very first character typed is a space, it also has this effect. Space -- select buffer of line point is on. Also show buffers marked with m in other windows, deletes buffers marked with \"D\", and saves those marked with \"S\". m -- mark buffer to be displayed. ~ -- clear modified-flag on that buffer. s -- mark that buffer to be saved. d or C-d -- mark that buffer to be deleted. u -- remove all kinds of marks from current line. v -- view buffer, returning when done. Delete -- back up a line and remove marks. Entry to this mode via command \\[electric-buffer-list] calls the value of electric-buffer-menu-mode-hook if it is non-nil." (byte-code " !͉̉ >$ ! >\"%Ɉ!҉ƉƉӉeb#M!NɈ!" [electric-buffer-menu-mode-map mode-name mode-line-buffer-identification mode-line-format Helper-return-blurb truncate-lines t buffer-read-only major-mode nil kill-all-local-variables use-local-map "Electric Buffer Menu" "Electric Buffer List" copy-sequence setcar "Buffers" make-local-variable "return to buffer editing" Electric-buffer-menu-mode search-forward " ." forward-char -1 run-hooks electric-buffer-menu-mode-hook] 9)) (put (quote Electric-buffer-menu-undefined) (quote suppress-keymap) t) (if electric-buffer-menu-mode-map nil (let ((map (make-keymap))) (fillarray map (quote Electric-buffer-menu-undefined)) (define-key map "" (make-keymap)) (fillarray (lookup-key map "") (quote Electric-buffer-menu-undefined)) (define-key map "" (quote suspend-emacs)) (define-key map "v" (quote Electric-buffer-menu-mode-view-buffer)) (define-key map "" (quote Helper-help)) (define-key map "?" (quote Helper-describe-bindings)) (define-key map "" nil) (define-key map "" (quote Electric-buffer-menu-quit)) (define-key map "" (quote Electric-buffer-menu-quit)) (define-key map "q" (quote Electric-buffer-menu-quit)) (define-key map " " (quote Electric-buffer-menu-select)) (define-key map " " (quote recenter)) (define-key map "s" (quote Buffer-menu-save)) (define-key map "d" (quote Buffer-menu-delete)) (define-key map "k" (quote Buffer-menu-delete)) (define-key map "" (quote Buffer-menu-delete-backwards)) (define-key map "" (quote Buffer-menu-backup-unmark)) (define-key map "~" (quote Buffer-menu-not-modified)) (define-key map "u" (quote Buffer-menu-unmark)) (let ((i 48)) (while (<= i 57) (define-key map (char-to-string i) (quote digit-argument)) (define-key map (concat "" (char-to-string i)) (quote digit-argument)) (setq i (1+ i)))) (define-key map "-" (quote negative-argument)) (define-key map "-" (quote negative-argument)) (define-key map "m" (quote Buffer-menu-mark)) (define-key map "" (quote universal-argument)) (define-key map "" (quote previous-line)) (define-key map "" (quote next-line)) (define-key map "p" (quote previous-line)) (define-key map "n" (quote next-line)) (define-key map "" (quote scroll-up)) (define-key map "v" (quote scroll-down)) (define-key map "" (quote scroll-other-window)) (define-key map ">" (quote end-of-buffer)) (define-key map "<" (quote beginning-of-buffer)) (setq electric-buffer-menu-mode-map map))) (defun Electric-buffer-menu-exit nil (interactive) (byte-code "ˆ ď" [unread-command-char last-input-char nil (byte-code "\"" [nil throw electric-buffer-menu-select] 3) ((error (byte-code " " [Buffer-menu-mode other-buffer] 3)))] 3)) (defun Electric-buffer-menu-select nil "\ Leave Electric Buffer Menu, selecting buffers and executing changes. Saves buffers marked \"S\". Deletes buffers marked \"K\". Selects buffer at point and displays buffers marked \">\" in other windows." (interactive) (byte-code "`\"" [nil throw electric-buffer-menu-select] 3)) (defun Electric-buffer-menu-quit nil "\ Leave Electric Buffer Menu, restoring previous window configuration. Does not execute select, save, or delete commands." (interactive) (byte-code "\"" [nil throw electric-buffer-menu-select] 3)) (defun Electric-buffer-menu-undefined nil (interactive) (byte-code " !=#!=#!=#!=*̂-!!!" [nil ding message key-binding "" Electric-buffer-menu-quit " " Electric-buffer-menu-select "" Helper-help "?" Helper-describe-bindings "Type C-c C-c to exit, Space to select, C-h for help, ? for commands" substitute-command-keys "Type \\[Electric-buffer-menu-quit] to exit, \\[Electric-buffer-menu-select] to select, \\[Helper-help] for help, \\[Helper-describe-bindings] for commands." sit-for 4] 9)) (defun Electric-buffer-menu-mode-view-buffer nil "\ View buffer on current line in Electric Buffer Menu. Returns to Electric Buffer Menu when done." (interactive) (byte-code "!! \"!)" [bufnam nil Buffer-menu-buffer view-buffer ding message "Buffer %s does not exist!" sit-for 4] 6))