From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: org-export-latex-hyperref-options-format Date: Thu, 20 Feb 2014 21:51:07 +0100 Message-ID: <87vbw91pac.fsf@gmail.com> References: <87a9dpo0as.fsf@gmail.com> <8738jhnx1m.fsf@gmail.com> <878ut72qyo.fsf@gmail.com> <87zjlm13st.fsf@gmail.com> <8672745997102408713@unknownmsgid> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGaa6-00055W-0b for emacs-orgmode@gnu.org; Thu, 20 Feb 2014 15:51:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGaZw-0006XI-Uy for emacs-orgmode@gnu.org; Thu, 20 Feb 2014 15:50:53 -0500 Received: from mail-we0-x235.google.com ([2a00:1450:400c:c03::235]:34700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGaZw-0006X3-Ml for emacs-orgmode@gnu.org; Thu, 20 Feb 2014 15:50:44 -0500 Received: by mail-we0-f181.google.com with SMTP id w61so1836258wes.26 for ; Thu, 20 Feb 2014 12:50:43 -0800 (PST) In-Reply-To: (Joe Hirn's message of "Thu, 20 Feb 2014 11:58:02 -0600") 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: Joe Hirn Cc: "emacs-orgmode@gnu.org" Hello, Joe Hirn writes: > I was able to test this on my local machine and it seems to work as we > discussed. > > If there are any other changes to the patch you'd like to see, please let > me know. Thank you for the patch. Here are a few comments. > - (:latex-hyperref-p nil "texht" org-latex-with-hyperref t) > + (:latex-hyperref-p nil "texht" (if org-latex-hyperref-template t) t) I think we can drop the "-p" suffix since this is no longer a predicate. So the property can be named :latex-hyperref. Also we can replace "texht" with nil since it doesn't make much sense to specify a full template from the OPTIONS line. Eventually, the default value should be `org-latex-hyperref-template'. This boils down to the following line: (:latex-hyperref nil nil org-latex-hyperref-template t) > -(defcustom org-latex-with-hyperref t > - "Toggle insertion of \\hypersetup{...} in the preamble." > + > +(defcustom org-latex-hyperref-template "\\hypersetup{\n > pdfkeywords={%k},\n pdfsubject={%d},\n pdfcreator={%c}}\n" > + "The value of \\hyperrefsetup{...} in the preamble. String is a > format-spec which accepts keywords for %k (pdfkeywords), %d > (pdfdescription) and %c (pdfcreator). Set to nil for no \\hyperrefsetup." > :group 'org-export-latex > - :type 'boolean) > + :type 'string) The first line of the docstring should contain complete sentences only. I would say something along the lines: "Template for hyperref package options. Value is a format string, which can contain the following placeholders: %k for KEYWORDS line %d for DESCRIPTION line %c for CREATOR line An empty string disables the setup." Since you specify :type as 'string, it is wrong to expect a nil value in the variable. Note that nil is not an absolute necessity. We can allow to disable the template with an empty string instead. > + (format-spec org-latex-hyperref-template > + (format-spec-make > + ?k (or (plist-get info :keywords) "") > + ?d (or (plist-get info :description)"") > + ?c (if (plist-get info :with-creator) > + (plist-get info :creator) > + "")))) You are not using the :latex-hyperref property. This should be: (format-spec (plist-get info :latex-hyperref) ...) Regards, -- Nicolas Goaziou