emacs-devel
[Top][All Lists]
Advanced

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

ignore-error?


From: Lars Ingebrigtsen
Subject: ignore-error?
Date: Mon, 15 Jul 2019 12:29:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

It seems like people like writing `ignore-errors' a lot more than
`condition-case', and I think `ignore-errors' is the wrong thing to say
90% of the time.

So would it be a good idea to add a new convenience macro `ignore-error'
to entice people to not use `ignore-errors' so much?  It would take an
error condition as its parameter, so:

  (ignore-error 'file-error
    (directory-files dir))

which would simply expand to

  (condition-case _
      (directory-files dir)
    (file-error nil))

It indents nicely, too.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




reply via email to

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