diff options
| author | Richard M. Stallman | 2002-04-27 23:16:18 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-04-27 23:16:18 +0000 |
| commit | f54b0d85a84e185abefb4109266de21b4f050517 (patch) | |
| tree | 15a345ba8d879ac9b228cec32058511856b5365c | |
| parent | ca429a2557b926ec53915848adee4049790109a1 (diff) | |
| download | emacs-f54b0d85a84e185abefb4109266de21b4f050517.tar.gz emacs-f54b0d85a84e185abefb4109266de21b4f050517.zip | |
(next-buffer, prev-buffer): New commands.
Bind C-x left and C-x right to them.
| -rw-r--r-- | lisp/simple.el | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 1b5e866645a..09acf9b86ff 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -41,6 +41,27 @@ | |||
| 41 | "Highlight (un)matching of parens and expressions." | 41 | "Highlight (un)matching of parens and expressions." |
| 42 | :group 'matching) | 42 | :group 'matching) |
| 43 | 43 | ||
| 44 | (define-key global-map [?\C-x right] 'next-buffer) | ||
| 45 | (define-key global-map [?\C-x left] 'prev-buffer) | ||
| 46 | (defun next-buffer () | ||
| 47 | "Switch to the next buffer in cyclic order." | ||
| 48 | (interactive) | ||
| 49 | (let ((buffer (current-buffer))) | ||
| 50 | (switch-to-buffer (other-buffer buffer)) | ||
| 51 | (bury-buffer buffer))) | ||
| 52 | |||
| 53 | (defun prev-buffer () | ||
| 54 | "Switch to the previous buffer in cyclic order." | ||
| 55 | (interactive) | ||
| 56 | (let ((list (nreverse (buffer-list))) | ||
| 57 | found) | ||
| 58 | (while (and (not found) list) | ||
| 59 | (let ((buffer (car list))) | ||
| 60 | (if (and (not (get-buffer-window buffer)) | ||
| 61 | (not (string-match "\\` " (buffer-name buffer)))) | ||
| 62 | (setq found buffer))) | ||
| 63 | (setq list (cdr list))) | ||
| 64 | (switch-to-buffer found))) | ||
| 44 | 65 | ||
| 45 | (defun fundamental-mode () | 66 | (defun fundamental-mode () |
| 46 | "Major mode not specialized for anything in particular. | 67 | "Major mode not specialized for anything in particular. |
| @@ -3974,7 +3995,7 @@ PREFIX is the string that represents this modifier in an event type symbol." | |||
| 3974 | (kp-decimal ?.) | 3995 | (kp-decimal ?.) |
| 3975 | (kp-divide ?/) | 3996 | (kp-divide ?/) |
| 3976 | (kp-equal ?=))) | 3997 | (kp-equal ?=))) |
| 3977 | 3998 | ||
| 3978 | ;;;; | 3999 | ;;;; |
| 3979 | ;;;; forking a twin copy of a buffer. | 4000 | ;;;; forking a twin copy of a buffer. |
| 3980 | ;;;; | 4001 | ;;;; |
| @@ -4124,8 +4145,7 @@ the front of the list of recently selected ones." | |||
| 4124 | (clone-indirect-buffer nil t norecord))) | 4145 | (clone-indirect-buffer nil t norecord))) |
| 4125 | 4146 | ||
| 4126 | (define-key ctl-x-4-map "c" 'clone-indirect-buffer-other-window) | 4147 | (define-key ctl-x-4-map "c" 'clone-indirect-buffer-other-window) |
| 4127 | 4148 | ||
| 4128 | |||
| 4129 | ;;; Handling of Backspace and Delete keys. | 4149 | ;;; Handling of Backspace and Delete keys. |
| 4130 | 4150 | ||
| 4131 | (defcustom normal-erase-is-backspace nil | 4151 | (defcustom normal-erase-is-backspace nil |