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

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

bug#14724: 24.3.50; `isearch-open-necessary-overlays' handling of overla


From: Drew Adams
Subject: bug#14724: 24.3.50; `isearch-open-necessary-overlays' handling of overlay property 'isearch-open-invisible'
Date: Wed, 26 Jun 2013 19:38:19 -0700 (PDT)

> > The code would be more robust if it would gracefully handle (1) an
> > non-functional value and perhaps
> 
> Wouldn't such a non-function non-nil value reflect an error in an
> Elisp package?

Yes, normally.  In Elisp code, whether a package or not, and whether 
distributed by Emacs Dev or not.

> If so, why should we silence it?

It would allow 3rd-party code that might not be correct in this regard to at 
least allow Isearch to continue to function normally otherwise.

The only reasonable value is a function, since we immediately invoke funcall 
with it.  I'm guessing it might not be obvious to someone where the error lies.

It costs nothing for the code to protect itself from funcalling a non-function 
here and thus fail gracefully with a no-op.  Someone trying to use this feature 
will as likely dig in to figure out the problem with a non-action as with an 
error, but users would at least not be impacted.

Of course I agree that raising an error for incorrect code is typically TRT.  
I'm not sure it is in this case.  See what I said about 
`isearch-open-invisible-temporary', which is different in that it is not set up 
in distant code but is internal to isearch.el.

> > For (1+2), that could be wrapped in `ignore-errors'.
> 
> I thing I disagree with ignore-errors here (at least, I don't think such
> errors are normal, so they shouldn't be silenced), but using
> with-demoted-errors could make sense if errors in this code could make
> isearch non-functional.  Is that the case?

An error is raised; that's all - Isearch is not broken by it.  Yes, 
`with-demoted-errors' makes more sense.  The same considerations apply here as 
for a non-function: better a no-op (a msg is OK) than an error, I think.

Whatever you decide is fine with me.  I'm essentially bringing it to your 
attention.  Perhaps Juri has some input on this?






reply via email to

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