bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#818: 23.0.60; error when window-size-change-functions is a buffer-lo


From: Markus Triska
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

martin rudalics <address@hidden> 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  <address@hidden>

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]