all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* recentf: abbreviate paths? tilde for home folder?
@ 2005-08-01 12:44 David Reitter
  0 siblings, 0 replies; 5+ messages in thread
From: David Reitter @ 2005-08-01 12:44 UTC (permalink / raw


How can I get recentf to show abbreviated paths in the "Open Recent"  
menu?
That is, show paths just like in buffer names, where path names are  
shown only where necessary in order to distinguish between existing  
buffers.
At least, I'd like to be able to replace my home folder with a tilde  
where possible.

thanks. 

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

* Re: recentf: abbreviate paths? tilde for home folder?
       [not found] <mailman.2231.1122900523.20277.help-gnu-emacs@gnu.org>
@ 2005-08-01 14:18 ` Reiner Steib
  2005-08-02 17:25   ` Kevin Rodgers
       [not found]   ` <mailman.2353.1123004606.20277.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Reiner Steib @ 2005-08-01 14:18 UTC (permalink / raw


On Mon, Aug 01 2005, David Reitter wrote:

> How can I get recentf to show abbreviated paths in the "Open Recent"
> menu?  That is, show paths just like in buffer names, where path
> names are shown only where necessary in order to distinguish between
> existing buffers.

[ In Emacs 22 (CVS)...]

(setq recentf-menu-filter 'recentf-show-basenames) or
`M-x customize-variable RET recentf-menu-filter RET'

> At least, I'd like to be able to replace my home folder with a tilde  where
> possible.

(defun rs-recentf-filename-handler (name)
  (replace-regexp-in-string (concat "\\`" (expand-file-name "~")) "~" name))
(setq recentf-filename-handler 'rs-recentf-filename-handler)

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

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

* Re: recentf: abbreviate paths? tilde for home folder?
  2005-08-01 14:18 ` Reiner Steib
@ 2005-08-02 17:25   ` Kevin Rodgers
       [not found]   ` <mailman.2353.1123004606.20277.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Kevin Rodgers @ 2005-08-02 17:25 UTC (permalink / raw


Reiner Steib wrote:
 > On Mon, Aug 01 2005, David Reitter wrote:
 >>At least, I'd like to be able to replace my home folder with a tilde 
  where
 >>possible.
 >
 > (defun rs-recentf-filename-handler (name)
 >   (replace-regexp-in-string (concat "\\`" (expand-file-name "~")) "~" 
name))
 > (setq recentf-filename-handler 'rs-recentf-filename-handler)

Why not just (setq recentf-filename-handler 'abbreviate-file-name)

-- 
Kevin Rodgers

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

* Re: recentf: abbreviate paths? tilde for home folder?
       [not found]   ` <mailman.2353.1123004606.20277.help-gnu-emacs@gnu.org>
@ 2005-08-02 18:47     ` Reiner Steib
  0 siblings, 0 replies; 5+ messages in thread
From: Reiner Steib @ 2005-08-02 18:47 UTC (permalink / raw


On Tue, Aug 02 2005, Kevin Rodgers wrote:

> Reiner Steib wrote:
[...]
>  > (defun rs-recentf-filename-handler (name)
>  >   (replace-regexp-in-string (concat "\\`" (expand-file-name "~")) "~"
>      name))
>  > (setq recentf-filename-handler 'rs-recentf-filename-handler)
>
> Why not just (setq recentf-filename-handler 'abbreviate-file-name)

Thanks for pointing this out.  I think `abbreviate-file-name' should
be added as a choice in the defcustom of `recentf-filename-handler'.

[ BTW: Emacs 21 doesn't offer `recentf-filename-handler' so it might
  not be useful for David. ]

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

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

* Re: recentf: abbreviate paths? tilde for home folder?
@ 2005-08-04 17:12 David Reitter
  0 siblings, 0 replies; 5+ messages in thread
From: David Reitter @ 2005-08-04 17:12 UTC (permalink / raw


Reiner, Kevin:

(setq recentf-menu-filter 'recentf-show-basenames  )

is exactly what I wanted, thanks very much.

Now, I've changed that function to produce the same syntax as used  
for buffer names (or in the buffers menu - don't know which one it  
is) with the "--" instead of showing the path in parenthesis. I  
wanted to use uniquify to produce exactly the same behavior (i.e.  
abbreviated paths where necessary), but it looks like uniquify only  
works with buffer names and not simply with an arbitrary list of path  
names :-(

Thanks again
David

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

end of thread, other threads:[~2005-08-04 17:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-04 17:12 recentf: abbreviate paths? tilde for home folder? David Reitter
     [not found] <mailman.2231.1122900523.20277.help-gnu-emacs@gnu.org>
2005-08-01 14:18 ` Reiner Steib
2005-08-02 17:25   ` Kevin Rodgers
     [not found]   ` <mailman.2353.1123004606.20277.help-gnu-emacs@gnu.org>
2005-08-02 18:47     ` Reiner Steib
  -- strict thread matches above, loose matches on Subject: below --
2005-08-01 12:44 David Reitter

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.