help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to open two or more scratch buffers ?


From: Mario Lassnig
Subject: Re: How to open two or more scratch buffers ?
Date: Fri, 14 Jan 2011 23:34:34 +0100
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-GB; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]