[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: for all XEmacs users
From:       Bo Thorsen <gobo () imada ! sdu ! dk>
Date:       1999-11-25 11:41:18
[Download RAW message or body]

Hi Dirk.

I have been using this for some time now, but I have been meaning to fix
one thing about it: it does not strip tabs. If someone has already done
this I won't have to dust off my elisp skills.

To everyone else using (X)Emacs I would like to point you to the same file
since this is not the only thing Arnt has done. He also hacked recognition
of the Qt keywords in, made automatic tab after enter etc. This mostly
works well. There are a couple of problems though e.g. not being able to
move a comment to the right position with tab etc.

On Thu, 25 Nov 1999, Dirk A. Mueller wrote:
> ...
> A few weeks ago I found a nice elisp hook (.emacs from agulbra@troll.no)
> that forces XEmacs to trim the lines while loading. I adopted it to do that
> during saving, as it makes more sense there. 
> 
> So, please, everybody who uses XEmacs, please add the following lines to
> your ~/.emacs: 
> 
> (defun agulbra-clean-out-spaces ()
>   "Remove spaces at ends of lines"
>   (interactive)
>   (and ;;(eq major-mode 'c++-mode)
>        (not buffer-read-only)
>        (save-excursion
>          (goto-char (point-min))
>          (let ((count 0)
>                (bmp (buffer-modified-p)))
>            (while (re-search-forward "  *$" nil t)
>              (setq count (1+ count))
>              (replace-match "" t t))
>            (and (> count 0)
>                 (progn
>                   (set-buffer-modified-p bmp)
>                   (message "Cleaned %d lines" count)))))) nil)
> (add-hook 'write-file-hooks 'agulbra-clean-out-spaces)
> 
> (custom-set-variables
>  '(require-final-newline t)
> ) 
> 
> 
> Thanks in advance. 
> 
> Dirk
> 
> 


--

Bo Thorsen
gobo@imada.sdu.dk
Lahnsgade 31, st.
DK-5000 Odense C
Tlf: +45 66 11 83 85

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic