64 |
:type 'integer |
:type 'integer |
65 |
:group 'paren-showing |
:group 'paren-showing |
66 |
:version "21.1") |
:version "21.1") |
67 |
|
|
68 |
(defcustom show-paren-ring-bell-on-mismatch nil |
(defcustom show-paren-ring-bell-on-mismatch nil |
69 |
"*If non-nil, beep if mismatched paren is detected." |
"*If non-nil, beep if mismatched paren is detected." |
70 |
:type 'boolean |
:type 'boolean |
71 |
:group 'paren-showing |
:group 'paren-showing |
72 |
:version "20.3") |
:version "20.3") |
73 |
|
|
74 |
(defface show-paren-match-face |
(defface show-paren-match-face |
75 |
'((((class color) (background light)) |
'((((class color) (background light)) |
76 |
:background "turquoise") ; looks OK on tty (becomes cyan) |
:background "turquoise") ; looks OK on tty (becomes cyan) |
86 |
|
|
87 |
(defface show-paren-mismatch-face |
(defface show-paren-mismatch-face |
88 |
'((((class color)) (:foreground "white" :background "purple")) |
'((((class color)) (:foreground "white" :background "purple")) |
89 |
(t (:reverse-video t))) |
(t (:inverse-video t))) |
90 |
"Show Paren mode face used for a mismatching paren." |
"Show Paren mode face used for a mismatching paren." |
91 |
:group 'faces |
:group 'faces |
92 |
:group 'paren-showing) |
:group 'paren-showing) |
135 |
;; and show it until input arrives. |
;; and show it until input arrives. |
136 |
(defun show-paren-function () |
(defun show-paren-function () |
137 |
(if show-paren-mode |
(if show-paren-mode |
138 |
(let (pos dir mismatch face (oldpos (point))) |
(let ((oldpos (point)) |
139 |
(cond ((eq (char-syntax (preceding-char)) ?\)) |
(dir (cond ((eq (car (syntax-after (1- (point)))) 5) -1) |
140 |
(setq dir -1)) |
((eq (car (syntax-after (point))) 4) 1))) |
141 |
((eq (char-syntax (following-char)) ?\() |
pos mismatch face) |
|
(setq dir 1))) |
|
142 |
;; |
;; |
143 |
;; Find the other end of the sexp. |
;; Find the other end of the sexp. |
144 |
(when dir |
(when dir |