summaryrefslogtreecommitdiff
path: root/lisp/dired.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2022-07-09 10:14:54 +0200
committerStefan Kangas <stefan@marxist.se>2022-07-09 11:47:52 +0200
commit04f1396640f2af1a3be2ba48181c4e9242e6e77c (patch)
treed22ede18aa54120e1aac8ab023f7f4c81e01e850 /lisp/dired.el
parentac7b90e323eb375d5ff48fb24df206dc6336e656 (diff)
downloademacs-04f1396640f2af1a3be2ba48181c4e9242e6e77c.tar.gz
Move dired-buffer-more-recently-used-p to dired.el
* lisp/dired-x.el (dired-buffer-more-recently-used-p): Move from here... * lisp/dired.el (dired-buffer-more-recently-used-p): ...to here.
Diffstat (limited to 'lisp/dired.el')
-rw-r--r--lisp/dired.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 5769b73f638..bdcfc36a0e0 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -40,9 +40,6 @@
(require 'dired-loaddefs nil t)
(require 'dnd)
-(declare-function dired-buffer-more-recently-used-p
- "dired-x" (buffer1 buffer2))
-
;;; Customizable variables
@@ -3505,6 +3502,14 @@ is the directory where the file on this line resides."
(point-max)
(point))))
+;; This should be a builtin
+(defun dired-buffer-more-recently-used-p (buffer1 buffer2)
+ "Return t if BUFFER1 is more recently used than BUFFER2.
+Considers buffers closer to the car of `buffer-list' to be more recent."
+ (and (not (equal buffer1 buffer2))
+ (memq buffer1 (buffer-list))
+ (not (memq buffer1 (memq buffer2 (buffer-list))))))
+
;;; Deleting files