emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Simon Braß" <simon_brass@gmx.de>
To: Kyle Meyer <kyle@kyleam.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug: org-attach-follow with wrong-number-of-arguments [ ( @ /home/sbrass/.emacs.d/elpa/org-9.4.4/)]
Date: Tue, 6 Apr 2021 08:12:50 +0200	[thread overview]
Message-ID: <CA+atfxQgFU=SvA3z2LVSuZKekg=86wJUXUFYus0eB7DooL2cXA@mail.gmail.com> (raw)
In-Reply-To: <87sg44axd9.fsf@kyleam.com>

[-- Attachment #1: Type: text/plain, Size: 3333 bytes --]

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ß 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" :format
> > bracket :raw-link "attachment:1805.00020.pdf" :application nil
> > :search-option nil :begin 717 :end 818 :contents-begin 746 :contents-end
> > 816 :post-blank 0 :parent (paragraph (:begin 717 :end 819 :contents-begin
> > 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 =&optional= to the definition of =org-attach-follow=, 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")
> >   …
> > #+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

[-- Attachment #2: Type: text/html, Size: 5150 bytes --]

  reply	other threads:[~2021-04-06  6:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 17:08 Bug: org-attach-follow with wrong-number-of-arguments [ ( @ /home/sbrass/.emacs.d/elpa/org-9.4.4/)] Simon Braß
2021-04-06  3:46 ` Kyle Meyer
2021-04-06  6:12   ` Simon Braß [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-02-06 13:52 Simon Braß
2022-05-06  9:40 ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+atfxQgFU=SvA3z2LVSuZKekg=86wJUXUFYus0eB7DooL2cXA@mail.gmail.com' \
    --to=simon_brass@gmx.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=kyle@kyleam.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).