summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Wahl <marcowahlsoft@gmail.com>2017-10-25 17:35:26 +0200
committerMarco Wahl <marcowahlsoft@gmail.com>2017-10-25 17:35:26 +0200
commit22e7bc8e2ba5ca5c6851695adfeea024d5fb2c8d (patch)
treebf5032fe69e7255b0fe1614a7dc14166e65832ae
parent78c6a299d2780d9c9000b409c1a1d694c30032d2 (diff)
downloadorg-mode-22e7bc8e2ba5ca5c6851695adfeea024d5fb2c8d.tar.gz
org-agenda: Refactoring. Deactivate mark in case of a region.
* lisp/org-agenda.el (org-agenda-bulk-mark): Use region-beginning/end defuns. And deactivate the mark in case.
-rw-r--r--lisp/org-agenda.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index ae744f9..750221e 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -9726,10 +9726,9 @@ in the region.
When ARG is greater than one mark ARG lines."
(interactive "p")
(when (and (or (not arg) (= arg 1)) (use-region-p))
- (let ((start (caar (region-bounds)))
- (end (cdar (region-bounds))))
- (setq arg (count-lines start end))
- (goto-char start)))
+ (setq arg (count-lines (region-beginning) (region-end)))
+ (goto-char (region-beginning))
+ (deactivate-mark))
(dotimes (i (or arg 1))
(unless (org-get-at-bol 'org-agenda-diary-link)
(let* ((m (org-get-at-bol 'org-hd-marker))