I am writing a custom function which is supposed to write selected text to some arbitrary file on the system. It does something like
(defun write-region-to-file (&optional arg) (interactive "*p") (write-region (point) (mark-marker) "/path/to/file/other/then/visited"))
If I then run it in a read-only buffer I get
command-execute: Buffer is read-only: #<buffer ...>
Why is this happening? I don't do any modification to the visited one, I am writing to a completely different file.