unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Tim Johnson <tim@akwebsoft.com>, Emacs <Help-gnu-emacs@gnu.org>
Subject: RE: Directory name to variable (dired?)
Date: Sun, 7 Oct 2018 23:02:44 +0000 (UTC)	[thread overview]
Message-ID: <c57f872c-c863-476e-b4be-c9dce281a7ec@default> (raw)
In-Reply-To: <20181007214950.GA17855@mail.akwebsoft.com>

> 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	other threads:[~2018-10-07 23:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-07 21:49 Directory name to variable (dired?) Tim Johnson
2018-10-07 23:02 ` Drew Adams [this message]
2018-10-07 23:14   ` Tim Johnson
2018-10-08  0:02     ` Drew Adams
2018-10-08  0:20       ` Tim Johnson
2018-10-08  1:55         ` Drew Adams
2018-10-08 15:08           ` Tim Johnson
2018-10-08 15:18             ` Tim Johnson
2018-10-08 15:27               ` Noam Postavsky
2018-10-08 15:56               ` Drew Adams
2018-10-08 20:12             ` Stefan Monnier
2018-10-08 20:50               ` Tim Johnson
2018-10-07 23:18 ` Noam Postavsky
2018-10-08  0:05   ` Tim Johnson
2018-10-08 10:56     ` Noam Postavsky
2018-10-08 15:42       ` Tim Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c57f872c-c863-476e-b4be-c9dce281a7ec@default \
    --to=drew.adams@oracle.com \
    --cc=Help-gnu-emacs@gnu.org \
    --cc=tim@akwebsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).