From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 ) for ; 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 ) for ; 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 ; 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 ) 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 ) 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 ) 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 ; 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: <87sg44axd9.fsf@kyleam.com> In-Reply-To: <87sg44axd9.fsf@kyleam.com> From: =?UTF-8?Q?Simon_Bra=C3=9F?= Date: Tue, 6 Apr 2021 08:12:50 +0200 Message-ID: Subject: Re: Bug: org-attach-follow with wrong-number-of-arguments [ ( @ /home/sbrass/.emacs.d/elpa/org-9.4.4/)] To: Kyle Meyer 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." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" 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 : > [ 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
Thanks for an answer, in any place first = :).

Am Di., 6. Apr. 2021 um 05:46=C2=A0Uhr 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) >=C2=A0 =C2=A0org-attach-follow("1805.00020.pdf")
>=C2=A0 =C2=A0org-link-open((link (:type "attachment" :path &q= uot;1805.00020.pdf" :format
> bracket :raw-link "attachment:1805.00020.pdf" :application n= il
> :search-option nil :begin 717 :end 818 :contents-begin 746 :contents-e= nd
> 816 :post-blank 0 :parent (paragraph (:begin 717 :end 819 :contents-be= gin
> 717 :contents-end 819 :post-blank 0 :post-affiliated 717 :parent (item=
> (:bullet "- " :begin 708 :end 819 :contents-begin 717 :conte= nts-end 819
> :checkbox off :counter nil :structure (... ... ... ... ...) :pre-blank= 0
> :post-blank 0 :post-affiliated 708 :tag nil :parent (plain-list ...)))= ))))
> nil)
>=C2=A0 =C2=A0org-open-at-point(nil)
>=C2=A0 =C2=A0funcall-interactively(org-open-at-point nil)
>=C2=A0 =C2=A0call-interactively(org-open-at-point nil nil)
>=C2=A0 =C2=A0command-execute(org-open-at-point)
> #+end_example

Hmm, this looks like an inaccessible state for Org 9.4.4.=C2=A0 Here's = how
org-link-open would handle an attachment type:

=C2=A0 (let ((f (org-link-get-parameter type :follow)))
=C2=A0 =C2=A0 (when (functionp f)
=C2=A0 =C2=A0 =C2=A0 ;; Function defined in `:follow' parameter may use= a single
=C2=A0 =C2=A0 =C2=A0 ;; argument, as it was mandatory before Org 9.4.=C2=A0= This is
=C2=A0 =C2=A0 =C2=A0 ;; deprecated, but support it for now.
=C2=A0 =C2=A0 =C2=A0 (condition-case nil
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (funcall (org-link-get-parameter type :f= ollow) path arg)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (wrong-number-of-arguments
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(funcall (org-link-get-parameter type :fo= llow) path)))))

So it first calls with the expected 2 arguments and then falls back to
the single one.
Thanks, good to know. I'm cl= early 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.

=C2=A0 https://orgmode.org/worg/org-faq.html#mix= ed-install

> After adding =3D&optional=3D to the definition of =3Dorg-attach-fo= llow=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) >=C2=A0 =C2=A0(org-link-open-as-file (org-attach-expand file) arg)
>=C2=A0 =C2=A0org-attach-follow("0906.4487.pdf")
>=C2=A0 =C2=A0=E2=80=A6
> #+end_example

That function was added in 9.4 and is in the same file as the caller,
org-link-open.=C2=A0 The fact that it's not defined also points to a mi= xed
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 ca= refully, and remind myself of a possible mixed installation.

<= /div>
Thanks, again, Kyle for your answer.

Cheers,
Sim= on
--000000000000602caa05bf47b642--