From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Markus Triska Newsgroups: gmane.emacs.bugs Subject: bug#818: 23.0.60; error when window-size-change-functions is a buffer-local hook Date: Sun, 31 Aug 2008 01:49:37 -0400 Message-ID: References: <48B95651.4010305@gmx.at> Reply-To: Markus Triska , 818@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1220162865 12146 80.91.229.12 (31 Aug 2008 06:07:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 31 Aug 2008 06:07:45 +0000 (UTC) Cc: 818@emacsbugs.donarmstrong.com To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 31 08:08:39 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KZg74-00021a-RW for geb-bug-gnu-emacs@m.gmane.org; Sun, 31 Aug 2008 08:08:39 +0200 Original-Received: from localhost ([127.0.0.1]:47468 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KZg66-0002Yt-71 for geb-bug-gnu-emacs@m.gmane.org; Sun, 31 Aug 2008 02:07:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KZg62-0002YE-Ny for bug-gnu-emacs@gnu.org; Sun, 31 Aug 2008 02:07:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KZg60-0002Xu-UP for bug-gnu-emacs@gnu.org; Sun, 31 Aug 2008 02:07:34 -0400 Original-Received: from [199.232.76.173] (port=44545 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KZg60-0002Xr-R0 for bug-gnu-emacs@gnu.org; Sun, 31 Aug 2008 02:07:32 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:34734) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KZg60-0006YZ-5A for bug-gnu-emacs@gnu.org; Sun, 31 Aug 2008 02:07:32 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7V67UC6030938; Sat, 30 Aug 2008 23:07:30 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m7V603EO027281; Sat, 30 Aug 2008 23:00:03 -0700 X-Loop: don@donarmstrong.com Resent-From: Markus Triska Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 31 Aug 2008 06:00:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 818 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 818-submit@emacsbugs.donarmstrong.com id=B818.122016181024643 (code B ref 818); Sun, 31 Aug 2008 06:00:03 +0000 Original-Received: (at 818) by emacsbugs.donarmstrong.com; 31 Aug 2008 05:50:10 +0000 Original-Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id m7V5o5Wi023920 for <818@emacsbugs.donarmstrong.com>; Sat, 30 Aug 2008 22:50:07 -0700 Original-Received: (qmail invoked by alias); 31 Aug 2008 05:49:59 -0000 Original-Received: from v254-019.vps.tuwien.ac.at (EHLO v254-019.vps.tuwien.ac.at) [128.131.254.19] by mail.gmx.net (mp021) with SMTP; 31 Aug 2008 07:49:59 +0200 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX18UmxhK0vUUP/5iYONxFQwuvNvXIdSWZSiQxyJe/f EQV94MCe9WcQos Original-Received: by mt-computer.local (Postfix, from userid 502) id 3E3C3A467FB; Sun, 31 Aug 2008 01:49:38 -0400 (EDT) In-Reply-To: <48B95651.4010305@gmx.at> (martin rudalics's message of "Sat, 30 Aug 2008 16:16:49 +0200") X-Y-GMX-Trusted: 0 X-FuHaFi: 0.54 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Sun, 31 Aug 2008 02:07:34 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:19922 Archived-At: martin rudalics writes: > Does the attached patch fix it? Yes, thank you. Once it is fixed in trunk, could you please apply the following patch to linum.el? Thank you! 2008-08-30 Markus Triska * linum.el (linum-mode): `window-size-change-functions' can now be buffer-local. (linum-update-window): Use result of `move-overlay'. diff --git a/lisp/linum.el b/lisp/linum.el index a88bb61..4f77035 100644 --- a/lisp/linum.el +++ b/lisp/linum.el @@ -30,7 +30,7 @@ ;;; Code: -(defconst linum-version "0.9wz") +(defconst linum-version "0.9x") (defvar linum-overlays nil "Overlays used in this buffer.") (defvar linum-available nil "Overlays available for reuse.") @@ -82,15 +82,14 @@ and you have to scroll or press \\[recenter-top-bottom] to update the numbers." 'linum-update-current) nil t) (add-hook 'after-change-functions 'linum-after-change nil t)) (add-hook 'window-scroll-functions 'linum-after-scroll nil t) - ;; mistake in Emacs: window-size-change-functions cannot be local - (add-hook 'window-size-change-functions 'linum-after-size) + (add-hook 'window-size-change-functions 'linum-after-size nil t) (add-hook 'change-major-mode-hook 'linum-delete-overlays nil t) (add-hook 'window-configuration-change-hook 'linum-after-config nil t) (linum-update-current)) (remove-hook 'post-command-hook 'linum-update-current t) (remove-hook 'post-command-hook 'linum-schedule t) - (remove-hook 'window-size-change-functions 'linum-after-size) + (remove-hook 'window-size-change-functions 'linum-after-size t) (remove-hook 'window-scroll-functions 'linum-after-scroll t) (remove-hook 'after-change-functions 'linum-after-change t) (remove-hook 'window-configuration-change-hook 'linum-after-config t) @@ -154,11 +153,9 @@ and you have to scroll or press \\[recenter-top-bottom] to update the numbers." (throw 'visited t)))))) (setq width (max width (length str))) (unless visited - (let (ov) - (if (null linum-available) - (setq ov (make-overlay (point) (point))) - (setq ov (pop linum-available)) - (move-overlay ov (point) (point))) + (let ((ov (if (null linum-available) + (make-overlay (point) (point)) + (move-overlay (pop linum-available) (point) (point))))) (push ov linum-overlays) (overlay-put ov 'before-string (propertize " " 'display `((margin left-margin) ,str)))