GNU bug report logs - #17009
Please add a hook to visual-line-mode

Previous Next

Package: emacs;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Fri, 14 Mar 2014 00:57:02 UTC

Severity: wishlist

Fixed in version 23.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17009 in the body.
You can then email your comments to 17009 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#17009; Package emacs. (Fri, 14 Mar 2014 00:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Reuben Thomas <rrt <at> sc3d.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 14 Mar 2014 00:57:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: bug-emacs <bug-emacs <at> gnu.org>
Subject: Please add a hook to visual-line-mode
Date: Fri, 14 Mar 2014 00:56:06 +0000
[Message part 1 (text/plain, inline)]
It would be nice to be able to activate window-margin-mode when
visual-line-mode is turned on:

https://github.com/aculich/window-margin.el

-- 
http://rrt.sc3d.org
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17009; Package emacs. (Fri, 14 Mar 2014 07:51:02 GMT) Full text and rfc822 format available.

Message #8 received at 17009 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 17009 <at> debbugs.gnu.org
Subject: Re: bug#17009: Please add a hook to visual-line-mode
Date: Fri, 14 Mar 2014 03:50:20 -0400
Modes defined with define-minor-mode have hooks.

C-h v visual-line-mode-hook

    visual-line-mode-hook is a variable defined in `simple.el'.
    Its value is (visual-line-mode-set-explicitly)

    This variable may be risky if used as a file-local variable.

    Documentation:
    Hook run after entering or leaving `visual-line-mode'.
    No problems result if this variable is not bound.
    `add-hook' automatically binds it.  (This is true for all hook
    variables.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17009; Package emacs. (Fri, 14 Mar 2014 12:18:02 GMT) Full text and rfc822 format available.

Message #11 received at 17009 <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 17009 <at> debbugs.gnu.org
Subject: Re: bug#17009: Please add a hook to visual-line-mode
Date: Fri, 14 Mar 2014 12:17:56 +0000
[Message part 1 (text/plain, inline)]
On 14 March 2014 07:50, Glenn Morris <rgm <at> gnu.org> wrote:

>
> Modes defined with define-minor-mode have hooks.
>
> C-h v visual-line-mode-hook
>
>     visual-line-mode-hook is a variable defined in `simple.el'.
>     Its value is (visual-line-mode-set-explicitly)
>
>     This variable may be risky if used as a file-local variable.
>
>     Documentation:
>     Hook run after entering or leaving `visual-line-mode'.
>     No problems result if this variable is not bound.
>     `add-hook' automatically binds it.  (This is true for all hook
>     variables.)
>

Great! Is this new in 24.4, because this doesn't work for me?

-- 
http://rrt.sc3d.org
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17009; Package emacs. (Fri, 14 Mar 2014 13:40:02 GMT) Full text and rfc822 format available.

Message #14 received at 17009 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: Glenn Morris <rgm <at> gnu.org>, 17009 <at> debbugs.gnu.org
Subject: Re: bug#17009: Please add a hook to visual-line-mode
Date: Fri, 14 Mar 2014 09:39:15 -0400
> Great! Is this new in 24.4, because this doesn't work for me?

No, it's been there from the very beginning.  What do you mean by
"doesn't work"?


        Stfean




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17009; Package emacs. (Fri, 14 Mar 2014 13:49:01 GMT) Full text and rfc822 format available.

Message #17 received at 17009 <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Glenn Morris <rgm <at> gnu.org>, 17009 <at> debbugs.gnu.org
Subject: Re: bug#17009: Please add a hook to visual-line-mode
Date: Fri, 14 Mar 2014 13:48:27 +0000
[Message part 1 (text/plain, inline)]
On 14 March 2014 13:39, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:

> > Great! Is this new in 24.4, because this doesn't work for me?
>
> No, it's been there from the very beginning.  What do you mean by
> "doesn't work"?
>

C-h v visual-line-mode-hook [No match]

So this is a hook that magically comes into existence if I assign to it:
having done so, C-h v now works.

This is all rather confusing; thanks for straightening me out.

-- 
http://rrt.sc3d.org
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17009; Package emacs. (Fri, 14 Mar 2014 14:29:01 GMT) Full text and rfc822 format available.

Message #20 received at 17009 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 17009 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#17009: Please add a hook to visual-line-mode
Date: Fri, 14 Mar 2014 16:28:30 +0200
Reuben Thomas <rrt <at> sc3d.org> writes:

> So this is a hook that magically comes into existence if I assign to it:
> having done so, C-h v now works.

That's true of all hooks: a hook variable doesn't have to be defined for
`add-hook' or `run-hooks' to work. Of course, the latter won't do
anything in that case.




bug marked as fixed in version 23.1, send any further explanations to 17009 <at> debbugs.gnu.org and Reuben Thomas <rrt <at> sc3d.org> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 14 Mar 2014 15:56:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17009; Package emacs. (Fri, 14 Mar 2014 16:50:02 GMT) Full text and rfc822 format available.

Message #25 received at 17009 <at> debbugs.gnu.org (full text, mbox):

From: Stefan <monnier <at> iro.umontreal.ca>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: Glenn Morris <rgm <at> gnu.org>, 17009 <at> debbugs.gnu.org
Subject: Re: bug#17009: Please add a hook to visual-line-mode
Date: Fri, 14 Mar 2014 12:49:11 -0400
> C-h v visual-line-mode-hook [No match]

Who cares?  Use it anyway: it will work.

Quoting the message Glenn send you earlier:

>     No problems result if this variable is not bound.
>     `add-hook' automatically binds it.  (This is true for all hook
>     variables.)


-- Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17009; Package emacs. (Fri, 14 Mar 2014 17:01:02 GMT) Full text and rfc822 format available.

Message #28 received at 17009 <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: Stefan <monnier <at> iro.umontreal.ca>
Cc: Glenn Morris <rgm <at> gnu.org>, 17009 <at> debbugs.gnu.org
Subject: Re: bug#17009: Please add a hook to visual-line-mode
Date: Fri, 14 Mar 2014 17:00:36 +0000
[Message part 1 (text/plain, inline)]
On 14 March 2014 16:49, Stefan <monnier <at> iro.umontreal.ca> wrote:

> > C-h v visual-line-mode-hook [No match]
>
> Who cares?  Use it anyway: it will work.
>

Even from a careful reading of the documentation, it's not obvious that the
variable not being bound means that its documentation will not be
available: it's reasonable to think that C-h v not working means that
something is wrong. Sure, it works, but discoverability is not great.

-- 
http://rrt.sc3d.org
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17009; Package emacs. (Fri, 14 Mar 2014 17:13:02 GMT) Full text and rfc822 format available.

Message #31 received at 17009 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 17009 <at> debbugs.gnu.org, Stefan <monnier <at> iro.umontreal.ca>
Subject: Re: bug#17009: Please add a hook to visual-line-mode
Date: Fri, 14 Mar 2014 13:12:51 -0400
Reuben Thomas wrote:

> Even from a careful reading of the documentation, it's not obvious that the
> variable not being bound means that its documentation will not be
> available: it's reasonable to think that C-h v not working means that
> something is wrong. Sure, it works, but discoverability is not great.

That's the part that will be different in 24.4.


2013-05-27  Stefan Monnier  <monnier <at> iro.umontreal.ca>

            * emacs-lisp/easy-mmode.el (define-minor-mode):
            * emacs-lisp/derived.el (define-derived-mode): Always defvar
            the mode hook and provide a docstring.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17009; Package emacs. (Wed, 26 Mar 2014 13:49:01 GMT) Full text and rfc822 format available.

Message #34 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kevin Rodgers <kevin.d.rodgers <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#17009: Please add a hook to visual-line-mode
Date: Wed, 26 Mar 2014 07:49:03 -0600
On 3/14/14 11:12 AM, Glenn Morris wrote:
> Reuben Thomas wrote:
>
>> Even from a careful reading of the documentation, it's not obvious that the
>> variable not being bound means that its documentation will not be
>> available: it's reasonable to think that C-h v not working means that
>> something is wrong. Sure, it works, but discoverability is not great.
>
> That's the part that will be different in 24.4.
>
>
> 2013-05-27  Stefan Monnier<monnier <at> iro.umontreal.ca>
>
>              * emacs-lisp/easy-mmode.el (define-minor-mode):
>              * emacs-lisp/derived.el (define-derived-mode): Always defvar
>              the mode hook and provide a docstring.

:-)

http://lists.gnu.org/archive/html/help-gnu-emacs/2008-03/msg00136.html

-- 
Kevin Rodgers
Denver, Colorado, USA





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17009; Package emacs. (Wed, 26 Mar 2014 14:22:02 GMT) Full text and rfc822 format available.

Message #37 received at 17009 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Kevin Rodgers <kevin.d.rodgers <at> gmail.com>
Cc: 17009 <at> debbugs.gnu.org
Subject: Re: bug#17009: Please add a hook to visual-line-mode
Date: Wed, 26 Mar 2014 10:21:26 -0400
> http://lists.gnu.org/archive/html/help-gnu-emacs/2008-03/msg00136.html

Oh, yes, I know, this is a very long standing issue, both with
define-derived-mode and define-minor-mode.


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 24 Apr 2014 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 62 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.