unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* minor bug in next-error-follow-minor-mode?
@ 2005-08-15 16:24 Bruce Stephens
  2005-08-15 17:50 ` Dan Nicolaescu
  2005-08-16  2:25 ` minor bug in next-error-follow-minor-mode? Richard M. Stallman
  0 siblings, 2 replies; 7+ messages in thread
From: Bruce Stephens @ 2005-08-15 16:24 UTC (permalink / raw)


I was confused by the behaviour of next-error-follow-minor-mode in the
current emacs CVS.  I vaguely remembered that it was on by default,
and indeed found that C-c C-f switched it off (and another C-c C-f
switched it on).  However, now I look at the code, I think it's just a
minor bug, where ":init-value" ought to be ":lighter", in simple.el.
(" Fol" is presumably a valid non-nil value, but it looks suspiciously
like something meant for the modeline.)

(define-minor-mode next-error-follow-minor-mode
  "Minor mode for compilation, occur and diff modes.
When turned on, cursor motion in the compilation, grep, occur or diff
buffer causes automatic display of the corresponding source code
location."
  :group 'next-error :init-value " Fol"
  (if (not next-error-follow-minor-mode)
      (remove-hook 'post-command-hook 'next-error-follow-mode-post-command-hook t)
    (add-hook 'post-command-hook 'next-error-follow-mode-post-command-hook nil t)
    (make-local-variable 'next-error-follow-last-line)))

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

* Re: minor bug in next-error-follow-minor-mode?
  2005-08-15 16:24 minor bug in next-error-follow-minor-mode? Bruce Stephens
@ 2005-08-15 17:50 ` Dan Nicolaescu
  2005-08-15 18:17   ` diff-mode-hook (was Re: minor bug in next-error-follow-minor-mode?) Bruce Stephens
  2005-08-16  2:25 ` minor bug in next-error-follow-minor-mode? Richard M. Stallman
  1 sibling, 1 reply; 7+ messages in thread
From: Dan Nicolaescu @ 2005-08-15 17:50 UTC (permalink / raw)
  Cc: emacs-devel

Bruce Stephens <bruce@cenderis.demon.co.uk> writes:

  > I was confused by the behaviour of next-error-follow-minor-mode in the
  > current emacs CVS.  I vaguely remembered that it was on by default,

I don't think it was supposed to be on by default.

  > and indeed found that C-c C-f switched it off (and another C-c C-f
  > switched it on).  However, now I look at the code, I think it's just a
  > minor bug, where ":init-value" ought to be ":lighter", in simple.el.
  > (" Fol" is presumably a valid non-nil value, but it looks suspiciously
  > like something meant for the modeline.)

You are right, I fixed this.

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

* diff-mode-hook (was Re: minor bug in next-error-follow-minor-mode?)
  2005-08-15 17:50 ` Dan Nicolaescu
@ 2005-08-15 18:17   ` Bruce Stephens
  2005-08-15 18:32     ` Dan Nicolaescu
  2005-08-16  2:25     ` diff-mode-hook (was Re: minor bug in next-error-follow-minor-mode?) Richard M. Stallman
  0 siblings, 2 replies; 7+ messages in thread
From: Bruce Stephens @ 2005-08-15 18:17 UTC (permalink / raw)
  Cc: emacs-devel

Dan Nicolaescu <dann@ics.uci.edu> writes:

> Bruce Stephens <bruce@cenderis.demon.co.uk> writes:

[...]

>   > and indeed found that C-c C-f switched it off (and another C-c C-f
>   > switched it on).  However, now I look at the code, I think it's just a
>   > minor bug, where ":init-value" ought to be ":lighter", in simple.el.
>   > (" Fol" is presumably a valid non-nil value, but it looks suspiciously
>   > like something meant for the modeline.)
>
> You are right, I fixed this.

Yes, I just noticed.  Thanks for that.

While investigating that, I tried switching on
next-error-follow-minor-mode explicitly:

(add-hook 'diff-mode-hook (function () (next-error-follow-minor-mode t)))

But that failed, and then I tried a function that did (setq foo 42),
and that didn't seem to set foo.  

I suspect diff-mode doesn't call diff-mode-hook.  The documentation
for diff-mode doesn't say it does, but diff-mode-hook does suggest it
gets called.  So something seems wrong.

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

* Re: diff-mode-hook (was Re: minor bug in next-error-follow-minor-mode?)
  2005-08-15 18:17   ` diff-mode-hook (was Re: minor bug in next-error-follow-minor-mode?) Bruce Stephens
@ 2005-08-15 18:32     ` Dan Nicolaescu
  2005-08-15 19:51       ` diff-mode-hook Bruce Stephens
  2005-08-16  2:25     ` diff-mode-hook (was Re: minor bug in next-error-follow-minor-mode?) Richard M. Stallman
  1 sibling, 1 reply; 7+ messages in thread
From: Dan Nicolaescu @ 2005-08-15 18:32 UTC (permalink / raw)
  Cc: emacs-devel

Bruce Stephens <bruce@cenderis.demon.co.uk> writes:

  > Dan Nicolaescu <dann@ics.uci.edu> writes:
  > 
  > > Bruce Stephens <bruce@cenderis.demon.co.uk> writes:
  > 
  > [...]
  > 
  > >   > and indeed found that C-c C-f switched it off (and another C-c C-f
  > >   > switched it on).  However, now I look at the code, I think it's just a
  > >   > minor bug, where ":init-value" ought to be ":lighter", in simple.el.
  > >   > (" Fol" is presumably a valid non-nil value, but it looks suspiciously
  > >   > like something meant for the modeline.)
  > >
  > > You are right, I fixed this.
  > 
  > Yes, I just noticed.  Thanks for that.
  > 
  > While investigating that, I tried switching on
  > next-error-follow-minor-mode explicitly:
  > 
  > (add-hook 'diff-mode-hook (function () (next-error-follow-minor-mode t)))


(add-hook 'diff-mode-hook (lambda () (next-error-follow-minor-mode t)))
should work.

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

* Re: diff-mode-hook
  2005-08-15 18:32     ` Dan Nicolaescu
@ 2005-08-15 19:51       ` Bruce Stephens
  0 siblings, 0 replies; 7+ messages in thread
From: Bruce Stephens @ 2005-08-15 19:51 UTC (permalink / raw)
  Cc: emacs-devel

Dan Nicolaescu <dann@ics.uci.edu> writes:

> Bruce Stephens <bruce@cenderis.demon.co.uk> writes:

[...]

>   > (add-hook 'diff-mode-hook (function () (next-error-follow-minor-mode t)))
>
>
> (add-hook 'diff-mode-hook (lambda () (next-error-follow-minor-mode t)))
> should work.

So it does.  I was just confused.  (The documentation's clear about
what "function" does.)

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

* Re: minor bug in next-error-follow-minor-mode?
  2005-08-15 16:24 minor bug in next-error-follow-minor-mode? Bruce Stephens
  2005-08-15 17:50 ` Dan Nicolaescu
@ 2005-08-16  2:25 ` Richard M. Stallman
  1 sibling, 0 replies; 7+ messages in thread
From: Richard M. Stallman @ 2005-08-16  2:25 UTC (permalink / raw)
  Cc: emacs-devel

Thanks.

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

* Re: diff-mode-hook (was Re: minor bug in next-error-follow-minor-mode?)
  2005-08-15 18:17   ` diff-mode-hook (was Re: minor bug in next-error-follow-minor-mode?) Bruce Stephens
  2005-08-15 18:32     ` Dan Nicolaescu
@ 2005-08-16  2:25     ` Richard M. Stallman
  1 sibling, 0 replies; 7+ messages in thread
From: Richard M. Stallman @ 2005-08-16  2:25 UTC (permalink / raw)
  Cc: dann, emacs-devel

    But that failed, and then I tried a function that did (setq foo 42),
    and that didn't seem to set foo.  

    I suspect diff-mode doesn't call diff-mode-hook.

The disassembled code says that it does.  It uses run-mode-hooks.
Under some circumstances the running of those hooks can be delayed
till when a calling function exits, but that is supposed to occur
only if it is called from anothetr major mode.

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

end of thread, other threads:[~2005-08-16  2:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-15 16:24 minor bug in next-error-follow-minor-mode? Bruce Stephens
2005-08-15 17:50 ` Dan Nicolaescu
2005-08-15 18:17   ` diff-mode-hook (was Re: minor bug in next-error-follow-minor-mode?) Bruce Stephens
2005-08-15 18:32     ` Dan Nicolaescu
2005-08-15 19:51       ` diff-mode-hook Bruce Stephens
2005-08-16  2:25     ` diff-mode-hook (was Re: minor bug in next-error-follow-minor-mode?) Richard M. Stallman
2005-08-16  2:25 ` minor bug in next-error-follow-minor-mode? Richard M. Stallman

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