GNU bug report logs - #8416
easy-mmode.el -- enhance define-minor-mode to define turn-on-* and turn-off-* functions

Previous Next

Package: emacs;

Reported by: Jari Aalto <jari.aalto <at> cante.net>

Date: Sun, 3 Apr 2011 13:43:02 UTC

Severity: wishlist

Tags: wontfix

Found in version 23.2+1-7

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

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 8416 in the body.
You can then email your comments to 8416 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 owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8416; Package emacs. (Sun, 03 Apr 2011 13:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jari Aalto <jari.aalto <at> cante.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 03 Apr 2011 13:43:02 GMT) Full text and rfc822 format available.

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

From: Jari Aalto <jari.aalto <at> cante.net>
To: submit <at> debbugs.gnu.org
Subject: easy-mmode.el -- enhance define-minor-mode to define turn-on-* and
	turn-off-* functions
Date: Sun, 03 Apr 2011 16:42:03 +0300
Package: emacs
Version: 23.2+1-7
Severity: wishlist

It would be nice if the define-minor-mode would also define functions:

    turn-on-*
    turn-off-*

An example:

    ;; lisp/hl-line.el
    (define-minor-mode hl-line-mode ...)

That would make it possible to add to ~/.emacs:

    (add-hook 'nroff-mode-hook 'turn-on-hl-line-mode)

    ;; Or later:
    (remove-hook 'nroff-mode-hook 'turn-on-hl-line-mode)

This would be much more cleaner than what is needed now:

    (add-hook 'nroff-mode-hook '(lambda () (turn-on-hl-line-mode 1)))
    ...
    ;; the hook removal command is as messy


-- System Information
Debian Release: wheezy/sid
  APT Prefers testing
  APT policy: (990, testing) (500, unstable) (1, experimental)
Architecture: amd64
Kernel: Linux picasso 2.6.32-5-amd64 #1 SMP Wed Jan 12 03:40:32 UTC 2011 x86_64 GNU/Linux
Locale: LANG=en_DK.UTF-8

-- Versions of packages `emacs depends on'.
Depends:
emacs23         23.2+1-7        GNU Emacs is the extensible self-documenting
emacs23-lucid   23.2+1-7        GNU Emacs is the extensible self-documenting
emacs23-nox     23.2+1-7        GNU Emacs is the extensible self-documenting




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8416; Package emacs. (Sun, 03 Apr 2011 17:47:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Jari Aalto <jari.aalto <at> cante.net>
Cc: 8416 <at> debbugs.gnu.org
Subject: Re: bug#8416: easy-mmode.el -- enhance define-minor-mode to define
	turn-on-* and turn-off-* functions
Date: Sun, 03 Apr 2011 13:46:03 -0400
Jari Aalto wrote:

> It would be nice if the define-minor-mode would also define functions:
>
>     turn-on-*
>     turn-off-*

You've proposed this kind of thing before, and it has been rejected.

http://debbugs.gnu.org/cgi/bugreport.cgi?msg=9;bug=4288

  "...I don't like the turn-on-* and turn-off-* functions: we have
  already the *-mode functions which should be plenty."

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7709#8

  "There is no need for it (and neither is there a need for
  turn-on-eldoc-mode). There is M-x eldoc-mode."




Added tag(s) wontfix. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 04 Apr 2011 06:45:02 GMT) Full text and rfc822 format available.

Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Mon, 04 Apr 2011 14:33:01 GMT) Full text and rfc822 format available.

Notification sent to Jari Aalto <jari.aalto <at> cante.net>:
bug acknowledged by developer. (Mon, 04 Apr 2011 14:33:02 GMT) Full text and rfc822 format available.

Message #15 received at 8416-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jari Aalto <jari.aalto <at> cante.net>
Cc: 8416-done <at> debbugs.gnu.org
Subject: Re: bug#8416: easy-mmode.el -- enhance define-minor-mode to define
	turn-on-* and turn-off-* functions
Date: Mon, 04 Apr 2011 10:32:03 -0400
> It would be nice if the define-minor-mode would also define functions:

>     turn-on-*
>     turn-off-*

In Emacs-24, the `foo-mode' function of a minor mode *is* the
turn-on-foo-mode function (at least when called non-interactively
without an argument, e.g. on a normal hook).

> This would be much more cleaner than what is needed now:
>     (add-hook 'nroff-mode-hook '(lambda () (turn-on-hl-line-mode 1)))

As mentioned, the above is not needed any more:

  (add-hook 'nroff-mode-hook 'hl-line-mode)

will work just fine.

The turn-off-foo is rarely needed in my experience.


        Stefan




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

This bug report was last modified 14 years and 54 days ago.

Previous Next


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