emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 220/255: list buffer navigation


From: Eric Schulte
Subject: [elpa] 220/255: list buffer navigation
Date: Sun, 16 Mar 2014 01:02:52 +0000

eschulte pushed a commit to branch go
in repository elpa.

commit dad4afef29698e7f6f1372552229fa881d8fdd90
Author: Eric Schulte <address@hidden>
Date:   Thu Aug 8 09:20:21 2013 -0600

    list buffer navigation
---
 list-buffer.el |   32 +++++++++++++++++++++++++++-----
 1 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/list-buffer.el b/list-buffer.el
index 7af6a0b..2657107 100644
--- a/list-buffer.el
+++ b/list-buffer.el
@@ -141,13 +141,35 @@ through the `*buffer-list*' variable.")
   (interactive)
   (error "not implemented."))
 
+(defun list-move-col (direction)
+  (cl-flet ((col () (or (get-text-property (point) :col) start-col)))
+    (let ((start-col (col)))
+      (while (= start-col (col))
+        (case direction
+          (:forward (forward-char))
+          (:backward (backward-char))))
+      (when (eql direction :backward)
+        (let ((end-col (col)))
+          (while (= end-col (col)) (backward-char))
+          (forward-char))))))
+
+(defun list-next-col () (interactive) (list-move-col :forward))
+(defun list-prev-col () (interactive) (list-move-col :backward))
+
 (defvar list-mode-map
   (let ((map (make-sparse-keymap)))
-    (define-key map (kbd "<up>")    'list-up)
-    (define-key map (kbd "<down>")  'list-down)
-    (define-key map (kbd "f")       'list-filter)
-    (define-key map (kbd "RET")     'list-enter)
-    (define-key map (kbd "q")       'bury-buffer)
+    ;; navigation
+    (define-key map (kbd "j")               'next-line)
+    (define-key map (kbd "k")               'previous-line)
+    (define-key map (kbd "u")               'scroll-down-command)
+    (define-key map (kbd "<tab>")           'list-next-col)
+    (define-key map (kbd "<S-iso-lefttab>") 'list-prev-col)
+    ;; list functions
+    (define-key map (kbd "<up>")            'list-up)
+    (define-key map (kbd "<down>")          'list-down)
+    (define-key map (kbd "f")               'list-filter)
+    (define-key map (kbd "RET")             'list-enter)
+    (define-key map (kbd "q")               'bury-buffer)
     map)
   "Keymap for `list-mode'.")
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]