From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#36886: 26.2; (global-eldoc-mode -1) should disable eldoc completely Date: Sun, 04 Aug 2019 10:51:08 +0300 Message-ID: <87ftmhs70z.fsf@tcd.ie> References: <87h8719nzl.fsf@example.com> <83imrggjmo.fsf@gnu.org> <8736ijap0e.fsf@example.com> <87d0hn23mm.fsf@tcd.ie> <83mugrg4kv.fsf@gnu.org> <87k1bvzovi.fsf@tcd.ie> <83ftmjfxq7.fsf@gnu.org> <87k1btsr78.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="257902"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 36886@debbugs.gnu.org, sanelz@gmail.com To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 04 09:52:11 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1huBJK-0014zx-R9 for geb-bug-gnu-emacs@m.gmane.org; Sun, 04 Aug 2019 09:52:10 +0200 Original-Received: from localhost ([::1]:43106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1huBJJ-00064e-Ba for geb-bug-gnu-emacs@m.gmane.org; Sun, 04 Aug 2019 03:52:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42246) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1huBJC-00063h-V4 for bug-gnu-emacs@gnu.org; Sun, 04 Aug 2019 03:52:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1huBJB-0004Fj-SU for bug-gnu-emacs@gnu.org; Sun, 04 Aug 2019 03:52:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51556) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1huBJB-0004Fd-PQ for bug-gnu-emacs@gnu.org; Sun, 04 Aug 2019 03:52:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1huBJB-0002c4-Kk for bug-gnu-emacs@gnu.org; Sun, 04 Aug 2019 03:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Aug 2019 07:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36886 X-GNU-PR-Package: emacs Original-Received: via spool by 36886-submit@debbugs.gnu.org id=B36886.15649050799992 (code B ref 36886); Sun, 04 Aug 2019 07:52:01 +0000 Original-Received: (at 36886) by debbugs.gnu.org; 4 Aug 2019 07:51:19 +0000 Original-Received: from localhost ([127.0.0.1]:60377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1huBIU-0002b6-QU for submit@debbugs.gnu.org; Sun, 04 Aug 2019 03:51:19 -0400 Original-Received: from mail-wm1-f49.google.com ([209.85.128.49]:39219) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1huBIT-0002au-4D for 36886@debbugs.gnu.org; Sun, 04 Aug 2019 03:51:17 -0400 Original-Received: by mail-wm1-f49.google.com with SMTP id u25so59867784wmc.4 for <36886@debbugs.gnu.org>; Sun, 04 Aug 2019 00:51:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=zRXMUXtqOD17HkXAurthiy87YI6oR/BBEomQxZXoSHc=; b=BsMCfJSLNf8kZqBjCBTsskxoCTIu8iLwK1gLWYSn5mDLK+TxX4tFck71fYSTIqP7DX 0Ms4Kx+ox+x03sCtJaZ0FOHVL/+dpR2ZPDICHl2jc7ai3VmGecyXYyKtXPiqYbP94w0+ TA/akGCrysOwA8XurXN2vWqVMvwYG9RRww/GbziLv66Kzl1yorLeIXW6mASHP8c6Vdia DbISw6JMUkaNv7T+AoCMK0fyqqiVqXp/x9NdIMe1Oo26W5I/VSpjw8ls7ANF8mN3JChQ Kxm9WfAaOM1YL+y0mprFjKrDfiPRaOt9muSimpjDcDuNbVEOJOEkqTdGVVhRHO4ZLyxB JR1w== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=zRXMUXtqOD17HkXAurthiy87YI6oR/BBEomQxZXoSHc=; b=rNEstOeafnIhFNv+xk+SZ941w9j3uBvM5D7+pE2uetulIvG56bzmx1kybcNyPJEI3Y WoQqqsa9Nc1ikQhveLkusYV09X9QAqcdh5fVeCl+bnxJHhJ4nPZiHsW5Tcgr/5ro0YCK 37GqlP5JYEX0E0sBp7aTmSiaIpVlS8NjvC2hku7yXBZF10z+20Vy4AkyEKXu8xAd70ct TG3z4zla9UZs7mu8R3a3AMr3OURVQxeNec6nOI4EBTql3gY/gj9eEdMSAHm9EI2VEwl3 JuuXPfGUUPk822TJ4MsXUPVwf5fyE+63E2qG8m1GNKWebxdQOQpkS7CfKQcn1ryFomDo BifQ== X-Gm-Message-State: APjAAAWWP7xGHQMin8Eyizq22Uniow/2Ux7YFa2AV+y3/61czEhlaa9/ Dtvf6KuDQWAEMcJ9Rbu+wXQ4MA== X-Google-Smtp-Source: APXvYqxf/XiHMJ1AqG7jjnTuSCzGkhduQku3PudoGPvKDKwxr8iGopiCLnntyhliKOqwRFlbn4THyg== X-Received: by 2002:a1c:345:: with SMTP id 66mr12997997wmd.8.1564905071122; Sun, 04 Aug 2019 00:51:11 -0700 (PDT) Original-Received: from localhost (adsl-107.91.140.91.tellas.gr. [91.140.91.107]) by smtp.gmail.com with ESMTPSA id o26sm167864291wro.53.2019.08.04.00.51.10 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 00:51:10 -0700 (PDT) In-Reply-To: <87k1btsr78.fsf@gmail.com> (Noam Postavsky's message of "Sat, 03 Aug 2019 20:35:23 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:164532 Archived-At: Noam Postavsky writes: > Eli Zaretskii writes: > >> I actually don't understand why, when the globalized mode is ON, it >> doesn't work in the minibuffer. What am I missing? > > define-globalized-minor-mode only adds after-change-major-mode-hook, > find-file-hook, and change-major-mode-hook. AFAICT, the minibuffer > stays in fundamental-mode, and doesn't visit a file so none of those are > triggered. The call to read-from-minibuffer in read--expression triggers change-major-mode-hook and after-change-major-mode-hook. These in turn call turn-on-eldoc-mode, which calls eldoc--supported-p, which checks the value of eldoc-documentation-function. The problem is that minibuffer-setup-hook, which sets eldoc-documentation-function, has not yet run at this stage, so the minibuffer is not yet considered suitable for enabling eldoc-mode. > Possible patch attached (some additional manual updates + > NEWS would be needed for define-globalized-minor-mode change). > > From d16b9c5dffb84c53bc6f55c4ca74fc8135d48d7f Mon Sep 17 00:00:00 2001 > From: Noam Postavsky > Date: Sat, 3 Aug 2019 20:19:31 -0400 > Subject: [PATCH] Respect global-eldoc-mode in minibuffers (Bug#36886) > > * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Accept > a BODY parameter. > * lisp/emacs-lisp/eldoc.el (global-eldoc-mode): Add or remove > eldoc-mode to eval-expression-minibuffer-setup-hook when enabling or > disabling global-eldoc-mode. > * lisp/simple.el (read--expression): Remove the no-longer-needed > unconditional call to eldoc-mode. Should this log entry mention bug#27202 as well? [...] > diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el > index 16b5863209..e5f1832de6 100644 > --- a/lisp/emacs-lisp/eldoc.el > +++ b/lisp/emacs-lisp/eldoc.el > @@ -207,7 +207,10 @@ eldoc-mode > (define-globalized-minor-mode global-eldoc-mode eldoc-mode turn-on-eldoc-mode > :group 'eldoc > :initialize 'custom-initialize-delay > - :init-value t) > + :init-value t > + (if global-eldoc-mode > + (add-hook 'eval-expression-minibuffer-setup-hook #'eldoc-mode) > + (remove-hook 'eval-expression-minibuffer-setup-hook #'eldoc-mode))) This looks fine to me (the only alternative I can think of is creating a new major mode specifically for read--expression), but shouldn't this call to eldoc-mode be bundled in the same hook function with... > ;;;###autoload > (defun turn-on-eldoc-mode () > diff --git a/lisp/simple.el b/lisp/simple.el > index e33709e8ad..f81400c073 100644 > --- a/lisp/simple.el > +++ b/lisp/simple.el > @@ -1583,7 +1583,6 @@ read--expression > ;; FIXME: call emacs-lisp-mode? > (add-function :before-until (local 'eldoc-documentation-function) > #'elisp-eldoc-documentation-function) ...this advice? > - (eldoc-mode 1) > (add-hook 'completion-at-point-functions > #'elisp-completion-at-point nil t) > (run-hooks 'eval-expression-minibuffer-setup-hook)) Thanks, -- Basil