From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jiajie Chen Newsgroups: gmane.emacs.bugs Subject: bug#23777: 25.0.95; Throwing (error "Selecting deleted buffer") in timer Date: Mon, 27 Jun 2016 22:08:09 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1467036570 20124 80.91.229.3 (27 Jun 2016 14:09:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Jun 2016 14:09:30 +0000 (UTC) Cc: 23777@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 27 16:09:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bHXDx-0008Oa-4j for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Jun 2016 16:09:17 +0200 Original-Received: from localhost ([::1]:58929 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHXDw-0003bU-5h for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Jun 2016 10:09:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHXDp-0003aL-8Y for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2016 10:09:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHXDj-0006Ej-6D for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2016 10:09:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46051) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHXDi-0006EZ-9P for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2016 10:09:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bHXDi-0003Ik-63 for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2016 10:09:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Jiajie Chen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Jun 2016 14:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23777 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 23777-submit@debbugs.gnu.org id=B23777.146703650412635 (code B ref 23777); Mon, 27 Jun 2016 14:09:02 +0000 Original-Received: (at 23777) by debbugs.gnu.org; 27 Jun 2016 14:08:24 +0000 Original-Received: from localhost ([127.0.0.1]:58388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHXD6-0003Hj-7b for submit@debbugs.gnu.org; Mon, 27 Jun 2016 10:08:24 -0400 Original-Received: from smtpbg63.qq.com ([103.7.29.150]:20263) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHXD2-0003HQ-Er for 23777@debbugs.gnu.org; Mon, 27 Jun 2016 10:08:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1467036492; bh=2acUBqT9r8EYn9u7dbavxvktz7q7oXHlDvIdlrCKC2k=; h=From:To:Subject:CC:Date:Message-ID:MIME-Version:Content-Type; b=obPUMGUnZeGA2Xd6luDSZV2tqbz42+dX7hnadByAVZchGyK4heHDS/NcDlixvS65m PVbian06xhafL9S4wD1cTZ/3xgUMmwwWpUyqzHA79DyTOGUZC3hWclZkK9lLQTcaNj /TV+iizaRy50C7Qt9atutp0nDw6nCBgGtTbdWC94= X-QQ-mid: esmtp27t1467036489t978t06393 Original-Received: from MacBookAirs-MacBook-Air.local (unknown [14.153.27.159]) by esmtp4.qq.com (ESMTP) with id ; Mon, 27 Jun 2016 22:08:06 +0800 (CST) X-QQ-SSF: 0100000000000050F31000000000000 X-QQ-FEAT: Pz/DvRwIHaLlhpkkai6ycd9aodyYSfbGBjRGXTdQLxavQBM+DWIR2NXh0ul7t 4hlNSAMpMmA48bi/sgMVMLU8xRL4YZUFDglhKj/sAkcWDuYkj1IIvM2QF+79F1f0HEGFK4N KVmh6YM8QxLyRUWUeIbVFrxfNTleABaaM/JeuXJ0vlJtB1qIpgzqmZWTs5qcinHtthQIidj ZrPaCntEJplPsw8Gg8xzj+VzEGYABH1954FmFNv/wXLN4kTKatw1P X-QQ-GoodBg: 0 X-QQ-SENDSIZE: 520 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:120151 Archived-At: I have found the bug -- it comes from nlinum.el: (defun nlinum--flush () (nlinum--setup-windows) ;; (kill-local-variable 'nlinum--ol-counter) (remove-overlays (point-min) (point-max) 'nlinum t) (run-with-timer 0 nil (lambda (buf) (with-current-buffer buf (with-silent-modifications ;; FIXME: only remove `fontified' on those parts of the ;; buffer that had an nlinum overlay! (remove-text-properties (point-min) (point-max) '(fontified))))) (current-buffer))) It seems that when the timer is ran, the (current-buffer) no longer exists. That buffer may be a temp buffer. And my init code includes: (add-hook 'nlinum-mode-hook (lambda () (when nlinum-mode (setq nlinum--width (1+ (length (number-to-string (count-lines (point-min) (point-max)))))) (nlinum--flush)))) A fix would be: (defun nlinum--flush () (nlinum--setup-windows) ;; (kill-local-variable 'nlinum--ol-counter) (remove-overlays (point-min) (point-max) 'nlinum t) (run-with-timer 0 nil (lambda (buf) (when (buffer-live-p buf) (with-current-buffer buf (with-silent-modifications ;; FIXME: only remove `fontified' on those parts of the ;; buffer that had an nlinum overlay! (remove-text-properties (point-min) (point-max) '(fontified))))) (current-buffer)))