From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: # of parameters of `org-latex-format-headline-function' Date: Fri, 17 Oct 2014 11:21:53 -0400 Message-ID: <87vbniafhq.fsf@alphaville.bos.redhat.com> References: <86mw8vw04q.fsf@example.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xf9M8-0002Hc-Ig for emacs-orgmode@gnu.org; Fri, 17 Oct 2014 11:22:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xf9M1-0008EC-Ez for emacs-orgmode@gnu.org; Fri, 17 Oct 2014 11:22:16 -0400 Received: from plane.gmane.org ([80.91.229.3]:48578) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xf9M1-0008E8-8b for emacs-orgmode@gnu.org; Fri, 17 Oct 2014 11:22:09 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Xf9Lz-0007Va-6u for emacs-orgmode@gnu.org; Fri, 17 Oct 2014 17:22:07 +0200 Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Oct 2014 17:22:07 +0200 Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Oct 2014 17:22:07 +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 Sebastien Vauban writes: > Hello, > > During the summer, the number of parameters of the > `org-latex-format-headline-function' changed from 5 to 6: addition of > `info'. > > The new version of my private formatting function is: > > ;; function for formatting the headline's text > (setq org-latex-format-headline-function > 'my/org-latex-format-headline) > > ;; markup for TODO keywords and for tags, as a printf format > (defun my/org-latex-format-headline (todo todo-type priority text tags info) > "Default function for formatting the headline's text." > (concat (when todo > (format "{%s\\textbf{\\textsc{\\textsf{%s}}}} " > (cond ((equal todo-type 'todo) "\\color{red}") > ((equal todo-type 'done) "\\color{teal}") > (t "\\color{gray}")) > todo)) > (when priority > (format "\\framebox{\\#%c} " priority)) > text > (when tags > (format "\\hfill{}\\fbox{\\textsc{%s}}" > (mapconcat 'identity tags ":"))))) > > That works on `master', but not on Org from ELPA (`maint'). > > As parts of my config file are shared between my coworkers, and as some > of them don't have Git Org but the ELPA package, how can I support both > versions of Org? > > Do I have to test the Org version number, or is there a more clever way? > Make info an &optional parameter in your function: recent org will call it with a non-nil info, old org will call it without an info parameter (which I believe will make it nil inside your function). Untested. Nick