help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

About untabify in latest pre-test 24.0.95.1


From: Ming
Subject: About untabify in latest pre-test 24.0.95.1
Date: Mon, 16 Apr 2012 14:24:07 -0700 (PDT)
User-agent: G2/1.0

Hello,

I am using the following codes to untabify code in c mode.

;; Untabify when saving
(defun ska-untabify ()
  (save-excursion
    (goto-char (point-min))
    (when (search-forward "\t" nil t)
      (untabify (1- (point)) (point-max)))
    nil))

(defun saving-untabify ()
  (add-hook 'write-contents-functions 'ska-untabify nil t))
(add-hook 'c-mode-common-hook 'saving-untabify)

Right now when I try this, it looks like it will remove all tabs in makefile. 
My understanding is this func only works on cc-mode. Is that correct?

Thanks a lot.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]