aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-07-20 05:59:51 +0000
committerRichard M. Stallman1993-07-20 05:59:51 +0000
commit30322a2736baed3fcece68381caa4d33c599b8fe (patch)
tree97f0cabc6bd29a177a8b5b49592b3775c217c194
parentf5d7a8f2f81df6eb76c138f2d1dd4e6b59f75d67 (diff)
downloademacs-30322a2736baed3fcece68381caa4d33c599b8fe.tar.gz
emacs-30322a2736baed3fcece68381caa4d33c599b8fe.zip
(show-paren-face): New variable.
(show-paren-command-hook): Use it. Call set-face-background properly.
-rw-r--r--lisp/paren.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/paren.el b/lisp/paren.el
index c96efcd1863..cd1c8878180 100644
--- a/lisp/paren.el
+++ b/lisp/paren.el
@@ -36,12 +36,15 @@
36 36
37(defvar show-paren-mismatch-face nil) 37(defvar show-paren-mismatch-face nil)
38 38
39(defvar show-paren-face 'region
40 "*Name of face to use for showing the matching paren.")
41
39;; Find the place to show, if there is one, 42;; Find the place to show, if there is one,
40;; and show it until input arrives. 43;; and show it until input arrives.
41(defun show-paren-command-hook () 44(defun show-paren-command-hook ()
42 (if window-system 45 (if window-system
43 (let (pos dir mismatch (oldpos (point)) 46 (let (pos dir mismatch (oldpos (point))
44 (face 'region)) 47 (face show-paren-face))
45 (cond ((eq (char-syntax (following-char)) ?\() 48 (cond ((eq (char-syntax (following-char)) ?\()
46 (setq dir 1)) 49 (setq dir 1))
47 ((eq (char-syntax (preceding-char)) ?\)) 50 ((eq (char-syntax (preceding-char)) ?\))
@@ -81,7 +84,8 @@
81 (progn 84 (progn
82 (setq show-paren-mismatch-face 85 (setq show-paren-mismatch-face
83 (make-face 'paren-mismatch)) 86 (make-face 'paren-mismatch))
84 (set-face-background 'paren-mismatch 'purple)))) 87 (set-face-background 'paren-mismatch
88 "purple"))))
85 (if show-paren-mismatch-face 89 (if show-paren-mismatch-face
86 (setq face show-paren-mismatch-face) 90 (setq face show-paren-mismatch-face)
87 (message "Paren mismatch")))) 91 (message "Paren mismatch"))))