Re: Unable to follow gnus links

2021-10-04 Thread Tom Ed White
Ihor Radchenko  writes:

> Tom Ed White  writes:
>
>> I was able to fix the problem for the time being by changing the
>> arguments to:
>>
>> (defun org-gnus-open (path  _)
>>
>> The keystroke I use is C-c C-o, which runs org-open-at-point which is in
>> org.el.
>
> I understand. But it does not solve the potential problem for other users.
>
>> Debugger entered--Lisp error: (wrong-number-of-arguments (2 . 2) 1)
>> ... ((functionp (org-link-get-parameter type :follow)) (funcall
>> (org-link-get-parameter type :follow) path))
>> ...
>
> Judging from your backtrace, you seem to have a mixed Org installation
> with some files loaded from Org <9.4 (that's when we changed the number
> of arguments in :follow functions).
>
> Can you try to re-install Org?
>
> Note that mixed installation can also cause other unexpected problems.
>
> Best,
> Ihor

That was it, thank you. I was loading an obsolete version of
ol.el. Hopefully I've found and eliminated all obsolete org code.

Regards,
Tom Ed




Re: Unable to follow gnus links

2021-10-03 Thread Tom Ed White
Ihor Radchenko  writes:

> Tom Ed White  writes:
>
>> Following gnus links in org fails with the message:
>>
>> funcall: Wrong number of arguments: ((t) (path _) "Follow the Gnus
>> message or folder link specified by PATH." (if (string-match
>> "\\`\\([^#]+\\)\\(#\\(.*\\)\\)?" path) nil (error "Error in Gnus link
>> %S" path)) (let ((group (match-string-no-properties 1 path)) (article
>> (match-string-no-properties 3 path))) (org-gnus-follow-link group
>> article))), 1
>
> This should not happen.  Do you open the link using org-link-open?  Can
> you share backtrace after M-x debug-on-entry org-gnus-open?
>
> Best,
> Ihor

I was able to fix the problem for the time being by changing the
arguments to:

(defun org-gnus-open (path  _)

The keystroke I use is C-c C-o, which runs org-open-at-point which is in
org.el.

Regards,
Tom Ed White

Debugger entered--Lisp error: (wrong-number-of-arguments (2 . 2) 1)
  org-gnus-open("nnmaildir+Old 
Fiddlebike:Inbox#caj6zs8+tp6gvgckvqa-e1-5cdkfqsnkg8gm69o8emu1zyq5...@mail.gmail.com")
  funcall(org-gnus-open "nnmaildir+Old 
Fiddlebike:Inbox#caj6zs8+tp6gvgckvqa-e1-5cdkfqsnkg8gm69o8emu1zyq5...@mail.gmail.com")
  (cond ((equal type "file") (if (string-match "[*?{]" (file-name-nondirectory 
path)) (dired path) (let* ((option (org-element-property :search-option link)) 
(app (org-element-property :application link)) (dedicated-function 
(org-link-get-parameter (if app ... type) :follow))) (if dedicated-function 
(funcall dedicated-function (concat path (and option ...))) (apply 
#'org-open-file path (cond (arg) (... ...) (... ...)) (cond (... nil) (... ...) 
(t ...))) ((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-link--buffer-for-internals))) (let 
((destination (save-excursion (save-restriction ... ... ... (if (and (<= 
(point-min) destination) (>= (point-max) destination)) nil (widen)) (goto-char 
destination (t (browse-url-at-point)))
  (let ((type (org-element-property :type link)) (path (org-element-property 
:path link))) (cond ((equal type "file") (if (string-match "[*?{]" 
(file-name-nondirectory path)) (dired path) (let* ((option 
(org-element-property :search-option link)) (app (org-element-property 
:application link)) (dedicated-function (org-link-get-parameter ... :follow))) 
(if dedicated-function (funcall dedicated-function (concat path ...)) (apply 
#'org-open-file path (cond ... ... ...) (cond ... ... ...)) ((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-link--buffer-for-internals))) (let ((destination (save-excursion ...))) 
(if (and (<= ... destination) (>= ... destination)) nil (widen)) (goto-char 
destination (t (browse-url-at-point
  org-link-open((link (:type "gnus" :path "nnmaildir+Old 
Fiddlebike:Inbox#CAJ6ZS8+TP6gVGckVQA..." :format bracket :raw-link 
"gnus:nnmaildir+Old Fiddlebike:Inbox#CAJ6ZS8+TP6gVG..." :application nil 
:search-option nil :begin 19723 :end 19880 :contents-begin 19829 :contents-end 
19878 :post-blank 0 :parent (headline (:raw-value "Debug gnus org links
[[gnus:nnmaildir+Old Fiddl..." :begin 19691 :end 19882 :pre-blank 0 
:contents-begin nil :contents-end nil :level 2 :priority nil :tags nil 
:todo-keyword #("TODO" 0 4 (face org-todo org-category "personal" fontified t)) 
:todo-type todo :post-blank 1 :footnote-section-p nil :archivedp nil 
:commentedp nil :post-affiliated 19691 :title "Debug gnus org links
[[gnus:nnmaildir+Old Fiddl..." nil)
  org-open-at-point(nil)
  funcall-interactively(org-open-at-point nil)
  call-interactively(org-open-at-point nil nil)
  command-execute(org-open-at-point)




Unable to follow gnus links

2021-09-27 Thread Tom Ed White
Following gnus links in org fails with the message:

funcall: Wrong number of arguments: ((t) (path _) "Follow the Gnus
message or folder link specified by PATH." (if (string-match
"\\`\\([^#]+\\)\\(#\\(.*\\)\\)?" path) nil (error "Error in Gnus link
%S" path)) (let ((group (match-string-no-properties 1 path)) (article
(match-string-no-properties 3 path))) (org-gnus-follow-link group
article))), 1

The function is org-gnus-open in ol-gnus.el. I found a workaround by
changing the function arguments:

(defun org-gnus-open (path  _ moo)

I put the "moo" argument in for testing.

I can eval the original function and run it by itself and it works fine,
so maybe the calling function is passing too many arguments. I believe
the calling function is org-open-at-point from org.el.

I'm running the latest org (20210920) from melpa. The file ol-gnus.el
gets loaded via org module customization.