   (interactive "r")
   (save-restriction
     (narrow-to-region beg end)
-    ;; Since we're piping a region of text to the formatter, remove any leading
-    ;; indentation to make it look like a file.
-    (let ((indent (save-excursion
-                    (goto-char beg)
-                    (skip-chars-forward " \t\n")
-                    (current-indentation))))
-      (with-silent-modifications
-        (indent-rigidly (point-min) (point-max) (- indent)))
-      (+format/buffer)
-      (with-silent-modifications
-        ;; Then restore it afterwards, without affecting new indentation
-        (indent-rigidly (point-min) (point-max)
-                        (max 0 (- indent
-                                  (save-excursion
-                                    (goto-char beg)
-                                    (skip-chars-forward " \t\n")
-                                    (current-column)))))))))
+    (+format/buffer)))
 
 ;;;###autoload
 (defun +format/region-or-buffer (beg end)

             ((error "Invalid rcs patch or internal error in +format--apply-rcs-patch")))))))
    (move-to-column column)))


;;
;; Public library

          (let ((output (buffer-substring-no-properties (point-min) (point-max))))
            (with-temp-buffer
              (insert output)
              ;; Since we're piping a region of text to the formatter, remove
              ;; any leading indentation to make it look like a file.
              (setq indent (+format--current-indentation))
              (when (> indent 0)
                (indent-rigidly (point-min) (point-max) (- indent)))
              (funcall f-function executable mode-result)))))
      (unwind-protect
          (cond ((null output) 'error)
