It may be controversial so I'm sending to here.
Most of the function which does kill-region or something and
has name of kill-* has `*' in its interactive spec.
So, It signals an error before executing function body.
However, kill-rectangle and kill-region is designed to work
in read-only buffer and I'd like to use it even in read-only
buffer.
What confuses me is the fact that comments and the code in
the source says different thing. For example, in rect.el,
(defun kill-rectangle (start end &optional fill)
[...]
(interactive "*r\nP")
[...]
;; ### NOTE: this is actually the only function that needs to do complicated
;; stuff like what's happening in `operate-on-rectangle', because the buffer
;; might be read-only. --dv
(defun extract-rectangle-line (startcol endcol lines)
kill-paragraph, kill-sentence, kill-primary-selection,
backward-or-forward-kill-word,
backward-or-forward-kill-sentence,
backward-or-forward-kill-sentence, zap-to-char, kill-line,
kill-comment, kill-word, backward-kill-word
are the list of functions which have `*' spec. Some of the
are clearly marked with `;; XEmacs modified' or `; XEmacs'
but there's no entry in the ChangeLog and no hit in
xemacs-beta archive search.
My question is, is it OK to change them to be executed in a
read-only buffer?
I sometimes use kill-rectangle in read-only buffer and think
it as useful. The patch is attached.
--
Yoshiki Hayashi