From kde-commits Thu Feb 03 23:35:42 2011 From: Raphael Kubo da Costa Date: Thu, 03 Feb 2011 23:35:42 +0000 To: kde-commits Subject: KDE/kdesdk/scripts/kde-emacs Message-Id: <20110203233542.7C14CAC8C5 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=129677618105044 SVN commit 1218721 by rkcosta: kde-emacs: Make whitespace removal optional. Sometimes one is working on a one-liner and does not want to fix whitespaces in the whole file, so it is now possible to set 'kde-emacs-delete-trailing-whitespace to nil to disable that. GNU Emacs already has the delete-trailing-whitespace function; we can hopefully remove the whitespace removal altogether when an XEmacs equivalent shows up. Reviewed-by: dfaure via email. M +4 -0 kde-emacs-core.el M +6 -0 kde-emacs-vars.el --- trunk/KDE/kdesdk/scripts/kde-emacs/kde-emacs-core.el #1218720:1218721 @@ -173,8 +173,12 @@ (font-lock-mode) (c-set-style kde-c-style)) +(and (user-variable-p 'kde-emacs-delete-trailing-whitespace) + kde-emacs-delete-trailing-whitespace + (progn (add-hook 'find-file-hooks 'agulbra-c++-clean-out-spaces) (add-hook 'write-file-hooks 'agulbra-c++-clean-out-spaces) + )) (add-hook 'c++-mode-hook 'kde-c++-mode-hook) (add-hook 'c-mode-hook 'kde-c-mode-hook) --- trunk/KDE/kdesdk/scripts/kde-emacs/kde-emacs-vars.el #1218720:1218721 @@ -81,6 +81,12 @@ :group 'kde-devel :type 'boolean) +(defcustom kde-emacs-delete-trailing-whitespace 't + "Set this variable to true to automatically delete trailing whitespace when a buffer is loaded from a file or when it is written. On GNU +Emacs, it is worth seeing delete-trailing-whitespace function." + :group 'kde-devel + :type 'boolean) + (defcustom kde-emacs-make "make" "Specifies the make command which KDE Emacs will use" :group 'kde-devel