Function: woman-tab-to-tab-stop

woman-tab-to-tab-stop is a byte-compiled function defined in woman.el.gz.

Signature

(woman-tab-to-tab-stop)

Documentation

Insert spaces to next defined tab-stop column.

The variable tab-stop-list is a list whose elements are either left tab stop columns or pairs (COLUMN . TYPE) where TYPE is R or C.

Source Code

;; Defined in /usr/src/emacs/lisp/woman.el.gz
(defun woman-tab-to-tab-stop ()
  "Insert spaces to next defined tab-stop column.
The variable `tab-stop-list' is a list whose elements are either left
tab stop columns or pairs (COLUMN . TYPE) where TYPE is R or C."
  ;; Based on tab-to-tab-stop in indent.el.
  ;; R & C tabs probably not quite right!
  (delete-char -1)
  (let ((tabs tab-stop-list))
    (while (and tabs (>= (current-column)
			 (woman-get-tab-stop (car tabs))))
      (setq tabs (cdr tabs)))
    (if tabs
	(let* ((tab (car tabs))
	       (type (and (consp tab) (cdr tab)))
	       eol n)
	  (if type
	      (setq tab (woman-get-tab-stop tab)
		    eol (line-end-position)
		    n (save-excursion
			(search-forward "\t" eol t))
		    n (- (if n (1- n) eol) (point))
		    tab (- tab (if (eq type ?C) (/ n 2) n))) )
	  (setq n (- tab (current-column)))
	  (insert-char ?\s n))
      (insert ?\s))))