From 1e32c568023fd7856c61caf6624812aca961e592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20A=2E=20Gomes?= Date: Thu, 7 Oct 2021 21:29:16 +0300 Subject: [PATCH 21/76] Deprecate org-edit-headline. --- lisp/org-colview.el | 2 +- lisp/org-compat.el | 2 ++ lisp/org.el | 2 +- testing/lisp/test-org.el | 16 ++++++++-------- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lisp/org-colview.el b/lisp/org-colview.el index 955b9809b..89eea7a76 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -609,7 +609,7 @@ Where possible, use the standard interface for changing this line." ("CLOCKSUM" (user-error "This special column cannot be edited")) ("ITEM" - (lambda () (org-with-point-at pom (org-edit-headline)))) + (lambda () (org-with-point-at pom (org-edit-heading)))) ("TODO" (lambda () (org-with-point-at pom (call-interactively #'org-todo)))) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 2e571cc17..88720de5c 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -350,6 +350,8 @@ Counting starts at 1." 'org-bibtex-heading-format-function "9.5") (define-obsolete-variable-alias 'org-bibtex-treat-headline-as-title 'org-bibtex-treat-heading-as-title "9.5") +(define-obsolete-function-alias 'org-edit-headline + 'org-edit-heading "9.5") (defun org-in-fixed-width-region-p () "Non-nil if point in a fixed-width region." diff --git a/lisp/org.el b/lisp/org.el index a79000b83..6b488c629 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -7157,7 +7157,7 @@ This is a list with the following elements: (org-back-to-heading t) (buffer-substring (point-at-bol 2) (org-end-of-subtree t)))) -(defun org-edit-headline (&optional heading) +(defun org-edit-heading (&optional heading) "Edit the current heading. Set it to HEADING when provided." (interactive) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index e056bea2f..202e5cb16 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -2397,43 +2397,43 @@ SCHEDULED: <2014-03-04 tue.>" (org-map-entries #'point "yes&no")))))) (ert-deftest test-org/edit-headline () - "Test `org-edit-headline' specifications." + "Test `org-edit-heading' specifications." (should (equal "* B" (org-test-with-temp-text "* A" - (org-edit-headline "B") + (org-edit-heading "B") (buffer-string)))) ;; Handle empty headings. (should (equal "* " (org-test-with-temp-text "* A" - (org-edit-headline "") + (org-edit-heading "") (buffer-string)))) (should (equal "* A" (org-test-with-temp-text "* " - (org-edit-headline "A") + (org-edit-heading "A") (buffer-string)))) ;; Handle TODO keywords and priority cookies. (should (equal "* TODO B" (org-test-with-temp-text "* TODO A" - (org-edit-headline "B") + (org-edit-heading "B") (buffer-string)))) (should (equal "* [#A] B" (org-test-with-temp-text "* [#A] A" - (org-edit-headline "B") + (org-edit-heading "B") (buffer-string)))) (should (equal "* TODO [#A] B" (org-test-with-temp-text "* TODO [#A] A" - (org-edit-headline "B") + (org-edit-heading "B") (buffer-string)))) ;; Handle tags. (equal "* B :tag:" (org-test-with-temp-text "* A :tag:" - (let ((org-tags-column 4)) (org-edit-headline "B")) + (let ((org-tags-column 4)) (org-edit-heading "B")) (buffer-string)))) -- 2.33.0