X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/3a880af4a79688e90da45311a8d85bae2d59a811..6b26f14f789112bb929f65a8d44caeda11418432:/lisp/paren.el diff --git a/lisp/paren.el b/lisp/paren.el index ab856380d3..a9d3be6062 100644 --- a/lisp/paren.el +++ b/lisp/paren.el @@ -1,6 +1,6 @@ ;;; paren.el --- highlight matching paren -;; Copyright (C) 1993, 1996, 2001-2012 Free Software Foundation, Inc. +;; Copyright (C) 1993, 1996, 2001-2013 Free Software Foundation, Inc. ;; Author: rms@gnu.org ;; Maintainer: FSF @@ -243,27 +243,26 @@ matching parenthesis is highlighted in `show-paren-style' after ;; ;; Turn on highlighting for the matching paren, if found. ;; If it's an unmatched paren, turn off any such highlighting. - (unless (integerp pos) - (delete-overlay show-paren-overlay)) - (let ((to (if (or (eq show-paren-style 'expression) - (and (eq show-paren-style 'mixed) - (not (pos-visible-in-window-p pos)))) - (point) - pos)) - (from (if (or (eq show-paren-style 'expression) + (if (not (integerp pos)) + (when show-paren-overlay (delete-overlay show-paren-overlay)) + (let ((to (if (or (eq show-paren-style 'expression) (and (eq show-paren-style 'mixed) (not (pos-visible-in-window-p pos)))) - pos - (save-excursion - (goto-char pos) - (- (point) dir))))) - (if show-paren-overlay - (move-overlay show-paren-overlay from to (current-buffer)) - (setq show-paren-overlay (make-overlay from to nil t)))) - ;; - ;; Always set the overlay face, since it varies. - (overlay-put show-paren-overlay 'priority show-paren-priority) - (overlay-put show-paren-overlay 'face face))) + (point) + pos)) + (from (if (or (eq show-paren-style 'expression) + (and (eq show-paren-style 'mixed) + (not (pos-visible-in-window-p pos)))) + pos + (save-excursion + (goto-char pos) + (- (point) dir))))) + (if show-paren-overlay + (move-overlay show-paren-overlay from to (current-buffer)) + (setq show-paren-overlay (make-overlay from to nil t)))) + ;; Always set the overlay face, since it varies. + (overlay-put show-paren-overlay 'priority show-paren-priority) + (overlay-put show-paren-overlay 'face face)))) ;; show-paren-mode is nil in this buffer. (and show-paren-overlay (delete-overlay show-paren-overlay))