Function: whitespace-toggle-list

whitespace-toggle-list is a byte-compiled function defined in whitespace.el.gz.

Signature

(whitespace-toggle-list LOCAL-P ARG THE-LIST)

Documentation

Toggle options in THE-LIST based on list ARG.

If LOCAL-P is non-nil, it uses a local context; otherwise, it uses a global context.

ARG is a list of options to be toggled.

THE-LIST is a list of options. This list will be toggled and the resultant list will be returned.

Source Code

;; Defined in /usr/src/emacs/lisp/whitespace.el.gz
    (list sym)))			; return the appropriate symbol


(defun whitespace-toggle-list (local-p arg the-list)
  "Toggle options in THE-LIST based on list ARG.

If LOCAL-P is non-nil, it uses a local context; otherwise, it
uses a global context.

ARG is a list of options to be toggled.

THE-LIST is a list of options.  This list will be toggled and the
resultant list will be returned."
  (unless (if local-p whitespace-mode global-whitespace-mode)
    (setq the-list whitespace-style))
  (setq the-list (copy-sequence the-list)) ; keep original list
  (dolist (sym (if (listp arg) arg (list arg)))
    (cond
     ;; ignore help value
     ((eq sym 'help-newline))
     ;; restore default values
     ((eq sym 'whitespace-style)
      (setq the-list whitespace-style))
     ;; toggle valid values
     ((memq sym whitespace-style-value-list)
      (setq the-list (if (memq sym the-list)
			 (delq sym the-list)
		       (cons sym the-list))))))
  the-list)