[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: copy-region-as-kill => variable
From: |
Harald Hanche-Olsen |
Subject: |
Re: copy-region-as-kill => variable |
Date: |
Tue, 17 Jan 2006 00:59:46 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (berkeley-unix) |
+ Tim Johnson <tim@johnsons-web.com>:
| Is there a function that would operate as copy-region-as-kill,
| but instead of copying to kill-ring would copy the data to a variable,
| such as one created by 'defvar?
Such a beast is not terribly hard to write:
(defun copy-region-to-variable (start end variable)
(interactive "r\nvCopy region to variable: ")
(set variable (buffer-substring start end)))
Note that this copies text properties as well.
You may find this confusing. Or perhaps not.
--
* Harald Hanche-Olsen <URL:http://www.math.ntnu.no/~hanche/>
- Debating gives most of us much more psychological satisfaction
than thinking does: but it deprives us of whatever chance there is
of getting closer to the truth. -- C.P. Snow