aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/ui-navigation.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/ui-navigation.el b/modules/ui-navigation.el
index f1324c16..f0d2ef52 100644
--- a/modules/ui-navigation.el
+++ b/modules/ui-navigation.el
@@ -160,7 +160,9 @@ This function won't work with more than one split window."
;; UNDO KILL BUFFER
(defun cj/undo-kill-buffer (arg)
- "Re-open the last buffer killed. With ARG, re-open the nth buffer."
+ "Re-open the last buffer killed.
+With numeric prefix ARG, re-open the ARGth most-recently-killed file
+\(1-based, so no prefix re-opens the most recent)."
(interactive "p")
(require 'recentf)
(unless recentf-mode
@@ -178,8 +180,7 @@ This function won't work with more than one split window."
buffer-files-list)
(when recently-killed-list
(find-file
- (if arg (nth arg recently-killed-list)
- (car recently-killed-list))))))
+ (nth (1- arg) recently-killed-list)))))
(keymap-global-set "M-S-z" #'cj/undo-kill-buffer) ;; was M-Z, overrides zap-to-char
;; ---------------------------- Undo Layout Changes ----------------------------