unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Kevin Ryde <user42@zip.com.au>
Cc: 5294@debbugs.gnu.org
Subject: bug#5294: 23.1; unload-feature disable minor-mode
Date: Wed, 6 Jan 2010 01:23:41 +0100	[thread overview]
Message-ID: <f7ccd24b1001051623g4b4a2d20g5b00de7f29df6183@mail.gmail.com> (raw)
In-Reply-To: <87iqbgt9h4.fsf@blah.blah>

On Wed, Jan 6, 2010 at 00:31, Kevin Ryde <user42@zip.com.au> wrote:

> To, umm, get slightly back on-topic -- as an alternative for unloading
> minor modes, if the mode is currently enabled in a buffer, or enabled
> globally for a global, then unload-feature might refuse to unload
> (except under FORCE) on that basis that in-use is a kind of dependency
> on the feature's code etc.  The same might be applied to major modes,
> ie. refuse to unload if in use.

That would be too restrictive; there are instances in which just
deactivating the mode(s) and unloading the package is just what the
user expects. Also, FORCE already has a defined meaning: to bypass
checks for package dependencies, not safety checks for all kinds of
things a package may set up.

> Some generality could be had if there was a way that define-minor-mode
> might tie-in a test that unload-feature would reach when considering
> whether to unload.

How is passing that test (presumibly, either a form or a predicate
function) to define-minor-mode better than putting it into
FEATURE-unload-function?

> define-minor-mode might like to run some code on the
> actual unload too, to reverse some of `add-minor-mode', like removing
> from minor-mode-list (unless perhaps autoloaded minor mode funcs could
> stay there happily enough).

Which can be done from FEATURE-unload-function.

At first you talked about add-ons which would want to piggyback into
the unloading of a package, and I don't think that's a good idea, but
if a package author is really interested on it, it is doable with
advices, etc. But your examples in this message are all things that
can already be done on FEATURE-unload-function, for those packages
that really need it.

If you consider that going through the full buffer list, checking for
the mode and disabling it is too cumbersome, perhaps you can write a
helper function that could be called from the unload function...

    Juanma






  reply	other threads:[~2010-01-06  0:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2010-01-06  1:01               ` Kevin Ryde
2010-01-06  1:09                 ` Juanma Barranquero
2022-02-13 10:06                   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7ccd24b1001051623g4b4a2d20g5b00de7f29df6183@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=5294@debbugs.gnu.org \
    --cc=user42@zip.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).