From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: andrea Newsgroups: gmane.emacs.help Subject: Grab and yank Date: Sat, 23 Jan 2010 22:31:56 +0100 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1264282396 8827 80.91.229.12 (23 Jan 2010 21:33:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Jan 2010 21:33:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jan 23 22:33:08 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NYnbN-00043V-1k for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Jan 2010 22:33:05 +0100 Original-Received: from localhost ([127.0.0.1]:39673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NYnbO-0007O0-54 for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Jan 2010 16:33:06 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NYnak-0007Ea-T3 for help-gnu-emacs@gnu.org; Sat, 23 Jan 2010 16:32:27 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NYnag-0007Bm-Be for help-gnu-emacs@gnu.org; Sat, 23 Jan 2010 16:32:26 -0500 Original-Received: from [199.232.76.173] (port=35135 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NYnaf-0007BG-NS for help-gnu-emacs@gnu.org; Sat, 23 Jan 2010 16:32:21 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:42995) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NYnaf-0000Ml-5O for help-gnu-emacs@gnu.org; Sat, 23 Jan 2010 16:32:21 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1NYnaa-0003r1-K8 for help-gnu-emacs@gnu.org; Sat, 23 Jan 2010 22:32:16 +0100 Original-Received: from 134.61.95.223 ([134.61.95.223]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 23 Jan 2010 22:32:16 +0100 Original-Received: from andrea.crotti.0 by 134.61.95.223 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 23 Jan 2010 22:32:16 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 23 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 134.61.95.223 User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (darwin) Cancel-Lock: sha1:qIb2eflrPa59MK5rQ8HvutgZVPM= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:71408 Archived-At: I notice that I often do this operation: I am in one buffer and I need to fetch something from another buffer. So I visit the other one, select what I need, go back and yank. Now something like that would be nice instead: - visit the buffer in view mode - when quitting automatically put it in kill-ring and yank it to the point of the original buffer This would save quite a lot of time, what do you thik? I started something like that -8<---------------cut here---------------start------------->8--- (defun grab-and-yank (buffer) "Grabs from another buffer and yank it to your point" (interactive "bbuffer:\n") (switch-to-buffer-other-window buffer) (view-mode 1)) --8<---------------cut here---------------end--------------->8--- But the view mode apparently don't keep it read only, and I think I should change the keymap to make "q" do something different than just exiting