Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2002-09-12 02:52:28

Rob Stewart wrote:
> From: Douglas Gregor <gregod_at_[hidden]>
>>On Monday 09 September 2002 10:16 am, David Abrahams wrote:
>>>Emacs can do anything.
>>Actually, would anyone have a bit 'o' elisp to untabify a file when it's
>>saved? That would make it rather impossible for Emacs users to add tabs to
>>Boost sources :)
> Try this (inherited; I'm no elisper):
> [snip]

Personally, I wouldn't like to untabify other's files without a warning.
The following elisp will ask you before untabifying a buffer.

(defun has-tabs ()
     (search-forward "\t" nil t nil)
(defun untabify-buffer () (untabify (point-min) (point-max)))

(defun untabify-with-prompt ()
    (if (has-tabs)
       (if (yes-or-no-p (concat "Untabify the buffer?"))

(defun config-c ()
   ;; snip other settings
   (add-hook 'local-write-file-hooks 'untabify-with-prompt)

- Volodya

Boost list run by bdawes at, gregod at, cpdaniel at, john at