Browse Source

fix my-dired-previous/next-line

pull/1/head
10sr 12 years ago
parent
commit
8f9379d3f5
1 changed files with 26 additions and 20 deletions
  1. +26
    -20
      emacs.el

+ 26
- 20
emacs.el View File

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


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

(defun my-dired-previous-line (arg) (defun my-dired-previous-line (arg)
"" ""
(interactive "p") (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) (defun my-dired-next-line (arg)
"" ""
(interactive "p") (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 () (defun my-dired-print-current-dir-and-file ()
(message "%s %s" (message "%s %s"


Loading…
Cancel
Save