unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: ignore-error?
Date: Fri, 26 Jul 2019 10:08:18 +0200	[thread overview]
Message-ID: <m3tvb99q19.fsf@gnus.org> (raw)
In-Reply-To: <jwvmuhfnysp.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Mon, 15 Jul 2019 10:45:58 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Let's see...  It's this stuff?
>
> Yup.
>
>> The parameter should perhaps also be allowed to be a list of symbols:
>>
>> (ignore-error (file-error some-other-error)
>>   (foo))
>
> Even better,

I have now added `ignore-error', and provided for completion...  but
with some caveats, as `elisp-completion-at-point' isn't...  er...  quite
right?  :-)

Right: If you say

(ignore-erC-M-i

then funpos will indicate that we're in a function position and complete
over functions (which is correct).

(ignore-error C-M-i

still has funpos indicating that we're in a function definition, which
doesn't seem correct?  But even if we fix that, then `end' will indicate
that we can't complete anything anyway.

(ignore-error argC-M-i

will have everything correct and complete to

(ignore-error args-out-of-range

Unfortunately, so will

(ignore-error foo
  argC-M-i

because we don't have a count at all where we are in the sexp we're
completing.  But on the other hand, the sexps are usually not closed
when we're completing anyway, so I guess that's a hard problem.

And, by the way

(condition-case nil
   (foo)
  (argC-M-i

completes well, but not

(condition-case nil
   (foo)
  ((argC-M-i

that is, where the condition is a list...

It seems like that completing function could, like, use more...  stuff.
:-)  But I guess it's a DWIM best effort kinda thing.

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



  reply	other threads:[~2019-07-26  8:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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       ` Lars Ingebrigtsen [this message]
2019-07-26 13:42         ` ignore-error? Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3tvb99q19.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).