]> khamidou — GitHub mirrors - config-files.git/commitdiff
added a function cycle-through-buffers
authorkhamidou <karim@lambda-expr.org>
Thu, 9 Apr 2009 16:47:25 +0000 (18:47 +0200)
committerkhamidou <karim@lambda-expr.org>
Thu, 9 Apr 2009 16:47:25 +0000 (18:47 +0200)
.emacs

diff --git a/.emacs b/.emacs
index 2a2d2a5ff3b1e5c1f486edd1cfe6052f47d7e96b..628b67762776e6768f82b6c772f13a368497ae77 100755 (executable)
--- a/.emacs
+++ b/.emacs
@@ -85,6 +85,11 @@ vi style of % jumping to matching brace."
   (interactive)
   (switch-to-buffer (other-buffer)))
 
+; Bury the previous buffer to go the antepenultian buffer.
+(defun cycle-through-buffers ()
+  (interactive)
+  (bury-buffer (other-buffer))
+  (previous-buf))
 
 ; Courtesy of pgas.
 
@@ -232,7 +237,8 @@ indent according to mode."
 (global-set-key [(tab)] 'smart-tab)
 (setq c-hungry-delete-key 't)
 (global-set-key (kbd "<f3>") 'previous-buf)
-(global-set-key (kbd "<f2>") 'anything)
+(global-set-key (kbd "<f2>") 'previous-buf)
+(global-set-key (kbd "<f1>") 'anything)
 (global-set-key (kbd "<f5>") 'run-scheme)
 (global-set-key (kbd "<f6>") 'ielm)
 (add-hook 'python-mode-hook (lambda () (local-set-key (kbd "TAB") 'smart-tab)))