* bug#818: 23.0.60; error when window-size-change-functions is a buffer-local hook
@ 2008-08-29 15:03 Markus Triska
2008-08-30 14:16 ` martin rudalics
0 siblings, 1 reply; 6+ messages in thread
From: Markus Triska @ 2008-08-29 15:03 UTC (permalink / raw)
To: emacs-pretest-bug
In "emacs -Q", evaluating:
(progn
(add-hook 'window-size-change-functions 'identity nil t)
(split-window))
yields:
Symbol's function definition is void: t
In GNU Emacs 23.0.60.4 (i386-apple-darwin8.11.1, GTK+ Version 2.12.9)
of 2008-08-26 on mt-computer.vdn.ca
Windowing system distributor `The XFree86 Project, Inc', version 11.0.40400000
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: en.UTF-8
value of $XMODIFIERS: nil
locale-coding-system: nil
default-enable-multibyte-characters: t
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#818: 23.0.60; error when window-size-change-functions is a buffer-local hook
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
2008-09-01 8:58 ` Andreas Schwab
0 siblings, 2 replies; 6+ messages in thread
From: martin rudalics @ 2008-08-30 14:16 UTC (permalink / raw)
To: Markus Triska, 818
[-- Attachment #1: Type: text/plain, Size: 239 bytes --]
> In "emacs -Q", evaluating:
>
> (progn
> (add-hook 'window-size-change-functions 'identity nil t)
> (split-window))
>
> yields:
>
> Symbol's function definition is void: t
Does the attached patch fix it?
martin
[-- Attachment #2: 818.diff --]
[-- Type: text/plain, Size: 486 bytes --]
*** xdisp.c.~1.1244.~ 2008-08-07 03:54:06.000000000 +0200
--- xdisp.c 2008-08-30 16:12:09.765625000 +0200
***************
*** 9591,9597 ****
while (CONSP (functions))
{
! call1 (XCAR (functions), frame);
functions = XCDR (functions);
}
UNGCPRO;
--- 9591,9598 ----
while (CONSP (functions))
{
! if (!EQ (XCAR (functions), Qt))
! call1 (XCAR (functions), frame);
functions = XCDR (functions);
}
UNGCPRO;
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#818: 23.0.60; error when window-size-change-functions is a buffer-local hook
2008-08-30 14:16 ` martin rudalics
@ 2008-08-31 5:49 ` Markus Triska
2008-08-31 9:00 ` martin rudalics
2008-09-01 8:58 ` Andreas Schwab
1 sibling, 1 reply; 6+ messages in thread
From: Markus Triska @ 2008-08-31 5:49 UTC (permalink / raw)
To: martin rudalics; +Cc: 818
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)))
^ permalink raw reply related [flat|nested] 6+ messages in thread
* bug#818: 23.0.60; error when window-size-change-functions is a buffer-local hook
2008-08-31 5:49 ` Markus Triska
@ 2008-08-31 9:00 ` martin rudalics
0 siblings, 0 replies; 6+ messages in thread
From: martin rudalics @ 2008-08-31 9:00 UTC (permalink / raw)
To: Markus Triska; +Cc: 818
>> 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!
I hopefully checked it in. Please have a look.
> + (add-hook 'window-size-change-functions 'linum-after-size nil t)
My fix only makes sure that Emacs does not issue an error when calling a
function in `window-size-change-functions' and one of these functions
was earlier added buffer-locally. But I'm not sure whether this DTRT
when the value is buffer-local. If it doesn't, we might have to fix it
as Stefan did for `window-configuration-change-hook' just with the frame
argument added. Please have a look at this issue. You might also want
to look at the thread "Wrong window end reported after splitting window"
on emacs-devel around the beginning of this year.
martin
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#818: 23.0.60; error when window-size-change-functions is a buffer-local hook
2008-08-30 14:16 ` martin rudalics
2008-08-31 5:49 ` Markus Triska
@ 2008-09-01 8:58 ` Andreas Schwab
2008-09-01 9:15 ` martin rudalics
1 sibling, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2008-09-01 8:58 UTC (permalink / raw)
To: martin rudalics; +Cc: Markus Triska, 818
martin rudalics <rudalics@gmx.at> writes:
> *** xdisp.c.~1.1244.~ 2008-08-07 03:54:06.000000000 +0200
> --- xdisp.c 2008-08-30 16:12:09.765625000 +0200
> ***************
> *** 9591,9597 ****
>
> while (CONSP (functions))
> {
> ! call1 (XCAR (functions), frame);
> functions = XCDR (functions);
> }
> UNGCPRO;
> --- 9591,9598 ----
>
> while (CONSP (functions))
> {
> ! if (!EQ (XCAR (functions), Qt))
> ! call1 (XCAR (functions), frame);
> functions = XCDR (functions);
> }
> UNGCPRO;
Why doesn't this use run-hook-with-args?
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-09-01 9:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2008-08-31 9:00 ` martin rudalics
2008-09-01 8:58 ` Andreas Schwab
2008-09-01 9:15 ` martin rudalics
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).