diff options
author | Kyle Meyer <kyle@kyleam.com> | 2015-09-27 12:27:52 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2015-10-04 02:31:29 -0400 |
commit | e802936f4b39f8b1e56cc015f34aa655565afe7f (patch) | |
tree | 895727619d3d8e64fc9942c5f2624becf9a770ce | |
parent | ef3ea9d02d16128989d5d5129073386397dca1ec (diff) | |
download | org-mode-e802936f4b39f8b1e56cc015f34aa655565afe7f.tar.gz |
Pass LIMIT argument to org-looking-back
* lisp/org-mouse.el (org-mouse-insert-item):
(org-mouse-context-menu):
* lisp/org-pcomplete.el (org-thing-at-point):
* lisp/org.el (org-read-date-minibuffer-local-map):
(org-timestamp-change): Provide LIMIT argument to org-looking-back.
* lisp/org.el (org-read-date-minibuffer-local-map):
(org-insert-heading): Replace looking-back with org-looking-back.
As of Emacs 25, the LIMIT argument to looking-back is advertised as a
required argument.
-rw-r--r-- | lisp/org-mouse.el | 5 | ||||
-rw-r--r-- | lisp/org-pcomplete.el | 6 | ||||
-rwxr-xr-x | lisp/org.el | 7 |
3 files changed, 11 insertions, 7 deletions
diff --git a/lisp/org-mouse.el b/lisp/org-mouse.el index 6095094..43ebfb6 100644 --- a/lisp/org-mouse.el +++ b/lisp/org-mouse.el @@ -586,7 +586,7 @@ This means, between the beginning of line and the point." (:end ; insert text here (skip-chars-backward " \t") (kill-region (point) (point-at-eol)) - (unless (org-looking-back org-mouse-punctuation) + (unless (org-looking-back org-mouse-punctuation (line-beginning-position)) (insert (concat org-mouse-punctuation " "))))) (insert text) (beginning-of-line)) @@ -644,7 +644,8 @@ 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" (- (point) 2)))) + (org-looking-back " \\|\t" (- (point) 2) + (line-beginning-position)))) (org-mouse-popup-global-menu)) ((funcall get-context :checkbox) (popup-menu diff --git a/lisp/org-pcomplete.el b/lisp/org-pcomplete.el index 05683fe..42d0f9f 100644 --- a/lisp/org-pcomplete.el +++ b/lisp/org-pcomplete.el @@ -93,8 +93,10 @@ The return value is a string naming the thing at point." (skip-chars-backward "[ \t\n]") ;; org-drawer-regexp matches a whole line but while ;; looking-back, we just ignore trailing whitespaces - (or (org-looking-back (substring org-drawer-regexp 0 -1)) - (org-looking-back org-property-re)))) + (or (org-looking-back (substring org-drawer-regexp 0 -1) + (line-beginning-position)) + (org-looking-back org-property-re + (line-beginning-position))))) (cons "prop" nil)) ((and (equal (char-before beg1) ?:) (not (equal (char-after (point-at-bol)) ?*))) diff --git a/lisp/org.el b/lisp/org.el index c703b63..fc8f54f 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -7844,7 +7844,7 @@ heading, unconditionally." (re-search-forward org-outline-regexp-bol) (beginning-of-line 0)) (skip-chars-backward " \r\t\n") - (and (not (looking-back "^\\*+" (line-beginning-position))) + (and (not (org-looking-back "^\\*+" (line-beginning-position))) (looking-at "[ \t]+") (replace-match "")) (unless (eobp) (forward-char 1)) (when (looking-at "^\\*") @@ -16770,7 +16770,7 @@ So these are more for recording a certain time/date." (org-defkey map (kbd ".") (lambda () (interactive) ;; Are we at the beginning of the prompt? - (if (looking-back "^[^:]+: ") + (if (org-looking-back "^[^:]+: " (line-beginning-position)) (org-eval-in-calendar '(calendar-goto-today)) (insert ".")))) (org-defkey map (kbd "C-.") @@ -18063,7 +18063,8 @@ When SUPPRESS-TMP-DELAY is non-nil, suppress delays like \"--2d\"." (message "No clock to adjust") (cond ((save-excursion ; fix previous clock? (re-search-backward org-ts-regexp0 nil t) - (org-looking-back (concat org-clock-string " \\["))) + (org-looking-back (concat org-clock-string " \\[") + (line-beginning-position))) (setq fixnext 1 clrgx (concat org-ts-regexp0 "\\] =>.*$"))) ((save-excursion ; fix next clock? (re-search-backward org-ts-regexp0 nil t) |