Article View: gnu.epoch.misc
Article #1472changing styles within a zone
From: t e bennett
Date: Wed, 22 Apr 1992 17:38
Date: Wed, 22 Apr 1992 17:38
89 lines
4141 bytes
4141 bytes
epoch 4.0p0. SunOS 4.1.2
I've hacked vm-summary.el (5.31) so that the summary lines
are grey for deleted msgs, pink for unread mail, orange for
current msg, etc. Basically it works great, but there is one
small problem that I've been living with for months and
am now trying to resolve.
Typically when I delete a msg, the color of the summary line
changes from orange (current msg) to grey and the current
msg is moved to the next msg. This works fine.
But if I am on the last msg in the folder and I delete it, there is no "next"
msg and so the current msg doesnt move. In this case the summary does not
completely become grey. Only the letter 'D' that VM puts in the summary as
its indication of deletedness is gray. The rest of the line is still orange.
If I redraw the screen with ^L it is fixed.
I've tried every combination of deleting zones, adding zones, moving
zones, epoch::redisplay-screen, etc. that I can think of, but I still
get this behavior.
Detail follows. Comments represent various other attempts.
Suggestions?
;;
;; current zone may have been deleted
;; if so, restore it.
;;
(if (null vm-epoch-summary-current-zone)
(setq vm-epoch-summary-current-zone
(epoch::set-zone-style
(epoch::make-zone) vm-epoch-summary-current-style)))
;;
;; if this msg is current msg, then just move that zone,
;;
(if (equal vm-summary-pointer m)
(progn
(let ((old-msg (epoch::zone-data vm-epoch-summary-current-zone)))
(set-style-background
vm-epoch-summary-current-style
(cond ((vm-deleted-flag m) vm-epoch-summary-deleted-color)
((vm-new-flag m) vm-epoch-summary-new-color)
((vm-unread-flag m) vm-epoch-summary-new-color)
((vm-mark-of m) vm-epoch-summary-marked-color)
(t vm-epoch-summary-current-background-color)))
(set-style-foreground
vm-epoch-summary-current-style
(cond ((vm-deleted-flag m) my-color-background)
((vm-new-flag m) my-color-background)
((vm-unread-flag m) my-color-background)
((vm-mark-of m) my-color-background)
(t vm-epoch-summary-current-color)))
; (setq vm-epoch-summary-current-zone
; (epoch::delete-zone-at (vm-su-start-of m)))
(epoch::delete-zone-at (vm-su-start-of m))
(setq vm-epoch-summary-current-zone
(epoch::add-zone (vm-su-start-of m)
(vm-su-end-of m) vm-epoch-summary-current-style))
; (epoch::move-zone vm-epoch-summary-current-zone
; (vm-su-start-of m) (vm-su-end-of m))
;
; (epoch::set-zone-style vm-epoch-summary-current-zone vm-epoch-summary-current-style)
;;
;; patch up the color on the previous summary line
;;
(if (and old-msg
(not (equal old-msg m))
(markerp (vm-su-start-of m))
(marker-position (vm-su-start-of m))
(equal (marker-buffer (vm-su-start-of m)) (current-buffer)))
(vm-epoch-update-summary-color old-msg)))
(epoch::set-zone-data vm-epoch-summary-current-zone m)))
(epoch::redisplay-screen)
--
--tbennett tony.bennett@East.Sun.COM mailstop: RTP-NC
Technical Details
Message-ID:
<TONY.BENNETT.92Apr22133841@uh-oh.East.Sun.COM>Path:
arc1-ca.pugleaf.net!sparky!uunet!sun-barr.EBay.Sun.COM!news2me.ebay.sun.com!seven-up.East.Sun.COM!sixgun.East.Sun.COM!sunpix!tony.bennettShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc7ee,e82bbb70476f3b0b,start X-Google-Attributes: gidfc7ee,public X-Google-ArrivalTime: 1992-04-22 10:38:41 PST Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr.EBay.Sun.COM!news2me.ebay.sun.com!seven-up.East.Sun.COM!sixgun.East.Sun.COM!sunpix!tony.bennett From: tony.bennett@East.Sun.COM (t e bennett) Newsgroups: gnu.epoch.misc Subject: changing styles within a zone Date: 22 Apr 92 17:38:41 GMT Organization: Sun Microsystems, RTP, NC Lines: 89 Distribution: gnu Message-ID: <TONY.BENNETT.92Apr22133841@uh-oh.East.Sun.COM> NNTP-Posting-Host: uh-oh.east.sun.com