Return non-nil if region was adjusted.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Tue, 20 Dec 2011 23:28:29 +0200
changeset 851 1c6bb299d28b
parent 850 38ca922a6d11
child 852 571e98c6d3c2
Return non-nil if region was adjusted.
dict-mode.el
--- a/dict-mode.el	Tue Dec 20 23:18:04 2011 +0200
+++ b/dict-mode.el	Tue Dec 20 23:28:29 2011 +0200
@@ -29,20 +29,23 @@
 
 (defun dict-c5-font-lock-extend-region ()
   "Look for '_____' expression and extend `font-lock-beg' and `font-lock-end'."
-  (let (beg end)
+  (let ((changed nil))
     (save-excursion
       ;; (message "%d, %d:%d" point font-lock-beg font-lock-end)
       (goto-char font-lock-beg)
       (beginning-of-line)
       (when (eq (char-after (point)) ?_)
         (forward-line 3)
-        (setq font-lock-end (point)))
+        (setq font-lock-end (point))
+        (setq changed t))
       (goto-char font-lock-beg)
       (forward-line -2)
       (when (eq (char-after (point)) ?_)
-        (setq font-lock-beg (point)))
-      )))
-
+        (setq font-lock-beg (point))
+        (setq changed t))
+      )
+    changed
+    ))
 
 ;;;###autoload
 (define-derived-mode dict-c5-mode fundamental-mode "Dict-c5"