Fix `org-refile' when logging multiple entries
* lisp/org.el (org-log-refile): Improve docstring. (org-refile): Record information for every headline in the region. Reported-by: "Eugene Sharygin" <eush77@gmail.com> <http://lists.gnu.org/r/emacs-orgmode/2019-02/msg00315.html>
This commit is contained in:
parent
029cf66f01
commit
95e1f844ac
22
lisp/org.el
22
lisp/org.el
|
@ -2447,8 +2447,8 @@ This option can also be set with on a per-file-basis with
|
||||||
You can have local logging settings for a subtree by setting the LOGGING
|
You can have local logging settings for a subtree by setting the LOGGING
|
||||||
property to one or more of these keywords.
|
property to one or more of these keywords.
|
||||||
|
|
||||||
When bulk-refiling from the agenda, the value `note' is forbidden and
|
When bulk-refiling, e.g., from the agenda, the value `note' is
|
||||||
will temporarily be changed to `time'."
|
forbidden and will temporarily be changed to `time'."
|
||||||
:group 'org-refile
|
:group 'org-refile
|
||||||
:group 'org-progress
|
:group 'org-progress
|
||||||
:version "24.1"
|
:version "24.1"
|
||||||
|
@ -11342,7 +11342,7 @@ prefix argument (`C-u C-u C-u C-c C-w')."
|
||||||
(setq last-command nil)
|
(setq last-command nil)
|
||||||
(when regionp
|
(when regionp
|
||||||
(goto-char region-start)
|
(goto-char region-start)
|
||||||
(or (bolp) (goto-char (point-at-bol)))
|
(beginning-of-line)
|
||||||
(setq region-start (point))
|
(setq region-start (point))
|
||||||
(unless (or (org-kill-is-subtree-p
|
(unless (or (org-kill-is-subtree-p
|
||||||
(buffer-substring region-start region-end))
|
(buffer-substring region-start region-end))
|
||||||
|
@ -11430,10 +11430,18 @@ prefix argument (`C-u C-u C-u C-c C-w')."
|
||||||
(or (outline-next-heading) (goto-char (point-max)))))
|
(or (outline-next-heading) (goto-char (point-max)))))
|
||||||
(unless (bolp) (newline))
|
(unless (bolp) (newline))
|
||||||
(org-paste-subtree level nil nil t)
|
(org-paste-subtree level nil nil t)
|
||||||
(when org-log-refile
|
;; Record information, according to `org-log-refile'.
|
||||||
(org-add-log-setup 'refile nil nil org-log-refile)
|
;; Do not prompt for a note when refiling multiple
|
||||||
(unless (eq org-log-refile 'note)
|
;; headlines, however. Simply add a time stamp.
|
||||||
(save-excursion (org-add-log-note))))
|
(cond
|
||||||
|
((not org-log-refile))
|
||||||
|
(regionp
|
||||||
|
(org-map-region
|
||||||
|
(lambda () (org-add-log-setup 'refile nil nil 'time))
|
||||||
|
(point)
|
||||||
|
(+ (point) (- region-end region-start))))
|
||||||
|
(t
|
||||||
|
(org-add-log-setup 'refile nil nil org-log-refile)))
|
||||||
(and org-auto-align-tags
|
(and org-auto-align-tags
|
||||||
(let ((org-loop-over-headlines-in-active-region nil))
|
(let ((org-loop-over-headlines-in-active-region nil))
|
||||||
(org-align-tags)))
|
(org-align-tags)))
|
||||||
|
|
Loading…
Reference in New Issue