From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: hook and interactive with parameter Date: Tue, 13 Feb 2018 15:44:29 +0700 Message-ID: References: <86tvumgrbk.fsf@zoho.com> <86lgfygoux.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1518511429 2357 195.159.176.226 (13 Feb 2018 08:43:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 13 Feb 2018 08:43:49 +0000 (UTC) Cc: help-gnu-emacs , Emanuel Berg To: Lajos Bodnar Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 13 09:43:44 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 1elWBW-0007se-Nz for geh-help-gnu-emacs@m.gmane.org; Tue, 13 Feb 2018 09:43:30 +0100 Original-Received: from localhost ([::1]:56712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elWDX-0008Pz-2A for geh-help-gnu-emacs@m.gmane.org; Tue, 13 Feb 2018 03:45:35 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elWCp-0008Lw-FH for help-gnu-emacs@gnu.org; Tue, 13 Feb 2018 03:44:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1elWCo-0004b4-O7 for help-gnu-emacs@gnu.org; Tue, 13 Feb 2018 03:44:51 -0500 Original-Received: from mail-ot0-x231.google.com ([2607:f8b0:4003:c0f::231]:36847) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1elWCo-0004ac-JU for help-gnu-emacs@gnu.org; Tue, 13 Feb 2018 03:44:50 -0500 Original-Received: by mail-ot0-x231.google.com with SMTP id m20so16611398otf.3 for ; Tue, 13 Feb 2018 00:44:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=YvxD+rf2mdUVojtnkmyEgNpC0+1PjyModbkIS7dl1GI=; b=XgUFtV+RfwTlqx0lpyTjq8hLqUv8RGet6xLHE3igaopkklVVdJ0mMoIEbZvtxcafZm W0y9X+xfm/QxZBJO00zg3CqpHqmcDXYnq64sLXp82JxnI1g/GyxWQbaCx5WhVgrZrSzU 4kk8FAXkng7EY900PiErStiT3c0276ebEDsTKc2v7bZ492b1Ytd1ffOxhych9o5fFPIE MgcLaDbvL/UEbPqlnLY7fNuHnbo/2TYreG+ukQ8VfvwjCso0jTtrrA8LJ5rClNnVaXnk mhF9CWYDd07zr1f4sDW62kGxG89coAOBhWAZ89Sc/TEQGLzNfW32sbhtSD6XzYEi/fXS MUmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=YvxD+rf2mdUVojtnkmyEgNpC0+1PjyModbkIS7dl1GI=; b=CCtYHGvoqmdSlbZNBkN84NpYDY0bgwtiYyUWFeGTsDDTnWXUwbgeUMN4faiUtyCs4p d56JJQZz65okH5ON4IRKhBQHDcymISMHsT/AvXBfzUJg+PWa5Ih7p7dveNuqcDZU63el mkJ0iROefzCgy59JsRFdneDi38RUcSwNgXRkSI9tGON0MzPRu8ylfRP7s6bR1bhxtq8e xIKByaiOE7qYTPbcqlMerXHdK9fKnSQxgzSoQ6+yk7Sq4YMIK69WnGnJwmzNwZ/Kw6Qz 8ImOMIqoVA1ymi3MHXbTRN4JyGMYLng/fzDein/rfpIeNw7rhmLdEEx0Ja6XIZOOxkMJ c9ag== X-Gm-Message-State: APf1xPAAYUwHt16S/gsKIK3fkLCl+J/NoxdFatBlrYO1uDCXz62aNe7Q d55qSYsE3dfCal6y9dAZu3ns6zxysOqEfyr+QNE= X-Google-Smtp-Source: AH8x227cNovHWDOM2s7BojHLDEZy2IDqq842RyaTkdooZ17vcQOhXgfgF79/oYcpRa2WhxL3XlQ/PSbfi18Cx7zjMHg= X-Received: by 10.157.51.87 with SMTP id u23mr345414otd.26.1518511489717; Tue, 13 Feb 2018 00:44:49 -0800 (PST) Original-Received: by 10.74.211.74 with HTTP; Tue, 13 Feb 2018 00:44:29 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: iIvI5uGNxMHaWi3Mtbfivp41P48 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c0f::231 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:115964 Archived-At: On Tue, Feb 13, 2018 at 3:23 PM, Lajos Bodnar wro= te: > 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. Option 1: Bind intero-mode to an easy key, such as . Press it after opening each file. In term of keypresses, pressing is not much worse than pressing =E2=80=9Cy=E2=80=9D when you want to enable the mo= de, and not pressing is cheaper than pressing =E2=80=9Cn=E2=80=9D when you don=E2= =80=99t. Option 2: Enable intero-mode from the hook unconditionally and tolerate the expensiveness. Maybe bind a key to disable the mode. Option 3: Enable intero-mode dependent on a variable, let=E2=80=99s say, =E2=80=9Cmy-enable-intero-mode=E2=80=9D. Manage it as a file-local or direc= tory-local variable.