From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Removing unloaded functions from auto-mode-alist. Date: Tue, 19 Apr 2005 17:58:34 -0400 Message-ID: References: <87zmvu6ba2.fsf@xs4all.nl> <85ll7e68ei.fsf@lola.goethe.zz> <854qe2ihhi.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1113947858 16249 80.91.229.2 (19 Apr 2005 21:57:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 19 Apr 2005 21:57:38 +0000 (UTC) Cc: Lute Kamstra , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 19 23:57:35 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DO0ie-0002XQ-JM for ged-emacs-devel@m.gmane.org; Tue, 19 Apr 2005 23:57:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DO0n2-0001if-CZ for ged-emacs-devel@m.gmane.org; Tue, 19 Apr 2005 18:01:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DO0mh-0001XF-1g for emacs-devel@gnu.org; Tue, 19 Apr 2005 18:01:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DO0mf-0001Wp-Vl for emacs-devel@gnu.org; Tue, 19 Apr 2005 18:01:30 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DO0me-0001ME-A2 for emacs-devel@gnu.org; Tue, 19 Apr 2005 18:01:29 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DO0mC-0007Uc-BO; Tue, 19 Apr 2005 18:01:00 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 4AEB334001F; Tue, 19 Apr 2005 17:58:42 -0400 (EDT) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 7703E4AC274; Tue, 19 Apr 2005 17:58:34 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 5538DE6BD4; Tue, 19 Apr 2005 17:58:34 -0400 (EDT) Original-To: David Kastrup In-Reply-To: <854qe2ihhi.fsf@lola.goethe.zz> (David Kastrup's message of "Tue, 19 Apr 2005 23:28:25 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-4.835, requis 5, autolearn=not spam, AWL 0.07, BAYES_00 -4.90) X-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:36126 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:36126 > Forget it, Bub. TeX-mode and LaTeX-mode are already taken as aliases. > Who was the smart guy responsible for that? The annotations show: > 1.3 (jimb 13-May-91): ;;;###autoload > 1.17 (eric 23-Apr-93): (defalias 'TeX-mode 'tex-mode) > 1.3 (jimb 13-May-91): ;;;###autoload > 1.99 (rms 16-Feb-99): (defalias 'plain-TeX-mode 'plain-tex-mode) > 1.99 (rms 16-Feb-99): ;;;###autoload > 1.17 (eric 23-Apr-93): (defalias 'LaTeX-mode 'latex-mode) > 1.1 (root 28-Aug-90): Duh, this sucks! Any objection to removing those aliases? These names belong to AUCTeX and are just wrong in tex-mode.el. [ In the text below, I'll asume we remove those atrocities ] >> - make a `auctex-override.el' file which does: >> >> (defalias 'tex-mode 'TeX-mode) >> (defalias 'latex-mode 'LaTeX-mode) >> ... >> (provide 'auctex-override.el) >> >> Then (require 'auctex-override) makes AUCTeX the default, and hopefully an >> (unload-feature 'auctex-override) will restore the default autloads for the >> other tex-mode. > Won't work. Autoloads corresponding to a different file than the > loaded one don't get restored. That's a bug which we should fix. In the mean time, you can use an auctex-override-unload-hook to re-install the autoloads. >> Completely untested, of course. > Unfortunately, I tested this already. That's why I had to come up > with a better scheme. Not "better" as in "nicer", but in "reckless > enough to stand a chance of attaining its goal". I'd rather try and make my suggestion work than to follow down your insane path. I.e. we should remove those atrocities in tex-mode.el and we should fix the unload-feature to properly re-install autoloads. In the mean time, you should be able make my suggestion work by using the following autoload-override.el file: ;; Override the atrocities in tex-mode.el. (fmakunbound 'TeX-mode) (autoload 'TeX-mode "...") ... (defvar TeX-saved-other-tex-autoloads (mapcar (lambda (f) (cons f (symbol-function f))) '(tex-mode latex-mode ...))) (add-hook 'auctex-override-unload-hook (lambda () (dolist (x TeX-saved-other-tex-autoloads) (fset (car x) (cdr x))))) ;; Give preference to our (defalias 'tex-mode 'TeX-mode) ... Then users/admins can (require 'auctex-override) to make AUCTeX be the default, and if the admin made it the default, users can (unload-feature 'auctex-override) to make the other tex-mode be the default. Of course, you can name this file something else than `auctex-override'. It seems much less insane than your current code. WDYT? Stefan