emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Adam Porter <adam@alphapapa.net>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] When calling org-tree-to-indirect-buffer: (wrong-type-argument listp org-fold-outline) in org-fold-core-get-folding-spec-from-alias [9.6.6 (release_9.6.6 @ /gnu/store/c7vqk20kf6zw73klr8bacnh0gqahk5dd-emacs-29.1-29.1/share/emacs/29.1/lisp/org/)]
Date: Wed, 30 Aug 2023 23:22:19 -0500	[thread overview]
Message-ID: <b276b16a-6eb5-a5fa-377f-185aa9f65d3e@alphapapa.net> (raw)
In-Reply-To: <87v8cz34fs.fsf@localhost>

Hi Ihor,

On 8/28/23 04:24, Ihor Radchenko wrote:
> Adam Porter <adam@alphapapa.net> writes:
> 
>>> This is a very strange backtrace.
>>> When I run that `alist-get' call manually, there is no error. And
>>> `alist-get' does not call `car'.
>>>
>>> May you try to re-generate the backtrace again?
>>
>> It is indeed strange.  I generated the backtrace several times over
>> several sessions before reporting.  I also can reproduce it in a clean
>> Emacs configuration like so:
> 
> You re-define `alist-get' in one of the callers in a way that cannot
> handle normal alists like (key . value), not (key . list-value).
> 
> (cl-defun burly-follow-url-org-mode (&key buffer query)
>    "In BUFFER, jump to heading and position from QUERY, and return a buffer.
> If QUERY specifies that the buffer should be indirect, a new,
> indirect buffer is returned.  Otherwise BUFFER is returned."
>    ;; `pcase's map support uses `alist-get', which does not work with string keys
>    ;; unless its TESTFN arg is bound to, e.g. `equal', but `map-elt' has deprecated
>    ;; its TESTFN arg, and there's no way to pass it or bind it when using `pcase'
>    ;; anyway.  So we rebind `alist-get' to a function that uses `assoc-string'.
>    (with-current-buffer buffer
>      (cl-letf (((symbol-function 'alist-get)
>                 (lambda (key alist &optional _default _remove _testfn)
>                   ;; Only the first value in the list of values is returned, so multiple
>                   ;; values are not supported.  I don't expect this to be a problem...
>                   (cadr (assoc-string key alist)))))
> 
> Handled.
> Not an Org bug.

My apologies, I overlooked that when investigating the problem.  Thanks 
for your work.

Adam


      reply	other threads:[~2023-08-31  4:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24 16:50 [BUG] When calling org-tree-to-indirect-buffer: (wrong-type-argument listp org-fold-outline) in org-fold-core-get-folding-spec-from-alias [9.6.6 (release_9.6.6 @ /gnu/store/c7vqk20kf6zw73klr8bacnh0gqahk5dd-emacs-29.1-29.1/share/emacs/29.1/lisp/org/)] Adam Porter
2023-08-25  8:19 ` Ihor Radchenko
2023-08-28  6:35   ` Adam Porter
2023-08-28  9:24     ` Ihor Radchenko
2023-08-31  4:22       ` Adam Porter [this message]

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=b276b16a-6eb5-a5fa-377f-185aa9f65d3e@alphapapa.net \
    --to=adam@alphapapa.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /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).