From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
Received: from mp1 ([2001:41d0:8:6d80::])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	by ms0.migadu.com with LMTPS
	id GM2QOV78a2BAHQAAgWs5BA
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Tue, 06 Apr 2021 08:14:54 +0200
Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp1 with LMTPS
	id QCltM178a2BgZgAAbx9fmQ
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Tue, 06 Apr 2021 06:14:54 +0000
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id A539A1CCF5
	for <larch@yhetil.org>; Tue,  6 Apr 2021 08:14:54 +0200 (CEST)
Received: from localhost ([::1]:33046 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	id 1lTezE-0000Qg-Ak
	for larch@yhetil.org; Tue, 06 Apr 2021 02:14:52 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:34954)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <brsimon91@googlemail.com>)
 id 1lTexv-0000P8-AQ
 for emacs-orgmode@gnu.org; Tue, 06 Apr 2021 02:13:32 -0400
Received: from mail-ej1-f49.google.com ([209.85.218.49]:36650)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <brsimon91@googlemail.com>)
 id 1lText-0006gZ-5x
 for emacs-orgmode@gnu.org; Tue, 06 Apr 2021 02:13:30 -0400
Received: by mail-ej1-f49.google.com with SMTP id a7so20040984ejs.3
 for <emacs-orgmode@gnu.org>; Mon, 05 Apr 2021 23:13:27 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=nNIWoTYX5SHXt2nmViFf/l3u5cZaUIpewgnHIiiXvJI=;
 b=l1dOU/KrpYgWa/7b7PTY8x3/OwO0IFh2w90wufYdtR0mTbShuoi3dClcnd686uPqWn
 smok8attosQGE0NOiXkNtH5WTtqp40jRvfW0z0d7jReYw1fWruRFV2Pqsp7ZorBGAgII
 Mtl7S8CttexFVVBcHxCwlEk1BZ3fFMV8fi6EnRldB3AjsUdGqzOidEXLXG/waR7djaJe
 zcSGTvXoPdEgFamxKKWPnTZwWk84vt/6uA5kIyVPochDIA+vd2Yd8zmmC5u6ia+4cYUm
 TEh0dAAihAwGkygLrGj08WyEEgXcizUCQTmFspB+GJPGnuHqCP4qz4Fl75n/aXNd0uxE
 Tk3g==
X-Gm-Message-State: AOAM533cGuHn+DRLddUAztpk8zF0kl1mgVkqEiB2F196z3ikYvuyH8Uw
 XWnFZrinOc3Bx8tn6Pf3C06HhjzcdCw2jRQsjes=
X-Google-Smtp-Source: ABdhPJyy8oGL6HMiXhxfjyUza9LEA+/+mrclu4Nex9Mpl/aRI433G6heB1dtMBNz5UVLM2rI3NW0IQm8nTH6ZmqsqwM=
X-Received: by 2002:a17:907:75d9:: with SMTP id
 jl25mr31648536ejc.452.1617689606891; 
 Mon, 05 Apr 2021 23:13:26 -0700 (PDT)
MIME-Version: 1.0
References: <CA+atfxTHHk_JSx+tBajyrhwwRhzC1uMXxYXsMdUQrPz0gfYR8g@mail.gmail.com>
 <87sg44axd9.fsf@kyleam.com>
In-Reply-To: <87sg44axd9.fsf@kyleam.com>
From: =?UTF-8?Q?Simon_Bra=C3=9F?= <simon_brass@gmx.de>
Date: Tue, 6 Apr 2021 08:12:50 +0200
Message-ID: <CA+atfxQgFU=SvA3z2LVSuZKekg=86wJUXUFYus0eB7DooL2cXA@mail.gmail.com>
Subject: Re: Bug: org-attach-follow with wrong-number-of-arguments [ ( @
 /home/sbrass/.emacs.d/elpa/org-9.4.4/)]
To: Kyle Meyer <kyle@kyleam.com>
Content-Type: multipart/alternative; boundary="000000000000602caa05bf47b642"
Received-SPF: pass client-ip=209.85.218.49;
 envelope-from=brsimon91@googlemail.com; helo=mail-ej1-f49.google.com
X-Spam_score_int: -10
X-Spam_score: -1.1
X-Spam_bar: -
X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=0.25,
 FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001,
 HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-BeenThere: emacs-orgmode@gnu.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=subscribe>
Cc: emacs-orgmode@gnu.org
Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
Sender: "Emacs-orgmode" <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
X-Migadu-Flow: FLOW_IN
X-Migadu-Spam-Score: -4.00
Authentication-Results: aspmx1.migadu.com;
	none
X-Migadu-Queue-Id: A539A1CCF5
X-Spam-Score: -4.00
X-Migadu-Scanner: scn0.migadu.com
X-TUID: kaTdCzajJzMW

--000000000000602caa05bf47b642
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thanks for an answer, in any place first :).

Am Di., 6. Apr. 2021 um 05:46 Uhr schrieb Kyle Meyer <kyle@kyleam.com>:

> [ Sorry for the slow reply. ]
>
> Simon Bra=C3=9F writes:
>
> > Hi all,
> >
> > I've tried to open an attached file (added with org-attach-attach),
> however,
> > when I try to open it with C-c C-o I got the following backtrace:
> >
> > #+begin_example
> > Debugger entered--Lisp error: (wrong-number-of-arguments (2 . 2) 1)
> >   org-attach-follow("1805.00020.pdf")
> >   org-link-open((link (:type "attachment" :path "1805.00020.pdf" :forma=
t
> > bracket :raw-link "attachment:1805.00020.pdf" :application nil
> > :search-option nil :begin 717 :end 818 :contents-begin 746 :contents-en=
d
> > 816 :post-blank 0 :parent (paragraph (:begin 717 :end 819 :contents-beg=
in
> > 717 :contents-end 819 :post-blank 0 :post-affiliated 717 :parent (item
> > (:bullet "- " :begin 708 :end 819 :contents-begin 717 :contents-end 819
> > :checkbox off :counter nil :structure (... ... ... ... ...) :pre-blank =
0
> > :post-blank 0 :post-affiliated 708 :tag nil :parent (plain-list
> ...)))))))
> > 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)
> > #+end_example
>
> Hmm, this looks like an inaccessible state for Org 9.4.4.  Here's how
> org-link-open would handle an attachment type:
>
>   (let ((f (org-link-get-parameter type :follow)))
>     (when (functionp f)
>       ;; Function defined in `:follow' parameter may use a single
>       ;; argument, as it was mandatory before Org 9.4.  This is
>       ;; deprecated, but support it for now.
>       (condition-case nil
>           (funcall (org-link-get-parameter type :follow) path arg)
>         (wrong-number-of-arguments
>          (funcall (org-link-get-parameter type :follow) path)))))
>
> So it first calls with the expected 2 arguments and then falls back to
> the single one.
>
Thanks, good to know. I'm clearly not a Lisp expert...

Follow attachment links works okay on my end, and, aside from a mixed
> installation, I can't think of a way to get into that state.
>
>   https://orgmode.org/worg/org-faq.html#mixed-install
>
> > After adding =3D&optional=3D to the definition of =3Dorg-attach-follow=
=3D, and
> > reloading org-mode (uncompiled) I could get through org-attach-follow.
> > But, then I hit another issue:
> >
> > #+begin_example
> > Debugger entered--Lisp error: (void-function org-link-open-as-file)
> >   (org-link-open-as-file (org-attach-expand file) arg)
> >   org-attach-follow("0906.4487.pdf")
> >   =E2=80=A6
> > #+end_example
>
> That function was added in 9.4 and is in the same file as the caller,
> org-link-open.  The fact that it's not defined also points to a mixed
> install, with an older ol.el taking precedence.
>

It seems to work with the recent Emacs version: GNU Emacs 27.2 (build 1,
x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.17.4) of
2021-03-26.
So, it actually points to a mixed installation on my side.
Next time I will follow the instructions in
https://orgmode.org/manual/Feedback.html more carefully, and remind myself
of a possible mixed installation.

Thanks, again, Kyle for your answer.

Cheers,
Simon

--000000000000602caa05bf47b642
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon=
t-family:arial narrow,sans-serif">Thanks for an answer, in any place first =
:).<br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D=
"gmail_attr">Am Di., 6. Apr. 2021 um 05:46=C2=A0Uhr schrieb Kyle Meyer &lt;=
<a href=3D"mailto:kyle@kyleam.com">kyle@kyleam.com</a>&gt;:<br></div><block=
quote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1=
px solid rgb(204,204,204);padding-left:1ex">[ Sorry for the slow reply. ]<b=
r>
<br>
Simon Bra=C3=9F writes:<br>
<br>
&gt; Hi all,<br>
&gt;<br>
&gt; I&#39;ve tried to open an attached file (added with org-attach-attach)=
, however,<br>
&gt; when I try to open it with C-c C-o I got the following backtrace:<br>
&gt;<br>
&gt; #+begin_example<br>
&gt; Debugger entered--Lisp error: (wrong-number-of-arguments (2 . 2) 1)<br=
>
&gt;=C2=A0 =C2=A0org-attach-follow(&quot;1805.00020.pdf&quot;)<br>
&gt;=C2=A0 =C2=A0org-link-open((link (:type &quot;attachment&quot; :path &q=
uot;1805.00020.pdf&quot; :format<br>
&gt; bracket :raw-link &quot;attachment:1805.00020.pdf&quot; :application n=
il<br>
&gt; :search-option nil :begin 717 :end 818 :contents-begin 746 :contents-e=
nd<br>
&gt; 816 :post-blank 0 :parent (paragraph (:begin 717 :end 819 :contents-be=
gin<br>
&gt; 717 :contents-end 819 :post-blank 0 :post-affiliated 717 :parent (item=
<br>
&gt; (:bullet &quot;- &quot; :begin 708 :end 819 :contents-begin 717 :conte=
nts-end 819<br>
&gt; :checkbox off :counter nil :structure (... ... ... ... ...) :pre-blank=
 0<br>
&gt; :post-blank 0 :post-affiliated 708 :tag nil :parent (plain-list ...)))=
))))<br>
&gt; nil)<br>
&gt;=C2=A0 =C2=A0org-open-at-point(nil)<br>
&gt;=C2=A0 =C2=A0funcall-interactively(org-open-at-point nil)<br>
&gt;=C2=A0 =C2=A0call-interactively(org-open-at-point nil nil)<br>
&gt;=C2=A0 =C2=A0command-execute(org-open-at-point)<br>
&gt; #+end_example<br>
<br>
Hmm, this looks like an inaccessible state for Org 9.4.4.=C2=A0 Here&#39;s =
how<br>
org-link-open would handle an attachment type:<br>
<br>
=C2=A0 (let ((f (org-link-get-parameter type :follow)))<br>
=C2=A0 =C2=A0 (when (functionp f)<br>
=C2=A0 =C2=A0 =C2=A0 ;; Function defined in `:follow&#39; parameter may use=
 a single<br>
=C2=A0 =C2=A0 =C2=A0 ;; argument, as it was mandatory before Org 9.4.=C2=A0=
 This is<br>
=C2=A0 =C2=A0 =C2=A0 ;; deprecated, but support it for now.<br>
=C2=A0 =C2=A0 =C2=A0 (condition-case nil<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (funcall (org-link-get-parameter type :f=
ollow) path arg)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (wrong-number-of-arguments<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(funcall (org-link-get-parameter type :fo=
llow) path)))))<br>
<br>
So it first calls with the expected 2 arguments and then falls back to<br>
the single one.<br></blockquote><div><div style=3D"font-family:arial narrow=
,sans-serif" class=3D"gmail_default"></div><div style=3D"font-family:arial =
narrow,sans-serif" class=3D"gmail_default">Thanks, good to know. I&#39;m cl=
early not a Lisp expert...<br></div><div style=3D"font-family:arial narrow,=
sans-serif" class=3D"gmail_default"></div><br></div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,=
204,204);padding-left:1ex">
Follow attachment links works okay on my end, and, aside from a mixed<br>
installation, I can&#39;t think of a way to get into that state.<br>
<br>
=C2=A0 <a href=3D"https://orgmode.org/worg/org-faq.html#mixed-install" rel=
=3D"noreferrer" target=3D"_blank">https://orgmode.org/worg/org-faq.html#mix=
ed-install</a><br>
<br>
&gt; After adding =3D&amp;optional=3D to the definition of =3Dorg-attach-fo=
llow=3D, and<br>
&gt; reloading org-mode (uncompiled) I could get through org-attach-follow.=
<br>
&gt; But, then I hit another issue:<br>
&gt;<br>
&gt; #+begin_example<br>
&gt; Debugger entered--Lisp error: (void-function org-link-open-as-file)<br=
>
&gt;=C2=A0 =C2=A0(org-link-open-as-file (org-attach-expand file) arg)<br>
&gt;=C2=A0 =C2=A0org-attach-follow(&quot;0906.4487.pdf&quot;)<br>
&gt;=C2=A0 =C2=A0=E2=80=A6<br>
&gt; #+end_example<br>
<br>
That function was added in 9.4 and is in the same file as the caller,<br>
org-link-open.=C2=A0 The fact that it&#39;s not defined also points to a mi=
xed<br>
install, with an older ol.el taking precedence.<br></blockquote><div><br></=
div><div style=3D"font-family:arial narrow,sans-serif" class=3D"gmail_defau=
lt">It seems to work with the recent Emacs version: GNU Emacs 27.2 (build 1=
, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.17.4) of 2021-=
03-26.</div><div style=3D"font-family:arial narrow,sans-serif" class=3D"gma=
il_default">So, it actually points to a mixed installation on my side.</div=
><div style=3D"font-family:arial narrow,sans-serif" class=3D"gmail_default"=
>Next time I will follow the instructions in <a href=3D"https://orgmode.org=
/manual/Feedback.html">https://orgmode.org/manual/Feedback.html</a> more ca=
refully, and remind myself of a possible mixed installation.<br></div><div =
style=3D"font-family:arial narrow,sans-serif" class=3D"gmail_default"><br><=
/div><div style=3D"font-family:arial narrow,sans-serif" class=3D"gmail_defa=
ult">Thanks, again, Kyle for your answer.<br><br></div><div style=3D"font-f=
amily:arial narrow,sans-serif" class=3D"gmail_default">Cheers,<br></div><di=
v style=3D"font-family:arial narrow,sans-serif" class=3D"gmail_default">Sim=
on<br></div></div></div>

--000000000000602caa05bf47b642--