From: Nicolas Goaziou Date: Thu, 14 Aug 2014 12:11:40 +0000 (+0200) Subject: Merge branch 'maint' X-Git-Tag: release_8.3~934 X-Git-Url: https://repo.or.cz/w/org-mode.git/commitdiff_plain/cc6aa45f3b41d73eddca21b67d487e47dc4d7433 Merge branch 'maint' Conflicts: lisp/ox-texinfo.el --- cc6aa45f3b41d73eddca21b67d487e47dc4d7433 diff --cc lisp/ox-texinfo.el index ea203acde,c4b2ebf8c..18279fab3 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@@ -762,10 -785,20 +762,9 @@@ holding contextual information. (priority (and (plist-get info :with-priority) (org-element-property :priority headline))) (text (org-export-data (org-element-property :title headline) info)) - (full-text (if (not (eq org-texinfo-format-headline-function 'ignore)) - ;; User-defined formatting function. - (funcall org-texinfo-format-headline-function - todo todo-type priority text tags) - ;; Default formatting. - (concat - (when todo - (format "@strong{%s} " todo)) - (when priority (format "@emph{#%s} " priority)) - text - (when tags - (format " :%s:" - (mapconcat 'identity tags ":")))))) + (full-text (funcall (plist-get info :texinfo-format-headline-function) + todo todo-type priority text tags)) - (pre-blanks - (make-string (org-element-property :pre-blank headline) ?\n))) + (contents (if (org-string-nw-p contents) (concat "\n" contents) ""))) (cond ;; Case 1: This is a footnote section: ignore it. ((org-element-property :footnote-section-p headline) nil) @@@ -788,35 -821,16 +787,25 @@@ ;; format has been found. ((or (not section-fmt) (org-export-low-level-p headline info)) ;; Build the real contents of the sub-tree. - (let ((low-level-body - (concat - ;; If the headline is the first sibling, start a list. - (when (org-export-first-sibling-p headline info) - (format "@%s\n" (if numberedp 'enumerate 'itemize))) - ;; Itemize headline - "@item\n" full-text "\n" pre-blanks contents))) - ;; If headline is not the last sibling simply return - ;; LOW-LEVEL-BODY. Otherwise, also close the list, before any - ;; blank line. - (if (not (org-export-last-sibling-p headline info)) low-level-body - (replace-regexp-in-string - "[ \t\n]*\\'" - (format "\n@end %s" (if numberedp 'enumerate 'itemize)) - low-level-body)))) + (concat (and (org-export-first-sibling-p headline info) + (format "@%s\n" (if numberedp 'enumerate 'itemize))) + "@item\n" full-text "\n" + contents + (if (org-export-last-sibling-p headline info) + (format "@end %s" (if numberedp 'enumerate 'itemize)) + "\n"))) ;; Case 5: Standard headline. Export it as a section. - (t - (concat node - (format section-fmt full-text (concat pre-blanks contents))))))) + (t (concat node (format section-fmt full-text contents)))))) +(defun org-texinfo-format-headline-default-function + (todo todo-type priority text tags) + "Default format function for a headline. +See `org-texinfo-format-headline-function' for details." + (concat (when todo (format "@strong{%s} " todo)) + (when priority (format "@emph{#%s} " priority)) + text + (when tags (format " :%s:" (mapconcat 'identity tags ":"))))) + ;;;; Inline Src Block (defun org-texinfo-inline-src-block (inline-src-block contents info)