From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bastien Newsgroups: gmane.emacs.devel Subject: Re: [elpa] externals/org ec6d1df 2/2: lisp/ox.el (org-export-to-file): Don't load the major mode Date: Mon, 03 May 2021 21:38:32 +0200 Message-ID: <874kfjk3pj.fsf@bzg.fr> References: <20210503175717.27525.97949@vcs0.savannah.gnu.org> <20210503175719.483AE20D0E@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10516"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: TEC , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 03 21:39:44 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldePw-0002bw-Mz for ged-emacs-devel@m.gmane-mx.org; Mon, 03 May 2021 21:39:44 +0200 Original-Received: from localhost ([::1]:42610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldePv-0001rK-99 for ged-emacs-devel@m.gmane-mx.org; Mon, 03 May 2021 15:39:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldeOv-0001QZ-6s for emacs-devel@gnu.org; Mon, 03 May 2021 15:38:41 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:32850) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldeOs-0001xM-PB; Mon, 03 May 2021 15:38:40 -0400 Original-Received: from [2a01:e34:ec2b:7150:ed76:623:99f1:997] (port=57616 helo=guerry) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1ldeOp-0003Lm-E9; Mon, 03 May 2021 15:38:37 -0400 Original-Received: by guerry (Postfix, from userid 1000) id 4E6B91A60E5E; Mon, 3 May 2021 21:38:32 +0200 (CEST) In-Reply-To: (Stefan Monnier's message of "Mon, 03 May 2021 14:33:16 -0400") X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:268843 Archived-At: Stefan Monnier writes: >> Prior to this, when `org-export-to-file' was called it activated the >> major mode for that file type based on `auto-mode-alist'. This can be >> mildly annoying in various ways as loading the major mode (1) makes >> the export take longer, (2) can produce unwanted "noise" while >> initialising, namely warnings and errors related to the mode itself, >> (3) can produce spurious files like an .auctex-auto folder. By >> locally binding `auto-mode-alist' to nil, all of these undesirable >> behaviours can be avoided. > > Hmm... modes don't set themselves unless we ask for it (e.g. by using > `file-find-noselect` instead of `insert-file-contents`), so maybe > a better option is to change the code that causes the major modes to be > set so that it doesn't happen? Right. I don't see where a major is loaded in `org-export-to-file'. Timothy, can you double-check the original error was not due to your configuration? What happens with emacs -Q ? > Binding `auto-mode-alist` to nil is not the end of the world, but it's > a kind of ugly hack and inevitably comes with undesirable side-effects > (e.g. any ELisp package that happens to be loaded during this time and > whose initialization code adds/removes entries from `auto-mode-alist` > will be affected). Let's avoid this hack then. Thanks! -- Bastien