From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dominik Ernst Subject: empty default captions for src blocks Date: Mon, 14 Apr 2014 16:04:43 +0200 Message-ID: <534BEAFB.4080607@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZhVF-0000AX-Ey for emacs-orgmode@gnu.org; Mon, 14 Apr 2014 10:05:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WZhV7-0005im-S7 for emacs-orgmode@gnu.org; Mon, 14 Apr 2014 10:04:53 -0400 Received: from mout.gmx.net ([212.227.15.15]:56514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZhV7-0005iA-Iz for emacs-orgmode@gnu.org; Mon, 14 Apr 2014 10:04:45 -0400 Received: from [192.168.60.213] ([131.188.30.102]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0Lz3JU-1X4H3z3V6O-0148Mq for ; Mon, 14 Apr 2014 16:04:43 +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 Hallo, I have a small question, I hope it is right here. The following org code: #+CAPTION: caption of block 1 #+BEGIN_SRC vmpovapd %%zmm0, %zmm1 #+END_SRC #+BEGIN_SRC vmpovapd %%zmm0, %zmm1 #+END_SRC is exported (in my setup) to latex as: \lstset{language=phiassembler,caption={caption of block1},numbers=none} \begin{lstlisting} vmpovapd %%zmm0, %zmm1 \end{lstlisting} \begin{lstlisting} vmpovapd %%zmm0, %zmm1 \end{lstlisting} which results in the rendered pdf as two listings with the same caption, although only the first block has a caption. I think this is because of the lstlistings statemachine, that is maniupulated through lstset. It has an unchanged state in the second listing, which then gets the same caption. Is there an easy way to fix this? My hack so far is to modify ox-latex.el so that 2171: (when caption-str `(("caption" ,caption-str))) becomes: 2171: (if caption-str `(("caption" ,caption-str)) `(("caption" ,"{}")) ) which adds a default empty caption, which makes everything behave like I want it to, so no wrong captions on source blocks where I define no caption. My org version is 8.2.5h. Regards, Dominik