From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 02 16:09:25 2010 Received: (at submit) by debbugs.gnu.org; 2 Jan 2010 21:09:25 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NRBDw-0007mw-SZ for submit@debbugs.gnu.org; Sat, 02 Jan 2010 16:09:25 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NRBDu-0007mq-Ps for submit@debbugs.gnu.org; Sat, 02 Jan 2010 16:09:23 -0500 Received: from mail.gnu.org ([199.232.76.166]:33328 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NRBDq-0000vG-Nw for submit@debbugs.gnu.org; Sat, 02 Jan 2010 16:09:18 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NRBDp-0002aj-68 for submit@debbugs.gnu.org; Sat, 02 Jan 2010 16:09:18 -0500 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on monty-python X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO,UNPARSEABLE_RELAY autolearn=ham version=3.1.0 Received: from lists.gnu.org ([199.232.76.165]:53125) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NRBDo-0002ab-Sd for submit@debbugs.gnu.org; Sat, 02 Jan 2010 16:09:16 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NRBDo-0001C0-MS for bug-gnu-emacs@gnu.org; Sat, 02 Jan 2010 16:09:16 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NRBDk-00019K-8a for bug-gnu-emacs@gnu.org; Sat, 02 Jan 2010 16:09:16 -0500 Received: from [199.232.76.173] (port=38721 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRBDj-00019B-Ux for bug-gnu-emacs@gnu.org; Sat, 02 Jan 2010 16:09:11 -0500 Received: from mailout2-16.pacific.net.au ([125.255.80.143]:40805 helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NRBDj-0002ZB-8m for bug-gnu-emacs@gnu.org; Sat, 02 Jan 2010 16:09:11 -0500 Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout2.pacific.net.au (Postfix) with ESMTP id E6D1619BFF7 for ; Sun, 3 Jan 2010 08:09:09 +1100 (EST) Received: from blah.blah (ppp2155.dyn.pacific.net.au [61.8.33.85]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id 33E808C11 for ; Sun, 3 Jan 2010 08:09:08 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.71) (envelope-from ) id 1NRBDe-000239-Cm for bug-gnu-emacs@gnu.org; Sun, 03 Jan 2010 08:09:06 +1100 From: Kevin Ryde To: bug-gnu-emacs@gnu.org Subject: 23.1; unload-feature disable minor-mode Date: Sun, 03 Jan 2010 08:09:06 +1100 Message-ID: <87aawwp631.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.6 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.6 (-----) --=-=-= 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. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=foo.el Content-Transfer-Encoding: quoted-printable (define-minor-mode foo-mode "Bolden the buffer." ;; default no :global, so buffer-local :type 'boolean (if foo-mode (overlay-put (make-overlay (point-min) (point-max) (current-buffer) nil t) 'face 'bold) (remove-overlays (point-min) (point-max) 'face 'bold))) ;; (defun foo-unload-function () ;; (dolist (buffer (buffer-list)) ;; (with-current-buffer buffer ;; (foo-mode 0))) ;; nil) (provide 'foo) ;;; foo.el ends here --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=try-foo.el Content-Transfer-Encoding: quoted-printable (progn (add-to-list 'load-path (expand-file-name ".")) (load "foo.el") (switch-to-buffer "xyz") (insert "hello") (foo-mode 1) (unload-feature 'foo) ) --=-=-= 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='' --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 02 18:23:21 2010 Received: (at 5294) by debbugs.gnu.org; 2 Jan 2010 23:23:21 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NRDJZ-0000Mu-Gt for submit@debbugs.gnu.org; Sat, 02 Jan 2010 18:23:21 -0500 Received: from mail-bw0-f216.google.com ([209.85.218.216]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NRDJX-0000Mp-CE for 5294@debbugs.gnu.org; Sat, 02 Jan 2010 18:23:19 -0500 Received: by bwz8 with SMTP id 8so9025826bwz.39 for <5294@debbugs.gnu.org>; Sat, 02 Jan 2010 15:23:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=/7ASU5n2VpBnokg1EUY+Vb2FHqjcbZzEYzc7WAug6CQ=; b=skWo0DQKg0lCCKi0ckSiWqTREaVTNheBeU73Gm5XSSIyC9GCKfxIIk1E5H3Swb/Kjv S6egUHGZe59FfMUsiFmtVBoqBLZRMzHloBAnOlSRe0W2YdXUwEecye4XaUajSwb5Gdu3 ekubnDdN5pxupdjd0p7wU8XpDRRVG+s4l0fPA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=u0PJiT4ozXXQd+p4iLvSSbYVDRuxQVAKheM7xY8+x2XnXsOaaVm6HBerpdEU6sxclK giu9m5/oUvIQIJJ3ukkliqXYllDY39A9lxA6pyzqLekWrwTf7ZHX+c/DFLBWK7Lh7jfk z0Q7oiBHQ21MUMDZxUNXJyrC2ihHDAkGHOo84= MIME-Version: 1.0 Received: by 10.204.18.211 with SMTP id x19mr1229084bka.116.1262474594101; Sat, 02 Jan 2010 15:23:14 -0800 (PST) In-Reply-To: <87aawwp631.fsf@blah.blah> References: <87aawwp631.fsf@blah.blah> From: Juanma Barranquero Date: Sun, 3 Jan 2010 00:22:54 +0100 Message-ID: Subject: Re: bug#5294: 23.1; unload-feature disable minor-mode To: Kevin Ryde Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 5294 Cc: 5294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) On Sat, Jan 2, 2010 at 22:09, Kevin Ryde wrote: > 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. =C2=A0Eval the code in try-foo.el and it le= aves > the buffer boldened, where disabling the mode could have undone it. I don't know whether, in general, you want to disable all effects of a mode after downloading it. Modes that do want can use FOO-unload-function like in your example. > 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. FOO-unload-hook is deprecated. Juanma From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 02 18:59:31 2010 Received: (at 5294) by debbugs.gnu.org; 2 Jan 2010 23:59:31 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NRDsY-0000da-Pd for submit@debbugs.gnu.org; Sat, 02 Jan 2010 18:59:30 -0500 Received: from mailout1-6.pacific.net.au ([61.8.2.213] helo=mailout1.pacific.net.au) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NRDsK-0000dV-9K for 5294@debbugs.gnu.org; Sat, 02 Jan 2010 18:59:29 -0500 Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout1.pacific.net.au (Postfix) with ESMTP id 234C7508291; Sun, 3 Jan 2010 10:59:10 +1100 (EST) Received: from blah.blah (ppp2155.dyn.pacific.net.au [61.8.33.85]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 17F0D27424; Sun, 3 Jan 2010 10:59:04 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.71) (envelope-from ) id 1NRDrc-0003Kz-Bt; Sun, 03 Jan 2010 10:58:32 +1100 From: Kevin Ryde To: Juanma Barranquero Subject: Re: bug#5294: 23.1; unload-feature disable minor-mode References: <87aawwp631.fsf@blah.blah> Date: Sun, 03 Jan 2010 10:58:32 +1100 Message-ID: <87tyv4njo7.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 5294 Cc: 5294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) Juanma Barranquero writes: > > I don't know whether, in general, you want to disable all effects of a > mode after downloading it. It seems unlikely a minor mode can do anything much good when its functions have been unloaded. Some "static" effects might be ok, but anything active would presumably stick in an unchanging state or start to error out, either a bit or badly. > FOO-unload-hook is ... a flexible way for unrelated libraries, macros or bits of code to undo things they know about, even different conditionalized parts of one .el like in tramp-util.el. A kind of inverse to eval-after-load, difficult to arrange on a monolithic unload func. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 02 19:25:26 2010 Received: (at 5294) by debbugs.gnu.org; 3 Jan 2010 00:25:26 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NREHe-0000pH-8X for submit@debbugs.gnu.org; Sat, 02 Jan 2010 19:25:26 -0500 Received: from mail-bw0-f216.google.com ([209.85.218.216]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NREHc-0000pC-A7 for 5294@debbugs.gnu.org; Sat, 02 Jan 2010 19:25:24 -0500 Received: by bwz8 with SMTP id 8so9037964bwz.39 for <5294@debbugs.gnu.org>; Sat, 02 Jan 2010 16:25:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=tRwLWkJ7uc+Kh4upP+urnBFqBocQ8PloOaYsIM9jsRg=; b=hrv4lIMo627jHEGUVzsOXpAFjbWPrqQLzq2bLCV4qz0Jw9ec54BUsMJwSr2NaxVcY4 MZ4VpRZFTyaoZyBQqgfknKBdig4Dn5AYqxTyMtOZgO6dMqOuYX91EzDD+JojwW95DieM 5TkwSZUtNCEIC55G36BRcisYnvUBxBcx0Gwd8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=cM38ju+vZ23hEg7L4cyDlzVcoykZPP9q8cOYB1Hqupk0ZcjKw7Shsbz/sSgwnOCCbP n/VEFtrqx3TZSX70iJHD3u5QqqdEanVtRHWYXMBagTYlwcPUS7qtmlRv5aqvg611EC0M fRGbZa2hJuX9pwfetw/SIoxY24RFTAwB86AQg= MIME-Version: 1.0 Received: by 10.204.0.69 with SMTP id 5mr8114867bka.173.1262478319845; Sat, 02 Jan 2010 16:25:19 -0800 (PST) In-Reply-To: <87tyv4njo7.fsf@blah.blah> References: <87aawwp631.fsf@blah.blah> <87tyv4njo7.fsf@blah.blah> From: Juanma Barranquero Date: Sun, 3 Jan 2010 01:24:58 +0100 Message-ID: Subject: Re: bug#5294: 23.1; unload-feature disable minor-mode To: Kevin Ryde Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 5294 Cc: 5294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) On Sun, Jan 3, 2010 at 00:58, Kevin Ryde wrote: > It seems unlikely a minor mode can do anything much good when its > functions have been unloaded. =C2=A0Some "static" effects might be ok, That is the point. The writer of the mode knows better. I'm not saying that you're not right in this, only that there could be downsides. >> FOO-unload-hook is > > ... a flexible way for unrelated libraries, macros or bits of code to > undo things they know about, even different conditionalized parts of one > .el like in tramp-util.el. Yeah, well, that and also, it never really worked. You seem to think that FOO-unload-hook is a hook run while executing `unload-feature'. In fact, is a hook run *instead* of some other code. The very act of defining FOO-unload-hook has unexpected consequences: `unlead-feature' won't remove FOO functions from hooks, nor from `auto-mode-alist'. And it was always so; that's why I pushed for introducing FOO-unload-function. > A kind of inverse to eval-after-load, > difficult to arrange on a monolithic unload func. In general, a package is the place where the knowledge about its unloading should be concentrated, IMO. If you want to piggyback onto it, there are several ways, like advising FOO-unload-function, if it is defined, or `unload-feature', etc. There's nothing "difficult to arrange". If you want to have an inverse to eval-after-load, I'd suggest you propose a new hook, unload-feature-functions (not FOO-specific). Juanma From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 02 20:05:56 2010 Received: (at 5294) by debbugs.gnu.org; 3 Jan 2010 01:05:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NREup-000174-J9 for submit@debbugs.gnu.org; Sat, 02 Jan 2010 20:05:55 -0500 Received: from mailout2-16.pacific.net.au ([125.255.80.143] helo=mailout2.pacific.net.au) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NREum-00016z-Iq for 5294@debbugs.gnu.org; Sat, 02 Jan 2010 20:05:54 -0500 Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout2.pacific.net.au (Postfix) with ESMTP id 34436199690; Sun, 3 Jan 2010 12:05:46 +1100 (EST) Received: from blah.blah (ppp2155.dyn.pacific.net.au [61.8.33.85]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 94C6027405; Sun, 3 Jan 2010 12:05:45 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.71) (envelope-from ) id 1NREuc-0004WJ-UK; Sun, 03 Jan 2010 12:05:43 +1100 From: Kevin Ryde To: Juanma Barranquero Subject: Re: bug#5294: 23.1; unload-feature disable minor-mode References: <87aawwp631.fsf@blah.blah> <87tyv4njo7.fsf@blah.blah> Date: Sun, 03 Jan 2010 12:05:42 +1100 In-Reply-To: (Juanma Barranquero's message of "Sun, 3 Jan 2010 01:24:58 +0100") Message-ID: <87iqbkf15l.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: 5294 Cc: 5294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) Juanma Barranquero writes: > > In fact, is a hook run *instead* of some other code. Ah, I didn't know that. > The very act of > defining FOO-unload-hook has unexpected consequences: `unlead-feature' > won't remove FOO functions from hooks, nor from `auto-mode-alist'. And > it was always so; that's why I pushed for introducing > FOO-unload-function. Sounds like it could have been better to do those latter actions irrespective of the hook. Let only the FOO-unload-function say not to do them, for the rare cases they're unwanted. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 02 20:41:35 2010 Received: (at 5294) by debbugs.gnu.org; 3 Jan 2010 01:41:35 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NRFTL-0001Q2-31 for submit@debbugs.gnu.org; Sat, 02 Jan 2010 20:41:35 -0500 Received: from mail-bw0-f216.google.com ([209.85.218.216]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NRFTH-0001Pw-KY for 5294@debbugs.gnu.org; Sat, 02 Jan 2010 20:41:33 -0500 Received: by bwz8 with SMTP id 8so9050271bwz.39 for <5294@debbugs.gnu.org>; Sat, 02 Jan 2010 17:41:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=SpxrpW3rXgaA9OrM/BrcMU8/gTfT+5Gnxl1lv6OqbYg=; b=qW6zzaW0UtfTlN9+RaiY0Ztllty322KQptgOL8Myist5C+eZWJyAl3Vuh4SkyQT+b/ 0bnj9WHS+LSFsQQdMpkzR82UwQ1QjyWkc1amhmJI0tRnlbLmyEKekvR2X8raOyXo+uHV 9pyUexjg38HPREs/2f0GHGz2K4nBQQ01Ws97I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=UDyLQZB+jRbUSLBjCpOXlI4IjThaQEpx+/pVZKnaehLMHTZEHbUtdcZdarfYlUa7Od o73KnADcsCDF8CB5/pbhsKvE/22EiMydfxUpJvf7Dbkv6KYgwUndcGTQCs3/fGBwFnd5 sQ0t6OPb/sCS0MzN9uGMMpQm3DF3id64XrqNU= MIME-Version: 1.0 Received: by 10.204.3.152 with SMTP id 24mr2979168bkn.168.1262482887086; Sat, 02 Jan 2010 17:41:27 -0800 (PST) In-Reply-To: <87iqbkf15l.fsf@blah.blah> References: <87aawwp631.fsf@blah.blah> <87tyv4njo7.fsf@blah.blah> <87iqbkf15l.fsf@blah.blah> From: Juanma Barranquero Date: Sun, 3 Jan 2010 02:41:07 +0100 Message-ID: Subject: Re: bug#5294: 23.1; unload-feature disable minor-mode To: Kevin Ryde Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 5294 Cc: 5294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) On Sun, Jan 3, 2010 at 02:05, Kevin Ryde wrote: > Sounds like it could have been better to do those latter actions > irrespective of the hook. Let only the FOO-unload-function say not to > do them, for the rare cases they're unwanted. The now-obsolete functionality (for FOO-unload-hook, not unload-feature in general) was confusing, badly designed and ill-documented; changing it would have been backward incompatible, not to mention fragile. It was better to add a new way. The current FOO-feature-function was added because in most cases, it's the package's responsibility to know how to unload itself. For the few cases that do not, there's always advising; but perhaps `unload-feature-functions' would be a good idea, and there's no worry about compatibility. Juanma From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 03 18:06:50 2010 Received: (at 5294) by debbugs.gnu.org; 3 Jan 2010 23:06:50 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NRZX8-0002oQ-4W for submit@debbugs.gnu.org; Sun, 03 Jan 2010 18:06:50 -0500 Received: from mailout1-6.pacific.net.au ([61.8.2.213] helo=mailout1.pacific.net.au) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NRZX5-0002oL-4U for 5294@debbugs.gnu.org; Sun, 03 Jan 2010 18:06:48 -0500 Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout1.pacific.net.au (Postfix) with ESMTP id D9E77515AFC; Mon, 4 Jan 2010 10:06:38 +1100 (EST) Received: from blah.blah (ppp2EA9.dyn.pacific.net.au [61.8.46.169]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id 2D3FB8C25; Mon, 4 Jan 2010 10:06:30 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.71) (envelope-from ) id 1NRZVB-0004SD-9t; Mon, 04 Jan 2010 10:04:49 +1100 From: Kevin Ryde To: Juanma Barranquero Subject: Re: bug#5294: 23.1; unload-feature disable minor-mode References: <87aawwp631.fsf@blah.blah> <87tyv4njo7.fsf@blah.blah> Date: Mon, 04 Jan 2010 10:04:48 +1100 In-Reply-To: (Juanma Barranquero's message of "Sun, 3 Jan 2010 01:24:58 +0100") Message-ID: <87bpha7ptb.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: 5294 Cc: 5294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) Juanma Barranquero writes: > > advising ... `unload-feature' Sounds likely. Though I wonder that an add-on might want to slip in after the FOO-unload-function has reported whether the "normal" unload actions should be performed. > confusing ... not to mention fragile Hmm, ah dear, yep. > perhaps `unload-feature-functions' One thing I was contemplating is whether defadvice might automatically unload, and what advice.el or the defadvice macro might do to make that happen. I'll start another bug for that. Mind you, I wonder if unload-feature is slightly doomed in general, ie. unless a given package has thought rather carefully about the consequences! :-) From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 03 18:13:21 2010 Received: (at 5294) by debbugs.gnu.org; 3 Jan 2010 23:13:21 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NRZdR-0002rP-Bj for submit@debbugs.gnu.org; Sun, 03 Jan 2010 18:13:21 -0500 Received: from mail-bw0-f216.google.com ([209.85.218.216]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NRZdP-0002rG-Sj for 5294@debbugs.gnu.org; Sun, 03 Jan 2010 18:13:20 -0500 Received: by bwz8 with SMTP id 8so9340079bwz.39 for <5294@debbugs.gnu.org>; Sun, 03 Jan 2010 15:13:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=tRkx9zfT9doo8tnpWjacnccpZD7eEW3q5YqAIwCViSQ=; b=caPR87UVeicTKDnw/KgGrhpJ/co4LD+E8zPc0TwDRWlQUYkzYhaubNJ+hK8zBh0urN t0DWsuPDakJzMZ4Z3tbCFi847MXNRWcZetzAyCtfzy2sy4SMADYmN86KD3+FSvB3SFsw OROAu2koWMnGllCRw12kZguW2NHKV1Hl7R/ec= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=ooVv8CKzE4iToEiBCs4KhAyrTwtJClYoVplQ8ZKdsj2Imk9UjBuVYaqRjDYcfGFjew ND3dmiQNwCngd0up+BltDDFpoAl008VIo00pp2RDV6qHRawfBb963F/XaBRLY5BUOqil mhu6k+vci6keAp4gp5t6CE5bzc5/yVkrWlt8I= MIME-Version: 1.0 Received: by 10.204.8.151 with SMTP id h23mr3092385bkh.194.1262560395130; Sun, 03 Jan 2010 15:13:15 -0800 (PST) In-Reply-To: <87bpha7ptb.fsf@blah.blah> References: <87aawwp631.fsf@blah.blah> <87tyv4njo7.fsf@blah.blah> <87bpha7ptb.fsf@blah.blah> From: Juanma Barranquero Date: Mon, 4 Jan 2010 00:12:55 +0100 Message-ID: Subject: Re: bug#5294: 23.1; unload-feature disable minor-mode To: Kevin Ryde Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 5294 Cc: 5294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) On Mon, Jan 4, 2010 at 00:04, Kevin Ryde wrote: > Though I wonder that an add-on might want to slip in > after the FOO-unload-function has reported whether the "normal" unload > actions should be performed. You can use an around advice, and have almost complete control. > Mind you, I wonder if unload-feature is slightly doomed in general, > ie. unless a given package has thought rather carefully about the > consequences! =C2=A0:-) Well, certainly unloading can have consequences; that's why I insist that the best place to define what should do for any package is in the package itself. Even an add-on to a package should just define its own feature, and FOO-unload-function for itself, IMO. If you don't use the FORCE argument, a package cannot be unloaded before unloading its dependencies, so it is safe to unload the add-ons before. Juanma From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 05 18:31:37 2010 Received: (at 5294) by debbugs.gnu.org; 5 Jan 2010 23:31:37 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NSIsD-0001al-1S for submit@debbugs.gnu.org; Tue, 05 Jan 2010 18:31:37 -0500 Received: from mailout2-16.pacific.net.au ([125.255.80.143] helo=mailout2.pacific.net.au) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NSIsB-0001aY-FQ for 5294@debbugs.gnu.org; Tue, 05 Jan 2010 18:31:36 -0500 Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout2.pacific.net.au (Postfix) with ESMTP id B84201AAD37; Wed, 6 Jan 2010 10:31:29 +1100 (EST) Received: from blah.blah (ppp26FC.dyn.pacific.net.au [61.8.38.252]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 23FBF27413; Wed, 6 Jan 2010 10:31:29 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.71) (envelope-from ) id 1NSIrw-00036R-54; Wed, 06 Jan 2010 10:31:20 +1100 From: Kevin Ryde To: 5294@debbugs.gnu.org Subject: Re: bug#5294: 23.1; unload-feature disable minor-mode References: <87aawwp631.fsf@blah.blah> <87tyv4njo7.fsf@blah.blah> <87bpha7ptb.fsf@blah.blah> Date: Wed, 06 Jan 2010 10:31:19 +1100 In-Reply-To: (Juanma Barranquero's message of "Mon, 4 Jan 2010 00:12:55 +0100") Message-ID: <87iqbgt9h4.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: 5294 Cc: Juanma Barranquero X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) 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. 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. 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). From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 05 19:24:09 2010 Received: (at 5294) by debbugs.gnu.org; 6 Jan 2010 00:24:09 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NSJh2-000354-Lo for submit@debbugs.gnu.org; Tue, 05 Jan 2010 19:24:08 -0500 Received: from mail-bw0-f216.google.com ([209.85.218.216]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NSJh0-00034m-LB for 5294@debbugs.gnu.org; Tue, 05 Jan 2010 19:24:07 -0500 Received: by bwz8 with SMTP id 8so10772562bwz.39 for <5294@debbugs.gnu.org>; Tue, 05 Jan 2010 16:24:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=K9LOsZ2A2nc+jWeCXYqmTunM7xZIQ+49xOe6YLlvXJs=; b=vsX5a6gczZ0SqF3GkdwCLBKx9+s/epfEXD5e5dO0rLs0Yn68A8UhGqdqes+IHAKYCc +jJIEkxCUwKp0JQoewbUjSUvbavHE3MBy7z/dkV4cIZW58PfkvizkfPEXUAMFHVPqklm stIoZM7ZKqCQkKI4FDo5TuVRpZJ+NbeenKl5Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=qY2WIyYg7R7k1m0kp2G4fqxgz9C+iJ+abR8qFgbFjRU3ycd9dM2qXxcF4ia9BA6mz8 V7oBoYr2DMMdOEbSX6dW4uWw6eI2Xgw3qW+FOOoK6UYTENXwinDLGMYSoQgNP9ajpY8m 1fA36jTrqH8A5jr7eK+m7F4grYKRxBibacTGo= MIME-Version: 1.0 Received: by 10.204.25.208 with SMTP id a16mr5434461bkc.133.1262737442170; Tue, 05 Jan 2010 16:24:02 -0800 (PST) In-Reply-To: <87iqbgt9h4.fsf@blah.blah> References: <87aawwp631.fsf@blah.blah> <87tyv4njo7.fsf@blah.blah> <87bpha7ptb.fsf@blah.blah> <87iqbgt9h4.fsf@blah.blah> From: Juanma Barranquero Date: Wed, 6 Jan 2010 01:23:41 +0100 Message-ID: Subject: Re: bug#5294: 23.1; unload-feature disable minor-mode To: Kevin Ryde Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 5294 Cc: 5294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) On Wed, Jan 6, 2010 at 00:31, Kevin Ryde 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. =C2=A0The 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 05 20:01:22 2010 Received: (at 5294) by debbugs.gnu.org; 6 Jan 2010 01:01:23 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NSKH4-0003rD-OM for submit@debbugs.gnu.org; Tue, 05 Jan 2010 20:01:22 -0500 Received: from mailout1-6.pacific.net.au ([61.8.2.213] helo=mailout1.pacific.net.au) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NSKH2-0003r5-1w for 5294@debbugs.gnu.org; Tue, 05 Jan 2010 20:01:21 -0500 Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout1.pacific.net.au (Postfix) with ESMTP id 20F11511F66; Wed, 6 Jan 2010 12:01:14 +1100 (EST) Received: from blah.blah (ppp26FC.dyn.pacific.net.au [61.8.38.252]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 705342741F; Wed, 6 Jan 2010 12:01:13 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.71) (envelope-from ) id 1NSKGm-0005AY-Pw; Wed, 06 Jan 2010 12:01:04 +1100 From: Kevin Ryde To: Juanma Barranquero Subject: Re: bug#5294: 23.1; unload-feature disable minor-mode References: <87aawwp631.fsf@blah.blah> <87tyv4njo7.fsf@blah.blah> <87bpha7ptb.fsf@blah.blah> <87iqbgt9h4.fsf@blah.blah> Date: Wed, 06 Jan 2010 12:01:04 +1100 In-Reply-To: (Juanma Barranquero's message of "Wed, 6 Jan 2010 01:23:41 +0100") Message-ID: <87zl4srqr3.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: 5294 Cc: 5294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) Juanma Barranquero writes: > > 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? Principally that define-minor-mode knows what things it did and therefore should be undone, or why they might not be undone at the present time. I think it would be rather repetitive to be obliged to write a FOO-unload-function whenever making a minor mode. Which, err, presumes that there may be standardized things that should be considered and/or undone for unloading a mode. I see you say there's normally not -- where I say there could be a disable or a caution to avoid likely breakage, removal from the minor modes menu, etc. From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 05 20:09:37 2010 Received: (at 5294) by debbugs.gnu.org; 6 Jan 2010 01:09:37 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NSKP2-0003va-QL for submit@debbugs.gnu.org; Tue, 05 Jan 2010 20:09:36 -0500 Received: from mail-bw0-f216.google.com ([209.85.218.216]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NSKP0-0003vR-Jt for 5294@debbugs.gnu.org; Tue, 05 Jan 2010 20:09:35 -0500 Received: by bwz8 with SMTP id 8so10787409bwz.39 for <5294@debbugs.gnu.org>; Tue, 05 Jan 2010 17:09:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=HIlv5qbzWAxx+LjUJhVmwYcCpYKlYb4tq/lrt4hViMk=; b=EwYoJAEgFCkv4NG4VQ4a0dXWIbF6qtK+WW6NLpw7TbHjjpRMg1PumjleqQTVGGGXkQ 2kXBVwtF8Nm/WgWiNLId3HPQHdcc9YQkawGA2A8fzth4SjxkRl83QXKGani+p3p0MyEc a/XDLfOlstnKADr2fnwLUFTiLTwh1yD6QWPz8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=oZ9yG6vDFRNIPb74ycmXSeKGydmPe4KY4lMHqxNvneElDygKkIvKKmO4l2DZ9+pbLc JAo+lRhkgJB8A92l0Or9n9n3QvecKigknl3P2/bOtdhE/vDCBgPVkZJSAEsDQR2f/EWm oOpliT65uuWnp6Q/mZXZTfz6M0uy8eJBCIvCI= MIME-Version: 1.0 Received: by 10.204.32.131 with SMTP id c3mr2107728bkd.190.1262740170207; Tue, 05 Jan 2010 17:09:30 -0800 (PST) In-Reply-To: <87zl4srqr3.fsf@blah.blah> References: <87aawwp631.fsf@blah.blah> <87tyv4njo7.fsf@blah.blah> <87bpha7ptb.fsf@blah.blah> <87iqbgt9h4.fsf@blah.blah> <87zl4srqr3.fsf@blah.blah> From: Juanma Barranquero Date: Wed, 6 Jan 2010 02:09:10 +0100 Message-ID: Subject: Re: bug#5294: 23.1; unload-feature disable minor-mode To: Kevin Ryde Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 5294 Cc: 5294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On Wed, Jan 6, 2010 at 02:01, Kevin Ryde wrote: > Principally that define-minor-mode knows what things it did and > therefore should be undone, or why they might not be undone at the > present time. But that is defined in the same file as the unload-function... > I think it would be rather repetitive to be obliged to > write a FOO-unload-function whenever making a minor mode. You want to write the same code, but put it in define-minor-mode. I don't think define-minor-mode should worry itself with unloading. > Which, err, presumes that there may be standardized things that should > be considered and/or undone for unloading a mode. =C2=A0I see you say the= re's > normally not -- where I say there could be a disable or a caution to > avoid likely breakage, removal from the minor modes menu, etc. I do not say that there are not, I say that they are not easy to generalize. Some are. For example, removing a minor-mode for the minor-modes menu seems a good idea, and should be done by unload-feature if it is not done already, because calling a nonexistent function is an error. Juanma From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 13 05:06:52 2022 Received: (at 5294) by debbugs.gnu.org; 13 Feb 2022 10:06:53 +0000 Received: from localhost ([127.0.0.1]:36442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJBmO-0004iP-Mc for submit@debbugs.gnu.org; Sun, 13 Feb 2022 05:06:52 -0500 Received: from quimby.gnus.org ([95.216.78.240]:51932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJBmM-0004i8-RJ for 5294@debbugs.gnu.org; Sun, 13 Feb 2022 05:06:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=9X9PbtyVvLdDN2u0d7Vnhj4hFE9HDr7pCgXNwaIcopo=; b=Su3d4dq7+P4KkmTy0HzsHUqGpV ynzbUQ3fMRfOUKPnqfaMEQ5g6HAf/n/BENDBph0zCP1/dBZPL4G0s1U5C6wRmS+6ADNITgYzDYBPV EPiYxvVp3PKzt+CcPKPxZxIq5jjSl31mlSGL0D31xsGLToemSZdduyFW57muLXVoveWI=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJBmE-0001eD-8P; Sun, 13 Feb 2022 11:06:44 +0100 From: Lars Ingebrigtsen To: Juanma Barranquero Subject: Re: bug#5294: 23.1; unload-feature disable minor-mode References: <87aawwp631.fsf@blah.blah> <87tyv4njo7.fsf@blah.blah> <87bpha7ptb.fsf@blah.blah> <87iqbgt9h4.fsf@blah.blah> <87zl4srqr3.fsf@blah.blah> X-Now-Playing: Sidsel Endresen & Bugge Wesseltoft's _Out Here. In There._: "Names, numbers" Date: Sun, 13 Feb 2022 11:06:38 +0100 In-Reply-To: (Juanma Barranquero's message of "Wed, 6 Jan 2010 02:09:10 +0100") Message-ID: <871r07w05t.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Juanma Barranquero writes: > I do not say that there are not, I say that they are not easy to > generalize. Some are. For example, removing a minor-mode for the > minor-modes menu seems a good idea, and should be done by > unlo [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 5294 Cc: 5294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Juanma Barranquero writes: > I do not say that there are not, I say that they are not easy to > generalize. Some are. For example, removing a minor-mode for the > minor-modes menu seems a good idea, and should be done by > unload-feature if it is not done already, because calling a > nonexistent function is an error. (I'm going through old bug reports that unfortunately weren't resolved at the time.) I think the conclusion here was that there isn't much that can be done in general here -- minor modes aren't special here; removing all "running code" when unloading a feature isn't really possible. So I don't think there's anything actionable in this bug report, and I'm therefore closing it. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 13 05:06:57 2022 Received: (at control) by debbugs.gnu.org; 13 Feb 2022 10:06:57 +0000 Received: from localhost ([127.0.0.1]:36445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJBmS-0004ih-Td for submit@debbugs.gnu.org; Sun, 13 Feb 2022 05:06:57 -0500 Received: from quimby.gnus.org ([95.216.78.240]:51946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJBmR-0004iH-Di for control@debbugs.gnu.org; Sun, 13 Feb 2022 05:06:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=w4eAANCf9K9V0wATEVovQHDqCsOy744u4M6RYdKGicc=; b=JqdAV4YU97Mit6Yhq7y7uSsE72 fUlb5IpJAJ7l7KdCae0zp7XfXQ0AuVden/10yMFDbBzk3ykkES7Gxs4JS0R4T0fYkg+2u9ngeOSPp xZ1nSuBWBx5n9RnBZPcy0JdOHrtVK2c82Z0sjVNKx5e4bR5ENqTuBrgjloXLXuB//DRU=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJBmJ-0001eL-Al for control@debbugs.gnu.org; Sun, 13 Feb 2022 11:06:49 +0100 Date: Sun, 13 Feb 2022 11:06:46 +0100 Message-Id: <87zgmvull5.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #5294 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 5294 wontfix close 5294 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 5294 wontfix close 5294 quit From unknown Thu Aug 14 21:49:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 13 Mar 2022 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator