From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: default value of file-name-history Date: Fri, 19 Sep 2003 19:12:03 +0900 (JST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20030919.191203.202255364.jet@gyve.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1063966968 8636 80.91.224.253 (19 Sep 2003 10:22:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 19 Sep 2003 10:22:48 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Sep 19 12:22:46 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A0IPW-0007w8-00 for ; Fri, 19 Sep 2003 12:22:46 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1A0ITv-00057U-00 for ; Fri, 19 Sep 2003 12:27:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 1A0IJP-0001zB-9C for emacs-devel@quimby.gnus.org; Fri, 19 Sep 2003 06:16:27 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.22) id 1A0IGo-0001e5-I2 for emacs-devel@gnu.org; Fri, 19 Sep 2003 06:13:46 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.22) id 1A0IFr-0001Wz-Pl for emacs-devel@gnu.org; Fri, 19 Sep 2003 06:12:48 -0400 Original-Received: from [210.130.136.40] (helo=r-maa.spacetown.ne.jp) by monty-python.gnu.org with esmtp (Exim 4.22) id 1A0IFB-0000qW-HD for emacs-devel@gnu.org; Fri, 19 Sep 2003 06:12:05 -0400 Original-Received: from localhost (mx.jp.redhat.com [219.96.218.186]) by r-maa.spacetown.ne.jp (8.11.6) with ESMTP id h8JAC3I17899 for ; Fri, 19 Sep 2003 19:12:03 +0900 (JST) Original-To: emacs-devel@gnu.org X-Mailer: Mew version 3.1.52 on Emacs 21.3 / Mule 5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:16482 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:16482 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.