all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Markus Triska <markus.triska@gmx.at>
To: martin rudalics <rudalics@gmx.at>
Cc: 818@emacsbugs.donarmstrong.com
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	[thread overview]
Message-ID: <m1abetpwcu.fsf@v254-028.vps.tuwien.ac.at> (raw)
In-Reply-To: <48B95651.4010305@gmx.at> (martin rudalics's message of "Sat, 30 Aug 2008 16:16:49 +0200")

martin rudalics <rudalics@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@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)))






  reply	other threads:[~2008-08-31  5:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-29 15:03 bug#818: 23.0.60; error when window-size-change-functions is a buffer-local hook Markus Triska
2008-08-30 14:16 ` martin rudalics
2008-08-31  5:49   ` Markus Triska [this message]
2008-08-31  9:00     ` martin rudalics
2008-09-01  8:58   ` Andreas Schwab
2008-09-01  9:15     ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1abetpwcu.fsf@v254-028.vps.tuwien.ac.at \
    --to=markus.triska@gmx.at \
    --cc=818@emacsbugs.donarmstrong.com \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.