emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [org-cite] issues with org-cite-make-insert-processor select-style
@ 2021-07-21 15:14 Bruce D'Arcus
  2021-07-22  2:17 ` Bruce D'Arcus
  0 siblings, 1 reply; 6+ messages in thread
From: Bruce D'Arcus @ 2021-07-21 15:14 UTC (permalink / raw)
  To: org-mode-email

I have run into a problem in implementing a "select-style" function
for an org-cite-insert-processor.

The WIP code is here:

https://github.com/bdarcus/bibtex-actions/pull/182

It was running correctly yesterday morning, but now it doesn't.

I have two related issues:

1. I think, but am not sure, I may have run into a bug in
org-cite-make-insert-processor, as the function I am using for the
select-style parameter runs correctly outside of the insert processor,
and returns the same results as the "org-cite-basic--complete-style"
function. But when I uncomment the parameter to use it on the org-cite
insert processor, it not only doesn't work correctly, but Emacs won't
even load fully.

2. The error I get "wrong type" is so general it literally took me
hours to realize it was coming from this function; I was looking
elsewhere for the issue.

So if I'm right about a bug, obviously it would be great if that could be fixed.

But better error handling and reporting would also be really great.

Bruce

PS - I"m still learning elisp, and so am not super knowledgeable about
debugging in general. If anyone has any tips on that, that could help
me narrow down the source of the error, that would be much
appreciated.


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

* Re: [org-cite] issues with org-cite-make-insert-processor select-style
  2021-07-21 15:14 [org-cite] issues with org-cite-make-insert-processor select-style Bruce D'Arcus
@ 2021-07-22  2:17 ` Bruce D'Arcus
  2021-07-22  8:27   ` Bruce D'Arcus
  0 siblings, 1 reply; 6+ messages in thread
From: Bruce D'Arcus @ 2021-07-22  2:17 UTC (permalink / raw)
  To: org-mode-email

BTW, here's the info from the debugger:

Debugger entered--Lisp error: (error "Wrong argument type(s)")
error("Wrong argument type(s)")
org-cite-make-insert-processor(bibtex-actions-org-cite-insert
bibtex-actions-org-cite-select-style)
(org-cite-register-processor 'bibtex-actions-org-cite
:insert (org-cite-make-insert-processor
#'bibtex-actions-org-cite-insert
#'bibtex-actions-org-cite-select-style)
:follow #'bibtex-actions-org-cite-follow)
load-with-code-conversion("/home/bruce/.config/emacs/.local/straight/build-28..."
"/home/bruce/.config/emacs/.local/straight/build-28..." nil t)
require(bibtex-actions-org-cite nil nil)

On Wed, Jul 21, 2021 at 11:14 AM Bruce D'Arcus <bdarcus@gmail.com> wrote:
>
> I have run into a problem in implementing a "select-style" function
> for an org-cite-insert-processor.
>
> The WIP code is here:
>
> https://github.com/bdarcus/bibtex-actions/pull/182
>
> It was running correctly yesterday morning, but now it doesn't.
>
> I have two related issues:
>
> 1. I think, but am not sure, I may have run into a bug in
> org-cite-make-insert-processor, as the function I am using for the
> select-style parameter runs correctly outside of the insert processor,
> and returns the same results as the "org-cite-basic--complete-style"
> function. But when I uncomment the parameter to use it on the org-cite
> insert processor, it not only doesn't work correctly, but Emacs won't
> even load fully.
>
> 2. The error I get "wrong type" is so general it literally took me
> hours to realize it was coming from this function; I was looking
> elsewhere for the issue.
>
> So if I'm right about a bug, obviously it would be great if that could be fixed.
>
> But better error handling and reporting would also be really great.
>
> Bruce
>
> PS - I"m still learning elisp, and so am not super knowledgeable about
> debugging in general. If anyone has any tips on that, that could help
> me narrow down the source of the error, that would be much
> appreciated.


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

* Re: [org-cite] issues with org-cite-make-insert-processor select-style
  2021-07-22  2:17 ` Bruce D'Arcus
@ 2021-07-22  8:27   ` Bruce D'Arcus
  2021-07-22 10:30     ` Bruce D'Arcus
  0 siblings, 1 reply; 6+ messages in thread
From: Bruce D'Arcus @ 2021-07-22  8:27 UTC (permalink / raw)
  To: org-mode-email

Another odd thing.

If I comment out those lines and use the oc-basic style selector
instead to start emacs, and from there reactivate this function and
compile and reload the code from the buffer, THEN it works without
error.

On Wed, Jul 21, 2021 at 10:17 PM Bruce D'Arcus <bdarcus@gmail.com> wrote:
>
> BTW, here's the info from the debugger:
>
> Debugger entered--Lisp error: (error "Wrong argument type(s)")
> error("Wrong argument type(s)")
> org-cite-make-insert-processor(bibtex-actions-org-cite-insert
> bibtex-actions-org-cite-select-style)
> (org-cite-register-processor 'bibtex-actions-org-cite
> :insert (org-cite-make-insert-processor
> #'bibtex-actions-org-cite-insert
> #'bibtex-actions-org-cite-select-style)
> :follow #'bibtex-actions-org-cite-follow)
> load-with-code-conversion("/home/bruce/.config/emacs/.local/straight/build-28..."
> "/home/bruce/.config/emacs/.local/straight/build-28..." nil t)
> require(bibtex-actions-org-cite nil nil)
>
> On Wed, Jul 21, 2021 at 11:14 AM Bruce D'Arcus <bdarcus@gmail.com> wrote:
> >
> > I have run into a problem in implementing a "select-style" function
> > for an org-cite-insert-processor.
> >
> > The WIP code is here:
> >
> > https://github.com/bdarcus/bibtex-actions/pull/182
> >
> > It was running correctly yesterday morning, but now it doesn't.
> >
> > I have two related issues:
> >
> > 1. I think, but am not sure, I may have run into a bug in
> > org-cite-make-insert-processor, as the function I am using for the
> > select-style parameter runs correctly outside of the insert processor,
> > and returns the same results as the "org-cite-basic--complete-style"
> > function. But when I uncomment the parameter to use it on the org-cite
> > insert processor, it not only doesn't work correctly, but Emacs won't
> > even load fully.
> >
> > 2. The error I get "wrong type" is so general it literally took me
> > hours to realize it was coming from this function; I was looking
> > elsewhere for the issue.
> >
> > So if I'm right about a bug, obviously it would be great if that could be fixed.
> >
> > But better error handling and reporting would also be really great.
> >
> > Bruce
> >
> > PS - I"m still learning elisp, and so am not super knowledgeable about
> > debugging in general. If anyone has any tips on that, that could help
> > me narrow down the source of the error, that would be much
> > appreciated.


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

* Re: [org-cite] issues with org-cite-make-insert-processor select-style
  2021-07-22  8:27   ` Bruce D'Arcus
@ 2021-07-22 10:30     ` Bruce D'Arcus
  2021-07-22 13:27       ` Matt Price
  0 siblings, 1 reply; 6+ messages in thread
From: Bruce D'Arcus @ 2021-07-22 10:30 UTC (permalink / raw)
  To: org-mode-email

The problem was load order I guess; putting this of the file fixes it.

So when org-citemake-insert-processor is first loaded, it looks for
the two functions, which haven't been loaded yet.

I still think a) the error message could say that (that the functions
aren't found or some such), and b) that it shouldn't break starting
Emacs.

On Thu, Jul 22, 2021 at 4:27 AM Bruce D'Arcus <bdarcus@gmail.com> wrote:

> If I comment out those lines and use the oc-basic style selector
> instead to start emacs, and from there reactivate this function and
> compile and reload the code from the buffer, THEN it works without
> error.


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

* Re: [org-cite] issues with org-cite-make-insert-processor select-style
  2021-07-22 10:30     ` Bruce D'Arcus
@ 2021-07-22 13:27       ` Matt Price
  2021-07-22 13:55         ` Bruce D'Arcus
  0 siblings, 1 reply; 6+ messages in thread
From: Matt Price @ 2021-07-22 13:27 UTC (permalink / raw)
  To: Bruce D'Arcus; +Cc: org-mode-email

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

Bruce, are you loading this code with use-package? If so, and if I'm
reading this right, you can perhaps add the missing functions to the

:commands

directive for org-mode? IIUC that should ensure that they are available to
your package, as long as you have an
:after (org oc)
line in the package's use-package directive.

On Thu, Jul 22, 2021 at 6:31 AM Bruce D'Arcus <bdarcus@gmail.com> wrote:

> The problem was load order I guess; putting this of the file fixes it.
>
> So when org-citemake-insert-processor is first loaded, it looks for
> the two functions, which haven't been loaded yet.
>
> I still think a) the error message could say that (that the functions
> aren't found or some such), and b) that it shouldn't break starting
> Emacs.
>
> On Thu, Jul 22, 2021 at 4:27 AM Bruce D'Arcus <bdarcus@gmail.com> wrote:
>
> > If I comment out those lines and use the oc-basic style selector
> > instead to start emacs, and from there reactivate this function and
> > compile and reload the code from the buffer, THEN it works without
> > error.
>
>

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

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

* Re: [org-cite] issues with org-cite-make-insert-processor select-style
  2021-07-22 13:27       ` Matt Price
@ 2021-07-22 13:55         ` Bruce D'Arcus
  0 siblings, 0 replies; 6+ messages in thread
From: Bruce D'Arcus @ 2021-07-22 13:55 UTC (permalink / raw)
  To: Matt Price; +Cc: org-mode-email

Matt - that's not really the problem.

In general, these core org-cite functions
(org-cite-make-insert-processor and org-cite-register-processor) must
be loaded after anything they refer to; e.g. placed at the end of the
package file.

But if they aren't, the resulting error message is really confusing,
and emacs shouldn't break.

On Thu, Jul 22, 2021 at 9:27 AM Matt Price <moptop99@gmail.com> wrote:
>
> Bruce, are you loading this code with use-package? If so, and if I'm reading this right, you can perhaps add the missing functions to the
>
> :commands
>
> directive for org-mode? IIUC that should ensure that they are available to your package, as long as you have an
> :after (org oc)
> line in the package's use-package directive.
>
> On Thu, Jul 22, 2021 at 6:31 AM Bruce D'Arcus <bdarcus@gmail.com> wrote:
>>
>> The problem was load order I guess; putting this of the file fixes it.
>>
>> So when org-citemake-insert-processor is first loaded, it looks for
>> the two functions, which haven't been loaded yet.
>>
>> I still think a) the error message could say that (that the functions
>> aren't found or some such), and b) that it shouldn't break starting
>> Emacs.
>>
>> On Thu, Jul 22, 2021 at 4:27 AM Bruce D'Arcus <bdarcus@gmail.com> wrote:
>>
>> > If I comment out those lines and use the oc-basic style selector
>> > instead to start emacs, and from there reactivate this function and
>> > compile and reload the code from the buffer, THEN it works without
>> > error.
>>


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

end of thread, other threads:[~2021-07-22 13:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21 15:14 [org-cite] issues with org-cite-make-insert-processor select-style Bruce D'Arcus
2021-07-22  2:17 ` Bruce D'Arcus
2021-07-22  8:27   ` Bruce D'Arcus
2021-07-22 10:30     ` Bruce D'Arcus
2021-07-22 13:27       ` Matt Price
2021-07-22 13:55         ` Bruce D'Arcus

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