From 5d2b90097dda987fafb08f7e97a86cf9fab0225f Mon Sep 17 00:00:00 2001 From: Sebastien Barre Date: Tue, 11 Mar 2008 10:54:40 -0400 Subject: [PATCH] ENH: add simple function to convert all CMake commands to lowercase --- Docs/cmake-mode.el | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Docs/cmake-mode.el b/Docs/cmake-mode.el index e58257367..624740ef1 100644 --- a/Docs/cmake-mode.el +++ b/Docs/cmake-mode.el @@ -152,6 +152,26 @@ ;------------------------------------------------------------------------------ +;; +;; Helper functions for buffer +;; +(defun unscreamify-cmake-buffer () + "Convert all CMake commands to lowercase in buffer." + (interactive) + (setq save-point (point)) + (goto-char (point-min)) + (while (re-search-forward "^\\([ \t]*\\)\\(\\w+\\)\\([ \t]*(\\)" nil t) + (replace-match + (concat + (match-string 1) + (downcase (match-string 2)) + (match-string 3)) + t)) + (goto-char save-point) + ) + +;------------------------------------------------------------------------------ + ;; ;; Keyword highlighting regex-to-face map. ;;