all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#15292: 24.3.50; Isearch: handle commands properly when called at top level
@ 2013-09-06 18:56 Drew Adams
  2013-09-06 20:49 ` Juri Linkov
  2013-09-06 22:55 ` Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Drew Adams @ 2013-09-06 18:56 UTC (permalink / raw)
  To: 15292

Isearch now has quite a few commands that can be invoked during Isearch,
using keys.  None of these commands currently take care of the fact that
they might get called at top level, e.g., with `isearch-mode' = nil.

Some such commands, such as `isearch-help-for-help' should be callable
outside of Isearch.  Others, such as `isearch-repeat-forward', should
not.  For those that should not, an error should be raised, saying that
the command is for use only in Isearch.

For those that should be allowable outside of Isearch, the code should
take care to DTRT when not in `isearch-mode':

* wrt messages (mostly inhibit messages, esp. if they use
  `isearch-message-prefix' etc.)

* wrt Isearch highlighting (they should not do any highlighting)

* wrt calling `isearch-update' etc. (they should not do it)

* wrt calling `exit-minibuffer' (they should not do it: no catch for
  throw)

Some commands, such as `isearch-describe-bindings' and
`isearch-highlight-regexp' can be used outside of Isearch with no change
- they work well already.  This includes even `isearch-edit-string',
which can be called outside Isearch but which then continues in Isearch
with no problem.

Among the comands that might be useful, or at least allowable, outside
of Isearch (dunno), but that might need some minor fixup are the
following.  They should not call `isearch-update' etc.

* isearch-help-for-help

* isearch-describe-key (should explicitly use `isearch-mode-map')

* isearch-describe-mode

* isearch-toggle-*

Dunno whether there is any use for these commands outside Isearch:

* isearch-cancel (moves point to last Isearch start)

* isearch-abort


In GNU Emacs 24.3.50.1 (i686-pc-mingw32)
 of 2013-08-23 on ODIEONE
Bzr revision: 113986 rgm@gnu.org-20130823185841-zoy6h1qk433ibrlf
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/Devel/emacs/binary --enable-checking=yes,glyphs
 'CFLAGS=-O0 -g3' LDFLAGS=-Lc:/Devel/emacs/lib
 CPPFLAGS=-Ic:/Devel/emacs/include'





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

* bug#15292: 24.3.50; Isearch: handle commands properly when called at top level
  2013-09-06 18:56 bug#15292: 24.3.50; Isearch: handle commands properly when called at top level Drew Adams
@ 2013-09-06 20:49 ` Juri Linkov
  2013-09-06 21:04   ` Drew Adams
  2013-09-06 22:55 ` Stefan Monnier
  1 sibling, 1 reply; 5+ messages in thread
From: Juri Linkov @ 2013-09-06 20:49 UTC (permalink / raw)
  To: Drew Adams; +Cc: 15292

> Among the comands that might be useful, or at least allowable, outside
> of Isearch (dunno), but that might need some minor fixup are the
> following.  They should not call `isearch-update' etc.
>
> * isearch-help-for-help
> * isearch-describe-key (should explicitly use `isearch-mode-map')
> * isearch-describe-mode
> * isearch-toggle-*

Isearch is not a library of functions, and not intended for external use.
I can't imagine how you might want to use e.g. isearch-help-for-help
outside of Isearch.





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

* bug#15292: 24.3.50; Isearch: handle commands properly when called at top level
  2013-09-06 20:49 ` Juri Linkov
@ 2013-09-06 21:04   ` Drew Adams
  0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2013-09-06 21:04 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 15292

> Isearch is not a library of functions, and not intended for external use.

Every library containing functions is a library of functions.  And there is
no "external use".  But it's clear we will continue to disagree about that.

> I can't imagine how you might want to use e.g. isearch-help-for-help
> outside of Isearch.

I have nothing particular in mind wrt that.  The main point was that
commands that should be called only when in `isearch-mode' could usefully
raise an error if called outside that mode.  Likewise, minibuffer commands
that make no sense if called outside the minibuffer, and so on.  IMO, such
commands should barf if called outside the expected context.

But it does not bother me if you decide not to do anything about such things.





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

* bug#15292: 24.3.50; Isearch: handle commands properly when called at top level
  2013-09-06 18:56 bug#15292: 24.3.50; Isearch: handle commands properly when called at top level Drew Adams
  2013-09-06 20:49 ` Juri Linkov
@ 2013-09-06 22:55 ` Stefan Monnier
  2013-09-06 23:19   ` Drew Adams
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2013-09-06 22:55 UTC (permalink / raw)
  To: Drew Adams; +Cc: 15292

> Some such commands, such as `isearch-help-for-help' should be callable
> outside of Isearch.

You mean via something like M-x isearch-help-for-help, right?
(I doubt anyone would bind such a command to a key).

> Others, such as `isearch-repeat-forward', should not.  For those that
> should not, an error should be raised, saying that the command is for
> use only in Isearch.

Actually, it's not important to signal an error saying "don't use it
outside Isearch mode", *unless* running that command outside Isearch
mode results in nasty behavior.


        Stefan





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

* bug#15292: 24.3.50; Isearch: handle commands properly when called at top level
  2013-09-06 22:55 ` Stefan Monnier
@ 2013-09-06 23:19   ` Drew Adams
  0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2013-09-06 23:19 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 15292

> > Some such commands, such as `isearch-help-for-help' should be callable
> > outside of Isearch.
> 
> You mean via something like M-x isearch-help-for-help, right?

Yes.

> (I doubt anyone would bind such a command to a key).

They might.  Or they might read the command name in the minibuffer from
some other command that then invokes it.  Or whatever.

After all, that command does give you a general entry to help of various
kinds on Isearch.  And for the most part it does work OK at top level.
There is just a minor hiccup because it calls `isearch-update'.  It
wouldn't cost much to make it useful pretty much anywhere, just as
`isearch-describe-bindings' already is.

> > Others, such as `isearch-repeat-forward', should not.  For those that
> > should not, an error should be raised, saying that the command is for
> > use only in Isearch.
> 
> Actually, it's not important to signal an error saying "don't use it
> outside Isearch mode", *unless* running that command outside Isearch
> mode results in nasty behavior.

I don't disagree that it's not important in such cases.  Just thought
it might be better.  It's not important to me, in any case.  Nothing
in this bug report is.

Particularly the toggle commands, I think, might be commands that
someone might mistakenly think could be used at top level.  It's not
obvious, when you do something like `apropos-command' etc., whether such
a command like `isearch-toggle-lax-whitespace' is relevant only in some
particular context.  The doc is mute about it; you find out what it does
in the wrong context only by trying it there.





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

end of thread, other threads:[~2013-09-06 23:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-06 18:56 bug#15292: 24.3.50; Isearch: handle commands properly when called at top level Drew Adams
2013-09-06 20:49 ` Juri Linkov
2013-09-06 21:04   ` Drew Adams
2013-09-06 22:55 ` Stefan Monnier
2013-09-06 23:19   ` Drew Adams

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.