From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rasmus Newsgroups: gmane.emacs.help Subject: Re: Question about string-match and match-string Date: Thu, 18 Jul 2013 10:33:20 +0200 Message-ID: <87ppug469b.fsf@gmx.us> References: <20130717081704.GB16899@kuru.dyndns-at-home.com> <20130717083511.GC16899@kuru.dyndns-at-home.com> <87sizdbmo2.fsf@gmx.us> <874nbsb8lw.fsf@free.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1374136430 6028 80.91.229.3 (18 Jul 2013 08:33:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Jul 2013 08:33:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 18 10:33:52 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 1Uzjeq-0002XZ-EE for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jul 2013 10:33:52 +0200 Original-Received: from localhost ([::1]:37352 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uzjeq-0001xi-2i for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jul 2013 04:33:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uzjeg-0001wi-65 for help-gnu-emacs@gnu.org; Thu, 18 Jul 2013 04:33:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uzjed-0003oi-AB for help-gnu-emacs@gnu.org; Thu, 18 Jul 2013 04:33:42 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:50042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uzjed-0003oe-3u for help-gnu-emacs@gnu.org; Thu, 18 Jul 2013 04:33:39 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UzjeY-0002Oh-V8 for help-gnu-emacs@gnu.org; Thu, 18 Jul 2013 10:33:34 +0200 Original-Received: from business-213-023-238-209.static.arcor-ip.net ([213.23.238.209]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 18 Jul 2013 10:33:34 +0200 Original-Received: from rasmus by business-213-023-238-209.static.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 18 Jul 2013 10:33:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 71 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: business-213-023-238-209.static.arcor-ip.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAAAAAByaaZbAAAAAmJLR0QA/4ePzL8AAAAJcEhZ cwAAAEgAAABIAEbJaz4AAAE1SURBVEgN1cHBYcIwEADBrehquUrUiypRJdfRPiISGwzImG9m+A+i l3+Sa+lULYjM0s4FHcFDaOeDbvEiNTgz7LzTwVrZWSmLFe2slcU7bZzpdl6VDTCZglfN5Fm3Aw4m 5U0zeKJAl0lZGHJUMimTgxXlwMYU3NhYSXlIuWZw56AZLKX8qeJOuo21UH6l3MkwOKPBjcEmhJIT TeXGziaEkBOKnWkUmxAoWVI2KZswAA3eNItdyM5kKk2eNE0eZGfjVzmNljFlVxtHsrOxiV7lZvBC dna+IbuSb8gu5AshdzaujeIu5ZrJg4NLcmRwwcFRGHwU8mzIRyYvSj5Q3pScUhZKTihLysowOTEs Xg3lAzV5SJULXUcyRXMK2hhlOVVPbqJlyzGV5ejNgxqjZQTnYiL4V34ArFoDSH8mOYQAAAAASUVO RK5CYII= Cancel-Lock: sha1:WHLpND2/umn8o7Yfgf0BtqGzxDc= 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:92222 Archived-At: Julien Cubizolles writes: > Rasmus writes: > > >> > > I'm also looking for a ignoreheading function and was looking forward to > using yours. As said, I'm pretty sure Nicholas posted it first! > However I get a (void-variable headline) error when exporting to > LaTeX. That's surprising. First try the following, which I think will solve the problem provided you're using org > 8 AND Emacs >24.4. ;; add ignoreheading only after ox. (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)) With Emacs < 24.4 load with (eval-after-load 'ox '(progn (defun ...) (add-to-list ...) )) In general with-eval-after-load is a wonderful function that can really speed up things around start. The function is what you'd guess: it stores the information until a certain file (a string) or feature (a symbol) is loaded and then evals the body. You can also just put a (require 'ox) before the defun. If the above ain't working follow this recipe and let me know when the error occurs. 1. start Emacs by issuing emacs -q in the terminal (don't load config) 2. in the *scratch* buffer type (require 'org) (shouldn't be necessary, actually). 3. Type M-x org-version RET and check that it's greater than 8. E.g. my output it: Org-mode version 8.0.3 (release_8.0.3-309-gabacff @ /usr/share/emacs/site-lisp/org/) 4. Load the filter above 5. type C-x b test.org RET M-x org-mode RET 6. input * test :ignoreheading: test-text 7. type C-x C-e lL On my system this gives the desired output. Can you reproduce? -- May contains speling mistake