浏览代码

Implement org-return-follows-link directly in `org-return'.

This used to depend on the mouse map, but I no longer think this is a
good idea.  So the function org-return now directly handles this case.
Carsten Dominik 16 年之前
父节点
当前提交
aeba61e640
共有 2 个文件被更改,包括 12 次插入6 次删除
  1. 6 0
      lisp/ChangeLog
  2. 6 6
      lisp/org.el

+ 6 - 0
lisp/ChangeLog

@@ -1,3 +1,9 @@
+2009-02-09  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-return): Implement `org-return-follows-link' in the
+	function org-return.  This is more robust than using the mouse
+	map, I think.
+
 2009-02-07  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-exp.el (org-export-preprocess-string): Remove clock lines

+ 6 - 6
lisp/org.el

@@ -3704,9 +3704,6 @@ The following commands are available:
 (when org-tab-follows-link
   (org-defkey org-mouse-map [(tab)] 'org-open-at-point)
   (org-defkey org-mouse-map "\C-i" 'org-open-at-point))
-(when org-return-follows-link
-  (org-defkey org-mouse-map [(return)] 'org-open-at-point)
-  (org-defkey org-mouse-map "\C-m" 'org-open-at-point))
 
 (require 'font-lock)
 
@@ -13588,15 +13585,18 @@ See the individual commands for more information."
   (interactive)
   (cond
    ((bobp) (if indent (newline-and-indent) (newline)))
+   ((org-at-table-p)
+    (org-table-justify-field-maybe)
+    (call-interactively 'org-table-next-row))
+   ((and org-return-follows-link
+	 (eq (get-text-property (point) 'face) 'org-link))
+    (call-interactively 'org-open-at-point))
    ((and (org-at-heading-p)
 	 (looking-at
 	  (org-re "\\([ \t]+\\(:[[:alnum:]_@:]+:\\)\\)[ \t]*$")))
     (org-show-entry)
     (end-of-line 1)
     (newline))
-   ((org-at-table-p)
-    (org-table-justify-field-maybe)
-    (call-interactively 'org-table-next-row))
    (t (if indent (newline-and-indent) (newline)))))
 
 (defun org-return-indent ()