Function: super-save-delete-trailing-whitespace-maybe

super-save-delete-trailing-whitespace-maybe is a natively compiled function defined in super-save.el.

Signature

(super-save-delete-trailing-whitespace-maybe)

Documentation

Delete trailing whitespace, optionally avoiding the current line.

See super-save-delete-trailing-whitespace.

Source Code

;; Defined in /nix/store/8mya90aayfyjjmvwkbq8wf8x7gg109i7-emacs-packages-deps/share/emacs/site-lisp/elpa/super-save-20260318.1214/super-save.el
(defun super-save-delete-trailing-whitespace-maybe ()
  "Delete trailing whitespace, optionally avoiding the current line.

See `super-save-delete-trailing-whitespace'."
  (cond
   ((eq super-save-delete-trailing-whitespace 'except-current-line)
    (let ((start (line-beginning-position))
          (current (point)))
      (save-excursion
        (when (< (point-min) start)
          (save-restriction
            (narrow-to-region (point-min) (1- start))
            (delete-trailing-whitespace)))
        (when (> (point-max) current)
          (save-restriction
            (narrow-to-region current (point-max))
            (delete-trailing-whitespace))))))
   (super-save-delete-trailing-whitespace
    (delete-trailing-whitespace))))