diff options
author | Nicholas Vollmer <iarchivedmywholelife@gmail.com> | 2020-07-31 18:38:11 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2020-08-02 22:55:47 -0400 |
commit | 093b474e6a11d5240f1e88e5ecc7cbbba72ead9d (patch) | |
tree | a12989b9eeecc498fdc421610431edd4bea95789 | |
parent | df5a83637518ad9aa586d49884a6271f11afc592 (diff) | |
download | org-mode-093b474e6a11d5240f1e88e5ecc7cbbba72ead9d.tar.gz |
org-list: Operate on single line if no active region
* lisp/org-list.el (org-toggle-item): Operate on single line if no
active region.
-rw-r--r-- | lisp/org-list.el | 2 | ||||
-rw-r--r-- | testing/lisp/test-org-list.el | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lisp/org-list.el b/lisp/org-list.el index 5c6ec4d..4af8d69 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -2953,7 +2953,7 @@ With a prefix argument ARG, change the region in a single item." (if (org-region-active-p) (setq beg (funcall skip-blanks (region-beginning)) end (copy-marker (region-end))) - (setq beg (funcall skip-blanks (point-at-bol)) + (setq beg (point-at-bol) end (copy-marker (point-at-eol)))) ;; Depending on the starting line, choose an action on the text ;; between BEG and END. diff --git a/testing/lisp/test-org-list.el b/testing/lisp/test-org-list.el index 338f29f..faa628c 100644 --- a/testing/lisp/test-org-list.el +++ b/testing/lisp/test-org-list.el @@ -1004,6 +1004,13 @@ b. Item 2<point>" (org-test-with-temp-text "* H\n:PROPERTIES:\n:A: 1\n:END:\n\n\nText" (org-toggle-item nil) (buffer-string)))) + ;; When no region is marked and point is on a blank line + ;; only operate on current line. + (should + (equal " \n* H :tag:" + (org-test-with-temp-text "<point> \n* H :tag:" + (org-toggle-item nil) + (buffer-string)))) ;; When a region is marked and first line is a headline, all ;; headlines are turned into items. (should |