all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Stuart D. Herring" <herring@lanl.gov>
Cc: emacs-devel@gnu.org
Subject: Re: Why should interactive search results raise errors?
Date: Thu, 4 May 2006 08:34:30 -0700 (PDT)	[thread overview]
Message-ID: <36883.128.165.123.132.1146756870.squirrel@webmail.lanl.gov> (raw)
In-Reply-To: <445A0DAB.1070809@student.lu.se>

> If I want to see if there is any hits at all then a failed search is not
> an error. It gives me the information I wanted - whether there are hits
> or not. Why should then this be an error?

The menu eventually calls `search-forward'.  Its doc string begins thus:

  Search forward from point for STRING.
  Set point to the end of the occurrence found, and return point.

If there is no occurrence of STRING, then this function cannot do what it
says it will do, so it must signal an error.  Even if we ignore that it
says it will return point and return nil from it, it has not set point to
anything meaningful, so it should not return normally.

Certainly one could define a function with different semantics -- or a
flag for an existing function.  And we have:

  Optional third argument, if t, means if fail just return nil (no error).
    If not nil and not t, move to limit of search and return nil.

So perhaps you just want `nonincremental-search-forward' to do
(search-forward string nil t)?  That's not unreasonable, but then the menu
and the underlying command would behave differently.  So you could make
the default value for the NOERROR argument depend on whether the function
was called interactively.  But then you have to print some sort of message
when the search fails, and (ding) for backwards compatibility -- but only
when interactive...

It just seems simpler to me to keep the current behavior and use (the
proposed) `user-error' or `debug-ignored-errors' as suggested.

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.

  reply	other threads:[~2006-05-04 15:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-03 16:26 Why should interactive search results raise errors? Lennart Borgman
2006-05-03 16:34 ` Chong Yidong
2006-05-03 16:50   ` Lennart Borgman
2006-05-04 14:17     ` Richard Stallman
2006-05-04 14:20       ` Lennart Borgman
2006-05-04 15:34         ` Stuart D. Herring [this message]
2006-05-04 16:15       ` Stefan Monnier
2006-05-03 17:29 ` Stefan Monnier
2006-05-03 19:58   ` Lennart Borgman
2006-05-04  8:34 ` Kim F. Storm
  -- strict thread matches above, loose matches on Subject: below --
2006-05-04  9:21 LENNART BORGMAN
2006-05-04  9:58 ` Miles Bader

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

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

  git send-email \
    --in-reply-to=36883.128.165.123.132.1146756870.squirrel@webmail.lanl.gov \
    --to=herring@lanl.gov \
    --cc=emacs-devel@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.