[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fixed highlighting in draft mode
At Tue, 19 Jan 2010 17:07:53 +0100,
Vitaly Mayatskikh wrote:
>
> At Tue, 19 Jan 2010 10:09:18 -0500, David Abrahams wrote:
>
> > Maybe pcl-cvs lied to me that the checkin succeeded. It's really
> > strange. But maybe that's a good thing because it seems to have
> > broken delete-selection-mode.
> >
> > I'll investigate further.
>
> How about such hack?
>
> (defun my-highlight-hook (beg end len)
> (let ((begining (save-excursion
> (goto-char beg)
> (re-search-backward "^" nil t)))
> (ending (save-excursion
> (goto-char end)
> (re-search-forward "$" nil t))))
> (put-text-property begining ending 'face nil)
> (wl-highlight-message begining ending t nil)
> (wl-highlight-message begining ending t t)))
>
> (add-hook 'wl-draft-mode-hook (lambda ()
> (add-hook 'after-change-functions
> 'my-highlight-hook)))
Well, I fixed my hack w.r.t delete-selection-mode; all I needed to do
was to add:
(put 'wl-draft-newline 'delete-selection t)
but frankly I like your hack better, if it works. I'll test it.
Frankly had I assumed that draft mode would /already/ be trying to
highlight the changed region and something was inhibiting that in a
few cases, which is why I was targeting newline. However, it seems
the highlight function is never called during editing right now.
> And, yes, my assumption about highlighting in SEMI was wrong.
Which assumption?
--
Dave Abrahams Meet me at BoostCon: http://www.boostcon.com
BoostPro Computing
http://www.boostpro.com