[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Directory name to variable (dired?)

From: Drew Adams
Subject: RE: Directory name to variable (dired?)
Date: Sun, 7 Oct 2018 23:02:44 +0000 (UTC)

> Is there a function that returns a directory and full path
> so that it could be assigned to a variable?
> Ideally, dired would be a great place to start, as the directory
> path is at the top of the screen.

In Dired, `M-0 w' invokes command `dired-copy-filename-as-kill'
with prefix arg 0, which copies the absolute name of the file
named on the current line.

Non-interactively, (dired-copy-filename-as-kill 0) does the
same thing.

Then (setq foo (current-kill 0)) sets variable `foo' to a string
with that absolute file name.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]