Re: [O] Issue with internal links

2019-08-09 Thread Tim Cross
Hi Marvin,

while what you have done may have fixed your error, I don't think it is
a correct fix. It could cause other issues and is an example of one of
those 'fixes' which will likely cause more subtle and difficult to
identify issues. 

The 'org-open-lin-functions is supposed to be either nil or a list of
functions which take a single argument. What you have done is add t to
that list. This likely works as t evaluates to itself, but I think it
will completely break org's handling of [[link text]] style links
because when org runs this hook, it will always return t, telling org
that your custom functions have handled it. You may have tested your fix
and found that it looked like it worked, but note the details in the doc
string for that hook. i.e.

"They will be called for links that look like [[link text][description]]
when LINK TEXT does not have a protocol like "http:" and does not look
like a filename (e.g. "./blue.png")"

Your original error is due to something in your config adding a function
to that hook which does not exist. What you need to do is either define
that function (or find it's definition) or remove it from your config
i.e. remove the add-hook line which adds the function.

Note that the default setting is nil i.e. most installations probably
don't have anything in this hook unless they have some special url
format or they have added a package which provides custom url
handling. If you found the line and just changed the function name to t
as a fix, you can safely just remove the line completely. 

HTH

Tim

Doyley, Marvin M.  writes:

> Hi Nicolas,
>
> (add-hook 'org-open-link-functions t)
> Fixed the problem.
>
> Thanks
> M
>
>> On Aug 8, 2019, at 4:53 PM, Nicolas Goaziou  wrote:
>> 
>> Hello,
>> 
>> "Doyley, Marvin M."  writes:
>> 
>>> Whenever I double click on an internal link I get the following error
>>> “void-function org-pass-link-to-system”
>> 
>> The function above doesn't exist in Org base. You may want to
>> investigate on whatever is adding it to `org-open-link-functions'.
>> 
>> Regards,
>> 
>> -- 
>> Nicolas Goaziou


-- 
Tim Cross



Re: [O] Issue with internal links

2019-08-09 Thread Doyley, Marvin M.
Hi Nicolas,

(add-hook 'org-open-link-functions t)
Fixed the problem.

Thanks
M

> On Aug 8, 2019, at 4:53 PM, Nicolas Goaziou  wrote:
> 
> Hello,
> 
> "Doyley, Marvin M."  writes:
> 
>> Whenever I double click on an internal link I get the following error
>> “void-function org-pass-link-to-system”
> 
> The function above doesn't exist in Org base. You may want to
> investigate on whatever is adding it to `org-open-link-functions'.
> 
> Regards,
> 
> -- 
> Nicolas Goaziou



Re: [O] Issue with internal links

2019-08-08 Thread Nick Dokos
"Doyley, Marvin M."  writes:

>
> * Testing
> * One
> * Two
>[[*Testing]].   (I also tried [[Testing]] and I got the same error)
>
> Debugger entered--Lisp error: (void-function org-pass-link-to-system)
>   org-pass-link-to-system("*Testing")
>   run-hook-with-args-until-success(org-pass-link-to-system "*Testing")
>   (if (run-hook-with-args-until-success 'org-open-link-functions path) 

org-pass-link-to-system is not a function defined by org mode, AFAICT.
The fact that it's the value of the org-open-link-functions hook reinforces
my belief that at some point in the past, you had defined this function
somewhere and you had included it in the hook; perhaps you lost the function
after an upgrade or a disk failure or ... who knows?

The value of org-open-link-functions is nil in my case, so I'd recommend
you try setting it to that:

 (setq org-open-link-functions nil)

and try following the link. If that works to your satisfaction, then
find the place in your init file or customizations file where
org-pass-link-to-system is added to org-open-link-functions and get
rid of it. Then restart emacs.

HTH.
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: [O] Issue with internal links

2019-08-08 Thread Nicolas Goaziou
Hello,

"Doyley, Marvin M."  writes:

> Whenever I double click on an internal link I get the following error
> “void-function org-pass-link-to-system”

The function above doesn't exist in Org base. You may want to
investigate on whatever is adding it to `org-open-link-functions'.

Regards,

-- 
Nicolas Goaziou



[O] Issue with internal links

2019-08-08 Thread Doyley, Marvin M.
Hi there,

Whenever I double click on an internal link I get the following error 
“void-function org-pass-link-to-system”

Does anybody know how to resolve this.

Thanks
M

PS.  Enclosed is the a back trace for a simple file

* Testing
* One
* Two
   [[*Testing]].   (I also tried [[Testing]] and I got the same error)

Debugger entered--Lisp error: (void-function org-pass-link-to-system)
  org-pass-link-to-system("*Testing")
  run-hook-with-args-until-success(org-pass-link-to-system "*Testing")
  (if (run-hook-with-args-until-success 'org-open-link-functions path) nil (if 
(not arg) (org-mark-ring-push) (switch-to-buffer-other-window 
(org-get-buffer-for-internal-link (current-buffer (let ((destination 
(save-excursion (save-restriction (widen) (if (equal type "radio") 
(org-search-radio-target (org-element-property :path context)) (org-link-search 
(cond ((equal type '"custom-id") (concat "#" path)) ((equal type '"coderef") 
(format "(%s)" path)) (t path)) (and (equal type "fuzzy") (+ 2 
(org-element-property :begin context) (point) (if (and (<= (point-min) 
destination) (>= (point-max) destination)) nil (widen)) (goto-char 
destination)))
  (cond ((equal type "file") (if (string-match "[*?{]" (file-name-nondirectory 
path)) (dired path) (let* ((option (org-element-property :search-option 
context)) (app (org-element-property :application context)) (dedicated-function 
(org-link-get-parameter (if app (concat type "+" app) type) :follow))) (if 
dedicated-function (funcall dedicated-function (concat path (and option (concat 
"::" option (apply (function org-open-file) path (cond (arg) ((equal app 
"emacs") 'emacs) ((equal app "sys") 'system)) (cond ((not option) nil) 
((string-match-p "\\`[0-9]+\\'" option) (list (string-to-number option))) (t 
(list nil option ((functionp (org-link-get-parameter type :follow)) 
(funcall (org-link-get-parameter type :follow) path)) ((member type '("coderef" 
"custom-id" "fuzzy" "radio")) (if (run-hook-with-args-until-success 
'org-open-link-functions path) nil (if (not arg) (org-mark-ring-push) 
(switch-to-buffer-other-window (org-get-buffer-for-internal-link 
(current-buffer (let ((destination (save-excursion (save-restriction 
(widen) (if (equal type "radio") (org-search-radio-target (org-element-property 
:path context)) (org-link-search (cond ((equal type '"custom-id") (concat "#" 
path)) ((equal type '"coderef") (format "(%s)" path)) (t path)) (and (equal 
type "fuzzy") (+ 2 (org-element-property :begin context) (point) (if 
(and (<= (point-min) destination) (>= (point-max) destination)) nil (widen)) 
(goto-char destination (t (browse-url-at-point)))
  (save-current-buffer (set-buffer (or reference-buffer (current-buffer))) 
(cond ((equal type "file") (if (string-match "[*?{]" (file-name-nondirectory 
path)) (dired path) (let* ((option (org-element-property :search-option 
context)) (app (org-element-property :application context)) (dedicated-function 
(org-link-get-parameter (if app (concat type "+" app) type) :follow))) (if 
dedicated-function (funcall dedicated-function (concat path (and option (concat 
"::" option (apply (function org-open-file) path (cond (arg) ((equal app 
"emacs") 'emacs) ((equal app "sys") 'system)) (cond ((not option) nil) 
((string-match-p "\\`[0-9]+\\'" option) (list (string-to-number option))) (t 
(list nil option ((functionp (org-link-get-parameter type :follow)) 
(funcall (org-link-get-parameter type :follow) path)) ((member type '("coderef" 
"custom-id" "fuzzy" "radio")) (if (run-hook-with-args-until-success 
'org-open-link-functions path) nil (if (not arg) (org-mark-ring-push) 
(switch-to-buffer-other-window (org-get-buffer-for-internal-link 
(current-buffer (let ((destination (save-excursion (save-restriction 
(widen) (if (equal type "radio") (org-search-radio-target (org-element-property 
:path context)) (org-link-search (cond ((equal type '"custom-id") (concat "#" 
path)) ((equal type '"coderef") (format "(%s)" path)) (t path)) (and (equal 
type "fuzzy") (+ 2 (org-element-property :begin context) (point) (if 
(and (<= (point-min) destination) (>= (point-max) destination)) nil (widen)) 
(goto-char destination (t (browse-url-at-point
  (let ((type (org-element-property :type context)) (path (org-element-property 
:path context))) (save-current-buffer (set-buffer (or reference-buffer 
(current-buffer))) (cond ((equal type "file") (if (string-match "[*?{]" 
(file-name-nondirectory path)) (dired path) (let* ((option 
(org-element-property :search-option context)) (app (org-element-property 
:application context)) (dedicated-function (org-link-get-parameter (if app 
(concat type "+" app) type) :follow))) (if dedicated-function (funcall 
dedicated-function (concat path (and option (concat "::" option (apply 
(function org-open-file) path (cond (arg) ((equal app "emacs") 'emacs) ((equal 
app "sys") 'system)) (cond ((not option) nil) ((string-match-p "\\`[0-9]+\\'"