From 1df505064362ebd98f1bb68cd955cabb0d1bb574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20A=2E=20Gomes?= Date: Wed, 6 Oct 2021 10:46:43 +0300 Subject: [PATCH 04/76] Fix internals with no impact on the user. Replace dummy variables. --- lisp/org-clock.el | 46 +++++++-------- lisp/org-colview.el | 2 +- lisp/org-compat.el | 6 +- lisp/org-element.el | 26 ++++----- lisp/org-feed.el | 6 +- lisp/org-lint.el | 6 +- lisp/org.el | 12 ++-- lisp/ox-ascii.el | 52 ++++++++--------- lisp/ox-beamer.el | 128 ++++++++++++++++++++--------------------- lisp/ox-html.el | 96 +++++++++++++++---------------- lisp/ox-icalendar.el | 20 +++---- lisp/ox-koma-letter.el | 18 +++--- lisp/ox-latex.el | 42 +++++++------- lisp/ox-man.el | 18 +++--- lisp/ox-md.el | 62 ++++++++++---------- lisp/ox-odt.el | 84 +++++++++++++-------------- lisp/ox-org.el | 18 +++--- lisp/ox-texinfo.el | 42 +++++++------- lisp/ox.el | 80 +++++++++++++------------- 19 files changed, 382 insertions(+), 382 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 26fbc28c0..0094d7255 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1852,13 +1852,13 @@ With prefix arg SELECT, offer recently clocked tasks for selection." "Holds the file total time in minutes, after a call to `org-clock-sum'.") ;;;###autoload -(defun org-clock-sum-today (&optional headline-filter) +(defun org-clock-sum-today (&optional heading-filter) "Sum the times for each subtree for today." (let ((range (org-clock-special-range 'today))) (org-clock-sum (car range) (cadr range) - headline-filter :org-clock-minutes-today))) + heading-filter :org-clock-minutes-today))) -(defun org-clock-sum-custom (&optional headline-filter range propname) +(defun org-clock-sum-custom (&optional heading-filter range propname) "Sum the times for each subtree for today." (let ((r (or (and (symbolp range) (org-clock-special-range range)) (org-clock-special-range @@ -1869,16 +1869,16 @@ With prefix arg SELECT, offer recently clocked tasks for selection." "interactive") nil t)))))) (org-clock-sum (car r) (cadr r) - headline-filter (or propname :org-clock-minutes-custom)))) + heading-filter (or propname :org-clock-minutes-custom)))) ;;;###autoload -(defun org-clock-sum (&optional tstart tend headline-filter propname) +(defun org-clock-sum (&optional tstart tend heading-filter propname) "Sum the times for each subtree. -Puts the resulting times in minutes as a text property on each headline. +Puts the resulting times in minutes as a text property on each heading. TSTART and TEND can mark a time range to be considered. -HEADLINE-FILTER is a zero-arg function that, if specified, is called for -each headline in the time range with point at the headline. Headlines for -which HEADLINE-FILTER returns nil are excluded from the clock summation. +HEADING-FILTER is a zero-arg function that, if specified, is called for +each heading in the time range with point at the heading. Headings for +which HEADING-FILTER returns nil are excluded from the clock summation. PROPNAME lets you set a custom text property instead of :org-clock-minutes." (with-silent-modifications (let* ((re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*" @@ -1931,26 +1931,26 @@ PROPNAME lets you set a custom text property instead of :org-clock-minutes." (time-since org-clock-start-time)) 60))) (setq t1 (+ t1 time)))) - (let* ((headline-forced + (let* ((heading-forced (get-text-property (point) :org-clock-force-headline-inclusion)) - (headline-included - (or (null headline-filter) + (heading-included + (or (null heading-filter) (save-excursion - (save-match-data (funcall headline-filter)))))) + (save-match-data (funcall heading-filter)))))) (setq level (- (match-end 1) (match-beginning 1))) (when (>= level lmax) (setq ltimes (vconcat ltimes (make-vector lmax 0)) lmax (* 2 lmax))) (when (or (> t1 0) (> (aref ltimes level) 0)) - (when (or headline-included headline-forced) - (if headline-included + (when (or heading-included heading-forced) + (if heading-included (cl-loop for l from 0 to level do (aset ltimes l (+ (aref ltimes l) t1)))) (setq time (aref ltimes level)) (goto-char (match-beginning 0)) (put-text-property (point) (point-at-eol) (or propname :org-clock-minutes) time) - (when headline-filter + (when heading-filter (save-excursion (save-match-data (while (org-up-heading-safe) @@ -2043,12 +2043,12 @@ that it will be easy to remove. This function assumes point is on a heading." (org-match-line org-complex-heading-regexp) (goto-char (match-beginning 4)) - (let* ((headline (match-string 4)) - (text (concat headline + (let* ((heading (match-string 4)) + (text (concat heading (org-add-props (make-string (max (- (- 60 (current-column)) - (org-string-width headline) + (org-string-width heading) (length (org-get-at-bol 'line-prefix))) 0) ?\ยท) @@ -2974,11 +2974,11 @@ PROPERTIES: The list properties specified in the `:properties' parameter (when (and time (> time 0) (org-at-heading-p)) (let ((level (org-reduced-level (org-current-level)))) (when (<= level maxlevel) - (let* ((headline (org-get-heading t t t t)) + (let* ((heading (org-get-heading t t t t)) (hdl - (if (not link) headline + (if (not link) heading (let ((search - (org-link-heading-search-string headline))) + (org-link-heading-search-string heading))) (org-link-make-string (if (not (buffer-file-name)) search (format "file:%s::%s" (buffer-file-name) search)) @@ -2989,7 +2989,7 @@ PROPERTIES: The list properties specified in the `:properties' parameter (org-link-display-format (replace-regexp-in-string "\\[[0-9]*\\(?:%\\|/[0-9]*\\)\\]" "" - headline))))))) + heading))))))) (tgs (and tags (org-get-tags))) (tsp (and timestamp diff --git a/lisp/org-colview.el b/lisp/org-colview.el index 5275b03bf..955b9809b 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -33,7 +33,7 @@ (declare-function org-agenda-redo "org-agenda" (&optional all)) (declare-function org-agenda-do-context-action "org-agenda" ()) -(declare-function org-clock-sum-today "org-clock" (&optional headline-filter)) +(declare-function org-clock-sum-today "org-clock" (&optional heading-filter)) (declare-function org-element-extract-element "org-element" (element)) (declare-function org-element-interpret-data "org-element" (data)) (declare-function org-element-map "org-element" (data types fun &optional info first-match no-recursion with-affiliated)) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 8f0bbde29..19ffe244b 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -886,11 +886,11 @@ This also applied for speedbar access." (last-level 0)) (while (re-search-backward re nil t) (let ((level (org-reduced-level (funcall outline-level))) - (headline (org-no-properties + (heading (org-no-properties (org-link-display-format (org-get-heading t t t t))))) - (when (and (<= level org-imenu-depth) (org-string-nw-p headline)) + (when (and (<= level org-imenu-depth) (org-string-nw-p heading)) (let* ((m (point-marker)) - (item (propertize headline 'org-imenu-marker m 'org-imenu t))) + (item (propertize heading 'org-imenu-marker m 'org-imenu t))) (push m org-imenu-markers) (if (>= level last-level) (push (cons item m) (aref subs level)) diff --git a/lisp/org-element.el b/lisp/org-element.el index da682c4a2..5c300d6c2 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -1048,7 +1048,7 @@ Assume point is at beginning of the heading." (progn (goto-char end) (skip-chars-backward " \r\t\n") (line-beginning-position 2))))) - (let ((headline + (let ((heading (list 'headline (nconc (list :raw-value raw-value @@ -1075,7 +1075,7 @@ Assume point is at beginning of the heading." time-props standard-props)))) (org-element-put-property - headline :title + heading :title (if raw-secondary-p raw-value (org-element--parse-objects (progn (goto-char title-start) @@ -1086,21 +1086,21 @@ Assume point is at beginning of the heading." (point)) nil (org-element-restriction 'headline) - headline))))))) + heading))))))) -(defun org-element-headline-interpreter (headline contents) - "Interpret HEADLINE element as Org syntax. +(defun org-element-headline-interpreter (heading contents) + "Interpret HEADING element as Org syntax. CONTENTS is the contents of the element." - (let* ((level (org-element-property :level headline)) - (todo (org-element-property :todo-keyword headline)) - (priority (org-element-property :priority headline)) + (let* ((level (org-element-property :level heading)) + (todo (org-element-property :todo-keyword heading)) + (priority (org-element-property :priority heading)) (title (org-element-interpret-data - (org-element-property :title headline))) - (tags (let ((tag-list (org-element-property :tags headline))) + (org-element-property :title heading))) + (tags (let ((tag-list (org-element-property :tags heading))) (and tag-list (format ":%s:" (mapconcat #'identity tag-list ":"))))) - (commentedp (org-element-property :commentedp headline)) - (pre-blank (or (org-element-property :pre-blank headline) 0)) + (commentedp (org-element-property :commentedp heading)) + (pre-blank (or (org-element-property :pre-blank heading) 0)) (heading (concat (make-string (if org-odd-levels-only (1- (* level 2)) level) ?*) @@ -1109,7 +1109,7 @@ CONTENTS is the contents of the element." (and priority (format " [#%c]" priority)) " " (if (and org-footnote-section - (org-element-property :footnote-section-p headline)) + (org-element-property :footnote-section-p heading)) org-footnote-section title)))) (concat diff --git a/lisp/org-feed.el b/lisp/org-feed.el index ea93d8704..9996fc8ec 100644 --- a/lisp/org-feed.el +++ b/lisp/org-feed.el @@ -306,7 +306,7 @@ it can be a list structured like an entry in `org-feed-alist'." (url (nth 1 feed)) (file (or (nth 2 feed) (buffer-file-name (or (buffer-base-buffer) (current-buffer))))) - (headline (nth 3 feed)) + (heading (nth 3 feed)) (filter (nth 1 (memq :filter feed))) (formatter (nth 1 (memq :formatter feed))) (new-handler (nth 1 (memq :new-handler feed))) @@ -330,7 +330,7 @@ it can be a list structured like an entry in `org-feed-alist'." (ignore-errors (kill-buffer feed-buffer)) (save-excursion (save-window-excursion - (setq inbox-pos (org-feed-goto-inbox-internal file headline)) + (setq inbox-pos (org-feed-goto-inbox-internal file heading)) (setq old-status (org-feed-read-previous-status inbox-pos drawer)) ;; Add the "handled" status to the appropriate entries (setq entries (mapcar (lambda (e) @@ -420,7 +420,7 @@ it can be a list structured like an entry in `org-feed-alist'." (message "Added %d new item%s from feed %s to file %s, heading %s" (length new) (if (> (length new) 1) "s" "") name - (file-name-nondirectory file) headline) + (file-name-nondirectory file) heading) (run-hooks 'org-feed-after-adding-hook) (length new)))))) diff --git a/lisp/org-lint.el b/lisp/org-lint.el index da5e6ae79..ec5859a92 100644 --- a/lisp/org-lint.el +++ b/lisp/org-lint.el @@ -544,14 +544,14 @@ Use :header-args: instead" (org-element-map ast 'drawer (lambda (d) (when (equal (org-element-property :drawer-name d) "PROPERTIES") - (let ((headline? (org-element-lineage d '(headline))) + (let ((heading? (org-element-lineage d '(headline))) (before (mapcar #'org-element-type (assq d (reverse (org-element-contents (org-element-property :parent d))))))) (list (org-element-property :post-affiliated d) - (if (or (and headline? (member before '(nil (planning)))) - (and (null headline?) (member before '(nil (comment))))) + (if (or (and heading? (member before '(nil (planning)))) + (and (null heading?) (member before '(nil (comment))))) "Incorrect contents for PROPERTIES drawer" "Incorrect location for PROPERTIES drawer"))))))) diff --git a/lisp/org.el b/lisp/org.el index 5dca48f59..b7b54dbc2 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -141,7 +141,7 @@ Stars are put in group 1 and the trimmed body in group 2.") (declare-function org-clock-out-if-current "org-clock" ()) (declare-function org-clock-remove-overlays "org-clock" (&optional beg end noremove)) (declare-function org-clock-report "org-clock" (&optional arg)) -(declare-function org-clock-sum "org-clock" (&optional tstart tend headline-filter propname)) +(declare-function org-clock-sum "org-clock" (&optional tstart tend heading-filter propname)) (declare-function org-clock-sum-current-item "org-clock" (&optional tstart)) (declare-function org-clock-timestamps-down "org-clock" (&optional n)) (declare-function org-clock-timestamps-up "org-clock" (&optional n)) @@ -7119,7 +7119,7 @@ Return nil before first heading." (looking-at org-complex-heading-regexp) (let ((todo (and (not no-todo) (match-string 2))) (priority (and (not no-priority) (match-string 3))) - (headline (pcase (match-string 4) + (heading (pcase (match-string 4) (`nil "") ((and (guard no-comment) h) (replace-regexp-in-string @@ -7129,7 +7129,7 @@ Return nil before first heading." (h h))) (tags (and (not no-tags) (match-string 5)))) (mapconcat #'identity - (delq nil (list todo priority headline tags)) + (delq nil (list todo priority heading tags)) " ")))))) (defun org-heading-components () @@ -20516,11 +20516,11 @@ This function also checks ancestors of the current heading, unless optional argument NO-INHERITANCE is non-nil." (cond ((org-before-first-heading-p) nil) - ((let ((headline (nth 4 (org-heading-components)))) - (and headline + ((let ((heading (nth 4 (org-heading-components)))) + (and heading (let ((case-fold-search nil)) (string-match-p (concat "^" org-comment-string "\\(?: \\|$\\)") - headline))))) + heading))))) (no-inheritance nil) (t (save-excursion (and (org-up-heading-safe) (org-in-commented-heading-p)))))) diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el index 185f1fe1f..30ca960ac 100644 --- a/lisp/ox-ascii.el +++ b/lisp/ox-ascii.el @@ -654,10 +654,10 @@ the title. When optional argument TOC is non-nil, use optional title if possible. It doesn't apply to `inlinetask' elements." - (let* ((headlinep (eq (org-element-type element) 'headline)) + (let* ((headingp (eq (org-element-type element) 'headline)) (numbers ;; Numbering is specific to headings. - (and headlinep + (and headingp (org-export-numbered-headline-p element info) (let ((numbering (org-export-get-headline-number element info))) (if toc (format "%d. " (org-last numbering)) @@ -666,7 +666,7 @@ possible. It doesn't apply to `inlinetask' elements." (text (org-trim (org-export-data - (if (and toc headlinep) (org-export-get-alt-title element info) + (if (and toc headingp) (org-export-get-alt-title element info) (org-element-property :title element)) info))) (todo @@ -694,7 +694,7 @@ possible. It doesn't apply to `inlinetask' elements." tags)) ;; Maybe underline text, if ELEMENT type is `headline' and an ;; underline character has been defined. - (when (and underline headlinep) + (when (and underline headingp) (let ((under-char (nth (1- (org-export-get-relative-level element info)) (cdr (assq (plist-get info :ascii-charset) @@ -763,13 +763,13 @@ contents according to the specified scope." (- (plist-get info :ascii-text-width) (plist-get info :ascii-global-margin))))) (mapconcat - (lambda (headline) - (let* ((level (org-export-get-relative-level headline info)) + (lambda (heading) + (let* ((level (org-export-get-relative-level heading info)) (indent (* (1- level) 3))) (concat (unless (zerop indent) (concat (make-string (1- indent) ?.) " ")) (org-ascii--build-title - headline info (- text-width indent) nil + heading info (- text-width indent) nil (or (not (plist-get info :with-tags)) (eq (plist-get info :with-tags) 'not-in-toc)) 'toc)))) @@ -1297,34 +1297,34 @@ CONTENTS is nil. INFO is a plist holding contextual information." ;;;; Heading -(defun org-ascii-headline (headline contents info) - "Transcode a HEADLINE element from Org to ASCII. -CONTENTS holds the contents of the headline. INFO is a plist +(defun org-ascii-headline (heading contents info) + "Transcode a HEADING element from Org to ASCII. +CONTENTS holds the contents of the heading. INFO is a plist holding contextual information." ;; Don't export footnote section, which will be handled at the end ;; of the template. - (unless (org-element-property :footnote-section-p headline) - (let* ((low-level (org-export-low-level-p headline info)) - (width (org-ascii--current-text-width headline info)) + (unless (org-element-property :footnote-section-p heading) + (let* ((low-level (org-export-low-level-p heading info)) + (width (org-ascii--current-text-width heading info)) ;; Export title early so that any link in it can be ;; exported and seen in `org-ascii--unique-links'. - (title (org-ascii--build-title headline info width (not low-level))) + (title (org-ascii--build-title heading info width (not low-level))) ;; Blank lines between heading and its contents. ;; `org-ascii-headline-spacing', when set, overwrites ;; original buffer's spacing. (pre-blanks (make-string (or (car (plist-get info :ascii-headline-spacing)) - (org-element-property :pre-blank headline) + (org-element-property :pre-blank heading) 0) ?\n)) (links (and (plist-get info :ascii-links-to-notes) (org-ascii--describe-links - (org-ascii--unique-links headline info) width info))) + (org-ascii--unique-links heading info) width info))) ;; Re-build contents, inserting section links at the right ;; place. The cost is low since build results are cached. (body (if (not (org-string-nw-p links)) contents - (let* ((contents (org-element-contents headline)) + (let* ((contents (org-element-contents heading)) (section (let ((first (car contents))) (and (eq (org-element-type first) 'section) first)))) @@ -1754,8 +1754,8 @@ contextual information." (if (not (org-string-nw-p links)) contents (concat (org-element-normalize-string contents) "\n\n" links)) ;; Do not apply inner margin if parent heading is low level. - (let ((headline (org-export-get-parent-headline section))) - (if (or (not headline) (org-export-low-level-p headline info)) 0 + (let ((heading (org-export-get-parent-headline section))) + (if (or (not heading) (org-export-low-level-p heading info)) 0 (plist-get info :ascii-inner-margin)))))) @@ -2028,19 +2028,19 @@ contextual information." ;;; Filters -(defun org-ascii-filter-headline-blank-lines (headline _backend info) - "Filter controlling number of blank lines after a headline. +(defun org-ascii-filter-headline-blank-lines (heading _backend info) + "Filter controlling number of blank lines after a heading. -HEADLINE is a string representing a transcoded headline. BACKEND +HEADING is a string representing a transcoded heading. BACKEND is symbol specifying back-end used for export. INFO is plist containing the communication channel. This function only applies to `ascii' back-end. See `org-ascii-headline-spacing' for information." - (let ((headline-spacing (plist-get info :ascii-headline-spacing))) - (if (not headline-spacing) headline - (let ((blanks (make-string (1+ (cdr headline-spacing)) ?\n))) - (replace-regexp-in-string "\n\\(?:\n[ \t]*\\)*\\'" blanks headline))))) + (let ((heading-spacing (plist-get info :ascii-headline-spacing))) + (if (not heading-spacing) heading + (let ((blanks (make-string (1+ (cdr heading-spacing)) ?\n))) + (replace-regexp-in-string "\n\\(?:\n[ \t]*\\)*\\'" blanks heading))))) (defun org-ascii-filter-paragraph-spacing (tree _backend info) "Filter controlling number of blank lines between paragraphs. diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el index fbed11f58..84a9193ba 100644 --- a/lisp/ox-beamer.el +++ b/lisp/ox-beamer.el @@ -320,18 +320,18 @@ channel." ;; like "ignoreheading", "note", "noteNH", "appendix" and ;; "againframe". -(defun org-beamer--get-label (headline info) - "Return label for HEADLINE, as a string. +(defun org-beamer--get-label (heading info) + "Return label for HEADING, as a string. INFO is a plist used as a communication channel. The value is either the label specified in \"BEAMER_opt\" property, the custom ID, if there is one and `:latex-prefer-user-labels' property has a non-nil value, or -a unique internal label. This function assumes HEADLINE will be +a unique internal label. This function assumes HEADING will be treated as a frame." (cond - ((let ((opt (org-element-property :BEAMER_OPT headline))) + ((let ((opt (org-element-property :BEAMER_OPT heading))) (and (stringp opt) (string-match "\\(?:^\\|,\\)label=\\(.*?\\)\\(?:$\\|,\\)" opt) (let ((label (match-string 1 opt))) @@ -339,26 +339,26 @@ treated as a frame." (substring label 1 -1) label))))) ((and (plist-get info :latex-prefer-user-labels) - (org-element-property :CUSTOM_ID headline))) - (t (format "sec:%s" (org-export-get-reference headline info))))) + (org-element-property :CUSTOM_ID heading))) + (t (format "sec:%s" (org-export-get-reference heading info))))) -(defun org-beamer--frame-level (headline info) - "Return frame level in subtree containing HEADLINE. +(defun org-beamer--frame-level (heading info) + "Return frame level in subtree containing HEADING. INFO is a plist used as a communication channel." (or ;; 1. Look for "frame" environment in parents, starting from the ;; farthest. (catch 'exit - (dolist (parent (nreverse (org-element-lineage headline))) + (dolist (parent (nreverse (org-element-lineage heading))) (let ((env (org-element-property :BEAMER_ENV parent))) (when (and env (member-ignore-case env '("frame" "fullframe"))) (throw 'exit (org-export-get-relative-level parent info)))))) ;; 2. Look for "frame" environment in HEADING. - (let ((env (org-element-property :BEAMER_ENV headline))) + (let ((env (org-element-property :BEAMER_ENV heading))) (and env (member-ignore-case env '("frame" "fullframe")) - (org-export-get-relative-level headline info))) + (org-export-get-relative-level heading info))) ;; 3. Look for "frame" environment in sub-tree. - (org-element-map headline 'headline + (org-element-map heading 'headline (lambda (hl) (let ((env (org-element-property :BEAMER_ENV hl))) (when (and env (member-ignore-case env '("frame" "fullframe"))) @@ -367,11 +367,11 @@ INFO is a plist used as a communication channel." ;; 4. No "frame" environment in tree: use default value. (plist-get info :headline-levels))) -(defun org-beamer--format-section (headline contents info) - "Format HEADLINE as a sectioning part. -CONTENTS holds the contents of the headline. INFO is a plist +(defun org-beamer--format-section (heading contents info) + "Format HEADING as a sectioning part. +CONTENTS holds the contents of the heading. INFO is a plist used as a communication channel." - (let ((latex-headline + (let ((latex-heading (org-export-with-backend ;; We create a temporary export back-end which behaves the ;; same as current one, but adds "\protect" in front of the @@ -388,40 +388,40 @@ used as a communication channel." (mapcar (lambda (type) (cons type protected-output)) '(bold footnote-reference italic strike-through timestamp underline)))) - headline + heading contents info)) - (mode-specs (org-element-property :BEAMER_ACT headline))) + (mode-specs (org-element-property :BEAMER_ACT heading))) (if (and mode-specs (string-match "\\`\\\\\\(.*?\\)\\(?:\\*\\|\\[.*\\]\\)?{" - latex-headline)) + latex-heading)) ;; Insert overlay specifications. - (replace-match (concat (match-string 1 latex-headline) + (replace-match (concat (match-string 1 latex-heading) (format "<%s>" mode-specs)) - nil nil latex-headline 1) - latex-headline))) + nil nil latex-heading 1) + latex-heading))) -(defun org-beamer--format-frame (headline contents info) - "Format HEADLINE as a frame. -CONTENTS holds the contents of the headline. INFO is a plist +(defun org-beamer--format-frame (heading contents info) + "Format HEADING as a frame. +CONTENTS holds the contents of the heading. INFO is a plist used as a communication channel." (let ((fragilep ;; FRAGILEP is non-nil when HEADING contains an element ;; among `org-beamer-verbatim-elements'. - (org-element-map headline org-beamer-verbatim-elements 'identity + (org-element-map heading org-beamer-verbatim-elements 'identity info 'first-match))) (concat "\\begin{frame}" ;; Overlay specification, if any. When surrounded by ;; square brackets, consider it as a default ;; specification. - (let ((action (org-element-property :BEAMER_ACT headline))) + (let ((action (org-element-property :BEAMER_ACT heading))) (cond ((not action) "") ((string-match "\\`\\[.*\\]\\'" action ) (org-beamer--normalize-argument action 'defaction)) (t (org-beamer--normalize-argument action 'action)))) ;; Options, if any. - (let* ((beamer-opt (org-element-property :BEAMER_OPT headline)) + (let* ((beamer-opt (org-element-property :BEAMER_OPT heading)) (options ;; Collect nonempty options from default value and ;; heading's properties. @@ -450,7 +450,7 @@ used as a communication channel." (not (cl-some (lambda (s) (string-match-p "^label=" s)) options)) (list - (let ((label (org-beamer--get-label headline info))) + (let ((label (org-beamer--get-label heading info))) ;; Labels containing colons need to be ;; wrapped within braces. (format (if (string-match-p ":" label) @@ -462,11 +462,11 @@ used as a communication channel." (mapconcat #'identity (append label fragile options) ",") 'option)) ;; Title. - (let ((env (org-element-property :BEAMER_ENV headline))) + (let ((env (org-element-property :BEAMER_ENV heading))) (format "{%s}" (if (and env (equal (downcase env) "fullframe")) "" (org-export-data - (org-element-property :title headline) info)))) + (org-element-property :title heading) info)))) "\n" ;; The following workaround is required in fragile frames ;; as Beamer will append "\par" to the beginning of the @@ -479,16 +479,16 @@ used as a communication channel." (replace-regexp-in-string "\\`\n*" "\\& " (or contents ""))) "\\end{frame}"))) -(defun org-beamer--format-block (headline contents info) - "Format HEADLINE as a block. -CONTENTS holds the contents of the headline. INFO is a plist +(defun org-beamer--format-block (heading contents info) + "Format HEADING as a block. +CONTENTS holds the contents of the heading. INFO is a plist used as a communication channel." - (let* ((column-width (org-element-property :BEAMER_COL headline)) + (let* ((column-width (org-element-property :BEAMER_COL heading)) ;; ENVIRONMENT defaults to "block" if none is specified and ;; there is no column specification. If there is a column ;; specified but still no explicit environment, ENVIRONMENT ;; is "column". - (environment (let ((env (org-element-property :BEAMER_ENV headline))) + (environment (let ((env (org-element-property :BEAMER_ENV heading))) (cond ;; "block" is the fallback environment. ((and (not env) (not column-width)) "block") @@ -496,16 +496,16 @@ used as a communication channel." ((not env) "column") ;; Use specified environment. (t env)))) - (raw-title (org-element-property :raw-value headline)) + (raw-title (org-element-property :raw-value heading)) (env-format (cond ((member environment '("column" "columns")) nil) ((assoc environment (append (plist-get info :beamer-environments-extra) org-beamer-environments-default))) - (t (user-error "Wrong block type at a headline named \"%s\"" + (t (user-error "Wrong block type at a heading named \"%s\"" raw-title)))) - (title (org-export-data (org-element-property :title headline) info)) - (raw-options (org-element-property :BEAMER_OPT headline)) + (title (org-export-data (org-element-property :title heading) info)) + (raw-options (org-element-property :BEAMER_OPT heading)) (options (if raw-options (org-beamer--normalize-argument raw-options 'option) "")) @@ -513,17 +513,17 @@ used as a communication channel." ;; when there is no previous heading or the previous ;; heading do not have a BEAMER_column property. (parent-env (org-element-property - :BEAMER_ENV (org-export-get-parent-headline headline))) + :BEAMER_ENV (org-export-get-parent-headline heading))) (start-columns-p (or (equal environment "columns") (and column-width (not (and parent-env (equal (downcase parent-env) "columns"))) - (or (org-export-first-sibling-p headline info) + (or (org-export-first-sibling-p heading info) (not (org-element-property :BEAMER_COL (org-export-get-previous-element - headline info))))))) + heading info))))))) ;; End the "columns" environment when explicitly requested or ;; when there is no next heading or the next heading do not ;; have a BEAMER_column property. @@ -532,10 +532,10 @@ used as a communication channel." (and column-width (not (and parent-env (equal (downcase parent-env) "columns"))) - (or (org-export-last-sibling-p headline info) + (or (org-export-last-sibling-p heading info) (not (org-element-property :BEAMER_COL - (org-export-get-next-element headline info)))))))) + (org-export-get-next-element heading info)))))))) (concat (when start-columns-p ;; Column can accept options only when the environment is @@ -558,7 +558,7 @@ used as a communication channel." ;; brackets, it is a default overlay specification and ;; overlay specification is empty. Otherwise, it is an ;; overlay specification and the default one is nil. - (let ((action (org-element-property :BEAMER_ACT headline))) + (let ((action (org-element-property :BEAMER_ACT heading))) (cond ((not action) (list (cons "a" "") (cons "A" "") (cons "R" ""))) ((and (string-prefix-p "[" action) @@ -586,32 +586,32 @@ used as a communication channel." (when column-width "\\end{column}\n") (when end-columns-p "\\end{columns}")))) -(defun org-beamer-headline (headline contents info) - "Transcode HEADLINE element into Beamer code. -CONTENTS is the contents of the headline. INFO is a plist used +(defun org-beamer-headline (heading contents info) + "Transcode HEADING element into Beamer code. +CONTENTS is the contents of the heading. INFO is a plist used as a communication channel." - (unless (org-element-property :footnote-section-p headline) - (let ((level (org-export-get-relative-level headline info)) - (frame-level (org-beamer--frame-level headline info)) - (environment (let ((env (org-element-property :BEAMER_ENV headline))) + (unless (org-element-property :footnote-section-p heading) + (let ((level (org-export-get-relative-level heading info)) + (frame-level (org-beamer--frame-level heading info)) + (environment (let ((env (org-element-property :BEAMER_ENV heading))) (or (org-string-nw-p env) "block")))) (cond ;; Case 1: Resume frame specified by "BEAMER_ref" property. ((equal environment "againframe") - (let ((ref (org-element-property :BEAMER_REF headline))) + (let ((ref (org-element-property :BEAMER_REF heading))) ;; Reference to frame being resumed is mandatory. Ignore ;; the whole heading if it isn't provided. (when (org-string-nw-p ref) (concat "\\againframe" ;; Overlay specification. - (let ((overlay (org-element-property :BEAMER_ACT headline))) + (let ((overlay (org-element-property :BEAMER_ACT heading))) (when overlay (org-beamer--normalize-argument overlay (if (string-match "\\`\\[.*\\]\\'" overlay) 'defaction 'action)))) ;; Options. - (let ((options (org-element-property :BEAMER_OPT headline))) + (let ((options (org-element-property :BEAMER_OPT heading))) (when options (org-beamer--normalize-argument options 'option))) ;; Resolve reference provided by "BEAMER_ref" @@ -635,19 +635,19 @@ as a communication channel." ;; Case 2: Creation of an appendix is requested. ((equal environment "appendix") (concat "\\appendix" - (org-element-property :BEAMER_ACT headline) + (org-element-property :BEAMER_ACT heading) "\n" - (make-string (org-element-property :pre-blank headline) ?\n) + (make-string (org-element-property :pre-blank heading) ?\n) contents)) ;; Case 3: Ignore heading. ((equal environment "ignoreheading") - (concat (make-string (org-element-property :pre-blank headline) ?\n) + (concat (make-string (org-element-property :pre-blank heading) ?\n) contents)) ;; Case 4: HEADING is a note. ((member environment '("note" "noteNH")) (concat "\\note" ;; Overlay specification. - (let ((overlay (org-element-property :BEAMER_ACT headline))) + (let ((overlay (org-element-property :BEAMER_ACT heading))) (when overlay (org-beamer--normalize-argument overlay @@ -657,19 +657,19 @@ as a communication channel." (concat (and (equal environment "note") (concat (org-export-data - (org-element-property :title headline) + (org-element-property :title heading) info) "\n")) (org-trim contents))))) ;; Case 5: HEADING is a frame. ((= level frame-level) - (org-beamer--format-frame headline contents info)) + (org-beamer--format-frame heading contents info)) ;; Case 6: Regular section, extracted from ;; `org-latex-classes'. ((< level frame-level) - (org-beamer--format-section headline contents info)) + (org-beamer--format-section heading contents info)) ;; Case 7: Otherwise, HEADING is a block. - (t (org-beamer--format-block headline contents info)))))) + (t (org-beamer--format-block heading contents info)))))) ;;;; Item diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 7acf82418..f48c09be4 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2312,9 +2312,9 @@ a plist used as a communication channel. Optional argument SCOPE is an element defining the scope of the table. Return the table of contents as a string, or nil if it is empty." (let ((toc-entries - (mapcar (lambda (headline) - (cons (org-html--format-toc-headline headline info) - (org-export-get-relative-level headline info))) + (mapcar (lambda (heading) + (cons (org-html--format-toc-headline heading info) + (org-export-get-relative-level heading info))) (org-export-collect-headlines info depth scope)))) (when toc-entries (let ((toc (concat "
" @@ -2342,7 +2342,7 @@ and value is its relative level, as an integer." (concat (mapconcat (lambda (entry) - (let ((headline (car entry)) + (let ((heading (car entry)) (level (cdr entry))) (concat (let* ((cnt (- level prev-level)) @@ -2353,34 +2353,34 @@ and value is its relative level, as an integer." times (cond ((> cnt 0) "\n\n"))) (if (> cnt 0) "\n\n")))) -(defun org-html--format-toc-headline (headline info) - "Return an appropriate table of contents entry for HEADLINE. +(defun org-html--format-toc-headline (heading info) + "Return an appropriate table of contents entry for HEADING. INFO is a plist used as a communication channel." - (let* ((headline-number (org-export-get-headline-number headline info)) + (let* ((heading-number (org-export-get-headline-number heading info)) (todo (and (plist-get info :with-todo-keywords) - (let ((todo (org-element-property :todo-keyword headline))) + (let ((todo (org-element-property :todo-keyword heading))) (and todo (org-export-data todo info))))) - (todo-type (and todo (org-element-property :todo-type headline))) + (todo-type (and todo (org-element-property :todo-type heading))) (priority (and (plist-get info :with-priority) - (org-element-property :priority headline))) + (org-element-property :priority heading))) (text (org-export-data-with-backend - (org-export-get-alt-title headline info) + (org-export-get-alt-title heading info) (org-export-toc-entry-backend 'html) info)) (tags (and (eq (plist-get info :with-tags) t) - (org-export-get-tags headline info)))) + (org-export-get-tags heading info)))) (format "%s" ;; Label. - (org-html--reference headline info) + (org-html--reference heading info) ;; Body. (concat - (and (not (org-export-low-level-p headline info)) - (org-export-numbered-headline-p headline info) - (concat (mapconcat #'number-to-string headline-number ".") + (and (not (org-export-low-level-p heading info)) + (org-export-numbered-headline-p heading info) + (concat (mapconcat #'number-to-string heading-number ".") ". ")) (apply (plist-get info :html-format-headline-function) todo todo-type priority text tags :section-number nil))))) @@ -2601,53 +2601,53 @@ CONTENTS is nil. INFO is a plist holding contextual information." ;;;; Heading -(defun org-html-headline (headline contents info) - "Transcode a HEADLINE element from Org to HTML. -CONTENTS holds the contents of the headline. INFO is a plist +(defun org-html-headline (heading contents info) + "Transcode a HEADING element from Org to HTML. +CONTENTS holds the contents of the heading. INFO is a plist holding contextual information." - (unless (org-element-property :footnote-section-p headline) - (let* ((numberedp (org-export-numbered-headline-p headline info)) - (numbers (org-export-get-headline-number headline info)) - (level (+ (org-export-get-relative-level headline info) + (unless (org-element-property :footnote-section-p heading) + (let* ((numberedp (org-export-numbered-headline-p heading info)) + (numbers (org-export-get-headline-number heading info)) + (level (+ (org-export-get-relative-level heading info) (1- (plist-get info :html-toplevel-hlevel)))) (todo (and (plist-get info :with-todo-keywords) - (let ((todo (org-element-property :todo-keyword headline))) + (let ((todo (org-element-property :todo-keyword heading))) (and todo (org-export-data todo info))))) - (todo-type (and todo (org-element-property :todo-type headline))) + (todo-type (and todo (org-element-property :todo-type heading))) (priority (and (plist-get info :with-priority) - (org-element-property :priority headline))) - (text (org-export-data (org-element-property :title headline) info)) + (org-element-property :priority heading))) + (text (org-export-data (org-element-property :title heading) info)) (tags (and (plist-get info :with-tags) - (org-export-get-tags headline info))) + (org-export-get-tags heading info))) (full-text (funcall (plist-get info :html-format-headline-function) todo todo-type priority text tags info)) (contents (or contents "")) - (id (org-html--reference headline info)) + (id (org-html--reference heading info)) (formatted-text (if (plist-get info :html-self-link-headlines) (format "%s" id full-text) full-text))) - (if (org-export-low-level-p headline info) + (if (org-export-low-level-p heading info) ;; This is a deep sub-tree: export it as a list item. (let* ((html-type (if numberedp "ol" "ul"))) (concat - (and (org-export-first-sibling-p headline info) + (and (org-export-first-sibling-p heading info) (apply #'format "<%s class=\"org-%s\">\n" (make-list 2 html-type))) (org-html-format-list-item contents (if numberedp 'ordered 'unordered) nil info nil (concat (org-html--anchor id nil nil info) formatted-text)) "\n" - (and (org-export-last-sibling-p headline info) + (and (org-export-last-sibling-p heading info) (format "\n" html-type)))) ;; Standard heading. Export it as a section. (let ((extra-class - (org-element-property :HTML_CONTAINER_CLASS headline)) - (headline-class - (org-element-property :HTML_HEADLINE_CLASS headline)) - (first-content (car (org-element-contents headline)))) + (org-element-property :HTML_CONTAINER_CLASS heading)) + (heading-class + (org-element-property :HTML_HEADLINE_CLASS heading)) + (first-content (car (org-element-contents heading)))) (format "<%s id=\"%s\" class=\"%s\">%s%s\n" - (org-html--container headline info) + (org-html--container heading info) (format "outline-container-%s" id) (concat (format "outline-%d" level) (and extra-class " ") @@ -2655,8 +2655,8 @@ holding contextual information." (format "\n%s\n" level id - (if (not headline-class) "" - (format " class=\"%s\"" headline-class)) + (if (not heading-class) "" + (format " class=\"%s\"" heading-class)) (concat (and numberedp (format @@ -2671,7 +2671,7 @@ holding contextual information." ;; `org-info.js'. (if (eq (org-element-type first-content) 'section) contents (concat (org-html-section first-content "" info) contents)) - (org-html--container headline info))))))) + (org-html--container heading info))))))) (defun org-html-format-headline-default-function (todo _todo-type priority text tags info) @@ -2685,9 +2685,9 @@ See `org-html-format-headline-function' for details." text (and tags "   ") tags))) -(defun org-html--container (headline info) - (or (org-element-property :HTML_CONTAINER headline) - (if (= 1 (org-export-get-relative-level headline info)) +(defun org-html--container (heading info) + (or (org-element-property :HTML_CONTAINER heading) + (if (= 1 (org-export-get-relative-level heading info)) (plist-get info :html-container) "div"))) @@ -2763,7 +2763,7 @@ INFO is a plist holding contextual information. See (defun org-html-format-list-item (contents type checkbox info &optional term-counter-id - headline) + heading) "Format a list item into HTML." (let ((class (if checkbox (format " class=\"%s\"" @@ -2771,7 +2771,7 @@ INFO is a plist holding contextual information. See (checkbox (concat (org-html-checkbox checkbox info) (and checkbox " "))) (br (org-html-close-tag "br" nil info)) - (extra-newline (if (and (org-string-nw-p contents) headline) "\n" ""))) + (extra-newline (if (and (org-string-nw-p contents) heading) "\n" ""))) (concat (pcase type (`ordered @@ -2779,13 +2779,13 @@ INFO is a plist holding contextual information. See (extra (if counter (format " value=\"%s\"" counter) ""))) (concat (format "" class extra) - (when headline (concat headline br))))) + (when heading (concat heading br))))) (`unordered (let* ((id term-counter-id) (extra (if id (format " id=\"%s\"" id) ""))) (concat (format "" class extra) - (when headline (concat headline br))))) + (when heading (concat heading br))))) (`descriptive (let* ((term term-counter-id)) (setq term (or term "(no term)")) diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el index b293636e0..8cd561ed8 100644 --- a/lisp/ox-icalendar.el +++ b/lisp/ox-icalendar.el @@ -331,12 +331,12 @@ a message if the file was modified." (message "ID properties created in file \"%s\"" file) (sit-for 2)))) -(defun org-icalendar-blocked-headline-p (headline info) - "Non-nil when HEADLINE is considered to be blocked. +(defun org-icalendar-blocked-headline-p (heading info) + "Non-nil when HEADING is considered to be blocked. INFO is a plist used as a communication channel. -A headline is blocked when either +A heading is blocked when either - it has children which are not all in a completed state; @@ -347,13 +347,13 @@ A headline is blocked when either done first or is a child of a blocked grandparent entry." (or ;; Check if any child is not done. - (org-element-map (org-element-contents headline) 'headline + (org-element-map (org-element-contents heading) 'headline (lambda (hl) (eq (org-element-property :todo-type hl) 'todo)) info 'first-match) ;; Check :ORDERED: node property. (catch 'blockedp - (let ((current headline)) - (dolist (parent (org-element-lineage headline)) + (let ((current heading)) + (dolist (parent (org-element-lineage heading)) (cond ((not (org-element-property :todo-keyword parent)) (throw 'blockedp nil)) @@ -515,11 +515,11 @@ or subject for the event." ;;; Filters -(defun org-icalendar-clear-blank-lines (headline _back-end _info) - "Remove blank lines in HEADLINE export. -HEADLINE is a string representing a transcoded headline. +(defun org-icalendar-clear-blank-lines (heading _back-end _info) + "Remove blank lines in HEADING export. +HEADING is a string representing a transcoded heading. BACK-END and INFO are ignored." - (replace-regexp-in-string "^\\(?:[ \t]*\n\\)+" "" headline)) + (replace-regexp-in-string "^\\(?:[ \t]*\n\\)+" "" heading)) diff --git a/lisp/ox-koma-letter.el b/lisp/ox-koma-letter.el index 50ef8c04e..b361a856c 100644 --- a/lisp/ox-koma-letter.el +++ b/lisp/ox-koma-letter.el @@ -626,31 +626,31 @@ channel." ;; Heading -(defun org-koma-letter-headline (headline contents info) - "Transcode a HEADLINE element from Org to LaTeX. -CONTENTS holds the contents of the headline. INFO is a plist +(defun org-koma-letter-headline (heading contents info) + "Transcode a HEADING element from Org to LaTeX. +CONTENTS holds the contents of the heading. INFO is a plist holding contextual information. -Note that if a headline is tagged with a tag from +Note that if a heading is tagged with a tag from `org-koma-letter-special-tags' it will not be exported, but stored in `org-koma-letter-special-contents' and included at the appropriate place." - (let ((special-tag (org-koma-letter--special-tag headline info))) + (let ((special-tag (org-koma-letter--special-tag heading info))) (if (not special-tag) contents (push (cons special-tag contents) org-koma-letter-special-contents) ""))) -(defun org-koma-letter--special-tag (headline info) - "Non-nil if HEADLINE is a special headline. +(defun org-koma-letter--special-tag (heading info) + "Non-nil if HEADING is a special heading. INFO is a plist holding contextual information. Return first -special tag headline." +special tag heading." (let ((special-tags (append (plist-get info :special-tags-in-letter) (plist-get info :special-tags-after-closing) (plist-get info :special-tags-after-letter)))) (cl-some (lambda (tag) (and (assoc-string tag special-tags) tag)) - (org-export-get-tags headline info)))) + (org-export-get-tags heading info)))) (defun org-koma-letter--keyword-or-headline (plist-key pred info) "Return the correct version of opening or closing. diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index ee627f780..dd8776796 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1949,14 +1949,14 @@ CONTENTS is nil. INFO is a plist holding contextual information." ;;;; Heading -(defun org-latex-headline (headline contents info) - "Transcode a HEADLINE element from Org to LaTeX. -CONTENTS holds the contents of the headline. INFO is a plist +(defun org-latex-headline (heading contents info) + "Transcode a HEADING element from Org to LaTeX. +CONTENTS holds the contents of the heading. INFO is a plist holding contextual information." - (unless (org-element-property :footnote-section-p headline) + (unless (org-element-property :footnote-section-p heading) (let* ((class (plist-get info :latex-class)) - (level (org-export-get-relative-level headline info)) - (numberedp (org-export-numbered-headline-p headline info)) + (level (org-export-get-relative-level heading info)) + (numberedp (org-export-numbered-headline-p heading info)) (class-sectioning (assoc class (plist-get info :latex-classes))) ;; Section formatting will set two placeholders: one for ;; the title and the other for the contents. @@ -1995,32 +1995,32 @@ holding contextual information." (verbatim . (lambda (o _ _) (org-latex--protect-texttt (org-element-property :value o))))))) (text (org-export-data-with-backend - (org-element-property :title headline) section-back-end info)) + (org-element-property :title heading) section-back-end info)) (todo (and (plist-get info :with-todo-keywords) - (let ((todo (org-element-property :todo-keyword headline))) + (let ((todo (org-element-property :todo-keyword heading))) (and todo (org-export-data todo info))))) - (todo-type (and todo (org-element-property :todo-type headline))) + (todo-type (and todo (org-element-property :todo-type heading))) (tags (and (plist-get info :with-tags) - (org-export-get-tags headline info))) + (org-export-get-tags heading info))) (priority (and (plist-get info :with-priority) - (org-element-property :priority headline))) + (org-element-property :priority heading))) ;; Create the heading text along with a no-tag version. ;; The latter is required to remove tags from toc. (full-text (funcall (plist-get info :latex-format-headline-function) todo todo-type priority text tags info)) ;; Associate \label to the heading for internal links. - (headline-label (org-latex--label headline info t t)) + (heading-label (org-latex--label heading info t t)) (pre-blanks - (make-string (org-element-property :pre-blank headline) ?\n))) - (if (or (not section-fmt) (org-export-low-level-p headline info)) + (make-string (org-element-property :pre-blank heading) ?\n))) + (if (or (not section-fmt) (org-export-low-level-p heading info)) ;; This is a deep sub-tree: export it as a list item. Also ;; export as items headings for which no section format has ;; been found. (let ((low-level-body (concat ;; If heading is the first sibling, start a list. - (when (org-export-first-sibling-p headline info) + (when (org-export-first-sibling-p heading info) (format "\\begin{%s}\n" (if numberedp 'enumerate 'itemize))) ;; Itemize heading "\\item" @@ -2028,13 +2028,13 @@ holding contextual information." (string-match-p "\\`[ \t]*\\[" full-text) "\\relax") " " full-text "\n" - headline-label + heading-label pre-blanks contents))) ;; If heading 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 + (if (not (org-export-last-sibling-p heading info)) low-level-body (replace-regexp-in-string "[ \t\n]*\\'" (format "\n\\\\end{%s}" (if numberedp 'enumerate 'itemize)) @@ -2046,7 +2046,7 @@ holding contextual information." (funcall (plist-get info :latex-format-headline-function) todo todo-type priority (org-export-data-with-backend - (org-export-get-alt-title headline info) + (org-export-get-alt-title heading info) section-back-end info) (and (eq (plist-get info :with-tags) t) tags) info)) @@ -2056,7 +2056,7 @@ holding contextual information." contents (let ((case-fold-search t) (section - (let ((first (car (org-element-contents headline)))) + (let ((first (car (org-element-contents heading)))) (and (eq (org-element-type first) 'section) first)))) (org-element-map section 'keyword (lambda (k) @@ -2076,11 +2076,11 @@ holding contextual information." (replace-regexp-in-string "\\[" "(" (replace-regexp-in-string "\\]" ")" opt-title)) full-text - (concat headline-label pre-blanks contents)) + (concat heading-label pre-blanks contents)) ;; Impossible to add an alternative heading. Fallback to ;; regular sectioning format string. (format section-fmt full-text - (concat headline-label pre-blanks contents)))))))) + (concat heading-label pre-blanks contents)))))))) (defun org-latex-format-headline-default-function (todo _todo-type priority text tags _info) diff --git a/lisp/ox-man.el b/lisp/ox-man.el index 59ddaf284..adededc31 100644 --- a/lisp/ox-man.el +++ b/lisp/ox-man.el @@ -442,11 +442,11 @@ CONTENTS is nil. INFO is a plist holding contextual information." ;;; Heading -(defun org-man-headline (headline contents info) - "Transcode a HEADLINE element from Org to Man. -CONTENTS holds the contents of the headline. INFO is a plist +(defun org-man-headline (heading contents info) + "Transcode a HEADING element from Org to Man. +CONTENTS holds the contents of the heading. INFO is a plist holding contextual information." - (let* ((level (org-export-get-relative-level headline info)) + (let* ((level (org-export-get-relative-level heading info)) ;; Section formatting will set two placeholders: one for the ;; title and the other for the contents. (section-fmt @@ -455,21 +455,21 @@ holding contextual information." (2 ".SS \"%s\"\n%s") (3 ".SS \"%s\"\n%s") (_ nil))) - (text (org-export-data (org-element-property :title headline) info))) + (text (org-export-data (org-element-property :title heading) info))) (cond ;; Case 1: This is a footnote section: ignore it. - ((org-element-property :footnote-section-p headline) nil) + ((org-element-property :footnote-section-p heading) nil) ;; Case 2. This is a deep sub-tree: export it as a list item. ;; Also export as items headings for which no section ;; format has been found. - ((or (not section-fmt) (org-export-low-level-p headline info)) + ((or (not section-fmt) (org-export-low-level-p heading info)) ;; Build the real contents of the sub-tree. (let ((low-level-body (concat ;; If the heading is the first sibling, start a list. - (when (org-export-first-sibling-p headline info) + (when (org-export-first-sibling-p heading info) (format "%s\n" ".RS")) ;; Itemize heading ".TP\n.ft I\n" text "\n.ft\n" @@ -477,7 +477,7 @@ holding contextual information." ;; If heading 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 + (if (not (org-export-last-sibling-p heading info)) low-level-body (replace-regexp-in-string "[ \t\n]*\\'" "" low-level-body)))) diff --git a/lisp/ox-md.el b/lisp/ox-md.el index fa0247ca0..9fb75fa57 100644 --- a/lisp/ox-md.el +++ b/lisp/ox-md.el @@ -159,15 +159,15 @@ Assume BACKEND is `md'." ;;; Internal functions -(defun org-md--headline-referred-p (headline info) - "Non-nil when HEADLINE is being referred to. +(defun org-md--headline-referred-p (heading info) + "Non-nil when HEADING is being referred to. INFO is a plist used as a communication channel. Links and table -of contents can refer to headlines." - (unless (org-element-property :footnote-section-p headline) +of contents can refer to headings." + (unless (org-element-property :footnote-section-p heading) (or ;; Global table of contents includes HEADING. (and (plist-get info :with-toc) - (memq headline + (memq heading (org-export-collect-headlines info (plist-get info :with-toc)))) ;; A local table of contents includes HEADING. (cl-some @@ -185,15 +185,15 @@ of contents can refer to headlines." (string-match "\\<[0-9]+\\>" value) (string-to-number (match-string 0 value)))) (local? (string-match-p "\\" value))) - (memq headline + (memq heading (org-export-collect-headlines info n (and local? keyword)))))))) info t)))) - (org-element-lineage headline)) + (org-element-lineage heading)) ;; A link refers internally to HEADING. (org-element-map (plist-get info :parse-tree) 'link (lambda (link) - (eq headline + (eq heading (pcase (org-element-property :type link) ((or "custom-id" "id") (org-export-resolve-id-link link info)) ("fuzzy" (org-export-resolve-fuzzy-link link info)) @@ -233,30 +233,30 @@ contents according to the specified element." (title (org-html--translate "Table of Contents" info))) (org-md--headline-title style 1 title nil))) (mapconcat - (lambda (headline) + (lambda (heading) (let* ((indentation (make-string - (* 4 (1- (org-export-get-relative-level headline info))) + (* 4 (1- (org-export-get-relative-level heading info))) ?\s)) (bullet - (if (not (org-export-numbered-headline-p headline info)) "- " + (if (not (org-export-numbered-headline-p heading info)) "- " (let ((prefix (format "%d." (org-last (org-export-get-headline-number - headline info))))) + heading info))))) (concat prefix (make-string (max 1 (- 4 (length prefix))) ?\s))))) (title (format "[%s](#%s)" (org-export-data-with-backend - (org-export-get-alt-title headline info) + (org-export-get-alt-title heading info) (org-export-toc-entry-backend 'md) info) - (or (org-element-property :CUSTOM_ID headline) - (org-export-get-reference headline info)))) + (or (org-element-property :CUSTOM_ID heading) + (org-export-get-reference heading info)))) (tags (and (plist-get info :with-tags) (not (eq 'not-in-toc (plist-get info :with-tags))) (org-make-tag-string - (org-export-get-tags headline info))))) + (org-export-get-tags heading info))))) (concat indentation bullet title tags))) (org-export-collect-headlines info n scope) "\n") "\n")) @@ -345,48 +345,48 @@ CONTENTS is nil. INFO is a plist holding contextual information." ;;;; Heading -(defun org-md-headline (headline contents info) - "Transcode HEADLINE element into Markdown format. -CONTENTS is the headline contents. INFO is a plist used as +(defun org-md-headline (heading contents info) + "Transcode HEADING element into Markdown format. +CONTENTS is the heading contents. INFO is a plist used as a communication channel." - (unless (org-element-property :footnote-section-p headline) - (let* ((level (org-export-get-relative-level headline info)) - (title (org-export-data (org-element-property :title headline) info)) + (unless (org-element-property :footnote-section-p heading) + (let* ((level (org-export-get-relative-level heading info)) + (title (org-export-data (org-element-property :title heading) info)) (todo (and (plist-get info :with-todo-keywords) (let ((todo (org-element-property :todo-keyword - headline))) + heading))) (and todo (concat (org-export-data todo info) " "))))) (tags (and (plist-get info :with-tags) - (let ((tag-list (org-export-get-tags headline info))) + (let ((tag-list (org-export-get-tags heading info))) (and tag-list (concat " " (org-make-tag-string tag-list)))))) (priority (and (plist-get info :with-priority) - (let ((char (org-element-property :priority headline))) + (let ((char (org-element-property :priority heading))) (and char (format "[#%c] " char))))) ;; Heading text without tags. (heading (concat todo priority title)) (style (plist-get info :md-headline-style))) (cond ;; Cannot create a heading. Fall-back to a list. - ((or (org-export-low-level-p headline info) + ((or (org-export-low-level-p heading info) (not (memq style '(atx setext))) (and (eq style 'atx) (> level 6)) (and (eq style 'setext) (> level 2))) (let ((bullet - (if (not (org-export-numbered-headline-p headline info)) "-" + (if (not (org-export-numbered-headline-p heading info)) "-" (concat (number-to-string (car (last (org-export-get-headline-number - headline info)))) + heading info)))) ".")))) (concat bullet (make-string (- 4 (length bullet)) ?\s) heading tags "\n\n" (and contents (replace-regexp-in-string "^" " " contents))))) (t (let ((anchor - (and (org-md--headline-referred-p headline info) + (and (org-md--headline-referred-p heading info) (format "" - (or (org-element-property :CUSTOM_ID headline) - (org-export-get-reference headline info)))))) + (or (org-element-property :CUSTOM_ID heading) + (org-export-get-reference heading info)))))) (concat (org-md--headline-title style level heading anchor tags) contents))))))) diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el index a506658b1..4da41be2c 100644 --- a/lisp/ox-odt.el +++ b/lisp/ox-odt.el @@ -1148,21 +1148,21 @@ table of contents as a string, or nil." ;; ;; Likewise, links, footnote references and regular targets are also ;; suppressed. - (let* ((headlines (org-export-collect-headlines info depth scope)) + (let* ((headings (org-export-collect-headlines info depth scope)) (backend (org-export-toc-entry-backend (org-export-backend-name (plist-get info :back-end))))) - (when headlines + (when headings (org-odt--format-toc (and (not scope) (org-export-translate "Table of Contents" :utf-8 info)) (mapconcat - (lambda (headline) + (lambda (heading) (let* ((entry (org-odt-format-headline--wrap - headline backend info 'org-odt-format-toc-headline)) - (level (org-export-get-relative-level headline info)) + heading backend info 'org-odt-format-toc-headline)) + (level (org-export-get-relative-level heading info)) (style (format "Contents_20_%d" level))) (format "\n%s" style entry))) - headlines "\n") + headings "\n") depth)))) @@ -1750,58 +1750,58 @@ CONTENTS is nil. INFO is a plist holding contextual information." ;;;; Heading -(defun org-odt-format-headline--wrap (headline backend info +(defun org-odt-format-headline--wrap (heading backend info &optional format-function &rest extra-keys) - "Transcode a HEADLINE element using BACKEND. + "Transcode a HEADING element using BACKEND. INFO is a plist holding contextual information." (setq backend (or backend (plist-get info :back-end))) - (let* ((level (+ (org-export-get-relative-level headline info))) - (headline-number (org-export-get-headline-number headline info)) - (section-number (and (org-export-numbered-headline-p headline info) + (let* ((level (+ (org-export-get-relative-level heading info))) + (heading-number (org-export-get-headline-number heading info)) + (section-number (and (org-export-numbered-headline-p heading info) (mapconcat 'number-to-string - headline-number "."))) + heading-number "."))) (todo (and (plist-get info :with-todo-keywords) - (let ((todo (org-element-property :todo-keyword headline))) + (let ((todo (org-element-property :todo-keyword heading))) (and todo (org-export-data-with-backend todo backend info))))) - (todo-type (and todo (org-element-property :todo-type headline))) + (todo-type (and todo (org-element-property :todo-type heading))) (priority (and (plist-get info :with-priority) - (org-element-property :priority headline))) + (org-element-property :priority heading))) (text (org-export-data-with-backend - (org-element-property :title headline) backend info)) + (org-element-property :title heading) backend info)) (tags (and (plist-get info :with-tags) - (org-export-get-tags headline info))) - (headline-label (org-export-get-reference headline info)) + (org-export-get-tags heading info))) + (heading-label (org-export-get-reference heading info)) (format-function (if (functionp format-function) format-function (cl-function (lambda (todo todo-type priority text tags - &key _level _section-number _headline-label + &key _level _section-number _heading-label &allow-other-keys) (funcall (plist-get info :odt-format-headline-function) todo todo-type priority text tags)))))) (apply format-function todo todo-type priority text tags - :headline-label headline-label + :headline-label heading-label :level level :section-number section-number extra-keys))) -(defun org-odt-headline (headline contents info) - "Transcode a HEADLINE element from Org to ODT. -CONTENTS holds the contents of the headline. INFO is a plist +(defun org-odt-headline (heading contents info) + "Transcode a HEADING element from Org to ODT. +CONTENTS holds the contents of the heading. INFO is a plist holding contextual information." ;; Case 1: This is a footnote section: ignore it. - (unless (org-element-property :footnote-section-p headline) - (let* ((full-text (org-odt-format-headline--wrap headline nil info)) + (unless (org-element-property :footnote-section-p heading) + (let* ((full-text (org-odt-format-headline--wrap heading nil info)) ;; Get level relative to current parsed data. - (level (org-export-get-relative-level headline info)) - (numbered (org-export-numbered-headline-p headline info)) + (level (org-export-get-relative-level heading info)) + (numbered (org-export-numbered-headline-p heading info)) ;; Get canonical label for the heading. - (id (org-export-get-reference headline info)) + (id (org-export-get-reference heading info)) ;; Extra targets. (extra-targets - (let ((id (org-element-property :ID headline))) + (let ((id (org-element-property :ID heading))) (if id (org-odt--target "" (concat "ID-" id)) ""))) ;; Title. (anchored-title (org-odt--target full-text id))) @@ -1809,10 +1809,10 @@ holding contextual information." ;; Case 2. This is a deep sub-tree: export it as a list item. ;; Also export as items headings for which no section ;; format has been found. - ((org-export-low-level-p headline info) + ((org-export-low-level-p heading info) ;; Build the real contents of the sub-tree. (concat - (and (org-export-first-sibling-p headline info) + (and (org-export-first-sibling-p heading info) (format "\n" ;; Choose style based on list type. (if numbered "OrgNumberedList" "OrgBulletedList") @@ -1820,12 +1820,12 @@ holding contextual information." ;; continue numbering. (format "text:continue-numbering=\"%s\"" (let* ((parent (org-export-get-parent-headline - headline))) + heading))) (if (and parent (org-export-low-level-p parent info)) "true" "false"))))) - (let ((headline-has-table-p - (let ((section (assq 'section (org-element-contents headline)))) + (let ((heading-has-table-p + (let ((section (assq 'section (org-element-contents heading)))) (assq 'table (and section (org-element-contents section)))))) (format "\n\n%s\n%s" (concat @@ -1833,10 +1833,10 @@ holding contextual information." "Text_20_body" (concat extra-targets anchored-title)) contents) - (if headline-has-table-p + (if heading-has-table-p "" ""))) - (and (org-export-last-sibling-p headline info) + (and (org-export-last-sibling-p heading info) ""))) ;; Case 3. Standard heading. Export it as a section. (t @@ -2654,7 +2654,7 @@ Return nil, otherwise." item-numbers ""))))) ;; Case 2: Locate a regular and numbered heading in the ;; hierarchy. Display its section number. - (let ((headline + (let ((heading (and ;; Test if destination is a numbered heading. (org-export-numbered-headline-p destination info) @@ -2664,22 +2664,22 @@ Return nil, otherwise." (org-export-numbered-headline-p el info)) return el)))) ;; We found one. - (when headline + (when heading (format "%s" label (mapconcat 'number-to-string (org-export-get-headline-number - headline info) ".")))) + heading info) ".")))) ;; Case 4: Locate a regular heading in the hierarchy. Display ;; its title. - (let ((headline (cl-loop for el in (cons destination genealogy) + (let ((heading (cl-loop for el in (cons destination genealogy) when (and (eq (org-element-type el) 'headline) (not (org-export-low-level-p el info))) return el))) ;; We found one. - (when headline + (when heading (format "%s" label - (let ((title (org-element-property :title headline))) + (let ((title (org-element-property :title heading))) (org-export-data title info))))) (error "FIXME?")))) diff --git a/lisp/ox-org.el b/lisp/ox-org.el index 842c3668b..74dfd5531 100644 --- a/lisp/ox-org.el +++ b/lisp/ox-org.el @@ -144,19 +144,19 @@ CONTENTS is its contents, as a string or nil. INFO is ignored." "^[ \t]*#\\+attr_[-_a-z0-9]+:\\(?: .*\\)?\n" "" (org-export-expand blob contents t)))) -(defun org-org-headline (headline contents info) - "Transcode HEADLINE element back into Org syntax. +(defun org-org-headline (heading contents info) + "Transcode HEADING element back into Org syntax. CONTENTS is its contents, as a string or nil. INFO is ignored." - (unless (org-element-property :footnote-section-p headline) + (unless (org-element-property :footnote-section-p heading) (unless (plist-get info :with-todo-keywords) - (org-element-put-property headline :todo-keyword nil)) + (org-element-put-property heading :todo-keyword nil)) (unless (plist-get info :with-tags) - (org-element-put-property headline :tags nil)) + (org-element-put-property heading :tags nil)) (unless (plist-get info :with-priority) - (org-element-put-property headline :priority nil)) - (org-element-put-property headline :level - (org-export-get-relative-level headline info)) - (org-element-headline-interpreter headline contents))) + (org-element-put-property heading :priority nil)) + (org-element-put-property heading :level + (org-export-get-relative-level heading info)) + (org-element-headline-interpreter heading contents))) (defun org-org-keyword (keyword _contents _info) "Transcode KEYWORD element back into Org syntax. diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index 5eef93353..bae16a9b8 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -414,9 +414,9 @@ If two strings share the same prefix (e.g. \"ISO-8859-1\" and "Remove TAB characters in string S." (replace-regexp-in-string "\t" (make-string tab-width ?\s) s)) -(defun org-texinfo--filter-section-blank-lines (headline _backend _info) +(defun org-texinfo--filter-section-blank-lines (heading _backend _info) "Filter controlling number of blank lines after a section." - (replace-regexp-in-string "\n\\(?:\n[ \t]*\\)*\\'" "\n\n" headline)) + (replace-regexp-in-string "\n\\(?:\n[ \t]*\\)*\\'" "\n\n" heading)) (defun org-texinfo--normalize-headlines (tree _backend info) "Normalize headings in TREE. @@ -863,28 +863,28 @@ plist holding contextual information." ;;;; Heading -(defun org-texinfo-headline (headline contents info) - "Transcode a HEADLINE element from Org to Texinfo. -CONTENTS holds the contents of the headline. INFO is a plist +(defun org-texinfo-headline (heading contents info) + "Transcode a HEADING element from Org to Texinfo. +CONTENTS holds the contents of the heading. INFO is a plist holding contextual information." (cond - ((org-element-property :footnote-section-p headline) nil) - ((org-not-nil (org-export-get-node-property :COPYING headline t)) nil) + ((org-element-property :footnote-section-p heading) nil) + ((org-not-nil (org-export-get-node-property :COPYING heading t)) nil) (t - (let* ((index (let ((i (org-export-get-node-property :INDEX headline t))) + (let* ((index (let ((i (org-export-get-node-property :INDEX heading t))) (and (member i '("cp" "fn" "ky" "pg" "tp" "vr")) i))) - (numbered? (org-export-numbered-headline-p headline info)) - (notoc? (org-export-excluded-from-toc-p headline info)) + (numbered? (org-export-numbered-headline-p heading info)) + (notoc? (org-export-excluded-from-toc-p heading info)) (command (and - (not (org-export-low-level-p headline info)) + (not (org-export-low-level-p heading info)) (let ((sections (org-texinfo--sectioning-structure info))) - (pcase (nth (1- (org-export-get-relative-level headline info)) + (pcase (nth (1- (org-export-get-relative-level heading info)) sections) (`(,numbered ,unnumbered ,unnumbered-no-toc ,appendix) (cond ((org-not-nil - (org-export-get-node-property :APPENDIX headline t)) + (org-export-get-node-property :APPENDIX heading t)) appendix) (numbered? numbered) (index unnumbered) @@ -895,15 +895,15 @@ holding contextual information." (plist-get info :texinfo-class))))))) (todo (and (plist-get info :with-todo-keywords) - (let ((todo (org-element-property :todo-keyword headline))) + (let ((todo (org-element-property :todo-keyword heading))) (and todo (org-export-data todo info))))) - (todo-type (and todo (org-element-property :todo-type headline))) + (todo-type (and todo (org-element-property :todo-type heading))) (tags (and (plist-get info :with-tags) - (org-export-get-tags headline info))) + (org-export-get-tags heading info))) (priority (and (plist-get info :with-priority) - (org-element-property :priority headline))) + (org-element-property :priority heading))) (text (org-texinfo--sanitize-title - (org-element-property :title headline) info)) + (org-element-property :title heading) info)) (full-text (funcall (plist-get info :texinfo-format-headline-function) todo todo-type priority text tags)) @@ -911,13 +911,13 @@ holding contextual information." (concat "\n" (if (org-string-nw-p contents) (concat "\n" contents) "") (and index (format "\n@printindex %s\n" index)))) - (node (org-texinfo--get-node headline info))) + (node (org-texinfo--get-node heading info))) (if (not command) - (concat (and (org-export-first-sibling-p headline info) + (concat (and (org-export-first-sibling-p heading info) (format "@%s\n" (if numbered? 'enumerate 'itemize))) (format "@item\n@anchor{%s}%s\n" node full-text) contents - (if (org-export-last-sibling-p headline info) + (if (org-export-last-sibling-p heading info) (format "@end %s" (if numbered? 'enumerate 'itemize)) "\n")) (concat diff --git a/lisp/ox.el b/lisp/ox.el index da8cc1475..cf7afbe59 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -1683,13 +1683,13 @@ associated numbering \(in the shape of a list of numbers) or nil for a footnotes section." (let ((numbering (make-vector org-export-max-depth 0))) (org-element-map data 'headline - (lambda (headline) - (when (and (org-export-numbered-headline-p headline options) - (not (org-element-property :footnote-section-p headline))) + (lambda (heading) + (when (and (org-export-numbered-headline-p heading options) + (not (org-element-property :footnote-section-p heading))) (let ((relative-level - (1- (org-export-get-relative-level headline options)))) + (1- (org-export-get-relative-level heading options)))) (cons - headline + heading (cl-loop for n across numbering for idx from 0 to org-export-max-depth @@ -3925,39 +3925,39 @@ process, leading to a different order when footnotes are nested." ;; as a secondary string, suitable for table of contents. It falls ;; back onto default title. -(defun org-export-get-relative-level (headline info) - "Return HEADLINE relative level within current parsed tree. +(defun org-export-get-relative-level (heading info) + "Return HEADING relative level within current parsed tree. INFO is a plist holding contextual information." - (+ (org-element-property :level headline) + (+ (org-element-property :level heading) (or (plist-get info :headline-offset) 0))) -(defun org-export-low-level-p (headline info) - "Non-nil when HEADLINE is considered as low level. +(defun org-export-low-level-p (heading info) + "Non-nil when HEADING is considered as low level. INFO is a plist used as a communication channel. -A low level headlines has a relative level greater than +A low level headings has a relative level greater than `:headline-levels' property value. -Return value is the difference between HEADLINE relative level +Return value is the difference between HEADING relative level and the last level being considered as high enough, or nil." (let ((limit (plist-get info :headline-levels))) (when (wholenump limit) - (let ((level (org-export-get-relative-level headline info))) + (let ((level (org-export-get-relative-level heading info))) (and (> level limit) (- level limit)))))) -(defun org-export-get-headline-number (headline info) - "Return numbered HEADLINE numbering as a list of numbers. +(defun org-export-get-headline-number (heading info) + "Return numbered HEADING numbering as a list of numbers. INFO is a plist holding contextual information." - (and (org-export-numbered-headline-p headline info) - (cdr (assq headline (plist-get info :headline-numbering))))) + (and (org-export-numbered-headline-p heading info) + (cdr (assq heading (plist-get info :headline-numbering))))) -(defun org-export-numbered-headline-p (headline info) - "Return a non-nil value if HEADLINE element should be numbered. +(defun org-export-numbered-headline-p (heading info) + "Return a non-nil value if HEADING element should be numbered. INFO is a plist used as a communication channel." - (unless (org-not-nil (org-export-get-node-property :UNNUMBERED headline t)) + (unless (org-not-nil (org-export-get-node-property :UNNUMBERED heading t)) (let ((sec-num (plist-get info :section-numbers)) - (level (org-export-get-relative-level headline info))) + (level (org-export-get-relative-level heading info))) (if (wholenump sec-num) (<= level sec-num) sec-num)))) (defun org-export-number-to-roman (n) @@ -4010,10 +4010,10 @@ If optional argument INHERITED is non-nil, the value can be inherited from a parent heading. Return value is a string or nil." - (let ((headline (if (eq (org-element-type datum) 'headline) datum + (let ((heading (if (eq (org-element-type datum) 'headline) datum (org-export-get-parent-headline datum)))) (if (not inherited) (org-element-property property datum) - (let ((parent headline)) + (let ((parent heading)) (catch 'found (while parent (when (plist-member (nth 1 parent) property) @@ -4038,13 +4038,13 @@ fail, the fall-back value is \"???\"." (and file (file-name-sans-extension (file-name-nondirectory file)))) "???")) -(defun org-export-get-alt-title (headline _) - "Return alternative title for HEADLINE, as a secondary string. +(defun org-export-get-alt-title (heading _) + "Return alternative title for HEADING, as a secondary string. If no optional title is defined, fall-back to the regular title." - (let ((alt (org-element-property :ALT_TITLE headline))) + (let ((alt (org-element-property :ALT_TITLE heading))) (if alt (org-element-parse-secondary-string - alt (org-element-restriction 'headline) headline) - (org-element-property :title headline)))) + alt (org-element-restriction 'headline) heading) + (org-element-property :title heading)))) (defun org-export-first-sibling-p (blob info) "Non-nil when BLOB is the first sibling in its parent. @@ -4377,10 +4377,10 @@ tree or a file name. Assume LINK type is either \"id\" or (let ((id (org-element-property :path link))) ;; First check if id is within the current parse tree. (or (org-element-map (plist-get info :parse-tree) 'headline - (lambda (headline) - (when (or (equal (org-element-property :ID headline) id) - (equal (org-element-property :CUSTOM_ID headline) id)) - headline)) + (lambda (heading) + (when (or (equal (org-element-property :ID heading) id) + (equal (org-element-property :CUSTOM_ID heading) id)) + heading)) info 'first-match) ;; Otherwise, look for external files. (cdr (assoc id (plist-get info :id-alist))) @@ -5351,19 +5351,19 @@ INFO is a plist used as a communication channel. Return a list of `src-block' elements with a caption." (org-export-collect-elements 'src-block info)) -(defun org-export-excluded-from-toc-p (headline info) - "Non-nil if HEADLINE should be excluded from tables of contents. +(defun org-export-excluded-from-toc-p (heading info) + "Non-nil if HEADING should be excluded from tables of contents. INFO is a plist used as a communication channel. -Note that such headlines are already excluded from +Note that such headings are already excluded from `org-export-collect-headlines'. Therefore, this function is not -necessary if you only need to list headlines in the table of +necessary if you only need to list headings in the table of contents. However, it is useful if some additional processing is -required on headlines excluded from table of contents." - (or (org-element-property :footnote-section-p headline) - (org-export-low-level-p headline info) - (equal "notoc" (org-export-get-node-property :UNNUMBERED headline t)))) +required on headings excluded from table of contents." + (or (org-element-property :footnote-section-p heading) + (org-export-low-level-p heading info) + (equal "notoc" (org-export-get-node-property :UNNUMBERED heading t)))) (defun org-export-toc-entry-backend (parent &rest transcoders) "Return an export back-end appropriate for table of contents entries. -- 2.33.0