From: Lajos Bodnar <bodnarlajoska@gmail.com>
To: tomas@tuxteam.de
Cc: help-gnu-emacs@gnu.org, Emanuel Berg <moasen@zoho.com>
Subject: Re: hook and interactive with parameter
Date: Tue, 13 Feb 2018 10:05:47 +0100 [thread overview]
Message-ID: <CAPibjn=xBRRDvX1eev_pfujHcq+X8TkXtb6ngYoQot+m532Peg@mail.gmail.com> (raw)
In-Reply-To: <20180213085148.GB29216@tuxteam.de>
Thanks a lot,
I overall solution will be that when a haskell file is opened and I push
the F9 button then I will look over that where the haskell project root is
(.git folder or stack.yaml file).
I will add this path to my-opened-projects list and if I open a new haskell
file I will check that the file is under these path and I will run
intero-mode automatically.
It will based on the .git folder or the stack.yaml file or ...
The other cases I will run intero-mode manually if it is neccessary.
There is another advantage with this solution that I can open a filtered
minibuffer with only the opened "project" files.
regards
Lajos
On Tue, Feb 13, 2018 at 9:51 AM, <tomas@tuxteam.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Tue, Feb 13, 2018 at 09:23:41AM +0100, Lajos Bodnar wrote:
> > Thanks a lot,
> > I understood what the problem is with this concept.
> > What is your advice ?
> > The problem is that if I open a haskell file then sometimes I don't want
> to
> > run intero-mode with it (because the intero mode is very expensive).
> > In most cases I would like to run intero but not all time.
>
> I'd go with experimenting. After all, a diffuse feeling by
> Emanuel and me is less worth than hard-nosed experience :-)
>
> So hook away, and either use yes-or-no-p (or its less verbose
> sister y-or-n-p), as Emanuel suggested -- or the more complex
> (but better tunable) minibuffer stuff. Find out what breaks
> (if at all: hunches are, after all, just... hunches :)
>
> Just to get you jumpsterted: this seems to work, more or less.
> Fine tuning is left as an exercise for the reader :)
>
> (defun my-confirm-extra-toppings ()
> (when (y-or-n-p "With extra toppings? ")
> ;; just to show something:
> (set-background-color "lightblue")))
>
> (add-hook 'find-file-hook 'my-confirm-extra-toppings)
>
> Enjoy :-)
>
> Cheers
> - -- t
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
>
> iEYEARECAAYFAlqCpyQACgkQBcgs9XrR2kaltACeMLATdhMYn8fFK/0H7FDUhL7m
> Q9oAnRN/fm0o/AH9lRGHr6GJOSE18Bke
> =Hrn/
> -----END PGP SIGNATURE-----
>
next prev parent reply other threads:[~2018-02-13 9:05 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
[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 [this message]
[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
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='CAPibjn=xBRRDvX1eev_pfujHcq+X8TkXtb6ngYoQot+m532Peg@mail.gmail.com' \
--to=bodnarlajoska@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=moasen@zoho.com \
--cc=tomas@tuxteam.de \
/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).