[logaling-commit] logaling/logalimacs [master] loga-buffer-or-popup-command: Move duplicate functions to local variable

Back to archive index

null+****@clear***** null+****@clear*****
Fri Jun 15 19:27:40 JST 2012


yuta yamada	2012-06-15 19:27:40 +0900 (Fri, 15 Jun 2012)

  New Revision: 84820aa053d94de12f989bbc3e6fe53b57f57b68

  Log:
    loga-buffer-or-popup-command: Move duplicate functions to local variable

  Modified files:
    logalimacs.el

  Modified: logalimacs.el (+15 -13)
===================================================================
--- logalimacs.el    2012-06-15 04:54:26 +0900 (9636027)
+++ logalimacs.el    2012-06-15 19:27:40 +0900 (bd26657)
@@ -148,19 +148,21 @@
 
 (defun loga-buffer-or-popup-command ()
   (read-event "")
-  (case (loga-response-of-event loga-buffer-or-popup-command-alist)
-    (:next-line
-     (unless (eq loga-current-endpoint :popup)
-       (scroll-other-window 1) (loga-buffer-or-popup-command)))
-    (:previous-line
-     (unless (eq loga-current-endpoint :popup)
-       (scroll-other-window-down 1) (loga-buffer-or-popup-command)))
-    (:buffer (loga-make-buffer (cdar loga-word-cache)))
-    (:quit
-     (if (eq loga-current-endpoint :buffer)
-         (kill-buffer "*logalimacs*"))
-     (keyboard-quit))
-    (:detail (loga-display-detail))))
+  (let ((event (loga-response-of-event loga-buffer-or-popup-command-alist))
+        (scroll-logalimacs-buffer
+         (lambda (up-or-down)
+           (unless (eq loga-current-endpoint :popup)
+             (scroll-other-window up-or-down)
+             (loga-buffer-or-popup-command)))))
+    (case event
+      (:next-line (funcall scroll-logalimacs-buffer 1))
+      (:previous-line (funcall scroll-logalimacs-buffer -1))
+      (:buffer (loga-make-buffer (cdar loga-word-cache)))
+      (:quit
+       (if (eq loga-current-endpoint :buffer)
+           (kill-buffer "*logalimacs*"))
+       (keyboard-quit))
+      (:detail (loga-display-detail)))))
 
 (defun loga-display-detail ()
   "If popup where current endpoint, output to buffer. if buffer, quit buffer"




More information about the logaling-commit mailing list
Back to archive index