From 7d390733a423b75765f5716bdd8d1bce592c3385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20A=2E=20Gomes?= Date: Fri, 8 Oct 2021 18:40:38 +0300 Subject: [PATCH 28/76] Deprecate org-export-get-parent-headline. --- lisp/org-compat.el | 2 ++ lisp/ox-ascii.el | 6 +++--- lisp/ox-beamer.el | 2 +- lisp/ox-html.el | 2 +- lisp/ox-odt.el | 2 +- lisp/ox-org.el | 2 +- lisp/ox-publish.el | 2 +- lisp/ox-texinfo.el | 2 +- lisp/ox.el | 8 ++++---- 9 files changed, 15 insertions(+), 13 deletions(-) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 870cc046e..6c5932577 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -362,6 +362,8 @@ Counting starts at 1." 'org-export-filter-heading-functions "9.5") (define-obsolete-function-alias 'org-export-get-headline-number 'org-export-get-heading-number "9.5") +(define-obsolete-function-alias 'org-export-get-parent-headline + 'org-export-get-parent-heading "9.5") (defun org-in-fixed-width-region-p () "Non-nil if point in a fixed-width region." diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el index 0e3d27791..416074e59 100644 --- a/lisp/ox-ascii.el +++ b/lisp/ox-ascii.el @@ -575,7 +575,7 @@ INFO is a plist used as a communication channel." ;; No inlinetask: Remove global margin from text width. (- (plist-get info :ascii-text-width) (plist-get info :ascii-global-margin) - (let ((parent (org-export-get-parent-headline element))) + (let ((parent (org-export-get-parent-heading element))) ;; Inner margin doesn't apply to text before first ;; heading. (if (not parent) 0 @@ -1404,7 +1404,7 @@ of the parameters." (make-string width (if utf8p ?━ ?_))) ;; Flush the inlinetask to the right. (- (plist-get info :ascii-text-width) (plist-get info :ascii-global-margin) - (if (not (org-export-get-parent-headline inlinetask)) 0 + (if (not (org-export-get-parent-heading inlinetask)) 0 (plist-get info :ascii-inner-margin)) (org-ascii--current-text-width inlinetask info))))) @@ -1754,7 +1754,7 @@ 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 ((heading (org-export-get-parent-headline section))) + (let ((heading (org-export-get-parent-heading section))) (if (or (not heading) (org-export-low-level-p heading info)) 0 (plist-get info :ascii-inner-margin)))))) diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el index 5b5524966..e34c62410 100644 --- a/lisp/ox-beamer.el +++ b/lisp/ox-beamer.el @@ -513,7 +513,7 @@ 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 heading))) + :BEAMER_ENV (org-export-get-parent-heading heading))) (start-columns-p (or (equal environment "columns") (and column-width diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 1fbbb1e9a..9d4210e23 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -3414,7 +3414,7 @@ holding contextual information." "Transcode a SECTION element from Org to HTML. CONTENTS holds the contents of the section. INFO is a plist holding contextual information." - (let ((parent (org-export-get-parent-headline section))) + (let ((parent (org-export-get-parent-heading section))) ;; Before first heading: no container, just return CONTENTS. (if (not parent) contents ;; Get div's class and id references. diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el index aab08973b..c7bcacb4d 100644 --- a/lisp/ox-odt.el +++ b/lisp/ox-odt.el @@ -1819,7 +1819,7 @@ holding contextual information." ;; If top-level list, re-start numbering. Otherwise, ;; continue numbering. (format "text:continue-numbering=\"%s\"" - (let* ((parent (org-export-get-parent-headline + (let* ((parent (org-export-get-parent-heading heading))) (if (and parent (org-export-low-level-p parent info)) diff --git a/lisp/ox-org.el b/lisp/ox-org.el index bccead7f3..477c35adb 100644 --- a/lisp/ox-org.el +++ b/lisp/ox-org.el @@ -223,7 +223,7 @@ a communication channel." ;; them are included in the result. (let ((footnotes (org-element-map - (list (org-export-get-parent-headline section) section) + (list (org-export-get-parent-heading section) section) 'footnote-reference (lambda (fn) (and (eq (org-element-property :type fn) 'standard) diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el index 711573486..8ab61ad94 100644 --- a/lisp/ox-publish.el +++ b/lisp/ox-publish.el @@ -1036,7 +1036,7 @@ its CDR is a string." (org-element-map (plist-get info :parse-tree) 'keyword (lambda (k) (when (equal (org-element-property :key k) "INDEX") - (let ((parent (org-export-get-parent-headline k))) + (let ((parent (org-export-get-parent-heading k))) (list (org-element-property :value k) file (cond diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index 6dbc18ad2..d2586e740 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -1400,7 +1400,7 @@ contextual information." "Transcode a SECTION element from Org to Texinfo. CONTENTS holds the contents of the section. INFO is a plist holding contextual information." - (let ((parent (org-export-get-parent-headline section))) + (let ((parent (org-export-get-parent-heading section))) (when parent ;first section is handled in `org-texinfo-template' (org-trim (concat contents diff --git a/lisp/ox.el b/lisp/ox.el index 32c679225..74c4bc057 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -4011,7 +4011,7 @@ inherited from a parent heading. Return value is a string or nil." (let ((heading (if (eq (org-element-type datum) 'headline) datum - (org-export-get-parent-headline datum)))) + (org-export-get-parent-heading datum)))) (if (not inherited) (org-element-property property datum) (let ((parent heading)) (catch 'found @@ -5285,7 +5285,7 @@ Return a list of all exportable headings as parsed elements. Footnote sections are ignored." (let* ((scope (cond ((not scope) (plist-get info :parse-tree)) ((eq (org-element-type scope) 'headline) scope) - ((org-export-get-parent-headline scope)) + ((org-export-get-parent-heading scope)) (t (plist-get info :parse-tree)))) (limit (plist-get info :headline-levels)) (n (if (not (wholenump n)) limit @@ -5691,7 +5691,7 @@ Return the new string." ;; Here are various functions to retrieve information about the ;; neighborhood of a given element or object. Neighbors of interest ;; are direct parent (`org-export-get-parent'), parent heading -;; (`org-export-get-parent-headline'), first element containing an +;; (`org-export-get-parent-heading'), first element containing an ;; object, (`org-export-get-parent-element'), parent table ;; (`org-export-get-parent-table'), previous element or object ;; (`org-export-get-previous-element') and next element or object @@ -5699,7 +5699,7 @@ Return the new string." ;; defsubst org-export-get-parent must be defined before first use -(defun org-export-get-parent-headline (blob) +(defun org-export-get-parent-heading (blob) "Return BLOB parent heading or nil. BLOB is the element or object being considered." (org-element-lineage blob '(headline))) -- 2.33.0