[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question about copy-region-as-kill
From: |
John Wiegley |
Subject: |
Re: Question about copy-region-as-kill |
Date: |
Sat, 06 Apr 2002 13:38:39 -0700 |
User-agent: |
Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i386-debian-linux-gnu) |
>>>>> On Sat Apr 6, RMS writes:
> Text properties are part of the text. Aside from special cases
> there is no reason not to copy them.
Yet there DO exist reasons to avoid doing so, which at present force
people to resort to overlays. I think there is sufficient evidence to
show that not copying text properties in certain buffers is a good
thing.
We're talking about such a small change here (see below). I can't
believe there is a valid philosophical reason to _deny_ such
configurability, forcing an entirely different paradigm (overlays)
just to avoid the copy.
And whether these are stripped at kill or yank, I don't care. I just
don't want read-only copied around when I kill text from Eshell, and
then yank it into an e-mail message!
John
----------------------------------------------------------------------
(defvar copy-properties-on-kill t)
(make-variable-buffer-local 'copy-properties-on-kill))
(defun copy-region-as-kill (beg end)
"Save the region as if killed, but don't kill it.
In Transient Mark mode, deactivate the mark.
If `interprogram-cut-function' is non-nil, also save the text for a window
system cut and paste."
(interactive "r")
(let ((str (if copy-properties-on-kill
(buffer-substring beg end)
(buffer-substring-no-properties beg end))))
(if (eq last-command 'kill-region)
(kill-append str (< end beg))
(kill-new str)))
(if transient-mark-mode
(setq deactivate-mark t))
nil)
- Re: Question about copy-region-as-kill, (continued)
- Re: Question about copy-region-as-kill, Francesco Potorti`, 2002/04/12
- Re: Question about copy-region-as-kill, Per Abrahamsen, 2002/04/09
- Re: Question about copy-region-as-kill, John Wiegley, 2002/04/09
- Re: Question about copy-region-as-kill, Tak Ota, 2002/04/06
- Re: Question about copy-region-as-kill, Andreas Schwab, 2002/04/06
- Re: Question about copy-region-as-kill, Richard Stallman, 2002/04/06
- Re: Question about copy-region-as-kill,
John Wiegley <=
- Re: Question about copy-region-as-kill, Alex Schroeder, 2002/04/06
- Re: Question about copy-region-as-kill, Colin Walters, 2002/04/06
- Re: Question about copy-region-as-kill, Miles Bader, 2002/04/06
- Re: Question about copy-region-as-kill, John Wiegley, 2002/04/06
- Re: Question about copy-region-as-kill, Colin Walters, 2002/04/06
- Re: Question about copy-region-as-kill, Miles Bader, 2002/04/06
- Re: Question about copy-region-as-kill, Colin Walters, 2002/04/07
- Re: Question about copy-region-as-kill, Miles Bader, 2002/04/07
- Re: Question about copy-region-as-kill, Colin Walters, 2002/04/07
- Re: Question about copy-region-as-kill, Alex Schroeder, 2002/04/07