Function: nroff-comment-indent

nroff-comment-indent is a byte-compiled function defined in nroff-mode.el.gz.

Signature

(nroff-comment-indent)

Documentation

Compute indent for an nroff/troff comment.

Puts a full-stop before comments on a line by themselves.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/nroff-mode.el.gz
;; Compute how much to indent a comment in nroff/troff source.
;; By mit-erl!gildea April 86
(defun nroff-comment-indent ()
  "Compute indent for an nroff/troff comment.
Puts a full-stop before comments on a line by themselves."
  (let ((pt (point)))
    (unwind-protect
	(progn
	  (skip-chars-backward " \t")
	  (if (bolp)
	      (progn
		;; FIXME delete-horizontal-space?
		(setq pt (1+ pt))
		(insert ?.)
		1)
	    (if (save-excursion
		  (backward-char 1)
		  (looking-at "^[.']"))
		1
	      (max comment-column
		   (* 8 (/ (+ (current-column)
			      9) 8)))))) ; add 9 to ensure at least two blanks
      (goto-char pt))))