From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jonathan Kyle Mitchell Newsgroups: gmane.emacs.help Subject: Re: Can I turn off ivy-mode in comint buffers? Date: Sun, 01 Jul 2018 02:37:52 -0500 Message-ID: <87a7rb5ru7.fsf@jonathanmitchell.org> References: <24796.1530381157@rds059.goodyear.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1530432303 10964 195.159.176.226 (1 Jul 2018 08:05:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 1 Jul 2018 08:05:03 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 01 10:04:59 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 1fZXLu-0002jx-KP for geh-help-gnu-emacs@m.gmane.org; Sun, 01 Jul 2018 10:04:58 +0200 Original-Received: from localhost ([::1]:49169 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZXO1-0005Tx-M8 for geh-help-gnu-emacs@m.gmane.org; Sun, 01 Jul 2018 04:07:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZWvn-0005mH-LE for help-gnu-emacs@gnu.org; Sun, 01 Jul 2018 03:38:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZWvk-0006l0-Iw for help-gnu-emacs@gnu.org; Sun, 01 Jul 2018 03:37:59 -0400 Original-Received: from mail-ot0-f172.google.com ([74.125.82.172]:38899) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZWvk-0006ke-DX for help-gnu-emacs@gnu.org; Sun, 01 Jul 2018 03:37:56 -0400 Original-Received: by mail-ot0-f172.google.com with SMTP id w22-v6so14260947otk.5 for ; Sun, 01 Jul 2018 00:37:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=/BfA/YzOZYS2Vma3S1X7PS0veI0RDBrWcbNUY//nXOM=; b=tvtOuOFdgP17KoXuqtuAUYFeO3mqDwDqpqsrTkiyKeOIBpOYxKSkC9bTVsM2z7yxYd qgDtZ+r/o/kZnlBfvEDVlWmLy3HemZTXOX1e7sH4z97386MLT7fp539ixAuoOYtpZe27 ABtMv+lIchu/aUrEws/OPZH+kUd7BC9KGlsbhH2tFLwCSkt9bQl1+uAOp3s8+gcxwY95 fWV5bKOYiVQ2BLRku+2R471SBUFIHWG4uMT5fF2QZDmFyT1QbXZqcnmAE8viD9js7Z1/ gUMEBgCWod0BJLglYR3MfKta5SYuHJESzun/QCojQjGX8KGVCVxUUAtiDHj5TKp4GWw3 ToQQ== X-Gm-Message-State: APt69E3eXSXPxqL4GA3QBGC5/KTxR9j+6BnyZdiKgFZQDxdi3QMH6XVe 8rXUVqTZBzhH7K6rfem0wXq13ySs//4= X-Google-Smtp-Source: AAOMgpcjNCJ/9kUFz9oBg6Nxm5HRLS9yjMUNznR30DfxmdhIShuAO7kfuwMb0Zxafmd4OF4fUKjv1g== X-Received: by 2002:a9d:14b8:: with SMTP id d53-v6mr12822925ote.41.1530430675001; Sun, 01 Jul 2018 00:37:55 -0700 (PDT) Original-Received: from fedorabox ([2601:2c3:8880:3cc9::66b]) by smtp.gmail.com with ESMTPSA id k133-v6sm6463787oia.36.2018.07.01.00.37.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 01 Jul 2018 00:37:54 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sun, 01 Jul 2018 00:22:22 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.172 X-Mailman-Approved-At: Sun, 01 Jul 2018 04:06:36 -0400 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:117314 Archived-At: Stefan Monnier writes: >> (if (derived-mode-p 'comint-mode) >> (ivy-mode -1) >> (ivy-mode 1))) > > AKA > > (ivy-mode (if (derived-mode-p 'comint-mode) -1 1)) > >> (add-hook 'post-command-hook 'disable-ivy-in-comint-only) > > Hmm... really? > You want to (re)enable/disable ivy-mode after every command? > > > Stefan Yeah, the command hooks are a blunt instrument. I was able to get M-x shell working with buffer-list-update-hook instead, but I had to add a second hook to make sure it's disabled on the first buffer switch. (ivy-mode 1) ;; Turn off ivy on first entry into a new comint-mode buffer. (add-hook 'comint-mode-hook (lambda () (ivy-mode -1))) ;; Toggle ivy after every buffer switch, avoiding the minibuffer. (add-hook 'buffer-list-update-hook (lambda () (unless (eq major-mode 'minibuffer-inactive-mode) (ivy-mode (if (derived-mode-p 'comint-mode) -1 1))))) How's that? -- Jonathan Kyle Mitchell