help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Defining functions within `condition-case'


From: Michael Heerdegen
Subject: Re: Defining functions within `condition-case'
Date: Wed, 25 Dec 2024 20:57:15 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Jean Louis <bugs@gnu.support> writes:

> ;; -*- lexical-binding: t; -*-
>
> (condition-case my
>
>     (defun my-2-hello ()
>       (message "I am `my-hello'"))
>       
>   (error (message "%s" my)))
>
> (my-2-hello) ➜ "I am ‘my-hello’"

You are aware that this doesn't catch runtime errors, only errors that
appear when evaluating the `defun'?  The above will not be of much use
unless your code contains lots of very strange and malformed defuns like
(defun 1).


Michael.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]