unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* 23.0.60; M-x occur no longer uses previous regexp as default
@ 2008-04-22 11:14 Sven Joachim
  2008-04-22 20:08 ` Richard Stallman
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Joachim @ 2008-04-22 11:14 UTC (permalink / raw)
  To: emacs-pretest-bug; +Cc: rfrancoise

In Emacs 22, M-x occur uses the previous regexp as default when invoked
a second time, so you could just press RET to look for it again.  Now
you have to use M-p to receive the previous regexp, if you forget that
Emacs hangs and uses 100% CPU (interruptible with C-g, backtrace
follows):

,----
| Debugger entered--Lisp error: (quit)
|   string-match("" #("To: emacs-pretest-bug@gnu.org" 0 2 (fontified t face message-header-name auto-composed t) 2 3 (fontified t face message-header-name auto-composed t) 3 4 (fontified t auto-composed t) 4 29 (fontified t face message-header-to auto-composed t)) 0)
|   occur-engine("" (#<buffer *mail to emacs-pretest-bug@gnu.org*>) #<buffer *Occur*> 0 t underline nil match t)
|   occur-1("" nil (#<buffer *mail to emacs-pretest-bug@gnu.org*>))
|   occur("" nil)
|   call-interactively(occur nil nil)
`----

FWIW, Emacs 22 directly signals an error if you supply an empty string
in M-x occur.


In GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+ Version 2.12.9)
 of 2008-04-18 on debian, modified by Debian
 (emacs-snapshot package, version 1:20080416-3)
Windowing system distributor `The X.Org Foundation', version 11.0.10300000
configured using `configure  '--build' 'i486-linux-gnu' '--host' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.60/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.60/site-lisp:/usr/share/emacs/site-lisp' '--with-x=yes' '--with-x-toolkit=gtk' '--disable-font-backend' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: C
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: de_DE.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Log-View

Minor modes in effect:
  shell-dirtrack-mode: t
  display-time-mode: t
  auto-image-file-mode: t
  show-paren-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-compression-mode: t
  temp-buffer-resize-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<right> <right> <right> <right> <right> SPC <f9> <delete> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> SPC 
<f9> <delete> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <delete> SPC SPC <f9> 
<delete> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> SPC <f9> <delete> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
SPC <f9> <delete> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> SPC <f9> <delete> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> SPC <f9> <delete> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> SPC <f9> C-c C-c o C-z C-c o <up> <return> 
C-x 1 C-x C-s C-c <return> C-x <return> f i s o <tab> 
l <tab> 1 - u <tab> <return> C-x C-s C-x C-j g <down> 
<down> <down> y <up> <up> <up> <return> C-x k <return> 
C e l o a p r 0 8 <return> <return> C-x d / u s r <tab> 
l o c <tab> s r <tab> t r <tab> e <tab> l i s <tab> 
<return> C-s o c c u r r <return> <C-end> C-c o o c 
c u r <return> C-c l o c c u r <return> C-h k C-c o 
C-x o <tab> <return> C-x 1 C-x C-j C-c l <return> <next> 
<prior> <next> <prior> <up> <up> <return> C-x b <return> 
q C-x 4 n C-c C-b C-x C-b C-x o <down> d d x <up> g 
<return> C-x 1 C-x v l C-s o c c u r C-s C-s C-s C-s 
C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-x 
1 <next> <f8> C-g M-x r e p o <tab> r t - e m <tab> 
<return> b <return>

Recent messages:
Copy: 1 file
Mark saved where search started
Mark set
Searched 1 buffer; no matches for `occur'
Type C-x 4 o RET to restore the other window, C-M-v to scroll help.
mouse-2, RET: find function's definition
Loading vc-cvs...done
Mark saved where search started
Quit
Making completion list... [2 times]




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

* Re: 23.0.60; M-x occur no longer uses previous regexp as default
  2008-04-22 11:14 23.0.60; M-x occur no longer uses previous regexp as default Sven Joachim
@ 2008-04-22 20:08 ` Richard Stallman
  2008-04-22 23:14   ` Juri Linkov
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Stallman @ 2008-04-22 20:08 UTC (permalink / raw)
  To: Sven Joachim; +Cc: emacs-pretest-bug, rfrancoise

    In Emacs 22, M-x occur uses the previous regexp as default when invoked
    a second time, so you could just press RET to look for it again.

I think we should consider that a bug and fix it.

      Now
    you have to use M-p to receive the previous regexp, if you forget that
    Emacs hangs and uses 100% CPU (interruptible with C-g, backtrace
    follows):

Maybe one of these functions should signal an error if the regexp arg
is "".




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

* Re: 23.0.60; M-x occur no longer uses previous regexp as default
  2008-04-22 20:08 ` Richard Stallman
@ 2008-04-22 23:14   ` Juri Linkov
  2008-04-23  1:47     ` Stefan Monnier
  2008-04-23 15:58     ` Richard M Stallman
  0 siblings, 2 replies; 6+ messages in thread
From: Juri Linkov @ 2008-04-22 23:14 UTC (permalink / raw)
  To: rms; +Cc: emacs-pretest-bug, rfrancoise, Sven Joachim

>     In Emacs 22, M-x occur uses the previous regexp as default when invoked
>     a second time, so you could just press RET to look for it again.
>
> I think we should consider that a bug and fix it.

The reason for removing the previous regexp from default was because
it makes more inconvenient to retrieve more available values from
the list of default values via M-n.  But maybe we could just display
the previous regexp in the prompt and accept it when the user types RET
with the empty string, but don't make it available via M-n, because it is
available via M-p for inserting into the minibuffer for editing.

>       Now
>     you have to use M-p to receive the previous regexp, if you forget that
>     Emacs hangs and uses 100% CPU (interruptible with C-g, backtrace
>     follows):
>
> Maybe one of these functions should signal an error if the regexp arg
> is "".

Alternatively, we could change the occur engine to display all lines for
the "" regexp.  This is not useful, but at least can be expected for "".

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: 23.0.60; M-x occur no longer uses previous regexp as default
  2008-04-22 23:14   ` Juri Linkov
@ 2008-04-23  1:47     ` Stefan Monnier
  2008-04-23  8:59       ` Juri Linkov
  2008-04-23 15:58     ` Richard M Stallman
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2008-04-23  1:47 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-pretest-bug, rfrancoise, rms, Sven Joachim

> The reason for removing the previous regexp from default was because
> it makes more inconvenient to retrieve more available values from
> the list of default values via M-n.  But maybe we could just display
> the previous regexp in the prompt and accept it when the user types RET
> with the empty string, but don't make it available via M-n, because it is
> available via M-p for inserting into the minibuffer for editing.

Then why not use

   (let ((ret (read-string (format "Regexp (default %s): " foo))))
     (if (equal ret "") foo ret))

> Alternatively, we could change the occur engine to display all lines for
> the "" regexp.  This is not useful, but at least can be expected for "".

Signalling an error in the function's code is better.
Making sure the interactive spec never returns "" is also better (and
not mutually exclusive).


        Stefan




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

* Re: 23.0.60; M-x occur no longer uses previous regexp as default
  2008-04-23  1:47     ` Stefan Monnier
@ 2008-04-23  8:59       ` Juri Linkov
  0 siblings, 0 replies; 6+ messages in thread
From: Juri Linkov @ 2008-04-23  8:59 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-pretest-bug, rfrancoise, rms, Sven Joachim

>> The reason for removing the previous regexp from default was because
>> it makes more inconvenient to retrieve more available values from
>> the list of default values via M-n.  But maybe we could just display
>> the previous regexp in the prompt and accept it when the user types RET
>> with the empty string, but don't make it available via M-n, because it is
>> available via M-p for inserting into the minibuffer for editing.
>
> Then why not use
>
>    (let ((ret (read-string (format "Regexp (default %s): " foo))))
>      (if (equal ret "") foo ret))

It seems this is the best to do where foo is (car regexp-history).

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: 23.0.60; M-x occur no longer uses previous regexp as default
  2008-04-22 23:14   ` Juri Linkov
  2008-04-23  1:47     ` Stefan Monnier
@ 2008-04-23 15:58     ` Richard M Stallman
  1 sibling, 0 replies; 6+ messages in thread
From: Richard M Stallman @ 2008-04-23 15:58 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-pretest-bug, rfrancoise, svenjoac

    > Maybe one of these functions should signal an error if the regexp arg
    > is "".

    Alternatively, we could change the occur engine to display all lines for
    the "" regexp.  This is not useful, but at least can be expected for "".

I think an error would be more convenient in practice.




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

end of thread, other threads:[~2008-04-23 15:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-22 11:14 23.0.60; M-x occur no longer uses previous regexp as default Sven Joachim
2008-04-22 20:08 ` Richard Stallman
2008-04-22 23:14   ` Juri Linkov
2008-04-23  1:47     ` Stefan Monnier
2008-04-23  8:59       ` Juri Linkov
2008-04-23 15:58     ` Richard M Stallman

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).