emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Unable to follow gnus links
@ 2021-09-27 17:55 Tom Ed White
  2021-10-03  8:35 ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Ed White @ 2021-09-27 17:55 UTC (permalink / raw)
  To: emacs-orgmode

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 &rest _ 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.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Unable to follow gnus links
  2021-09-27 17:55 Unable to follow gnus links Tom Ed White
@ 2021-10-03  8:35 ` Ihor Radchenko
  2021-10-03 15:54   ` Tom Ed White
  0 siblings, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2021-10-03  8:35 UTC (permalink / raw)
  To: Tom Ed White; +Cc: emacs-orgmode

Tom Ed White <wtomed@gmail.com> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Unable to follow gnus links
  2021-10-03  8:35 ` Ihor Radchenko
@ 2021-10-03 15:54   ` Tom Ed White
  2021-10-04  8:24     ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Ed White @ 2021-10-03 15:54 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode, Tom Ed White

Ihor Radchenko <yantar92@gmail.com> writes:

> Tom Ed White <wtomed@gmail.com> 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 &rest _)

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+Eg@mail.gmail.com")
  funcall(org-gnus-open "nnmaildir+Old Fiddlebike:Inbox#CAJ6ZS8+TP6gVGckVQA-e1-5cdKfQSnKG8Gm69o8emu1ZYq5+Eg@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)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Unable to follow gnus links
  2021-10-03 15:54   ` Tom Ed White
@ 2021-10-04  8:24     ` Ihor Radchenko
  2021-10-04 19:33       ` Tom Ed White
  0 siblings, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2021-10-04  8:24 UTC (permalink / raw)
  To: Tom Ed White; +Cc: emacs-orgmode

Tom Ed White <wtomed@gmail.com> writes:

> I was able to fix the problem for the time being by changing the
> arguments to:
>
> (defun org-gnus-open (path &rest _)
>
> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Unable to follow gnus links
  2021-10-04  8:24     ` Ihor Radchenko
@ 2021-10-04 19:33       ` Tom Ed White
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Ed White @ 2021-10-04 19:33 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode, Tom Ed White

Ihor Radchenko <yantar92@gmail.com> writes:

> Tom Ed White <wtomed@gmail.com> writes:
>
>> I was able to fix the problem for the time being by changing the
>> arguments to:
>>
>> (defun org-gnus-open (path &rest _)
>>
>> 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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-04 19:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-27 17:55 Unable to follow gnus links Tom Ed White
2021-10-03  8:35 ` Ihor Radchenko
2021-10-03 15:54   ` Tom Ed White
2021-10-04  8:24     ` Ihor Radchenko
2021-10-04 19:33       ` Tom Ed White

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).