]> code.delx.au - gnu-emacs/blobdiff - lisp/org/org-mouse.el
; Merge from origin/emacs-25
[gnu-emacs] / lisp / org / org-mouse.el
index 718f346670fde653b79841a3cfdb1f188d66ba9b..098165f528f475b08e6bc6ebd2f285b80f911a9f 100644 (file)
@@ -1,6 +1,6 @@
 ;;; org-mouse.el --- Better mouse support for org-mode
 
-;; Copyright (C) 2006-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2016 Free Software Foundation, Inc.
 
 ;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com>
 ;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
@@ -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 ")))
 
@@ -378,7 +378,7 @@ nor a function, elements of KEYWORDS are used directly."
 (defvar org-mouse-priority-regexp "\\[#\\([A-Z]\\)\\]"
   "Regular expression matching the priority indicator.
 Differs from `org-priority-regexp' in that it doesn't contain the
-leading '.*?'.")
+leading `.*?'.")
 
 (defun org-mouse-get-priority (&optional default)
   "Return the priority of the current headline.
@@ -539,7 +539,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
                ((stringp (nth 2 entry))
                 (concat (org-mouse-agenda-type (nth 1 entry))
                         (nth 2 entry)))
-               (t "Agenda Command '%s'"))
+               (t "Agenda Command `%s'"))
               30))))
      "--"
      ["Delete Blank Lines" delete-blank-lines
@@ -566,7 +566,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
       (save-excursion (org-apply-on-list wrap-fun nil)))))
 
 (defun org-mouse-bolp ()
-  "Return true if there only spaces, tabs, and '*' before point.
+  "Return true if there only spaces, tabs, and `*' before point.
 This means, between the beginning of line and the point."
   (save-excursion
     (skip-chars-backward " \t*") (bolp)))
@@ -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
@@ -708,9 +708,9 @@ This means, between the beginning of line and the point."
      ((org-mouse-looking-at ":\\([A-Za-z0-9_]+\\):" "A-Za-z0-9_" -1) ;tags
       (popup-menu
        `(nil
-        [,(format "Display '%s'" (match-string 1))
+        [,(format-message "Display `%s'" (match-string 1))
          (org-tags-view nil ,(match-string 1))]
-        [,(format "Sparse Tree '%s'" (match-string 1))
+        [,(format-message "Sparse Tree `%s'" (match-string 1))
          (org-tags-sparse-tree nil ,(match-string 1))]
         "--"
         ,@(org-mouse-tag-menu))))