From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Cross Subject: Re: cannot export to beamer. Date: Mon, 17 Dec 2018 08:36:07 +1100 Message-ID: <878t0pw3w8.fsf@gmail.com> References: <87zht6adx2.fsf@mat.ucm.es> <87y38qmzd9.fsf@gmail.com> <87sgyy4j38.fsf@mat.ucm.es> <87y38pg444.fsf@gmail.com> <87lg4pmj64.fsf@mat.ucm.es> <87a7l5wa5d.fsf@gmail.com> <87h8fdmbih.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYe9N-00060o-40 for emacs-orgmode@gnu.org; Sun, 16 Dec 2018 16:40:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gYe5C-0001pJ-Qa for emacs-orgmode@gnu.org; Sun, 16 Dec 2018 16:36:20 -0500 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:36824) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gYe5A-0001ja-Jg for emacs-orgmode@gnu.org; Sun, 16 Dec 2018 16:36:17 -0500 Received: by mail-pf1-x436.google.com with SMTP id b85so5341792pfc.3 for ; Sun, 16 Dec 2018 13:36:14 -0800 (PST) In-reply-to: <87h8fdmbih.fsf@mat.ucm.es> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Uwe Brauer Cc: emacs-orgmode@gnu.org I suspect that the recent changes in how Emacs runs initialisation may well expose a few edge cases for the customise interface. The custimise interface is fairly basic and makes a few assumptions which may not hold once you start altering the order of initialisation and package loading. While it all works fine 80% of the time, it may fail for more complex situations and the reality is, Org is large and complex. Strictly speaking, I don't think it is a bug. The problem is getting the right balance of what to load and what to leave for the user to decide to load. If you never use beamer, then having all the beamer stuff loaded by default is only going to slow down start up (though I do think people are way too obsessed with startup time these days! I start emacs about once per week and only that often because I shutdown my laptop on the weekend when I leave work!). If beamer is not loaded when you customise org-latex-classes, then it won't be in the variable and if it isn't in the variable, it cannot be saved into the custom block. If you then later decide to load it and it is loaded before your customisation is loaded, then the value it adds to org-latex-classes is lost. If on the other hand we 'hard code' it into the variable so it doesn't depend on whether ox-beamer is loaded, then a definition will exist which won't work when the user tries to use it as ox-beamer is not loaded. Previously, I think custom blocks were loaded at the start of your init, so before org was loaded, so this was less of an issue. No with the early init stuff, things are not quite the same (a lot of guess work here!). Tim Uwe Brauer writes: >>>> "Tim" == Tim Cross writes: > > > Just a shot in the dark here ..... > > > You mentioned you used custom to modify the org-latex-classes > > variable. Does the code in the custom 'block' of your init file have > > beamer as one of the classes? > > No it does not and this turns out a problem, also I thought the > ox-beamer code contains a add-to-list which should do add beamer, but it > seems not to do it. > > > > My suspicion is that when you added your exam class, for some > > reason, beamer had not been loaded and was not yet in the variable > > definition. When you edited it to add your exam class it has saved > > a version without beamer as a class. > > > When you start emacs, with the new init and run order, the code > > >> (unless (assoc "beamer" org-latex-classes) > >> (add-to-list 'org-latex-classes > >> '("beamer" > >> "\\documentclass[presentation]{beamer}" > >> ("\\section{%s}" . "\\section*{%s}") > >> ("\\subsection{%s}" . "\\subsection*{%s}") > >> ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) > > > is executed and beamer is added, but then your custom settings are > > evaluated and the variable is reset with the version you added the exam > > class to, which has no beamer entry, is used to reset the variable and > > the beamer setting is lost. > > > What you say makes send but this seems to defy the whole idea of custom! > > > > I would start by deleting the org-latex-classes customization and try > > adding it again to see if that fixes the problem. This is one reason I > > rarely use customise - I prefer to have the code in my own init file so > > that I can see exactly when everything is run. > > Thanks! I will do that and you are very right about custom, it is very > convenient but buggier than I thought. > > Uwe -- Tim Cross