[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to make Emacs paths in the minibuffer start at root (/) instead
Re: How to make Emacs paths in the minibuffer start at root (/) instead of $HOME (~)?
26 Mar 2014 01:23:18 GMT
Christopher Howard wrote:
> I'm not a guru, but I would think you could get a similiar result
> writing an interactive lisp function. Just looking at the docs, I was
> (expand-file-name (pwd))
> with a function around that to save it for pasting. Only problem is
> that, apparently, the `pwd' function includes other junk in the string
> along with the expanded file name. Any thoughts from the real
Well, `pwd' really only does
(message "Directory %s" default-directory)
should do the trick.
Putting it in the kill ring (which should normally make it available for
pasting outside Emacs) is not difficult either:
(kill-new (expand-file-name default-directory))
Wrap it in an interactive function:
(defun my-copy-pwd ()
"Copy the current directory to the kill ring."
(kill-new (expand-file-name default-directory)))
And assign it to a key:
(global-set-key "C-c p" 'my-copy-pwd)
There ya go!
Joost Kremers address@hidden
Selbst in die Unterwelt dringt durch Spalten Licht