[Top][All Lists]

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

decriminalize C-k in read-only buffers!

From: Dan Jacobson
Subject: decriminalize C-k in read-only buffers!
Date: Thu, 17 Apr 2003 09:14:06 +0800
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu)

"C-k runs the command kill-line ... If the buffer is read-only, Emacs
will beep and refrain from deleting the line, but put the line in the
kill ring anyway.  This means that you can use this command to copy
text from a read-only buffer."

OK, but what if we're bored with S/M and want to turn the little
tingle off?  (You see, mother has wired the bell to electrodes on my
head to teach me proper computing and not wake her up.)

Bruce suggests:
B> (defun copy-to-eol (&optional where)
B>   "Copy to the end of the line containing point."
B>   (interactive "d")
B>   (save-excursion
B>     (let ((beg (point)))
B>       (end-of-line)
B>       (copy-region-as-kill beg (point)))
B>     (end-of-line))
B>     (message "copied to eol"))

OK, but wait, original kill-line with the flashes/beeps moves the
cursor down upon repetition, nifty. Yours just stays there...

Maybe we should just push for a variable to decriminalize [no
flashing] C-k when the buffer is readonly. With maybe a  message, in
the minibuffer, if the user prefers.

reply via email to

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