From: <tomas@tuxteam.de>
To: help-gnu-emacs@gnu.org
Subject: Re: hook and interactive with parameter
Date: Mon, 12 Feb 2018 17:15:00 +0100 [thread overview]
Message-ID: <20180212161500.GB3408@tuxteam.de> (raw)
In-Reply-To: <CAPibjnmpcFoF_gmpawRhsMhf7VvdpmqXe5Uk7-tQYSDq3KWP-Q@mail.gmail.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Mon, Feb 12, 2018 at 04:43:04PM +0100, Lajos Bodnar wrote:
> Thanks for your advice.
> I would like to write a function which run up if I open a haskell file.
> This function will ask a question automaticaly about that i would like to
> run the intero-mode or not.
Note that the `interactive' form is just "declarative", i.e.
it doesn't "do" anything on itself. It just states what kind
of parameters a function is going to take when invoked "as a
command", that is, from a key binding or similar.
The "magic" of asking for parameters happens there.
When that function is invoked from a hook this "magic" will be
missing :-) Besides, most hook functions are parameterless.
One way around it is asking the user actively. See for example
the function "read-from-minibuffer" (and perhaps most of the
chapter on minibuffers from the Emacs manual).
That said, to me, calling user interaction from a hook "feels"
a bit strange. But perhaps it's just me.
Cheers
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAlqBvYQACgkQBcgs9XrR2kZveQCdHQG9Biu3wDCIhUpauInMsnQc
HTIAnil7u+iufFKdB/zDKpFjj1jtL6/6
=r1CJ
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2018-02-12 16:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.8968.1518443498.27995.help-gnu-emacs@gnu.org>
2018-02-12 15:28 ` hook and interactive with parameter Emanuel Berg
2018-02-12 15:43 ` Lajos Bodnar
2018-02-12 16:15 ` tomas [this message]
[not found] ` <mailman.8981.1518452114.27995.help-gnu-emacs@gnu.org>
2018-02-12 16:21 ` Emanuel Berg
2018-02-13 8:23 ` Lajos Bodnar
2018-02-13 8:42 ` Lajos Bodnar
2018-02-13 8:44 ` Yuri Khan
2018-02-13 8:51 ` tomas
2018-02-13 9:05 ` Lajos Bodnar
[not found] ` <mailman.9028.1518511493.27995.help-gnu-emacs@gnu.org>
2018-02-13 19:02 ` Emanuel Berg
[not found] ` <mailman.8974.1518450193.27995.help-gnu-emacs@gnu.org>
2018-02-12 16:16 ` Emanuel Berg
2018-02-12 10:03 Lajos Bodnar
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=20180212161500.GB3408@tuxteam.de \
--to=tomas@tuxteam.de \
--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.