[Gd-chatter] r11263 - trunk/src/tools/elisp

cpage at gwydiondylan.org cpage at gwydiondylan.org
Fri Apr 13 13:42:54 CEST 2007


Author: cpage
Date: Fri Apr 13 13:42:53 2007
New Revision: 11263

Modified:
   trunk/src/tools/elisp/dylan-mode.el
Log:
Job: 7349

Fixed Dylan Mode indenting broken in change r11261. Code lines beginning with
certain patterns, like "end", were indented incorrectly.



Modified: trunk/src/tools/elisp/dylan-mode.el
==============================================================================
--- trunk/src/tools/elisp/dylan-mode.el	(original)
+++ trunk/src/tools/elisp/dylan-mode.el	Fri Apr 13 13:42:53 2007
@@ -964,8 +964,10 @@
 (defun dylan-indent-to-column (column)
   "Add or remove whitespace to indent the current line to column COLUMN."
   (unless (eq column (current-indentation))
-    (delete-horizontal-space)
-    (indent-to-column column)))
+    (save-excursion
+      (beginning-of-line)
+      (delete-horizontal-space)
+      (indent-to-column column))))
 
 (defun dylan-indent-line (&optional ignore-case extra-indent)
   "Indents a line of dylan code according to its nesting."
@@ -979,7 +981,10 @@
 	;; Because "\b" doesn't work with "symbol-chars" we temporarily
 	;; install a new syntax table and restore the old one when done
 	(set-syntax-table dylan-indent-syntax-table)
-	(beginning-of-line)
+	;; Move point to the end of the current indentation. This allows us to
+	;; use looking-at to examine the start of the current line of code
+	;; without having to put whitespace at the start of all the patterns.
+	(back-to-indentation)
 	(let* ((body-start)		; beginning of "body" of enclosing
 					; compound statement
 	       (in-paren)		; t if in parenthesized expr.



More information about the chatter mailing list