unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Org-store-link in Gnus summary fails
@ 2017-11-10 15:17 Narendra Joshi
  2017-11-10 15:20 ` Narendra Joshi
  0 siblings, 1 reply; 11+ messages in thread
From: Narendra Joshi @ 2017-11-10 15:17 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I get the following error when I try to store link to a line in Gnus
summary. This happens because `org-store-link' tries to do a `mapcar' on
a list of functions calling them with `funcall'. One of those items in
the list-- `gnus-summary-article-header'-- is a macro. Hence, it
fails. How can this be fixed? 

Debugger entered--Lisp error: (invalid-function gnus-summary-article-header)
  gnus-summary-article-header()
  org-gnus-store-link()
  #f(compiled-function (f) #<bytecode 0x174a15d>)(org-gnus-store-link)
  mapcar(#f(compiled-function (f) #<bytecode 0x174a15d>) (org-rmail-store-link org-mhe-store-link org-irc-store-link org-info-store-link org-gnus-store-link org-docview-store-link org-bibtex-store-link org-bbdb-store-link org-w3m-store-link elfeed-link-store-link))
  org-store-link(nil)
  funcall-interactively(org-store-link nil)
  #<subr call-interactively>(org-store-link nil nil)
  apply(#<subr call-interactively> org-store-link (nil nil))
  call-interactively@ido-cr+-record-current-command(#<subr call-interactively> org-store-link nil nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (org-store-link nil nil))
  call-interactively(org-store-link nil nil)
  command-execute(org-store-link)


Thanks,
-- 
Narendra Joshi



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

* Re: Org-store-link in Gnus summary fails
  2017-11-10 15:17 Org-store-link in Gnus summary fails Narendra Joshi
@ 2017-11-10 15:20 ` Narendra Joshi
  2017-11-11 12:36   ` Michael Heerdegen
  0 siblings, 1 reply; 11+ messages in thread
From: Narendra Joshi @ 2017-11-10 15:20 UTC (permalink / raw)
  To: help-gnu-emacs

Narendra Joshi <narendraj9@gmail.com> writes:

> Hi,
>
> I get the following error when I try to store link to a line in Gnus
> summary. This happens because `org-store-link' tries to do a `mapcar' on
> a list of functions calling them with `funcall'. One of those items in
> the list-- `gnus-summary-article-header'-- is a macro. Hence, it
> fails. How can this be fixed? 
The strange thing is that if I go and re-evaluate the function
`org-gnus-store-link', it starts working. 

Please help me understand what is happening here. 
> Debugger entered--Lisp error: (invalid-function gnus-summary-article-header)
>   gnus-summary-article-header()
>   org-gnus-store-link()
>   #f(compiled-function (f) #<bytecode 0x174a15d>)(org-gnus-store-link)
>   mapcar(#f(compiled-function (f) #<bytecode 0x174a15d>) (org-rmail-store-link
> org-mhe-store-link org-irc-store-link org-info-store-link org-gnus-store-link
> org-docview-store-link org-bibtex-store-link org-bbdb-store-link
> org-w3m-store-link elfeed-link-store-link))
>   org-store-link(nil)
>   funcall-interactively(org-store-link nil)
>   #<subr call-interactively>(org-store-link nil nil)
>   apply(#<subr call-interactively> org-store-link (nil nil))
>   call-interactively@ido-cr+-record-current-command(#<subr call-interactively> org-store-link nil nil)
>   apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (org-store-link nil nil))
>   call-interactively(org-store-link nil nil)
>   command-execute(org-store-link)
>
>
> Thanks,

-- 
Narendra Joshi



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

* Re: Org-store-link in Gnus summary fails
  2017-11-10 15:20 ` Narendra Joshi
@ 2017-11-11 12:36   ` Michael Heerdegen
  2017-11-11 15:34     ` Narendra Joshi
  2017-11-11 15:52     ` Eric Abrahamsen
  0 siblings, 2 replies; 11+ messages in thread
From: Michael Heerdegen @ 2017-11-11 12:36 UTC (permalink / raw)
  To: Narendra Joshi; +Cc: help-gnu-emacs

Narendra Joshi <narendraj9@gmail.com> writes:

> The strange thing is that if I go and re-evaluate the function
> `org-gnus-store-link', it starts working. 
>
> Please help me understand what is happening here. 
> > Debugger entered--Lisp error: (invalid-function
> > gnus-summary-article-header)
> >   gnus-summary-article-header()
> >   org-gnus-store-link()
> >   #f(compiled-function (f) #<bytecode 0x174a15d>)(org-gnus-store-link)
> >   mapcar(#f(compiled-function (f) #<bytecode 0x174a15d>)
> > (org-rmail-store-link
> > org-mhe-store-link org-irc-store-link org-info-store-link
> > org-gnus-store-link
> > org-docview-store-link org-bibtex-store-link org-bbdb-store-link
> > org-w3m-store-link elfeed-link-store-link))
> >   org-store-link(nil)
> >   funcall-interactively(org-store-link nil)
> >   #<subr call-interactively>(org-store-link nil nil)
> >   apply(#<subr call-interactively> org-store-link (nil nil))
> >   call-interactively@ido-cr+-record-current-command(#<subr
> > call-interactively> org-store-link nil nil)
> >   apply(call-interactively@ido-cr+-record-current-command #<subr
> > call-interactively> (org-store-link nil nil))
> >   call-interactively(org-store-link nil nil)
> >   command-execute(org-store-link)

This kind of error happens when a file had been compiled without the
according macro definition been loaded.

If just recompiling doesn't help, there is probably a missing dependency
(at compile time).


Michael.



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

* Re: Org-store-link in Gnus summary fails
  2017-11-11 12:36   ` Michael Heerdegen
@ 2017-11-11 15:34     ` Narendra Joshi
  2017-11-11 17:06       ` Michael Heerdegen
  2017-11-11 15:52     ` Eric Abrahamsen
  1 sibling, 1 reply; 11+ messages in thread
From: Narendra Joshi @ 2017-11-11 15:34 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Help Gnu Emacs mailing list

Re-evaluating the org function that refers the macro fixes it. If the macro
definition had been loaded when the file was compiled, how does it make
funcall work on the macro anyways?

Thanks for the help,
Narendra Joshi
On 11 Nov 2017 18:06, "Michael Heerdegen" <michael_heerdegen@web.de> wrote:

> Narendra Joshi <narendraj9@gmail.com> writes:
>
> > The strange thing is that if I go and re-evaluate the function
> > `org-gnus-store-link', it starts working.
> >
> > Please help me understand what is happening here.
> > > Debugger entered--Lisp error: (invalid-function
> > > gnus-summary-article-header)
> > >   gnus-summary-article-header()
> > >   org-gnus-store-link()
> > >   #f(compiled-function (f) #<bytecode 0x174a15d>)(org-gnus-store-link)
> > >   mapcar(#f(compiled-function (f) #<bytecode 0x174a15d>)
> > > (org-rmail-store-link
> > > org-mhe-store-link org-irc-store-link org-info-store-link
> > > org-gnus-store-link
> > > org-docview-store-link org-bibtex-store-link org-bbdb-store-link
> > > org-w3m-store-link elfeed-link-store-link))
> > >   org-store-link(nil)
> > >   funcall-interactively(org-store-link nil)
> > >   #<subr call-interactively>(org-store-link nil nil)
> > >   apply(#<subr call-interactively> org-store-link (nil nil))
> > >   call-interactively@ido-cr+-record-current-command(#<subr
> > > call-interactively> org-store-link nil nil)
> > >   apply(call-interactively@ido-cr+-record-current-command #<subr
> > > call-interactively> (org-store-link nil nil))
> > >   call-interactively(org-store-link nil nil)
> > >   command-execute(org-store-link)
>
> This kind of error happens when a file had been compiled without the
> according macro definition been loaded.
>
> If just recompiling doesn't help, there is probably a missing dependency
> (at compile time).
>
>
> Michael.
>


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

* Re: Org-store-link in Gnus summary fails
  2017-11-11 12:36   ` Michael Heerdegen
  2017-11-11 15:34     ` Narendra Joshi
@ 2017-11-11 15:52     ` Eric Abrahamsen
  2017-11-11 17:07       ` Michael Heerdegen
  1 sibling, 1 reply; 11+ messages in thread
From: Eric Abrahamsen @ 2017-11-11 15:52 UTC (permalink / raw)
  To: Narendra Joshi; +Cc: help-gnu-emacs

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Narendra Joshi <narendraj9@gmail.com> writes:
>
>> The strange thing is that if I go and re-evaluate the function
>> `org-gnus-store-link', it starts working. 
>>
>> Please help me understand what is happening here. 
>> > Debugger entered--Lisp error: (invalid-function
>> > gnus-summary-article-header)
>> >   gnus-summary-article-header()
>> >   org-gnus-store-link()
>> >   #f(compiled-function (f) #<bytecode 0x174a15d>)(org-gnus-store-link)
>> >   mapcar(#f(compiled-function (f) #<bytecode 0x174a15d>)
>> > (org-rmail-store-link
>> > org-mhe-store-link org-irc-store-link org-info-store-link
>> > org-gnus-store-link
>> > org-docview-store-link org-bibtex-store-link org-bbdb-store-link
>> > org-w3m-store-link elfeed-link-store-link))
>> >   org-store-link(nil)
>> >   funcall-interactively(org-store-link nil)
>> >   #<subr call-interactively>(org-store-link nil nil)
>> >   apply(#<subr call-interactively> org-store-link (nil nil))
>> >   call-interactively@ido-cr+-record-current-command(#<subr
>> > call-interactively> org-store-link nil nil)
>> >   apply(call-interactively@ido-cr+-record-current-command #<subr
>> > call-interactively> (org-store-link nil nil))
>> >   call-interactively(org-store-link nil nil)
>> >   command-execute(org-store-link)
>
> This kind of error happens when a file had been compiled without the
> according macro definition been loaded.
>
> If just recompiling doesn't help, there is probably a missing dependency
> (at compile time).

It looks like org-gnus is missing several dependencies:

(eval-when-compile
  (require 'gnus-sum)
  (require 'nnheader)
  (require 'nnir))



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

* Re: Org-store-link in Gnus summary fails
  2017-11-11 15:34     ` Narendra Joshi
@ 2017-11-11 17:06       ` Michael Heerdegen
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Heerdegen @ 2017-11-11 17:06 UTC (permalink / raw)
  To: Narendra Joshi; +Cc: Help Gnu Emacs mailing list

Narendra Joshi <narendraj9@gmail.com> writes:

> Re-evaluating the org function that refers the macro fixes it. If the
> macro definition had been loaded when the file was compiled, how does
> it make funcall work on the macro anyways?

AFAICT, that's a difference between interpreted and compiled Elisp code:
symbols in compiled code can't refer to macros - these must be expanded
when code is compiled.  You get a compiler error ("unknown function")
when macro definitions are not loaded, so this is not that hard to
catch.


Michael.



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

* Re: Org-store-link in Gnus summary fails
  2017-11-11 15:52     ` Eric Abrahamsen
@ 2017-11-11 17:07       ` Michael Heerdegen
  2017-11-13  4:05         ` Eric Abrahamsen
  2017-11-16 23:33         ` Michael Heerdegen
  0 siblings, 2 replies; 11+ messages in thread
From: Michael Heerdegen @ 2017-11-11 17:07 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: Narendra Joshi, help-gnu-emacs

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> It looks like org-gnus is missing several dependencies:
>
> (eval-when-compile
>   (require 'gnus-sum)
>   (require 'nnheader)
>   (require 'nnir))

Hmm, can then somebody who can reproduce the error please make a bug
report?


Thanks,

Michael.



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

* Re: Org-store-link in Gnus summary fails
  2017-11-11 17:07       ` Michael Heerdegen
@ 2017-11-13  4:05         ` Eric Abrahamsen
  2017-11-13 13:13           ` Michael Heerdegen
  2017-11-16 23:33         ` Michael Heerdegen
  1 sibling, 1 reply; 11+ messages in thread
From: Eric Abrahamsen @ 2017-11-13  4:05 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Narendra Joshi, help-gnu-emacs

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> It looks like org-gnus is missing several dependencies:
>>
>> (eval-when-compile
>>   (require 'gnus-sum)
>>   (require 'nnheader)
>>   (require 'nnir))
>
> Hmm, can then somebody who can reproduce the error please make a bug
> report?

It's not really a mapcar/funcall problem: the mapcar is over
(org-store-link-functions), not over any Gnus macro. The function
`org-gnus-store-link' does use a bunch of Gnus macros, but not in a
funcall situation.

OP appears to be using Emacs master, otherwise I would guess that it had
to do with Gnus not being preloaded. If I run "make" in the org-mode git
repo, there are no complaints about Gnus macros being undefined, so I
don't know what's going on.

What's the Org version in question?

Eric



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

* Re: Org-store-link in Gnus summary fails
  2017-11-13  4:05         ` Eric Abrahamsen
@ 2017-11-13 13:13           ` Michael Heerdegen
  2017-11-13 15:55             ` Eric Abrahamsen
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Heerdegen @ 2017-11-13 13:13 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: Narendra Joshi, help-gnu-emacs

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> >> (eval-when-compile
> >>   (require 'gnus-sum)
> >>   (require 'nnheader)
> >>   (require 'nnir))
> >
> > Hmm, can then somebody who can reproduce the error please make a bug
> > report?
>
> It's not really a mapcar/funcall problem: the mapcar is over
> (org-store-link-functions), not over any Gnus macro. The function
> `org-gnus-store-link' does use a bunch of Gnus macros, but not in a
> funcall situation.

For that kind of error to happen, it's enough to call the macro in the
code somewhere.  This has nothing to do with `funcall'ing or
`mapcar'ing.  If a macro is not known at compile time, the compiler
turns the macro call into a function call.


Michael.



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

* Re: Org-store-link in Gnus summary fails
  2017-11-13 13:13           ` Michael Heerdegen
@ 2017-11-13 15:55             ` Eric Abrahamsen
  0 siblings, 0 replies; 11+ messages in thread
From: Eric Abrahamsen @ 2017-11-13 15:55 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Narendra Joshi, help-gnu-emacs

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> >> (eval-when-compile
>> >>   (require 'gnus-sum)
>> >>   (require 'nnheader)
>> >>   (require 'nnir))
>> >
>> > Hmm, can then somebody who can reproduce the error please make a bug
>> > report?
>>
>> It's not really a mapcar/funcall problem: the mapcar is over
>> (org-store-link-functions), not over any Gnus macro. The function
>> `org-gnus-store-link' does use a bunch of Gnus macros, but not in a
>> funcall situation.
>
> For that kind of error to happen, it's enough to call the macro in the
> code somewhere.  This has nothing to do with `funcall'ing or
> `mapcar'ing.

Right, I just meant I think the OP was a bit off with the original error
report.

> If a macro is not known at compile time, the compiler turns the macro
> call into a function call.

I was wondering if that was the case. Thanks for the information, that's
useful to know!



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

* Re: Org-store-link in Gnus summary fails
  2017-11-11 17:07       ` Michael Heerdegen
  2017-11-13  4:05         ` Eric Abrahamsen
@ 2017-11-16 23:33         ` Michael Heerdegen
  1 sibling, 0 replies; 11+ messages in thread
From: Michael Heerdegen @ 2017-11-16 23:33 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: Narendra Joshi, help-gnu-emacs

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Hmm, can then somebody who can reproduce the error please make a bug
> report?

I reported this as bug#29329 and CC'd both of you.


Thanks,

Michael.



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

end of thread, other threads:[~2017-11-16 23:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-10 15:17 Org-store-link in Gnus summary fails Narendra Joshi
2017-11-10 15:20 ` Narendra Joshi
2017-11-11 12:36   ` Michael Heerdegen
2017-11-11 15:34     ` Narendra Joshi
2017-11-11 17:06       ` Michael Heerdegen
2017-11-11 15:52     ` Eric Abrahamsen
2017-11-11 17:07       ` Michael Heerdegen
2017-11-13  4:05         ` Eric Abrahamsen
2017-11-13 13:13           ` Michael Heerdegen
2017-11-13 15:55             ` Eric Abrahamsen
2017-11-16 23:33         ` Michael Heerdegen

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).