From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [PATCH] Improve configurability of ox-koma-letter Date: Mon, 22 Apr 2013 14:09:14 +0200 Message-ID: <8738uidaxh.fsf@pank.eu> References: <20130421175957.GA7821@cartman> <878v4adh12.fsf@pank.eu> <20130422112728.GE7821@cartman> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:48900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUFYh-0006UY-Co for emacs-orgmode@gnu.org; Mon, 22 Apr 2013 08:09:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUFYc-0006ni-19 for emacs-orgmode@gnu.org; Mon, 22 Apr 2013 08:09:23 -0400 Received: from mout.gmx.net ([212.227.17.22]:55672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUFYb-0006mm-NQ for emacs-orgmode@gnu.org; Mon, 22 Apr 2013 08:09:17 -0400 Received: from mailout-eu.gmx.com ([10.1.101.215]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0Lo3XS-1V1OWC3IE4-00fx14 for ; Mon, 22 Apr 2013 14:09:16 +0200 In-Reply-To: <20130422112728.GE7821@cartman> (Viktor Rosenfeld's message of "Mon, 22 Apr 2013 13:27:28 +0200") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Viktor, >> In a similar spirit to subject is firsthead. First head is displayed >> by default in scrlttr2 as far as I recall, which is annoying. > > Is firsthead something that you change on a letter-by-letter basis? Or > do you configure it once for your letters and never change it? In the > latter case the configuration can be moved of to an LCO file. In the > former case an option would be nice. I had to actually change the > options I introduced so far for different letters (e.g., I don't want > foldmarks if I send the letter by email).=20 How I use scrlttr2: I rarely use firsthead as I find ugly. I use firstfoot all of the time and I change it regularly. E.g. for some letters I include bank addresse. Still, I see your point. >> If we make foldmark an option should it not be a string accepting >> values from "Table 4.3.: Combinable values for the configuration of >> folding marks with option foldmarks" in the KOMA-Script manual? > > Same as above. If I read the scrguide correctly, the foldmark variable > can be set multiple times, e.g., > #+BEGIN_SRC latex > \KOMAoption{foldmarks}{blmtP} > \KOMAoption{foldmarks}{true} > #+END_SRC This is true. > The first line sets the behavior (and could be moved to an LCO file), > the second line can be used to switch foldmarks on or off (and could be > set by the exporter). Haven't tried this though. Yeah, I guess it's true. Still, since foldmarks depends on which envelopes you have at hand it might make sense to have it accept a string. In lisp-terms a string is still t. On the other hand the current approach is consistent with your approach above so that's a merit. >> [...] >> > +(defcustom org-koma-letter-use-subject "untitled" >> > + "Use the title as the letter's subject." >> > + :group 'org-export-koma-letter >> > + :type 'string) >>=20 >> Perhaps the default should depend on whether a title is present? > > The way I understand the org exporter, a title is always present. If not > explicitly set using #+TITLE it defaults to the file name or the org > heading. Could be. It seems you are right. In the 'main' LaTeX exporter a \maketitle is inserted only if title is not nil: #+begin_src emacs-lisp ;; snip from ox-latex.el, Org-mode version 8.0-pre (release_8.0-pre-523-g72= 48fb @ /usr/share/emacs/site-lisp/org/) (format "\\title{%s}\n" title) ;; [...] (org-element-normalize-string (cond ((string=3D "" title) nil) ((not (stringp org-latex-title-command)) nil) ((string-match "\\(?:[^%]\\|^\\)%s" org-latex-title-command) (format org-latex-title-command title)) (t org-latex-title-command))) ;; Table of contents. #+end_src >> Another approach (which I also somehow like) is to put it under the >> LaTeX menu. E.g. like beamer or like org-ravel=C2=A0=C2=B9=20=20 > > I didn't know this was possible. I don't care either way, but I suppose > an advantage would be that some commands could be then consolidated to > save space. I slightly prefer the "org-ravel" mode of adding it to LaTeX ("l"). It make sense in the way that Beamer is also there. I don't know if there exists an official opinion on such practices. =20=20 >> > + (let ((with-place (plist-get info :with-place)) >> > + (place (plist-get info :place))) >> > + (when (or place (not with-place))=20 >> > + (format "\\setkomavar{place}{%s}\n" (if with-place place "")))) >>=20 >> Wouldn't this work better: E.g. it wouldn't allow a place when place >> is nil or when with-place is nil? >>=20 >> (when (and place (not with-place)) >> (format "\\setkomavar{place}{%s}\n" place )) > > This will print the place if it is configured somewhere, even if=20 > =3Dplace:nil=3D is set in #+OPTIONS. I see. I wasn't thinking of the possibility you outline below as I would configure the variable with my default location (which unfortunately isn't Berlin). > Note that I use the empty string "" to > surpress the space in my code. For example, I have in my LCO file > #+BEGIN_SRC latex > \setkomavar{place}{Berlin} > #+END_SRC > > That is, the space is usually printed in every letter.=20 > > If I use #+OPTIONS: place:nil in a particular letter, the following code > is emitted: > #+BEGIN_SRC latex > \LoadLetterOption{myletter.lco} % place is set here > \setkomavar{place}{} % this surpresses the printing of place > #+END_SRC > I would rather adapt the with-foldmarks option to accept a string rather = than > adding another foldmarks variable. Agree. I think it shold. It's almost "free" to add since a string is true in both and Emacs lisp sense and a scrlttr2 sense (in this case). Thanks! =E2=80=93Rasmus --=20 And let me remind you also that moderation in the pursuit of justice is no virtue