summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2015-04-20 21:55:00 -0400
committerKyle Meyer <kyle@kyleam.com>2015-07-26 23:29:31 -0400
commitc6164293fc8de8f01771034f149fdb0469111cb0 (patch)
treefe91bc473b4daf29571dcbddf0b03b53e3c413be
parent0cec91d0392c06cc6504b1cbd63d0a8fd3974789 (diff)
downloadorg-mode-c6164293fc8de8f01771034f149fdb0469111cb0.tar.gz
Backport commit c9a75a4 from Emacs master branch
* lisp/org.el (org-insert-heading, org-sort-entries): * lisp/org-mouse.el (org-mouse-end-headline) (org-mouse-context-menu): * lisp/org-clock.el (org-clock-cancel): Add explicit second arg to looking-back. Fix byte-compiler warnings about looking-back. c9a75a4030a556d700fd95222ec0bf4c1a9f67b5 Stefan Monnier Mon Apr 20 21:55:00 2015 -0400
-rw-r--r--lisp/org-clock.el3
-rw-r--r--lisp/org-mouse.el4
-rw-r--r--lisp/org.el5
3 files changed, 7 insertions, 5 deletions
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index b239e84..c1edcb5 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1656,7 +1656,8 @@ Optional argument N tells to change by that many units."
(save-excursion ; Do not replace this with `with-current-buffer'.
(org-no-warnings (set-buffer (org-clocking-buffer)))
(goto-char org-clock-marker)
- (if (org-looking-back (concat "^[ \t]*" org-clock-string ".*"))
+ (if (org-looking-back (concat "^[ \t]*" org-clock-string ".*")
+ (line-beginning-position))
(progn (delete-region (1- (point-at-bol)) (point-at-eol))
(org-remove-empty-drawer-at "LOGBOOK" (point)))
(message "Clock gone, cancel the timer anyway")
diff --git a/lisp/org-mouse.el b/lisp/org-mouse.el
index 718f346..3d0ba6b 100644
--- a/lisp/org-mouse.el
+++ b/lisp/org-mouse.el
@@ -191,7 +191,7 @@ Changing this variable requires a restart of Emacs to get activated."
(interactive)
(end-of-line)
(skip-chars-backward "\t ")
- (when (org-looking-back ":[A-Za-z]+:")
+ (when (org-looking-back ":[A-Za-z]+:" (line-beginning-position))
(skip-chars-backward ":A-Za-z")
(skip-chars-backward "\t ")))
@@ -645,7 +645,7 @@ This means, between the beginning of line and the point."
'org-mode-restart))))
((or (eolp)
(and (looking-at "\\( \\|\t\\)\\(+:[0-9a-zA-Z_:]+\\)?\\( \\|\t\\)+$")
- (org-looking-back " \\|\t")))
+ (org-looking-back " \\|\t" (- (point) 2))))
(org-mouse-popup-global-menu))
((funcall get-context :checkbox)
(popup-menu
diff --git a/lisp/org.el b/lisp/org.el
index 9e66b0e..15196f7 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7683,7 +7683,7 @@ command."
(re-search-forward org-outline-regexp-bol)
(beginning-of-line 0))
(skip-chars-backward " \r\n")
- (and (not (looking-back "^\*+"))
+ (and (not (looking-back "^\*+" (line-beginning-position)))
(looking-at "[ \t]+") (replace-match ""))
(unless (eobp) (forward-char 1))
(when (looking-at "^\\*")
@@ -8662,7 +8662,8 @@ links."
(when (equal (marker-buffer org-clock-marker) (current-buffer))
(save-excursion
(goto-char org-clock-marker)
- (looking-back "^.*") (match-string-no-properties 0))))
+ (buffer-substring-no-properties (line-beginning-position)
+ (point)))))
start beg end stars re re2
txt what tmp)
;; Find beginning and end of region to sort