unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* *Occur in buf*?
@ 2002-07-25 10:05 Marshall, Simon
  2002-07-25 13:42 ` Sam Steingold
  2002-07-26 15:36 ` Richard Stallman
  0 siblings, 2 replies; 21+ messages in thread
From: Marshall, Simon @ 2002-07-25 10:05 UTC (permalink / raw)


I frequently use M-x occur in several different buffers, in order to
compare the occur results from the different buffers.  Trouble is, M-x
occur always writes to *Occur*, so if I do several M-x occurs in
different buffers I have to rename each *Occur* buffer to make it
unique.  It's inconvenient, and if I do this frequently the number of
*Occur*<n> buffers gets out of hand.  Sure, I could M-x kill-buffer
before M-x occur M-x rename-uniquely.

IWBNI M-x occur created an *Occur in buf* buffer so that I wouldn't have
to do this, rather than *Occur*.

It doesn't seem an outrageous request, after all, the *Occur* buffer is
necessarily tied to a particular originating buffer.

^ permalink raw reply	[flat|nested] 21+ messages in thread
* RE: *Occur in buf*?
@ 2002-07-25 16:07 Marshall, Simon
  2002-07-25 18:46 ` Robert J. Chassell
  0 siblings, 1 reply; 21+ messages in thread
From: Marshall, Simon @ 2002-07-25 16:07 UTC (permalink / raw)
  Cc: 'Emacs Developers'

> I can add an `occur-rename' command (bound to `r') that would 
> rename the
> occur buffer as proposed and bind `clone-buffer' to 'c'.
> do you like this better?
> then the effect of my original patch can be accomplished by adding
> `occur-rename' to `occur-mode-hook'.

Sam, thanks for the suggestions.

I thought that this renaming might be optional, i.e., current behaviour
by default.  I was thinking in terms of a user variable rather than
adding to a hook.

But, I'm not sure how clean the Occur buffer key (to rename the *Occur*
buffer to *Occur: buf*) would actually be.  Suppose M-x occur simply
created an *Occur* buffer.  Suppose I was to rename one to *Occur: buf*
by using the key.  Then, I did another M-x occur (maybe for a different
regexp).  Should M-x occur create another *Occur* buffer?  Or reuse the
*Occur: buf* buffer?  The answer, of course, depends on what I happen to
feel like at the time.  Whichever it chooses will annoy me some of the
time.  "Damn, it went and created yet another buffer!"  Or "damn, it
overwrote my previous M-x occur buffer!".  M-x occur cannot know if I
had renamed the original *Occur* buffer so that *Occur: buf* is the
buffer I want for future M-x occur output or so that I could keep/save
that particular *Occur* buffer only.

Perhaps, in this case, it should create another *Occur* buffer.  If the
user uses the key again to rename it to *Occur: buf*, should Emacs
silently remove the old *Occur: buf* buffer?

Maybe it needs some more thought.

BTW, I prefer *Occur: buf* to *Occur:buf* though YMMV.
I find it easier to spot the original buffer name.
It follows the convention of other buffer names I've seen.

^ permalink raw reply	[flat|nested] 21+ messages in thread
* RE: *Occur in buf*?
@ 2002-07-29 13:52 Marshall, Simon
  0 siblings, 0 replies; 21+ messages in thread
From: Marshall, Simon @ 2002-07-29 13:52 UTC (permalink / raw)
  Cc: emacs-devel, 'Andre Spiegel'

> Alternatively, always name the buffer *Occur*, but provide a 
> occur-save-buffer
> command (bound to `s') which renames the buffer to *Occur: 
> buffer*; then the
> user can easily save precious occur buffers on a needed basis.
> 
> The same could be done for *Help* buffers where it would 
> sometimes be very
> useful to keep multiple help buffer around, e.g. *Help: 
> save-buffer* and
> *Help: bury-buffer*.

Perhaps that's the best solution, since as you point out we can use it
in other Emacs-generated buffers.  I would find it useful for *VC-log*
buffers when checking in different files at the same time.  Or maybe
vc.el should always use the file buffer name in the temporary log buffer
name.

Perhaps there should be a command similar to rename-uniquely that runs
some function to generate a new name.  Different major modes could set
this function to do the appropriate thing, e.g., M-x occur to use the
original buffer's name; M-x describe-variable to use the variable's
name; etc.

The other suggestions:
Using defadvice (on a function I have to find in replace.el) is not easy
or intuitive.  (Richard, was this what you meant by "customization"?)
Using clone-buffer or rename-uniquely is not what I want---it will
increase the amount of clutter and will not make it easy to find the
buffer in the buffer list.

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

end of thread, other threads:[~2002-08-09  7:34 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-25 10:05 *Occur in buf*? Marshall, Simon
2002-07-25 13:42 ` Sam Steingold
2002-07-25 14:37   ` Miles Bader
2002-07-25 15:01     ` Sam Steingold
2002-07-26 15:36       ` Richard Stallman
2002-07-26 19:53         ` Sam Steingold
2002-07-26 15:36 ` Richard Stallman
2002-07-26 17:53   ` Benjamin Rutt
2002-07-28  0:15   ` Kim F. Storm
2002-07-28  1:10     ` Miles Bader
2002-07-29  8:31       ` Kim F. Storm
2002-07-30 14:20         ` Sam Steingold
2002-07-31  1:36           ` Miles Bader
2002-07-31  5:54           ` Richard Stallman
2002-07-31 15:33             ` Sam Steingold
2002-08-09  7:32           ` Stefan Monnier
2002-08-09  7:34       ` Stefan Monnier
2002-07-29  1:42     ` Miles Bader
  -- strict thread matches above, loose matches on Subject: below --
2002-07-25 16:07 Marshall, Simon
2002-07-25 18:46 ` Robert J. Chassell
2002-07-29 13:52 Marshall, Simon

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