unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* ignore-error?
@ 2019-07-15 10:29 Lars Ingebrigtsen
  2019-07-15 13:08 ` ignore-error? Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-15 10:29 UTC (permalink / raw)
  To: emacs-devel

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




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-07-26 13:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-15 10:29 ignore-error? Lars Ingebrigtsen
2019-07-15 13:08 ` ignore-error? Stefan Monnier
2019-07-15 13:36   ` ignore-error? Lars Ingebrigtsen
2019-07-15 14:45     ` ignore-error? Stefan Monnier
2019-07-26  8:08       ` ignore-error? Lars Ingebrigtsen
2019-07-26 13:42         ` ignore-error? Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).