The function remove-text-properties requires a list for the third argument props -- e.g., (remove-text-properties start end '(face nil))

How can I remove all text properties in a buffer in one fell swoop, without necessarily knowing what all of those properties are?

up vote 5 down vote accepted

Maybe this:

(let ((inhibit-read-only t))
  (set-text-properties (point-min) (point-max) nil))
  • Yes, that works -- thank you very much. I am adding your snippet to my custom version of a fundamental-mode to essentially restore everything in the buffer to just raw plain text. – lawlist May 19 '15 at 20:25

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.