From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonas Bernoulli Subject: ox-texinfo: add support for NONODE element property Date: Fri, 08 Apr 2016 12:29:32 +0200 Message-ID: <87egagfl6b.fsf@bernoul.li> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoTfb-0001FE-9g for emacs-orgmode@gnu.org; Fri, 08 Apr 2016 06:29:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aoTfW-0007vm-6H for emacs-orgmode@gnu.org; Fri, 08 Apr 2016 06:29:43 -0400 Received: from mail.hostpark.net ([212.243.197.30]:49389) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoTfV-0007uF-VE for emacs-orgmode@gnu.org; Fri, 08 Apr 2016 06:29:38 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id 2B0CB16DBE for ; Fri, 8 Apr 2016 12:29:34 +0200 (CEST) Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail0.hostpark.net [127.0.0.1]) (amavisd-new, port 10124) with ESMTP id liYlkxhDN9rZ for ; Fri, 8 Apr 2016 12:29:34 +0200 (CEST) Received: from hal (80-218-86-217.dclient.hispeed.ch [80.218.86.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id 40ED216DBA for ; Fri, 8 Apr 2016 12:29:33 +0200 (CEST) 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" To: emacs-orgmode@gnu.org Hello, In the Magit manual I usually use separate nodes for sections and subsections, but in a few cases a section's children should be part of the section's node. I accomplished that by adding an additional element property NONODE and redefining `org-texinfo-headline' and `org-texinfo--menu-entries' accordingly. Here is an equivalent patch: diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index cd3e7ae..23bb1c8 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -777,13 +777,16 @@ (defun org-texinfo-headline (headline contents info) holding contextual information." (let* ((class (plist-get info :texinfo-class)) (level (org-export-get-relative-level headline info)) - (numberedp (org-export-numbered-headline-p headline info)) + (nonode (org-element-property :NONODE headline)) + (numberedp (and (not nonode) + (org-export-numbered-headline-p headline info))) (class-sectioning (assoc class (plist-get info :texinfo-classes))) ;; Find the index type, if any. (index (org-element-property :INDEX headline)) ;; Create node info, to insert it before section formatting. ;; Use custom menu title if present. - (node (format "@node %s\n" (org-texinfo--get-node headline info))) + (node (and (not nonode) + (format "@node %s\n" (org-texinfo--get-node headline info)))) ;; Section formatting will set two placeholders: one for the ;; title and the other for the contents. (section-fmt @@ -1147,7 +1150,8 @@ (defun org-texinfo--menu-entries (scope info) (puthash scope (org-element-map (org-element-contents scope) 'headline (lambda (h) - (and (not (org-not-nil (org-element-property :COPYING h))) + (and (not (org-element-property :NONODE h)) + (not (org-not-nil (org-element-property :COPYING h))) (not (org-element-property :footnote-section-p h)) (not (org-export-low-level-p h info)) h)) The property should probably be renamed to e.g. NOCHILDNODES, since it is the *children* of the section which has this option set that do not get any nodes of their own, not the section for which the property is set. Please consider adding this or something similar. Thanks! Jonas