unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [elpa] externals/org ec6d1df 2/2: lisp/ox.el (org-export-to-file): Don't load the major mode
       [not found] ` <20210503175719.483AE20D0E@vcs0.savannah.gnu.org>
@ 2021-05-03 18:33   ` Stefan Monnier
  2021-05-03 19:38     ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Monnier @ 2021-05-03 18:33 UTC (permalink / raw)
  To: TEC, Bastien; +Cc: emacs-devel

>     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?

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).


        Stefan




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [elpa] externals/org ec6d1df 2/2: lisp/ox.el (org-export-to-file): Don't load the major mode
  2021-05-03 18:33   ` [elpa] externals/org ec6d1df 2/2: lisp/ox.el (org-export-to-file): Don't load the major mode Stefan Monnier
@ 2021-05-03 19:38     ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2021-05-03 19:38 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: TEC, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> 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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-03 19:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210503175717.27525.97949@vcs0.savannah.gnu.org>
     [not found] ` <20210503175719.483AE20D0E@vcs0.savannah.gnu.org>
2021-05-03 18:33   ` [elpa] externals/org ec6d1df 2/2: lisp/ox.el (org-export-to-file): Don't load the major mode Stefan Monnier
2021-05-03 19:38     ` Bastien

unofficial mirror of emacs-devel@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/emacs-devel/0 emacs-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 emacs-devel emacs-devel/ https://yhetil.org/emacs-devel \
		emacs-devel@gnu.org
	public-inbox-index emacs-devel

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.devel
	nntp://news.gmane.io/gmane.emacs.devel


code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs.git

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git