unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* default value of file-name-history
@ 2003-09-19 10:12 Masatake YAMATO
  2003-09-19 16:40 ` Kevin Rodgers
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Masatake YAMATO @ 2003-09-19 10:12 UTC (permalink / raw)


How do you think initialize file-name-history with the 
value of `recentf-list'? So you can do C-x C-f M-p M-p M-p...
just after launching emacs.

(M-x describe-variable recentf-list: "List of recently opened files.")

Masatake YAMATO

Index: lisp/simple.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/simple.el,v
retrieving revision 1.620
diff -u -r1.620 simple.el
--- lisp/simple.el	8 Sep 2003 08:01:41 -0000	1.620
+++ lisp/simple.el	19 Sep 2003 10:09:24 -0000
@@ -900,10 +900,23 @@
 	   elt))
 	(goto-char (or minibuffer-temporary-goal-position (point-max))))))
 
+(defvar previous-history-element-used-recentf nil)
 (defun previous-history-element (n)
   "Inserts the previous element of the minibuffer history into the minibuffer."
   (interactive "p")
-  (next-history-element (- n)))
+  (let (result)
+  (unwind-protect
+      (setq result (next-history-element (- n)))
+    (if (and (= 0 (length (symbol-value minibuffer-history-variable)))
+	     (eq minibuffer-history-variable 'file-name-history)
+	     (not previous-history-element-used-recentf))
+	(progn (require 'recentf)
+	       (recentf-load-list) 
+	       (setq previous-history-element-used-recentf t
+		     file-name-history (mapcar 
+					'abbreviate-file-name
+					recentf-list))))
+    result)))
 
 (defun next-complete-history-element (n)
   "Get next history element which completes the minibuffer before the point.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-09-20 21:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-19 10:12 default value of file-name-history Masatake YAMATO
2003-09-19 16:40 ` Kevin Rodgers
2003-09-19 17:00   ` Henrik Enberg
2003-09-20  5:43   ` Masatake YAMATO
2003-09-20  7:20     ` David Ponce
2003-09-19 16:57 ` Stefan Monnier
2003-09-19 23:11 ` Stefan Daschek
2003-09-20  2:13   ` Miles Bader
2003-09-20 21:27   ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).