unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to open two or more scratch buffers ?
@ 2011-01-14 21:26 bolega
  2011-01-14 21:49 ` Pascal J. Bourguignon
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bolega @ 2011-01-14 21:26 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: bolega


(1) I want to compare two or three files (compare-windows) but I dont
want to save them in files, only as scratch buffers. C-x 2 replicates
the same buffer in two different windows.

Suppose the above is solved, then how to have a nice key binding if
there is no pre-existing one as I dont want to deviate from the normal
defaults, but only on these few occasions.

(2) In a newer emacs version, when I start emacs, it opens

*GNU Emacs*

as normal but on hitting return, does not clear the buffer and tells
me its readonly. which is really automatically switching to the
scratch buffer on hitting any key or hitting return.

How to do solve tthe two ?

Thanks




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

* Re: How to open two or more scratch buffers ?
  2011-01-14 21:26 How to open two or more scratch buffers ? bolega
@ 2011-01-14 21:49 ` Pascal J. Bourguignon
  2011-01-14 22:18 ` Drew Adams
       [not found] ` <mailman.1.1295043524.18911.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 4+ messages in thread
From: Pascal J. Bourguignon @ 2011-01-14 21:49 UTC (permalink / raw)
  To: help-gnu-emacs

bolega <gnuist006@gmail.com> writes:

> (1) I want to compare two or three files (compare-windows) but I dont
> want to save them in files, only as scratch buffers. C-x 2 replicates
> the same buffer in two different windows.

M-x ediff RET file1 RET file2 RET
M-x ediff3 for three files of course. 


> Suppose the above is solved, then how to have a nice key binding if
> there is no pre-existing one as I dont want to deviate from the normal
> defaults, but only on these few occasions.
>
> (2) In a newer emacs version, when I start emacs, it opens
>
> *GNU Emacs*

C-x k RET


> as normal but on hitting return, does not clear the buffer and tells
> me its readonly. which is really automatically switching to the
> scratch buffer on hitting any key or hitting return.
>
> How to do solve tthe two ?
>
> Thanks

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.


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

* RE: How to open two or more scratch buffers ?
  2011-01-14 21:26 How to open two or more scratch buffers ? bolega
  2011-01-14 21:49 ` Pascal J. Bourguignon
@ 2011-01-14 22:18 ` Drew Adams
       [not found] ` <mailman.1.1295043524.18911.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 4+ messages in thread
From: Drew Adams @ 2011-01-14 22:18 UTC (permalink / raw)
  To: 'bolega', help-gnu-emacs

> (1) I want to compare two or three files (compare-windows) but I dont
> want to save them in files,

Then you want to compare not files but buffers, no?

> only as scratch buffers.

Do you mean buffer `*scratch*' or just throw-away buffers?

You can open any buffers you want, using `C-x b'.  The buffer need not exist
first.

> C-x 2 replicates the same buffer in two different windows.

Then you are not comparing buffers or files, but the contents of windows
(`compare-windows', as you mentioned).

Consider using different, throw-away buffers, and using `ediff-compare-buffers'.

> Suppose the above is solved, then how to have a nice key binding if
> there is no pre-existing one as I dont want to deviate from the normal
> defaults, but only on these few occasions.

Personally, I use these bindings:

C-= b  ediff-buffers
C-= d  diff
C-= e  ediff-files
C-= f  ediff-files
C-= w  compare-windows

http://www.emacswiki.org/emacs/setup-keys.el




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

* Re: How to open two or more scratch buffers ?
       [not found] ` <mailman.1.1295043524.18911.help-gnu-emacs@gnu.org>
@ 2011-01-14 22:34   ` Mario Lassnig
  0 siblings, 0 replies; 4+ messages in thread
From: Mario Lassnig @ 2011-01-14 22:34 UTC (permalink / raw)
  To: help-gnu-emacs

On 1/14/11 11:18 PM, Drew Adams wrote:
>> (1) I want to compare two or three files (compare-windows) but I dont
>> want to save them in files,
>
> Then you want to compare not files but buffers, no?
>
>> only as scratch buffers.
>
> Do you mean buffer `*scratch*' or just throw-away buffers?
>
> You can open any buffers you want, using `C-x b'.  The buffer need not exist
> first.


I use this simple shortcut about a hundred times a day:


(defun new-scratchpad ()
   (interactive)
   (switch-to-buffer (concat "scratch-" (number-to-string (abs (random))))))

(global-set-key (kbd "C-n") 'new-scratchpad)





>
>> C-x 2 replicates the same buffer in two different windows.
>
> Then you are not comparing buffers or files, but the contents of windows
> (`compare-windows', as you mentioned).
>
> Consider using different, throw-away buffers, and using `ediff-compare-buffers'.
>
>> Suppose the above is solved, then how to have a nice key binding if
>> there is no pre-existing one as I dont want to deviate from the normal
>> defaults, but only on these few occasions.
>
> Personally, I use these bindings:
>
> C-= b  ediff-buffers
> C-= d  diff
> C-= e  ediff-files
> C-= f  ediff-files
> C-= w  compare-windows
>
> http://www.emacswiki.org/emacs/setup-keys.el
>
>



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

end of thread, other threads:[~2011-01-14 22:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-14 21:26 How to open two or more scratch buffers ? bolega
2011-01-14 21:49 ` Pascal J. Bourguignon
2011-01-14 22:18 ` Drew Adams
     [not found] ` <mailman.1.1295043524.18911.help-gnu-emacs@gnu.org>
2011-01-14 22:34   ` Mario Lassnig

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