Variable: whitespace-action

whitespace-action is a customizable variable defined in whitespace.el.gz.

Value

nil

Documentation

Specify which action is taken when a buffer is visited or written.

It's a list containing some or all of the following values:

   nil no action is taken.

   cleanup cleanup any bogus whitespace always when local
                        whitespace is turned on.
                        See whitespace-cleanup and
                        whitespace-cleanup-region.

   report-on-bogus report if there is any bogus whitespace always
                        when local whitespace is turned on.

   auto-cleanup cleanup any bogus whitespace when buffer is
                        written.
                        See whitespace-cleanup and
                        whitespace-cleanup-region.

   abort-on-bogus abort if there is any bogus whitespace and the
                        buffer is written.

   warn-if-read-only give a warning if cleanup or auto-cleanup
                        is included in whitespace-action and the
                        buffer is read-only.

Any other value is treated as nil.

Probably introduced at or before Emacs version 23.1.

Source Code

;; Defined in /usr/src/emacs/lisp/whitespace.el.gz
(defcustom whitespace-action nil
  "Specify which action is taken when a buffer is visited or written.

It's a list containing some or all of the following values:

   nil                  no action is taken.

   cleanup              cleanup any bogus whitespace always when local
                        whitespace is turned on.
                        See `whitespace-cleanup' and
                        `whitespace-cleanup-region'.

   report-on-bogus      report if there is any bogus whitespace always
                        when local whitespace is turned on.

   auto-cleanup         cleanup any bogus whitespace when buffer is
                        written.
                        See `whitespace-cleanup' and
                        `whitespace-cleanup-region'.

   abort-on-bogus       abort if there is any bogus whitespace and the
                        buffer is written.

   warn-if-read-only    give a warning if `cleanup' or `auto-cleanup'
                        is included in `whitespace-action' and the
                        buffer is read-only.

Any other value is treated as nil."
  :type '(choice :tag "Actions"
		 (const :tag "None" nil)
		 (repeat :tag "Action List"
		  (choice :tag "Action"
			  (const :tag "Cleanup When On" cleanup)
			  (const :tag "Report On Bogus" report-on-bogus)
			  (const :tag "Auto Cleanup" auto-cleanup)
			  (const :tag "Abort On Bogus" abort-on-bogus)
			  (const :tag "Warn If Read-Only" warn-if-read-only))))
  :group 'whitespace)