Function: Man-unindent

Man-unindent is a byte-compiled function defined in man.el.gz.

Signature

(Man-unindent)

Documentation

Delete the leading spaces that indent the manpage.

Source Code

;; Defined in /usr/src/emacs/lisp/man.el.gz
(defun Man-unindent ()
  "Delete the leading spaces that indent the manpage."
  (let ((inhibit-read-only t)
	(case-fold-search nil))
    (dolist (page Man-page-list)
      (let ((indent "")
	    (nindent 0))
	(narrow-to-region (car page) (car (cdr page)))
	(if Man-uses-untabify-flag
	    ;; The space characters inserted by `untabify' inherit
	    ;; sticky text properties, which is unnecessary and looks
	    ;; ugly with underlining (Bug#11408).
	    (let ((text-property-default-nonsticky
		   (cons '(face . t) text-property-default-nonsticky)))
	      (untabify (point-min) (point-max))))
	(if (catch 'unindent
	      (goto-char (point-min))
	      (if (not (re-search-forward Man-first-heading-regexp nil t))
		  (throw 'unindent nil))
	      (beginning-of-line)
	      (setq indent (buffer-substring (point)
					     (progn
					       (skip-chars-forward " ")
					       (point))))
	      (setq nindent (length indent))
	      (if (zerop nindent)
		  (throw 'unindent nil))
	      (setq indent (concat indent "\\|$"))
	      (goto-char (point-min))
	      (while (not (eobp))
		(if (looking-at indent)
		    (forward-line 1)
		  (throw 'unindent nil)))
	      (goto-char (point-min)))
	    (while (not (eobp))
	      (or (eolp)
		  (delete-char nindent))
	      (forward-line 1)))
	))))