瀏覽代碼

fix my-dired-previous/next-line

pull/1/head
10sr 12 年之前
父節點
當前提交
8f9379d3f5
共有 1 個文件被更改,包括 26 次插入20 次删除
  1. +26
    -20
      emacs.el

+ 26
- 20
emacs.el 查看文件

@@ -1267,33 +1267,39 @@ delete; o: select other; j, l: enlarge; h, k: shrink; q: quit."
(interactive)
(my-dired-next-line (- (window-height) 1)))

;; (defun my-dired-forward-line (arg)
;; ""
;; (interactive "p"))

(defun my-dired-previous-line (arg)
""
(interactive "p")
(when (> arg 0)
;; (ignore 'my-dired-print-current-dir-and-file)
(dired-previous-line 1)
(when (eq (line-number-at-pos)
2)
(goto-char (point-max))
(forward-line -1)
(dired-move-to-filename))
(my-dired-previous-line (- arg 1))
))
(if (> arg 0)
(progn
;; (ignore 'my-dired-print-current-dir-and-file)
(forward-line -1)
(when (eq (line-number-at-pos)
1)
(goto-char (point-max)))
(my-dired-previous-line (if (dired-get-filename nil t)
(- arg 1)
arg)))
(dired-move-to-filename)))

(defun my-dired-next-line (arg)
""
(interactive "p")
(when (> arg 0)
;; (ignore 'my-dired-print-current-dir-and-file)
(dired-next-line 1)
(when (eq (point)
(point-max))
(goto-char (point-min))
(forward-line 2)
(dired-move-to-filename))
(my-dired-next-line (- arg 1))
))
(if (> arg 0)
(progn
;; (ignore 'my-dired-print-current-dir-and-file)
(forward-line 1)
(when (eq (point)
(point-max))
(goto-char (point-min)))
(my-dired-next-line (if (dired-get-filename nil t)
(- arg 1)
arg)))
(dired-move-to-filename)))

(defun my-dired-print-current-dir-and-file ()
(message "%s %s"


Loading…
取消
儲存