浏览代码

emacs.el: Dirty fix of tree-mode-next,previous-node

pull/1/head
10sr 9 年前
父节点
当前提交
e37b5988e6
共有 1 个文件被更改,包括 24 次插入2 次删除
  1. +24
    -2
      emacs.el

+ 24
- 2
emacs.el 查看文件

@@ -905,7 +905,28 @@ found, otherwise returns nil."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; some modes and hooks

(lazy-load-eval 'dirtree)
(lazy-load-eval 'dirtree nil
(defun my-dirtree-current-line-directory-p ()
"Return nil if element on current line is not a directory."
(file-directory-p (widget-get (tree-mode-button-current-line)
:file)))

;; This fix is actually a little strange. Strictly speaking
;; judging tree should be done by whether the widget is a tree one.
(defun my-dirtree-next-node (arg)
"Fix the problem that `tree-mode-next-node' moves cursor 2 lines."
(interactive "p")
(if (my-dirtree-current-line-directory-p)
(widget-forward (* arg 2))
(widget-forward arg)))
(defun my-dirtree-previous-node (arg)
"Fix the problem that `tree-mode-previous-node' moves cursor 2 lines."
(interactive "p")
(my-dirtree-next-node (- arg)))

(define-key dirtree-mode-map "n" 'my-dirtree-next-node)
(define-key dirtree-mode-map "p" 'my-dirtree-previous-node)
)

(and (fetch-library
"https://raw.github.com/10sr/emacs-lisp/master/remember-major-modes-mode.el"
@@ -1419,7 +1440,8 @@ found, otherwise returns nil."
;; (call-interactively 'bs-toggle-show-all))
(set (make-local-variable 'scroll-margin) 0))))

(iswitchb-mode 1)
;;(iswitchb-mode 1)
(icomplete-mode)

(defun iswitchb-buffer-display-other-window ()
"Do iswitchb in other window."


正在加载...
取消
保存