Browse Source

Fix bug when using prefix arg to construct `org-link-search' call.

* lisp/org.el (org-open-at-point): Fix bug when using prefix arg to
construct `org-link-search' call. Rename prefix arg with a more
generic name, to reflect its diverse uses in this function.
Dan Davison 14 years ago
parent
commit
4d880b150f
1 changed files with 8 additions and 8 deletions
  1. 8 8
      lisp/org.el

+ 8 - 8
lisp/org.el

@@ -9100,12 +9100,12 @@ Functions in this hook must return t if they identify and follow
 a link at point.  If they don't find anything interesting at point,
 a link at point.  If they don't find anything interesting at point,
 they must return nil.")
 they must return nil.")
 
 
-(defun org-open-at-point (&optional in-emacs reference-buffer)
+(defun org-open-at-point (&optional arg reference-buffer)
   "Open link at or after point.
   "Open link at or after point.
 If there is no link at point, this function will search forward up to
 If there is no link at point, this function will search forward up to
 the end of the current line.
 the end of the current line.
 Normally, files will be opened by an appropriate application.  If the
 Normally, files will be opened by an appropriate application.  If the
-optional argument IN-EMACS is non-nil, Emacs will visit the file.
+optional prefix argument ARG is non-nil, Emacs will visit the file.
 With a double prefix argument, try to open outside of Emacs, in the
 With a double prefix argument, try to open outside of Emacs, in the
 application the system uses for this file type."
 application the system uses for this file type."
   (interactive "P")
   (interactive "P")
@@ -9123,7 +9123,7 @@ application the system uses for this file type."
 		       org-angle-link-re "\\|"
 		       org-angle-link-re "\\|"
 		       "[ \t]:[^ \t\n]+:[ \t]*$")))
 		       "[ \t]:[^ \t\n]+:[ \t]*$")))
 	 (not (get-text-property (point) 'org-linked-text)))
 	 (not (get-text-property (point) 'org-linked-text)))
-    (or (org-offer-links-in-entry in-emacs)
+    (or (org-offer-links-in-entry arg)
 	(progn (require 'org-attach) (org-attach-reveal 'if-exists))))
 	(progn (require 'org-attach) (org-attach-reveal 'if-exists))))
    ((run-hook-with-args-until-success 'org-open-at-point-functions))
    ((run-hook-with-args-until-success 'org-open-at-point-functions))
    ((org-at-timestamp-p t) (org-follow-timestamp-link))
    ((org-at-timestamp-p t) (org-follow-timestamp-link))
@@ -9228,7 +9228,7 @@ application the system uses for this file type."
 	  (browse-url (concat type ":" path)))
 	  (browse-url (concat type ":" path)))
 
 
 	 ((string= type "tags")
 	 ((string= type "tags")
-	  (org-tags-view in-emacs path))
+	  (org-tags-view arg path))
 
 
 	 ((string= type "tree-match")
 	 ((string= type "tree-match")
 	  (org-occur (concat "\\[" (regexp-quote path) "\\]")))
 	  (org-occur (concat "\\[" (regexp-quote path) "\\]")))
@@ -9242,7 +9242,7 @@ application the system uses for this file type."
 		      path (substring path 0 (match-beginning 0)))))
 		      path (substring path 0 (match-beginning 0)))))
 	  (if (string-match "[*?{]" (file-name-nondirectory path))
 	  (if (string-match "[*?{]" (file-name-nondirectory path))
 	      (dired path)
 	      (dired path)
-	    (org-open-file path in-emacs line search)))
+	    (org-open-file path arg line search)))
 
 
 	 ((string= type "shell")
 	 ((string= type "shell")
 	  (let ((cmd path))
 	  (let ((cmd path))
@@ -9274,14 +9274,14 @@ application the system uses for this file type."
 		'org-open-link-functions path)))
 		'org-open-link-functions path)))
 
 
 	 ((string= type "thisfile")
 	 ((string= type "thisfile")
-	  (if in-emacs
+	  (if arg
 	      (switch-to-buffer-other-window
 	      (switch-to-buffer-other-window
 	       (org-get-buffer-for-internal-link (current-buffer)))
 	       (org-get-buffer-for-internal-link (current-buffer)))
 	    (org-mark-ring-push))
 	    (org-mark-ring-push))
 	  (let ((cmd `(org-link-search
 	  (let ((cmd `(org-link-search
 		       ,path
 		       ,path
-		       ,(cond ((equal in-emacs '(4)) 'occur)
-			      ((equal in-emacs '(16)) 'org-occur)
+		       ,(cond ((equal arg '(4)) ''occur)
+			      ((equal arg '(16)) ''org-occur)
 			      (t nil))
 			      (t nil))
 		       ,pos)))
 		       ,pos)))
 	    (condition-case nil (eval cmd)
 	    (condition-case nil (eval cmd)