unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Eldoc mode in eval-minibuffer
@ 2014-01-20 16:02 Eli Zaretskii
  2014-01-20 17:48 ` Thierry Volpiatto
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Eli Zaretskii @ 2014-01-20 16:02 UTC (permalink / raw)
  To: emacs-devel

About a week ago Emacs on trunk started turning on eldoc-mode whenever
you type M-:, with the effect that a large portion of the mode line
gets overwritten "displaced" by information about the forms you type
into the minibuffer.

Besides the usual gripes about such prominent changes in behavior
being made during feature freeze, I have the following complaints:

 . This change doesn't seem to be mentioned in NEWS.  The closest
   thing is this laconic note:

    ** Eldoc Mode works properly in the minibuffer.

   Good luck understanding from this that it is now turned on in the
   minibuffer _by_default_.  It took me several minutes to figure out
   who or what did this to my mode line.  Showing this to Emacs users,
   let alone newbies, is an excellent candidate for an exam whose
   purpose is to detect heirs to Stefan as head maintainer.

 . Since it is not in NEWS, chances are it will never get mentioned in
   the manual, which is bad for default behavior.

 . There doesn't seem to be any way of turning this feature off,
   except by setting eldoc-idle-delay to some ridiculously high value.
   Consequently, 'customize-changed-options' will not say a word about
   this new feature.  That's not Emacs'y.

 . Why does it make sense to show this information when you eval in
   the minibuffer, but not when you eval in *scratch* or in IELM?  The
   latter two sound like much better candidates for this feature.

 . I don't think turning this on by default in eval-minibuffer was
   ever seriously discussed.  The ChangeLog entry refers to an obscure
   bug report, but the discussions of that bug (which I have read at
   the time, as I do with all bugs) never explicitly said anything
   about the effect I see.  Makes me think that perhaps all this is
   some mistake or unintentional consequence.

Apologies if I'm missing something obvious.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Eldoc mode in eval-minibuffer
  2014-01-20 16:02 Eldoc mode in eval-minibuffer Eli Zaretskii
@ 2014-01-20 17:48 ` Thierry Volpiatto
  2014-01-21  1:23   ` Leo Liu
  2014-01-21 13:35   ` Stefan Monnier
  2014-01-20 17:59 ` Stefan Monnier
  2014-01-21  1:32 ` Leo Liu
  2 siblings, 2 replies; 16+ messages in thread
From: Thierry Volpiatto @ 2014-01-20 17:48 UTC (permalink / raw)
  To: emacs-devel

BTW This default eldoc in minibuffer is not working properly,
type e.g "(defun"
The defun eldoc string is displayed, ok.
Type <backspace> <backspace>
you have now "(def"
in minibuffer but the eldoc string of defun is still present in
minibuffer, you should have now the default mode-line.
This bug is fixed in eldoc-eval.el.

And yes this default eldoc in minibuffer is difficult to enable/disable.
IMO you should have a mode instead to turn this on or off.

See https://github.com/thierryvolpiatto/eldoc-eval

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Eldoc mode in eval-minibuffer
  2014-01-20 16:02 Eldoc mode in eval-minibuffer Eli Zaretskii
  2014-01-20 17:48 ` Thierry Volpiatto
@ 2014-01-20 17:59 ` Stefan Monnier
  2014-01-20 19:25   ` Eli Zaretskii
  2014-01-21  1:32 ` Leo Liu
  2 siblings, 1 reply; 16+ messages in thread
From: Stefan Monnier @ 2014-01-20 17:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Leo Liu, emacs-devel

> Besides the usual gripes about such prominent changes in behavior
> being made during feature freeze,

I don't know of such a change.  AFAIK the change to eldoc installed
recently was about changing the implementation of
eldoc-post-insert-mode, to make it more like the normal eldoc mode.
I.e. a change in implementation more than in behavior.

>  . Since it is not in NEWS, chances are it will never get mentioned in
>    the manual, which is bad for default behavior.

IIUC this change in behavior was not intended.

Leo, can you take a look to see what's going on?

>  . Why does it make sense to show this information when you eval in
>    the minibuffer, but not when you eval in *scratch* or in IELM?

It doesn't.

>    The latter two sound like much better candidates for this feature.

Indeed, I'd like to enable eldoc-mode by default wherever it's
supported, but that's for after 24.4.

>  . I don't think turning this on by default in eval-minibuffer was
>    ever seriously discussed.  The ChangeLog entry refers to an obscure
>    bug report, but the discussions of that bug (which I have read at
>    the time, as I do with all bugs) never explicitly said anything
>    about the effect I see.  Makes me think that perhaps all this is
>    some mistake or unintentional consequence.

The discussions were about making eldoc work in the minibuffer, not
about enabling it, AFAIK.


        Stefan



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Eldoc mode in eval-minibuffer
  2014-01-20 17:59 ` Stefan Monnier
@ 2014-01-20 19:25   ` Eli Zaretskii
  2014-01-20 19:47     ` Glenn Morris
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2014-01-20 19:25 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: sdl.web, emacs-devel

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Leo Liu <sdl.web@gmail.com>, emacs-devel@gnu.org
> Date: Mon, 20 Jan 2014 12:59:26 -0500
> 
> > Besides the usual gripes about such prominent changes in behavior
> > being made during feature freeze,
> 
> I don't know of such a change.  AFAIK the change to eldoc installed
> recently was about changing the implementation of
> eldoc-post-insert-mode, to make it more like the normal eldoc mode.
> I.e. a change in implementation more than in behavior.
> 
> >  . Since it is not in NEWS, chances are it will never get mentioned in
> >    the manual, which is bad for default behavior.
> 
> IIUC this change in behavior was not intended.
> 
> Leo, can you take a look to see what's going on?

This part of r115987 does it:

=== modified file 'lisp/simple.el'
--- lisp/simple.el	2014-01-09 01:59:19 +0000
+++ lisp/simple.el	2014-01-12 04:00:03 +0000
@@ -1387,6 +1387,7 @@ display the result of expression evaluat
         (lambda ()
           (add-hook 'completion-at-point-functions
                     #'lisp-completion-at-point nil t)
+	  (eldoc-mode 1)
           (run-hooks 'eval-expression-minibuffer-setup-hook))
       (read-from-minibuffer prompt initial-contents
                             read-expression-map t




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Eldoc mode in eval-minibuffer
  2014-01-20 19:25   ` Eli Zaretskii
@ 2014-01-20 19:47     ` Glenn Morris
  0 siblings, 0 replies; 16+ messages in thread
From: Glenn Morris @ 2014-01-20 19:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel, Stefan Monnier, sdl.web

Eli Zaretskii wrote:

> This part of r115987 does it:

That doesn't even have a ChangeLog entry.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Eldoc mode in eval-minibuffer
  2014-01-20 17:48 ` Thierry Volpiatto
@ 2014-01-21  1:23   ` Leo Liu
  2014-01-21  1:42     ` Leo Liu
  2014-01-21 13:35   ` Stefan Monnier
  1 sibling, 1 reply; 16+ messages in thread
From: Leo Liu @ 2014-01-21  1:23 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: emacs-devel

On 2014-01-21 01:48 +0800, Thierry Volpiatto wrote:
> BTW This default eldoc in minibuffer is not working properly,
> type e.g "(defun"
> The defun eldoc string is displayed, ok.
> Type <backspace> <backspace>
> you have now "(def"
> in minibuffer but the eldoc string of defun is still present in
> minibuffer, you should have now the default mode-line.
> This bug is fixed in eldoc-eval.el.
>
> And yes this default eldoc in minibuffer is difficult to enable/disable.
> IMO you should have a mode instead to turn this on or off.
>
> See https://github.com/thierryvolpiatto/eldoc-eval

I am not sure what you mean. eldoc should work fine in eval-expression
or more generally in the minibuffer for example I am using it with
erlang eval every day in the past month. If not we should fix it.

Some time ago you posted eldoc-eval and Stefan requested to merge it
with eldoc. None happened. So I picked it up and added this to eldoc.el.
The intention is to make eldoc-eval obsolete.

Leo



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Eldoc mode in eval-minibuffer
  2014-01-20 16:02 Eldoc mode in eval-minibuffer Eli Zaretskii
  2014-01-20 17:48 ` Thierry Volpiatto
  2014-01-20 17:59 ` Stefan Monnier
@ 2014-01-21  1:32 ` Leo Liu
  2014-01-21  2:05   ` Stefan Monnier
  2014-01-21  3:45   ` Eli Zaretskii
  2 siblings, 2 replies; 16+ messages in thread
From: Leo Liu @ 2014-01-21  1:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On 2014-01-21 00:02 +0800, Eli Zaretskii wrote:
> About a week ago Emacs on trunk started turning on eldoc-mode whenever
> you type M-:, with the effect that a large portion of the mode line
> gets overwritten "displaced" by information about the forms you type
> into the minibuffer.

Adding this feature was on a request from Stefan to merge eldoc-eval
with eldoc.el. So eldoc was made to work in the minibuffer and
eval-expression to show arglist info.

But previously it was enabled only after loading eldoc.el via add-hook
to eval-expression-minibuffer-setup-hook.

But then someone added a FIXME on that add-hook.

While discarding the eldoc-post-insert-mode I thought I get rid of that
FIXME as well. Who would know someone would complain? ;)

I will remove it shortly so you can have your peace of mind back.

Cheers,
Leo



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Eldoc mode in eval-minibuffer
  2014-01-21  1:23   ` Leo Liu
@ 2014-01-21  1:42     ` Leo Liu
  2014-01-21  9:52       ` Thierry Volpiatto
  0 siblings, 1 reply; 16+ messages in thread
From: Leo Liu @ 2014-01-21  1:42 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: emacs-devel

On 2014-01-21 09:23 +0800, Leo Liu wrote:
> I am not sure what you mean. eldoc should work fine in eval-expression
> or more generally in the minibuffer for example I am using it with
> erlang eval every day in the past month. If not we should fix it.

I see your comments was based on the eldoc-post-insert-mode yes it
updates only after insertion as the name suggests; but the problem you
mentioned was real. We later changed it to use a heuristic approach by
setting eldoc-message-commands. We could do better to detect real
editing change if allowed to use after-change-functions.

HTH,
Leo



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Eldoc mode in eval-minibuffer
  2014-01-21  1:32 ` Leo Liu
@ 2014-01-21  2:05   ` Stefan Monnier
  2014-01-21  2:24     ` Leo Liu
  2014-01-21  3:45   ` Eli Zaretskii
  1 sibling, 1 reply; 16+ messages in thread
From: Stefan Monnier @ 2014-01-21  2:05 UTC (permalink / raw)
  To: Leo Liu; +Cc: Eli Zaretskii, emacs-devel

> But previously it was enabled only after loading eldoc.el via add-hook
> to eval-expression-minibuffer-setup-hook.
> But then someone added a FIXME on that add-hook.

Ah, that rings a bell, I was that someone.

> While discarding the eldoc-post-insert-mode I thought I get rid of that
> FIXME as well. Who would know someone would complain? ;)

I think the way to get rid of that FIXME is to remove the `add-hook'
but without replacing it with a mandatory call to eldoc-mode in
read--expression.

As for how to best enable eldoc-mode in the minibuffer, it's a good
question.  If the user enables (a hypothetical) global-eldoc-mode, then
read--expression could check global-eldoc-mode to decide whether to
enable eldoc-mode.


        Stefan



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Eldoc mode in eval-minibuffer
  2014-01-21  2:05   ` Stefan Monnier
@ 2014-01-21  2:24     ` Leo Liu
  2014-01-22 10:28       ` Darren Hoo
  0 siblings, 1 reply; 16+ messages in thread
From: Leo Liu @ 2014-01-21  2:24 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Eli Zaretskii, emacs-devel

On 2014-01-21 10:05 +0800, Stefan Monnier wrote:
> I think the way to get rid of that FIXME is to remove the `add-hook'
> but without replacing it with a mandatory call to eldoc-mode in
> read--expression.

Yes, I think we eventually come back to this.

> As for how to best enable eldoc-mode in the minibuffer, it's a good
> question.  If the user enables (a hypothetical) global-eldoc-mode, then
> read--expression could check global-eldoc-mode to decide whether to
> enable eldoc-mode.

I don't mind how it is enabled post-24.4 ;)

Leo



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Eldoc mode in eval-minibuffer
  2014-01-21  1:32 ` Leo Liu
  2014-01-21  2:05   ` Stefan Monnier
@ 2014-01-21  3:45   ` Eli Zaretskii
  1 sibling, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2014-01-21  3:45 UTC (permalink / raw)
  To: Leo Liu; +Cc: emacs-devel

> From:  Leo Liu <sdl.web@gmail.com>
> Cc: emacs-devel@gnu.org
> Date: Tue, 21 Jan 2014 09:32:01 +0800
> 
> While discarding the eldoc-post-insert-mode I thought I get rid of that
> FIXME as well. Who would know someone would complain? ;)

I didn't complain about the feature.  I complained about its
supporting documentation and the lack of possibility to turn it off.

> I will remove it shortly so you can have your peace of mind back.

I didn't ask to remove it.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Eldoc mode in eval-minibuffer
  2014-01-21  1:42     ` Leo Liu
@ 2014-01-21  9:52       ` Thierry Volpiatto
  2014-01-21 13:41         ` Stefan Monnier
  0 siblings, 1 reply; 16+ messages in thread
From: Thierry Volpiatto @ 2014-01-21  9:52 UTC (permalink / raw)
  To: emacs-devel

Another issue is not showing description of variables.
eldoc-eval.el handle this.
Also long descriptions are also not shown because they are out of
screen.
eldoc-eval.el handle this too.

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Eldoc mode in eval-minibuffer
  2014-01-20 17:48 ` Thierry Volpiatto
  2014-01-21  1:23   ` Leo Liu
@ 2014-01-21 13:35   ` Stefan Monnier
  1 sibling, 0 replies; 16+ messages in thread
From: Stefan Monnier @ 2014-01-21 13:35 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: emacs-devel

> Type <backspace> <backspace>
> you have now "(def"
> in minibuffer but the eldoc string of defun is still present in
> minibuffer, you should have now the default mode-line.

Indeed, thanks.  Should be fixed in trunk now,


        Stefan



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Eldoc mode in eval-minibuffer
  2014-01-21  9:52       ` Thierry Volpiatto
@ 2014-01-21 13:41         ` Stefan Monnier
  0 siblings, 0 replies; 16+ messages in thread
From: Stefan Monnier @ 2014-01-21 13:41 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: emacs-devel

> eldoc-eval.el handle this too.

Patches to integrate these aspects into eldoc.el would be most welcome,


        Stefan



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Eldoc mode in eval-minibuffer
  2014-01-21  2:24     ` Leo Liu
@ 2014-01-22 10:28       ` Darren Hoo
  2014-01-22 13:41         ` Stefan Monnier
  0 siblings, 1 reply; 16+ messages in thread
From: Darren Hoo @ 2014-01-22 10:28 UTC (permalink / raw)
  To: emacs-devel

Leo Liu <sdl.web@gmail.com> writes:

> On 2014-01-21 10:05 +0800, Stefan Monnier wrote:
>> I think the way to get rid of that FIXME is to remove the `add-hook'
>> but without replacing it with a mandatory call to eldoc-mode in
>> read--expression.
>
> Yes, I think we eventually come back to this.
>
>> As for how to best enable eldoc-mode in the minibuffer, it's a good
>> question.  If the user enables (a hypothetical) global-eldoc-mode, then
>> read--expression could check global-eldoc-mode to decide whether to
>> enable eldoc-mode.
>
> I don't mind how it is enabled post-24.4 ;)
>

I like this feature very much. It's a pity it won't go into 24.4

BTW, if we define this global-eldoc-mode as simple as lines follow
that turns on eldoc mode on all buffers (including the minibuffer) 
if enabled, then this feature is brought back without even changes
to read--expression on the trunk now.

  ;;;###autoload
  (define-globalized-minor-mode global-eldoc-mode
    eldoc-mode eldoc-mode
    :initialize 'custom-initialize-delay
    :init-value (not noninteractive)
    :group 'eldoc
    :version "24.4")





^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Eldoc mode in eval-minibuffer
  2014-01-22 10:28       ` Darren Hoo
@ 2014-01-22 13:41         ` Stefan Monnier
  0 siblings, 0 replies; 16+ messages in thread
From: Stefan Monnier @ 2014-01-22 13:41 UTC (permalink / raw)
  To: Darren Hoo; +Cc: emacs-devel

> I like this feature very much. It's a pity it won't go into 24.4

Yes, but such is life.  And as long as we're here, there'll be other
releases, so it's not the end of the world.

> BTW, if we define this global-eldoc-mode as simple as lines follow
> that turns on eldoc mode on all buffers (including the minibuffer)
> if enabled, then this feature is brought back without even changes
> to read--expression on the trunk now.

Feel free to add it as soon as we re-open the trunk for changes.


        Stefan



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-01-22 13:41 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-20 16:02 Eldoc mode in eval-minibuffer Eli Zaretskii
2014-01-20 17:48 ` Thierry Volpiatto
2014-01-21  1:23   ` Leo Liu
2014-01-21  1:42     ` Leo Liu
2014-01-21  9:52       ` Thierry Volpiatto
2014-01-21 13:41         ` Stefan Monnier
2014-01-21 13:35   ` Stefan Monnier
2014-01-20 17:59 ` Stefan Monnier
2014-01-20 19:25   ` Eli Zaretskii
2014-01-20 19:47     ` Glenn Morris
2014-01-21  1:32 ` Leo Liu
2014-01-21  2:05   ` Stefan Monnier
2014-01-21  2:24     ` Leo Liu
2014-01-22 10:28       ` Darren Hoo
2014-01-22 13:41         ` Stefan Monnier
2014-01-21  3:45   ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).