unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* miniaturising the file name displayed.
@ 2004-06-28 14:59 Abi
  2004-06-30 13:34 ` Kai Grossjohann
  2004-07-01 18:46 ` Kevin Rodgers
  0 siblings, 2 replies; 5+ messages in thread
From: Abi @ 2004-06-28 14:59 UTC (permalink / raw)



In emasc, when I type C-x C-f, the file name completion displays the
entire path of the directory. Instead I'd like to customize it so that
it shows only relative to my home directory. how do i do this in
emacs?
thanks
abi

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

* Re: miniaturising the file name displayed.
  2004-06-28 14:59 miniaturising the file name displayed Abi
@ 2004-06-30 13:34 ` Kai Grossjohann
  2004-07-01 18:46 ` Kevin Rodgers
  1 sibling, 0 replies; 5+ messages in thread
From: Kai Grossjohann @ 2004-06-30 13:34 UTC (permalink / raw)


Abi <abi_kREMSPAM@myrealbox.com> writes:

> In emasc, when I type C-x C-f, the file name completion displays the
> entire path of the directory. Instead I'd like to customize it so that
> it shows only relative to my home directory. how do i do this in
> emacs?

Replacing the home dir with ~ should be done automatically.  Emacs
looks at the environment variable $HOME to do this.

Perhaps you might like ido.el which displays only the last couple of
components of the directory name.

Kai

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

* Re: miniaturising the file name displayed.
  2004-06-28 14:59 miniaturising the file name displayed Abi
  2004-06-30 13:34 ` Kai Grossjohann
@ 2004-07-01 18:46 ` Kevin Rodgers
  2004-07-04  0:53   ` Abi
  1 sibling, 1 reply; 5+ messages in thread
From: Kevin Rodgers @ 2004-07-01 18:46 UTC (permalink / raw)


Abi wrote:
 > In emasc, when I type C-x C-f, the file name completion displays the
 > entire path of the directory. Instead I'd like to customize it so that
 > it shows only relative to my home directory. how do i do this in
 > emacs?

,----[ C-h v abbreviated-home-dir RET ]
| abbreviated-home-dir's value is
| "^/home/kevinr\\(/\\|$\\)"
|
| Documentation:
| The user's homedir abbreviated according to `directory-abbrev-alist'.
|
| Defined in `files'.
`----

So when I'm visiting a file under /home/kevinr, C-x C-f displays this in
the minibuffer:

Find file: ~/foo/bar/etc/

Is that what you want?

-- 
Kevin Rodgers

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

* Re: miniaturising the file name displayed.
  2004-07-01 18:46 ` Kevin Rodgers
@ 2004-07-04  0:53   ` Abi
  2004-07-06 17:51     ` Kevin Rodgers
  0 siblings, 1 reply; 5+ messages in thread
From: Abi @ 2004-07-04  0:53 UTC (permalink / raw)


yup, but i'd like to see ~/../../usr/etc/ when i access other files as
well.
or more preferable, the absolute path, or the path relative to my home
directory or the one from my CWD, whichever is shorter. I know this is
too much in the asking, but then if there is some elisp code to do
this, i'd be glad to add it to my .emacs.
thanks
abi

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

* Re: miniaturising the file name displayed.
  2004-07-04  0:53   ` Abi
@ 2004-07-06 17:51     ` Kevin Rodgers
  0 siblings, 0 replies; 5+ messages in thread
From: Kevin Rodgers @ 2004-07-06 17:51 UTC (permalink / raw)


Abi wrote:
 > yup, but i'd like to see ~/../../usr/etc/ when i access other files as
 > well.
 > or more preferable, the absolute path, or the path relative to my home
 > directory or the one from my CWD, whichever is shorter. I know this is
 > too much in the asking, but then if there is some elisp code to do
 > this, i'd be glad to add it to my .emacs.

In emacs, your current working directory is different for every buffer
(default-directory is a buffer local variable), so every path is
relative to the default directory.  If you don't want the directory
included in the minibuffer, set insert-default-directory to nil.

But here's an attempt to always prompt you with a path relative to your
home directory:

(defadvice find-file (before read-relative-file-name activate)
   ;; -literally, -other-window, -other-frame,
   ;; -read-only, -read-only-other-window, -read-only-other-frame
   "Always read FILENAME relative to ~."
   (interactive (list (read-file-name "Find file: "
				     (file-relative-name default-directory "~"))
		     (prefix-numeric-value current-prefix-arg))))

-- 
Kevin Rodgers

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

end of thread, other threads:[~2004-07-06 17:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-28 14:59 miniaturising the file name displayed Abi
2004-06-30 13:34 ` Kai Grossjohann
2004-07-01 18:46 ` Kevin Rodgers
2004-07-04  0:53   ` Abi
2004-07-06 17:51     ` Kevin Rodgers

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).