From: Heikki Junes <heikki.junes@hut.fi>
Date: Tue, 8 Jul 2003 22:12:01 +0000 (+0000)
Subject: restructuring and commenting paren-highlight.
X-Git-Tag: release/1.7.26~49
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3c1b8b5c07c052989fea427cd89a17b779abaf7d;p=lilypond.git

restructuring and commenting paren-highlight.
---

diff --git a/ChangeLog b/ChangeLog
index 785823dd0e..814051f2cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@
 
 	* Documentation/user/refman.itely: spelling fix.
 
+	* lilypond-mode.el, lilypond-indent.el: restrusture and comment.
+
 2003-07-07  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
 	* input/template/jazz-combo.ly: new file.
diff --git a/lilypond-indent.el b/lilypond-indent.el
index 50db7bb343..0ba6240fd4 100644
--- a/lilypond-indent.el
+++ b/lilypond-indent.el
@@ -1,7 +1,8 @@
 ;;; lilypond-indent.el --- Auto-indentation for lilypond code
 ;;;
 ;;; Heikki Junes <hjunes@cc.hut.fi>
-;;; * redefine Emacs' show-paren-function and XEmacs' paren-highlight
+;;; * introduce Lilypond-show-paren-function for Emacs and 
+;;;             Lilypond-paren-highlight for XEmacs
 ;;; * match two-char slurs '\( ... \)' and '\[ ... \]' separately.
 ;;; * adopt Emacs' f90-comment-region
 
@@ -16,7 +17,7 @@
 ;;;    * in syntax-highlighting slurs are not always highlighted the right way
 ;;;      e.g. opening slurs are found found better in "#( ( ) ( ) )" than
 ;;;      opening slurs
-;;;    * is locality of show-paren-function and paren-highlight possible?
+;;;    * should make Lilypond-show-paren-mode instead of using show-paren-mode
 
 (defcustom LilyPond-indent-level 4
   "*Indentation of lilypond statements with respect to containing block.")
@@ -569,17 +570,10 @@ builtin 'blink-matching-open' is not used. In syntax table, see
 in XEmacs' paren-highlight."
   (LilyPond-blink-matching-paren dir))
 
-;;; REDEFINITIONS: in future make show-paren-mode and paren-highlight local?
-
 ;;; From Emacs' paren.el, with minimal changes (see "LilyPond"-lines)
 ;; Find the place to show, if there is one,
 ;; and show it until input arrives.
-; (defun show-paren-function ()
-
-
-;;  don't redefine emacs functions. It breaks other modes.
-
-(defun LilyPond-show-paren-function () ; make show-paren-function local ??
+(defun LilyPond-show-paren-function ()
   (if show-paren-mode
       (let (pos dir mismatch face (oldpos (point)))
 	(cond ((eq (char-syntax (preceding-char)) ?\))
@@ -684,10 +678,7 @@ in XEmacs' paren-highlight."
 ;;; From XEmacs' paren.el, with minimal changes (see "LilyPond"-lines)
 ;; Find the place to show, if there is one,
 ;; and show it until input arrives.
-(if (string-match "XEmacs\\|Lucid" emacs-version)
-    (paren-set-mode 'paren)) ; works if this is set here (, right place?)
-;(defun paren-highlight ()
-(defun LilyPond-paren-highlight () ; make paren-highlight local ??
+(defun LilyPond-paren-highlight ()
   "This highlights matching parentheses.
 
 See the variables:
diff --git a/lilypond-mode.el b/lilypond-mode.el
index 44d7e79499..44ea6075bb 100644
--- a/lilypond-mode.el
+++ b/lilypond-mode.el
@@ -1115,16 +1115,23 @@ LilyPond-xdvi-command\t\tcommand to display dvi files -- bit superfluous"
   (if (not (string-match "XEmacs\\|Lucid" emacs-version))
       (progn
 	(make-local-variable 'show-paren-mode)
-	(setq show-paren-mode t)))
+	(setq show-paren-mode t))
+    (paren-set-mode 'paren))
 
   (if (not (string-match "XEmacs\\|Lucid" emacs-version))
       (progn
-	(make-local-variable 'show-paren-function)
-	;;(setq show-paren-function 'LilyPond-show-paren-function) ; possible ?
+	;; (make-local-variable 'show-paren-function) ; possible?
+	;; (setq show-paren-function 'LilyPond-show-paren-function) ; possible?
+	;;  don't redefine emacs functions. It breaks other modes.
+	;;  should have an own idle-timer instead
+	;; (defun show-paren-function () (LilyPond-show-paren-function)) ; for testing
 	)
     (progn
-      (make-local-variable 'paren-highlight)
-      ;;(setq paren-highlight 'LilyPond-paren-highlight) ; possible ?
+      ;; (make-local-variable 'paren-highlight) ; possible?
+      ;; (setq paren-highlight 'LilyPond-paren-highlight) ; possible?
+      ;;  don't redefine Xemacs functions. It breaks other modes.
+      ;;  should have an own idle-timer instead
+      ;; (defun paren-highlight () (LilyPond-paren-highlight)) ; for testing
       ))
 
   ;; In XEmacs imenu was synched up with: FSF 20.4