emacs-devel
[Top][All Lists]
Advanced

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

Re: New for GNU ELPA: literate-scratch


From: Michael Heerdegen
Subject: Re: New for GNU ELPA: literate-scratch
Date: Fri, 21 Jun 2024 01:12:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Philip Kaludercic <philipk@posteo.net> writes:

> >> You should be able to merge the `and-let*' and `and' like
> >>
> >> --8<---------------cut here---------------start------------->8---
> >> (and-let* ((new (car (bounds-of-thing-at-point 'paragraph)))
> >>       ((< new start)))
> >>   (setq start new))
> >> --8<---------------cut here---------------end--------------->8---
> >
> > Very interesting!
> > This seems to be undocumented behaviour of the macro, though?
> > I don't think I can see anything which implies it in the docstring.
>
> Apparently so?  I thought it was documented under if-let* or when-let*,
> but I couldn't find anything myself either.  BTW., an alternative is to
> bind the symbol `_', which will also discard the value/bind it to a
> fresh variable.

The whole documentation is not replicated completely in each doc string
- the complete documentation is that of `if-let', and it has this
sentence:

| An element can additionally be of the form (VALUEFORM), which is
| evaluated and checked for nil; i.e. SYMBOL can be omitted if only the
| test result is of interest.

which is what you speak about IIUC.  Unless I'm mistaken, this syntax
has been supported by all variants for a long time.

The `_' rewrite is also possible but raises compiler warnings.  We
have fixed this only recently in master.


Michael.



reply via email to

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