From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: Grab and yank Date: Sun, 24 Jan 2010 15:32:49 +0100 Message-ID: <4B5C5A11.9030403@easy-emacs.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1264344132 17768 80.91.229.12 (24 Jan 2010 14:42:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Jan 2010 14:42:12 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 24 15:42:04 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 1NZ3fA-0005FF-1o for geh-help-gnu-emacs@m.gmane.org; Sun, 24 Jan 2010 15:42:04 +0100 Original-Received: from localhost ([127.0.0.1]:43303 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZ3WB-0005gl-Re for geh-help-gnu-emacs@m.gmane.org; Sun, 24 Jan 2010 09:32:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZ3V8-00057u-1k for help-gnu-emacs@gnu.org; Sun, 24 Jan 2010 09:31:42 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZ3V3-000568-IB for help-gnu-emacs@gnu.org; Sun, 24 Jan 2010 09:31:41 -0500 Original-Received: from [199.232.76.173] (port=33604 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZ3V3-000564-Ao for help-gnu-emacs@gnu.org; Sun, 24 Jan 2010 09:31:37 -0500 Original-Received: from moutng.kundenserver.de ([212.227.126.186]:63365) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NZ3V3-0000vI-1g for help-gnu-emacs@gnu.org; Sun, 24 Jan 2010 09:31:37 -0500 Original-Received: from [192.168.178.27] (p54BE8273.dip0.t-ipconnect.de [84.190.130.115]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0Lgc4H-1OBzAA3MEH-00nWln; Sun, 24 Jan 2010 15:31:36 +0100 User-Agent: Thunderbird 2.0.0.19 (X11/20081227) In-Reply-To: X-Provags-ID: V01U2FsdGVkX1+HpFmv93JaYMGUCRWMUsK/+W4HdRLdV+05Z5C jRiveyYs9qlv2FxeUwMQ7oUyZ/vl5Fsn6baYsCE/6trMeDRUYQ RI0/ymR1XgaKkND9MyAAPrku/2kde+dbQDWZXauNxk= X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:71421 Archived-At: andrea wrote: > 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 > > > > > > Hi, what about the following procedure: 1) register your point 2) swirl around and collect your honey into a second register :-) 3) back to point (first register) 4 insert second register Andreas