Browse Source

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.
Marco Wahl 2 years ago
parent
commit
22e7bc8e2b
1 changed files with 3 additions and 4 deletions
  1. 3 4
      lisp/org-agenda.el

+ 3 - 4
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))