GNU bug report logs - #818
23.0.60; error when window-size-change-functions is a buffer-local hook

Previous Next

Package: emacs;

Reported by: Markus Triska <markus.triska <at> gmx.at>

Date: Fri, 29 Aug 2008 15:10:04 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #15 received at 818 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Markus Triska <markus.triska <at> gmx.at>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 818 <at> debbugs.gnu.org
Subject: Re: 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
martin rudalics <rudalics <at> gmx.at> 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  <markus.triska <at> gmx.at>

	* 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)))




This bug report was last modified 16 years and 265 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.