[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fixed highlighting in draft mode



FYI, I just checked in the following to CVS, which seems to fix the
highlighting issues in draft mode.

Index: wl/wl-draft.el
===================================================================
RCS file: /cvs/root/wanderlust/wl/wl-draft.el,v
retrieving revision 1.282
diff -u -p -8 -w -r1.282 wl-draft.el
--- wl/wl-draft.el	5 Jan 2010 09:27:58 -0000	1.282
+++ wl/wl-draft.el	18 Jan 2010 15:30:15 -0000
@@ -791,16 +791,30 @@ or `wl-draft-reply-with-argument-list' i
 (defun wl-draft-elide-region (b e)
   "Elide the text in the region.
 An ellipsis (from `wl-draft-elide-ellipsis') will be inserted where the
 text was killed."
   (interactive "r")
   (kill-region b e)
   (insert wl-draft-elide-ellipsis))
 
+(defun wl-draft-newline (&optional n)
+  (interactive "p")
+  (newline n)
+  (when wl-highlight-body-too
+    (let (
+          (modified (buffer-modified-p))
+          (start (- (point) n)))
+      (unwind-protect
+          (progn
+            (put-text-property start (point) 'face nil)
+            (wl-highlight-message start (point) t))
+        (set-buffer-modified-p modified)))
+  ))
+
 ;; Imported from message.el.
 (defun wl-draft-beginning-of-line (&optional n)
   "Move point to beginning of header value or to beginning of line."
   (interactive "p")
   (let ((zrs 'zmacs-region-stays))
     (when (and (interactive-p) (boundp zrs))
       (set zrs t)))
   (if (wl-draft-point-in-header-p)
Index: wl/wl-e21.el
===================================================================
RCS file: /cvs/root/wanderlust/wl/wl-e21.el,v
retrieving revision 1.66
diff -u -p -8 -w -r1.66 wl-e21.el
--- wl/wl-e21.el	5 Jan 2010 09:27:58 -0000	1.66
+++ wl/wl-e21.el	18 Jan 2010 15:30:15 -0000
@@ -657,17 +657,18 @@ Special commands:
   (define-key wl-draft-mode-map "\C-c\C-j" 'wl-template-select)
   (define-key wl-draft-mode-map "\C-c\C-p" 'wl-draft-preview-message)
   (define-key wl-draft-mode-map "\C-c\C-a" 'wl-addrmgr)
 ;;;  (define-key wl-draft-mode-map "\C-x\C-s" 'wl-draft-save)
   (define-key wl-draft-mode-map "\C-xk"    'wl-draft-mimic-kill-buffer)
   (define-key wl-draft-mode-map "\C-c\C-d" 'wl-draft-elide-region)
   (define-key wl-draft-mode-map "\C-a" 'wl-draft-beginning-of-line)
   (define-key wl-draft-mode-map "\M-p" 'wl-draft-previous-history-element)
-  (define-key wl-draft-mode-map "\M-n" 'wl-draft-next-history-element))
+  (define-key wl-draft-mode-map "\M-n" 'wl-draft-next-history-element)
+  (define-key wl-draft-mode-map "\C-m" 'wl-draft-newline))
 
 (defun wl-draft-overload-functions ()
   (wl-mode-line-buffer-identification)
 ;;;  (local-set-key "\C-c\C-s" 'wl-draft-send) ; override
   (wl-e21-setup-draft-toolbar)
   (wl-draft-overload-menubar))
 
 (defalias 'wl-defface 'defface)

-- 
Dave Abrahams           Meet me at BoostCon: http://www.boostcon.com
BoostPro Computing
http://www.boostpro.com