Make EAF support watch-other-window.el

master
Andy Stewart 7 years ago
parent 7c9b7418fb
commit 14f088ba26
  1. 19
      eaf.el
  2. 2
      eaf.py

@ -811,6 +811,25 @@ Other files will open normally with `dired-find-file' or `dired-find-alternate-f
(other-window -1)
ad-do-it))
(defadvice watch-other-window-internal (around eaf-watch-other-window activate)
"When next buffer is `eaf-mode', do `eaf-watch-other-window'."
(other-window +1)
(if (eq major-mode 'eaf-mode)
(let ((direction (ad-get-arg 0))
(line (ad-get-arg 1)))
(if (string-equal direction "up")
(if (null line)
(eaf-call "scroll_buffer" (eaf-get-view-info) "up" "page")
(eaf-call "scroll_buffer" (eaf-get-view-info) "up" "line")
)
(if (null line)
(eaf-call "scroll_buffer" (eaf-get-view-info) "down" "page")
(eaf-call "scroll_buffer" (eaf-get-view-info) "down" "line")
))
(other-window -1))
(other-window -1)
ad-do-it))
(provide 'eaf)
;;; eaf.el ends here

@ -81,7 +81,7 @@ class EAF(dbus.service.Object):
@dbus.service.method(EAF_DBUS_NAME, in_signature="sss", out_signature="")
def scroll_buffer(self, view_info, scroll_direction, scroll_type):
(buffer_id, _, _, _, _, _) = view_info.split(":")
(buffer_id, _, _, _, _) = view_info.split(":")
if buffer_id in self.buffer_dict:
self.buffer_dict[buffer_id].scroll(scroll_direction, scroll_type)

Loading…
Cancel
Save