Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site mit-athena.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!mit-athena!martillo
From: martillo@mit-athena.UUCP (Joaquim Martillo)
Newsgroups: net.emacs
Subject: Re: Tabbing in C Mode (Gnu Emacs)
Message-ID: <283@mit-athena.UUCP>
Date: Wed, 10-Jul-85 00:55:12 EDT
Article-I.D.: mit-athe.283
Posted: Wed Jul 10 00:55:12 1985
Date-Received: Thu, 11-Jul-85 20:22:09 EDT
References: <280@mit-athena.UUCP> <139@cucca.UUCP>
Reply-To: martillo@mit-athena.UUCP (Joaquim Martillo)
Organization: MIT Project Athena
Lines: 31
Summary: 


C-Q C-I will not work properly if the tab-stops have been  edited.   Try
the  function edit-tab-stops to see the problem. Put the tabs at 4 space
intervals rather than 8 space intervals.  Then try C-Q C-I.   An  actual
tab  will  be  inserted which will then be on output expanded to up to 8
spaces. The function contained an error.  It should have been:

(defun insert-tab (&optional arg)
       (interactive "p")
       (let ((temp-tab-stop-list tab-stop-list)
	     (nearest-tab-stop (car tab-stop-list)))
	    (if (null arg)
		(setq arg 1))
	    (set-mark (dot))
	    (while (> arg 0)
		   (if (null temp-tab-stop-list)
		       (insert "\t")
		       (progn
			(while (<=  nearest-tab-stop (current-column))
			       (setq temp-tab-stop-list
				     (cdr temp-tab-stop-list))
			       (setq nearest-tab-stop 
				     (car temp-tab-stop-list)))
			(while (< (current-column) nearest-tab-stop)
			       (insert " "))
			(tabify (mark) (dot))))
		   (setq arg (1- arg)))))

(define-key esc-map "\^i" 'insert-tab)

The set-mark was in the wrong place.