From: Ikumi Keita <ikumi@ikumi.que.jp>
To: "Mosè Giordano" <mose@gnu.org>
Cc: 23329@debbugs.gnu.org, emacs-devel@gnu.org
Subject: bug#23329: 11.89; Unloading tex-site doesn't restore original functionality
Date: Fri, 22 Apr 2016 15:49:57 +0900 [thread overview]
Message-ID: <29887.1461307797@localhost> (raw)
In-Reply-To: Your message of "Thu\, 21 Apr 2016 18\:22\:35 +0200." <CAKtYQqRGCor7pVdE5NCp=7GjQpfGujJXua_mjEuQSYr_ZqpqiQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 893 bytes --]
Hi all,
> tex-site.el defines `tex-site-unload-hook' which looks into
> `after-load-alist' to remove AUCTeX settings (it looks for
> `TeX-modes-set' function), but in Emacs 24 `after-load-alist' seems to
> have changed and there is no reference to `TeX-modes-set' anymore. Do
> you have any idea how to unload AUCTeX in Emacs 24?
I think I have figured out why `unload-feature' doesn't work well. The
story is as follows.
If `advice-add' is available, tex-site.el uses `advice-add' on the
original tex modes and doesn't touch `after-load-alist'.
The advices are added through the defcustom of `TeX-modes' when
tex-site.el is loaded, because it has the line
:set 'TeX-modes-set
. Thus `tex-site-unload-hook' should remove these advices when
`advice-add' is available.
I confirmed that the attached crude workaround makes unloading tex-site
to work as expected.
Regards,
Ikumi Keita
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: quick workaround --]
[-- Type: text/x-diff, Size: 706 bytes --]
diff -r 26f0a318aedb -r 125674651465 tex-site.el.in
--- a/tex-site.el.in Tue Jun 03 14:10:34 2014 +0900
+++ b/tex-site.el.in Fri Apr 22 15:22:33 2016 +0900
@@ -87,6 +87,8 @@
(add-hook 'tex-site-unload-hook
(lambda ()
+ (if (fboundp 'advice-add)
+ (TeX-modes-set 'TeX-modes nil)
(let ((list after-load-alist))
(while list
;; Adapted copy of the definition of `assq-delete-all'
@@ -101,7 +103,7 @@
(eq (car (car tail)) key))
(setq alist (delq (car tail) alist)))
(setq tail (cdr tail))))
- (setq list (cdr list))))
+ (setq list (cdr list)))))
(setq load-path (delq TeX-lisp-directory load-path))))
(defun TeX-modes-set (var value &optional update)
next prev parent reply other threads:[~2016-04-22 6:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <18668.1461248711@localhost>
2016-04-21 16:22 ` bug#23329: 11.89; Unloading tex-site doesn't restore original functionality Mosè Giordano
2016-04-22 6:49 ` Ikumi Keita [this message]
2016-04-22 11:56 ` Stefan Monnier
2016-04-23 16:52 ` Mosè Giordano
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=29887.1461307797@localhost \
--to=ikumi@ikumi.que.jp \
--cc=23329@debbugs.gnu.org \
--cc=emacs-devel@gnu.org \
--cc=mose@gnu.org \
/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).