unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5294: 23.1; unload-feature disable minor-mode
@ 2010-01-02 21:09 Kevin Ryde
  2010-01-02 23:22 ` Juanma Barranquero
  0 siblings, 1 reply; 13+ messages in thread
From: Kevin Ryde @ 2010-01-02 21:09 UTC (permalink / raw)
  To: bug-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 748 bytes --]

As an idea for unload-feature, when unloading a buffer-local minor mode
it could helpfully find buffers where the mode is enabled and disable it
before unloading.

An example foo.el mode below.  Eval the code in try-foo.el and it leaves
the buffer boldened, where disabling the mode could have undone it.

Of course foo.el can do something like the commented-out
`foo-unload-function' itself, but I think almost all minor modes would
benefit from this and that `unload-feature' might therefore handle it.

Identifying a minor mode function would be as easy as looking in
`minor-mode-list' would it?  Otherwise I expect define-minor-mode could
chuck some code in `foo-unload-hook' - if it presumes the feature symbol
will match the load filename.



[-- Attachment #2: foo.el --]
[-- Type: application/emacs-lisp, Size: 528 bytes --]

[-- Attachment #3: try-foo.el --]
[-- Type: application/emacs-lisp, Size: 174 bytes --]

[-- Attachment #4: Type: text/plain, Size: 732 bytes --]



In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5)
 of 2009-09-14 on raven, modified by Debian
configured using `configure  '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''

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

end of thread, other threads:[~2022-02-13 10:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-02 21:09 bug#5294: 23.1; unload-feature disable minor-mode Kevin Ryde
2010-01-02 23:22 ` Juanma Barranquero
2010-01-02 23:58   ` Kevin Ryde
2010-01-03  0:24     ` Juanma Barranquero
2010-01-03  1:05       ` Kevin Ryde
2010-01-03  1:41         ` Juanma Barranquero
2010-01-03 23:04       ` Kevin Ryde
2010-01-03 23:12         ` Juanma Barranquero
2010-01-05 23:31           ` Kevin Ryde
2010-01-06  0:23             ` Juanma Barranquero
2010-01-06  1:01               ` Kevin Ryde
2010-01-06  1:09                 ` Juanma Barranquero
2022-02-13 10:06                   ` Lars Ingebrigtsen

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