emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* ox-texinfo: add support for NONODE element property
@ 2016-04-08 10:29 Jonas Bernoulli
  2016-04-08 10:40 ` Jonas Bernoulli
  2016-04-10  7:18 ` Nicolas Goaziou
  0 siblings, 2 replies; 3+ messages in thread
From: Jonas Bernoulli @ 2016-04-08 10:29 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: ox-texinfo: add support for NONODE element property
  2016-04-08 10:29 ox-texinfo: add support for NONODE element property Jonas Bernoulli
@ 2016-04-08 10:40 ` Jonas Bernoulli
  2016-04-10  7:18 ` Nicolas Goaziou
  1 sibling, 0 replies; 3+ messages in thread
From: Jonas Bernoulli @ 2016-04-08 10:40 UTC (permalink / raw)
  To: emacs-orgmode

> 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.

Ignore this.  It is the section that has NONODE which does not get its
own node.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ox-texinfo: add support for NONODE element property
  2016-04-08 10:29 ox-texinfo: add support for NONODE element property Jonas Bernoulli
  2016-04-08 10:40 ` Jonas Bernoulli
@ 2016-04-10  7:18 ` Nicolas Goaziou
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Goaziou @ 2016-04-10  7:18 UTC (permalink / raw)
  To: Jonas Bernoulli; +Cc: emacs-orgmode

Hello,

Jonas Bernoulli <jonas@bernoul.li> writes:

> 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:

This sounds interesting. What happens if one tries to link to a "nonode"
heading within Org?

> +        (numberedp (and (not nonode)
> +                        (org-export-numbered-headline-p headline info)))

This change is unrelated to the specification.  There is
already :UNNUMBERED: property for this.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-10  7:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-08 10:29 ox-texinfo: add support for NONODE element property Jonas Bernoulli
2016-04-08 10:40 ` Jonas Bernoulli
2016-04-10  7:18 ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).