-deleted."
- (interactive "*r\nP")
- (when buffer-read-only
- (setq killed-rectangle (extract-rectangle start end))
- (barf-if-buffer-read-only))
- (setq killed-rectangle (delete-extract-rectangle start end fill)))
+deleted.
+
+If the buffer is read-only, Emacs will beep and refrain from deleting
+the rectangle, but put it in the kill ring anyway. This means that
+you can use this command to copy text from a read-only buffer.
+\(If the variable `kill-read-only-ok' is non-nil, then this won't
+even beep.)"
+ (interactive "r\nP")
+ (condition-case nil
+ (setq killed-rectangle (delete-extract-rectangle start end fill))
+ ((buffer-read-only text-read-only)
+ (setq killed-rectangle (extract-rectangle start end))
+ (if kill-read-only-ok
+ (progn (message "Read only text copied to kill ring") nil)
+ (barf-if-buffer-read-only)
+ (signal 'text-read-only (list (current-buffer)))))))