[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unexpected error using org-gnus-follow-link
From: |
Ihor Radchenko |
Subject: |
Re: Unexpected error using org-gnus-follow-link |
Date: |
Thu, 26 Dec 2024 13:22:01 +0000 |
Visuwesh <visuweshm@gmail.com> writes:
>> Also, (cdr (assq 'gnus org-link-frame-setup)) = nil is not the only
>> possible incorrect customization. I'd rather check if the cdr is a
>> function and throw a descriptive error otherwise asking to fix
>> `org-link-frame-setup'.
>
> How about the attached?
You still do not check if the value is a function.
Consider totally wrong values like '(wrong). `fboundp' will then throw
an error. You may consider `functionp' instead.
> +(defun org-link-frame-setup-function (link-type)
> + "Return the frame setup function for the link type LINK-TYPE.
> +This signals an error if the value of the key LINK-TYPE in
> +`org-link-frame-setup' is not a function."
> + (let ((fun (cdr (assq link-type org-link-frame-setup))))
> + (if (fboundp fun)
> + fun
> + (error "The frame setup configuration for `%s' link type is
> ill-defined"
> + link-type))))
In the error, we can also show the problematic value to aid the user.
> @@ -15311,20 +15311,20 @@ (defun org-modify-ts-extra (ts-string pos
> nincrements increment-step)
> (setq hour (mod hour 24))
> (setq pos-match-group 1
> new (format "-%02d:%02d" hour minute)))
> -
> +
> ...
Please remove irrelevant whitespace-only changes.
--
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
- Unexpected error using org-gnus-follow-link, Fraga, Eric, 2024/12/12
- Re: Unexpected error using org-gnus-follow-link, Visuwesh, 2024/12/12
- Re: Unexpected error using org-gnus-follow-link, Fraga, Eric, 2024/12/12
- Re: Unexpected error using org-gnus-follow-link, Visuwesh, 2024/12/13
- Re: Unexpected error using org-gnus-follow-link, Fraga, Eric, 2024/12/13
- Re: Unexpected error using org-gnus-follow-link, Max Nikulin, 2024/12/15
- Re: Unexpected error using org-gnus-follow-link, Ihor Radchenko, 2024/12/22
- Message not available
- Message not available
- Re: Unexpected error using org-gnus-follow-link, Visuwesh, 2024/12/26
- Message not available
- Message not available
- Re: Unexpected error using org-gnus-follow-link, Visuwesh, 2024/12/26
- Re: Unexpected error using org-gnus-follow-link,
Ihor Radchenko <=
- Re: Unexpected error using org-gnus-follow-link, Visuwesh, 2024/12/26
- Re: Unexpected error using org-gnus-follow-link, Ihor Radchenko, 2024/12/27