From: C K Kashyap <ckkashyap@gmail.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: A question about interactive
Date: Fri, 22 Mar 2013 12:29:31 +0530 [thread overview]
Message-ID: <CAGdT1gqBfEZ0hS2eofwR8REKPJTBdeUPH6dG=C5EymOBFUPu1Q@mail.gmail.com> (raw)
In-Reply-To: <AA6A5BBEF1F24820BD408B2091FCEA45@us.oracle.com>
[-- Attachment #1: Type: text/plain, Size: 983 bytes --]
Thanks a lot Drew ... using read-file-name worked for me
(defun f ()
(interactive)
(setq fn (read-file-name "Enter filename" "C:/"))
(insert fn)
)
I did not have to do the let-binding of default-directory - actually I do
not know how to do it either. It'll be great if you could show me what you
meant.
Regards,
Kashyap
On Thu, Mar 21, 2013 at 6:54 PM, Drew Adams <drew.adams@oracle.com> wrote:
> > Here's what I want to do - I'd like to write utility
> > functions in different el files and store them in a
> > particular directory. then write a function in .emacs
> > - say - my-script-load ... What I'd like it to do is
> > this: (interactive "fEnter script name: ")
> >
> > Now, the problem is that the ineractive "f" seems to
> > use the current buffer location as the starting point.
> > How can I change that?
>
> In the `interactive' spec, let-bind `default-directory' and then read the
> file
> name with `read-file-name'. See the doc for `interactive'.
>
>
[-- Attachment #2: Type: text/html, Size: 1640 bytes --]
next prev parent reply other threads:[~2013-03-22 6:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-21 6:46 A question about interactive C K Kashyap
2013-03-21 13:24 ` Drew Adams
2013-03-22 6:59 ` C K Kashyap [this message]
2013-03-22 7:18 ` Drew Adams
2013-03-22 11:24 ` C K Kashyap
2013-03-22 14:45 ` Drew Adams
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGdT1gqBfEZ0hS2eofwR8REKPJTBdeUPH6dG=C5EymOBFUPu1Q@mail.gmail.com' \
--to=ckkashyap@gmail.com \
--cc=drew.adams@oracle.com \
--cc=help-gnu-emacs@gnu.org \
/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.
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.