Richard Stallman writes:
> I wonder if the fix shouldn't be more elaborate -- the selected window
> isn't necessarily the one new messages are inserted in. This leads to
> rather random filling if your windows aren't all of the same width.
>
> Can you write a patch that would use the width of the
> proper window?
The attached patch approaches the problem by recording the window most
recently used to display a buffer in a local variable on window
configuration changes. I think this is more robust than determining the
proper window at the instant a message is about to be inserted. The
latter wouldn't work well when the rcirc buffers are shuffled in a fixed
set of windows using rcirc's activity tracking feature, while only a
subset of the buffers are visible at a time, which I presume is a common
way people use rcirc.
Nevertheless I'd still feel rather uneasy if this would be applied
without further review/testing. Maybe Ryan's development version would
be a better place for the change for now?
regards,
andreas
2007-05-22 Andreas Seltenreich <[EMAIL PROTECTED]>
* net/rcirc.el (rcirc-window): New variable to record the window
the buffer was most recently displayed in.
(rcirc-print, rcirc-window-configuration-change): Use it.
Index: rcirc.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/rcirc.el,v
retrieving revision 1.32.2.2
diff -c -r1.32.2.2 rcirc.el
*** rcirc.el 21 May 2007 19:38:52 -0000 1.32.2.2
--- rcirc.el 22 May 2007 21:12:19 -0000
***************
*** 296,301 ****
--- 296,304 ----
;; each process has an alist of (target . buffer) pairs
(defvar rcirc-buffer-alist nil)
+ (defvar rcirc-window nil
+ "The window the buffer was most recently displayed in.")
+
(defvar rcirc-activity nil
"List of buffers with unviewed activity.")
***************
*** 1247,1253 ****
(fill-column (cond ((eq rcirc-fill-column 'frame-width)
(1- (frame-width)))
((eq rcirc-fill-column 'window-width)
! (1- (window-width)))
(rcirc-fill-column
rcirc-fill-column)
(t fill-column))))
--- 1250,1256 ----
(fill-column (cond ((eq rcirc-fill-column 'frame-width)
(1- (frame-width)))
((eq rcirc-fill-column 'window-width)
! (1- (window-width rcirc-window)))
(rcirc-fill-column
rcirc-fill-column)
(t fill-column))))
***************
*** 1595,1601 ****
(let ((buf (window-buffer w)))
(with-current-buffer buf
(when (eq major-mode 'rcirc-mode)
! (rcirc-clear-activity buf)))
(when (eq buf rcirc-current-buffer)
(setq current-now-hidden nil)))))
;; add overlay arrow if the buffer isn't displayed
--- 1598,1606 ----
(let ((buf (window-buffer w)))
(with-current-buffer buf
(when (eq major-mode 'rcirc-mode)
! (rcirc-clear-activity buf)
! (set (make-local-variable
! 'rcirc-window) w)))
(when (eq buf rcirc-current-buffer)
(setq current-now-hidden nil)))))
;; add overlay arrow if the buffer isn't displayed
_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug