From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Julien Cubizolles Newsgroups: gmane.emacs.help Subject: Re: Question about string-match and match-string Date: Sat, 20 Jul 2013 17:26:49 +0200 Message-ID: <874nbp8d6u.fsf@free.fr> References: <20130717081704.GB16899@kuru.dyndns-at-home.com> <20130717083511.GC16899@kuru.dyndns-at-home.com> <87sizdbmo2.fsf@gmx.us> <874nbsb8lw.fsf@free.fr> <87ppug469b.fsf@gmx.us> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1374334039 29288 80.91.229.3 (20 Jul 2013 15:27:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Jul 2013 15:27:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jul 20 17:27:20 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V0Z44-00082Q-Ik for geh-help-gnu-emacs@m.gmane.org; Sat, 20 Jul 2013 17:27:20 +0200 Original-Received: from localhost ([::1]:59693 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0Z44-0005rv-6V for geh-help-gnu-emacs@m.gmane.org; Sat, 20 Jul 2013 11:27:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0Z3q-0005rd-Ph for help-gnu-emacs@gnu.org; Sat, 20 Jul 2013 11:27:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0Z3p-00067N-DS for help-gnu-emacs@gnu.org; Sat, 20 Jul 2013 11:27:06 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:59510) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0Z3p-00067H-5P for help-gnu-emacs@gnu.org; Sat, 20 Jul 2013 11:27:05 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1V0Z3m-0007ws-UG for help-gnu-emacs@gnu.org; Sat, 20 Jul 2013 17:27:02 +0200 Original-Received: from 37.161.82.231 ([37.161.82.231]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 20 Jul 2013 17:27:02 +0200 Original-Received: from j.cubizolles by 37.161.82.231 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 20 Jul 2013 17:27:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 48 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 37.161.82.231 User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:MeBBgUAq210xN0ATJPPBgWafKwA= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:92274 Archived-At: Rasmus writes: > (with-eval-after-load 'ox > (defun rasmus/org-latex-ignore-heading (headline backend info) > "Strip headline from HEADLINE if it has tag ignoreheading for > certain headlines. `info' is ignored" > (when (and (org-export-derived-backend-p backend 'latex 'html 'ascii 'odt) > (string-match "\\`.*ignoreheading.*\n" > (downcase headline))) > (replace-match "" nil nil headline))) > > (add-to-list 'org-export-filter-headline-functions > 'rasmus/org-latex-ignore-heading)) It's working, thanks, but it's ignored if you use tags:nil option (which is pretty common I guess). Consider the following --8<---------------cut here---------------start------------->8--- #+TITLE: Titre * First Heading :tag: blablabla * Second Heading :ignoreheading: blablabla --8<---------------cut here---------------end--------------->8--- The second heading is omitted and its text is present, just like I want it. However, you get an (in my opinion) ugly \textsc{tag} in the first heading (\section{First Heading\hfill{}\textsc{tag}}) If however you use --8<---------------cut here---------------start------------->8--- #+TITLE: Titre #+OPTIONS: tags:nil * First Heading :tag: blablabla * Second Heading :ignoreheading: blablabla --8<---------------cut here---------------end--------------->8--- Both the first and second heading are displayed (not what I want). Finally, something weird with the title: if you don't define it with de #+TITLE, it's set to name_of_thefile$_{\text{ignoreheading}}$... Julien.