Subject: bug#13529: 24.3.50; wrong-type-argument with show-paren-mode

From: Aaron Ecay <[email-masked]>
Date: Tue, 22 Jan 2013 18:59:00 -0500

The following is with emacs trunk built from git commit 36964d8b4 (Tue
Jan 22 15:48:00 2013 +0400)

1) emacs -Q
2) M-x set-variable debug-on-error t
3) M-x find-library paren
4) M-x eval-buffer
--- steps 3 and 4 are to get a better backtrace of byte-compiled functions
5) C-x b *scratch*
6) M-x show-paren-mode (mode is now enabled)
7) type ) – i.e. a closing parenthesis
8) Receive the following backtrace

Debugger entered--Lisp error: (wrong-type-argument overlayp nil)
  delete-overlay(nil)
  (if (integerp pos) nil (delete-overlay show-paren-overlay))
  (if (not pos) (progn (and show-paren-overlay (overlay-buffer show-paren-overlay) (delete-overlay show-paren-overlay)) (and show-paren-overlay-1 (overlay-buffer show-paren-overlay-1) (delete-overlay show-paren-overlay-1))) (if mismatch (progn (if show-paren-ring-bell-on-mismatch (beep)) (setq face (quote show-paren-mismatch))) (setq face (quote show-paren-match))) (if (and (not show-paren-highlight-openparen) (= dir 1) (integerp pos)) (if (and show-paren-overlay-1 (overlay-buffer show-paren-overlay-1)) (progn (delete-overlay show-paren-overlay-1))) (let ((from (if (= dir 1) (point) (- (point) 1))) (to (if (= dir 1) (+ (point) 1) (point)))) (if show-paren-overlay-1 (move-overlay show-paren-overlay-1 from to (current-buffer)) (setq show-paren-overlay-1 (make-overlay from to nil t))) (overlay-put show-paren-overlay-1 (quote priority) show-paren-priority) (overlay-put show-paren-overlay-1 (quote face) face))) (if (integerp pos) nil (delete-overlay show-paren-overlay)) (let ((to (if (or (eq show-paren-style (quote expression)) (and (eq show-paren-style ...) (not ...))) (point) pos)) (from (if (or (eq show-paren-style (quote expression)) (and (eq show-paren-style ...) (not ...))) 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)))) (overlay-put show-paren-overlay (quote priority) show-paren-priority) (overlay-put show-paren-overlay (quote face) face))
  (let* ((oldpos (point)) (dir (cond ((eq (syntax-class (syntax-after ...)) 5) -1) ((eq (syntax-class (syntax-after ...)) 4) 1))) (unescaped (if dir (progn (= (if (= dir -1) 1 0) (logand 1 (- ... ...)))))) pos mismatch face) (if unescaped (progn (save-excursion (save-restriction (if blink-matching-paren-distance (progn (narrow-to-region ... ...))) (condition-case nil (setq pos (scan-sexps ... dir)) (error (setq pos t mismatch t))) (if (integerp pos) (progn (if ... nil ...))) (if (integerp pos) (progn (let ... ...))))))) (if (not pos) (progn (and show-paren-overlay (overlay-buffer show-paren-overlay) (delete-overlay show-paren-overlay)) (and show-paren-overlay-1 (overlay-buffer show-paren-overlay-1) (delete-overlay show-paren-overlay-1))) (if mismatch (progn (if show-paren-ring-bell-on-mismatch (beep)) (setq face (quote show-paren-mismatch))) (setq face (quote show-paren-match))) (if (and (not show-paren-highlight-openparen) (= dir 1) (integerp pos)) (if (and show-paren-overlay-1 (overlay-buffer show-paren-overlay-1)) (progn (delete-overlay show-paren-overlay-1))) (let ((from (if (= dir 1) (point) (- ... 1))) (to (if (= dir 1) (+ ... 1) (point)))) (if show-paren-overlay-1 (move-overlay show-paren-overlay-1 from to (current-buffer)) (setq show-paren-overlay-1 (make-overlay from to nil t))) (overlay-put show-paren-overlay-1 (quote priority) show-paren-priority) (overlay-put show-paren-overlay-1 (quote face) face))) (if (integerp pos) nil (delete-overlay show-paren-overlay)) (let ((to (if (or (eq show-paren-style ...) (and ... ...)) (point) pos)) (from (if (or (eq show-paren-style ...) (and ... ...)) pos (save-excursion (goto-char pos) (- ... dir))))) (if show-paren-overlay (move-overlay show-paren-overlay from to (current-buffer)) (setq show-paren-overlay (make-overlay from to nil t)))) (overlay-put show-paren-overlay (quote priority) show-paren-priority) (overlay-put show-paren-overlay (quote face) face)))
  (if show-paren-mode (let* ((oldpos (point)) (dir (cond ((eq (syntax-class ...) 5) -1) ((eq (syntax-class ...) 4) 1))) (unescaped (if dir (progn (= (if ... 1 0) (logand 1 ...))))) pos mismatch face) (if unescaped (progn (save-excursion (save-restriction (if blink-matching-paren-distance (progn ...)) (condition-case nil (setq pos ...) (error ...)) (if (integerp pos) (progn ...)) (if (integerp pos) (progn ...)))))) (if (not pos) (progn (and show-paren-overlay (overlay-buffer show-paren-overlay) (delete-overlay show-paren-overlay)) (and show-paren-overlay-1 (overlay-buffer show-paren-overlay-1) (delete-overlay show-paren-overlay-1))) (if mismatch (progn (if show-paren-ring-bell-on-mismatch (beep)) (setq face (quote show-paren-mismatch))) (setq face (quote show-paren-match))) (if (and (not show-paren-highlight-openparen) (= dir 1) (integerp pos)) (if (and show-paren-overlay-1 (overlay-buffer show-paren-overlay-1)) (progn (delete-overlay show-paren-overlay-1))) (let ((from (if ... ... ...)) (to (if ... ... ...))) (if show-paren-overlay-1 (move-overlay show-paren-overlay-1 from to (current-buffer)) (setq show-paren-overlay-1 (make-overlay from to nil t))) (overlay-put show-paren-overlay-1 (quote priority) show-paren-priority) (overlay-put show-paren-overlay-1 (quote face) face))) (if (integerp pos) nil (delete-overlay show-paren-overlay)) (let ((to (if (or ... ...) (point) pos)) (from (if (or ... ...) pos (save-excursion ... ...)))) (if show-paren-overlay (move-overlay show-paren-overlay from to (current-buffer)) (setq show-paren-overlay (make-overlay from to nil t)))) (overlay-put show-paren-overlay (quote priority) show-paren-priority) (overlay-put show-paren-overlay (quote face) face))) (and show-paren-overlay (delete-overlay show-paren-overlay)) (and show-paren-overlay-1 (delete-overlay show-paren-overlay-1)))
  show-paren-function()
  apply(show-paren-function nil)
  byte-code("r\301^H\302H^H\303H\"\210)\301\207" [timer apply 5 6] 4)
  timer-event-handler([t 0 0 125000 t show-paren-function nil idle 0])

In GNU Emacs 24.3.50.4 (x86_64-unknown-linux-gnu, GTK+ Version 3.6.4)
 of 2013-01-22 on haize
Windowing system distributor `The X.Org Foundation', version 11.0.11301000
Configured using:
 `configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
 --libexecdir=/usr/lib --mandir=/usr/share/man --without-sound
 --with-xft --with-x-toolkit=gtk'

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

-- 
Aaron Ecay