From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lajos Bodnar Newsgroups: gmane.emacs.help Subject: Re: hook and interactive with parameter Date: Tue, 13 Feb 2018 10:05:47 +0100 Message-ID: References: <86tvumgrbk.fsf@zoho.com> <86lgfygoux.fsf@zoho.com> <20180213085148.GB29216@tuxteam.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1518512686 29847 195.159.176.226 (13 Feb 2018 09:04:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 13 Feb 2018 09:04:46 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, Emanuel Berg To: tomas@tuxteam.de Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 13 10:04:42 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1elWVg-0006G4-Nf for geh-help-gnu-emacs@m.gmane.org; Tue, 13 Feb 2018 10:04:20 +0100 Original-Received: from localhost ([::1]:58605 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elWXi-0000oB-EB for geh-help-gnu-emacs@m.gmane.org; Tue, 13 Feb 2018 04:06:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elWX8-0000l2-7S for help-gnu-emacs@gnu.org; Tue, 13 Feb 2018 04:05:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1elWX6-0002Tx-Rj for help-gnu-emacs@gnu.org; Tue, 13 Feb 2018 04:05:50 -0500 Original-Received: from mail-io0-x229.google.com ([2607:f8b0:4001:c06::229]:46088) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1elWX6-0002TU-LS for help-gnu-emacs@gnu.org; Tue, 13 Feb 2018 04:05:48 -0500 Original-Received: by mail-io0-x229.google.com with SMTP id k80so9154501ioe.13 for ; Tue, 13 Feb 2018 01:05:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Ht2MThwUsSayt0LGQLVP9vLb6F0qtMfE0t1G586BPYo=; b=aBueqBsIersYMW/jOUGAcSTB6ZgLEcIhMc+3nOPauEHzDpHjjN8N4x72mac+2WvNVx ufg0I2YT9UTdJsjrpZ8y35iHZOqoIHqQT94W56byegRoIAbYvY/SYZuC7YtARyHYpPCf lbh6RrHEPX3NAjwsuMFCv4LXQa18M4d7KegygTA35AdwHoV23G6kyE0UcmuTZUeEbKVM 0BJNs9P8KgQEQFwapy8e9PcmWDxEUToK6+APmaTwNJ6lctjp+sKCywImLLniHRXfKXVS oDuaR3APubxKKoEgklNRCV9Js0ZJR4hpsWF22Wot2OJokFblRe43l2eH71izfduPjq2l kkUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Ht2MThwUsSayt0LGQLVP9vLb6F0qtMfE0t1G586BPYo=; b=mCV/fSRvumeHfcDpaIrxEMUOhHJ1lvK2h4BCIUgDNS4osY9g5hT872DNgyrIszrx2m FuGib+Nqq+ls8W7L0POg19YbSk7WQy+MdYBptNMvqCFYxz7lZs+hbIskUKAAGFwiCe4F jR5xPsfVccWZyrr47FzpGRjgT2EhwA5+T5M7mFhCZY9pJsTi0WnQ7H4ODfVXOw4a/nqJ 0mx+HZvXmAU+lsalpJRP7kwaq16mPaffLjRmH+mS1VLhCmk5VrUSlpGbQfZRjk2yAcgg dnaAEDZNpRtZ62PqsOfR2zTQ9zz05Tny4Hp5ZPUjsBWt5GOSBKNSP5uo7Ab6gdg9kjFA Clqw== X-Gm-Message-State: APf1xPAusYzsZ7+8QAU9KHDkIHgXSArDEwvSPtrk24/+SuqtHoZE85CH 63MDBQPjv/3maYkupAFnfSvpGMfzpmksyLGy4/I= X-Google-Smtp-Source: AH8x224hxpZFusa3b1sXTvHTcWxGEYMdb7UKsPaShYQEHJy0lZ+DGEBc1Mxibxs4bRRXL0TdbbXoh8iFxLyxng7a/nM= X-Received: by 10.107.22.199 with SMTP id 190mr633772iow.242.1518512747856; Tue, 13 Feb 2018 01:05:47 -0800 (PST) Original-Received: by 10.79.203.77 with HTTP; Tue, 13 Feb 2018 01:05:47 -0800 (PST) In-Reply-To: <20180213085148.GB29216@tuxteam.de> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c06::229 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:115966 Archived-At: 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, 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----- >