fix
[elisp/wanderlust.git] / wl / wl-highlight.el
index 90ebebc..d230b0e 100644 (file)
@@ -1,6 +1,6 @@
 ;;; wl-highlight.el -- Hilight modules for Wanderlust.
 
-;; Copyright 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
+;; Copyright (C) 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
 
 ;; Author: Yuuichi Teranishi <teranisi@gohome.org>
 ;; Keywords: mail, net news
 (defvar wl-highlight-summary-refiled-regexp " *[0-9]+o")
 (defvar wl-highlight-summary-copied-regexp " *[0-9]+O")
 (defvar wl-highlight-summary-target-regexp " *[0-9]+\\*")
-;(defvar wl-highlight-summary-thread-top-regexp " *[0-9]+[^0-9][^0-9]../..\(.*\)..:.. \\[")
+;;(defvar wl-highlight-summary-thread-top-regexp " *[0-9]+[^0-9][^0-9]../..\(.*\)..:.. \\[")
 
 (defvar wl-highlight-citation-face-list
   '(wl-highlight-message-cited-text-1
                (setq fsymbol 'wl-highlight-summary-normal-face)))))
       (put-text-property bol eol 'face fsymbol)
       (if wl-use-highlight-mouse-line
-         (put-text-property bol;(1- (match-end 0))
+         (put-text-property bol
+;;; Use bol instead of (1- (match-end 0))
+;;;                         (1- (match-end 0))
                             eol 'mouse-face 'highlight))
-;      (put-text-property (match-beginning 3) (match-end 3)
-;                       'face 'wl-highlight-thread-indent-face)
+;;;   (put-text-property (match-beginning 3) (match-end 3)
+;;;                     'face 'wl-highlight-thread-indent-face)
       ;; Dnd stuff.
       (if wl-use-dnd
          (wl-dnd-set-drag-starter bol eol)))))
@@ -1069,7 +1071,7 @@ interpreted as cited text.)"
   (wl-highlight-message beg end t t))
 
 (defun wl-highlight-signature-search-simple (beg end)
-  "Search signature area in the body message between beg and end.
+  "Search signature area in the body message between BEG and END.
 Returns start point of signature."
   (save-excursion
     (goto-char end)
@@ -1080,7 +1082,7 @@ Returns start point of signature."
       end)))
 
 (defun wl-highlight-signature-search (beg end)
-  "Search signature area in the body message between beg and end.
+  "Search signature area in the body message between BEG and END.
 Returns start point of signature."
   (save-excursion
     (goto-char end)
@@ -1144,7 +1146,7 @@ interpreted as cited text.)"
        current  beg
        e p hend)
     (if too-big
-       nil    
+       nil
       (save-excursion
        (save-restriction
          (widen)
@@ -1163,9 +1165,9 @@ interpreted as cited text.)"
            ;; is sufficient
            (if (re-search-forward (format
                                    "^$\\|%s"
-                                   (regexp-quote mail-header-separator)) 
+                                   (regexp-quote mail-header-separator))
                                   nil t)
-               (narrow-to-region (point-min) (point)))
+               (narrow-to-region (point-min) (match-beginning 0)))
            ;; highlight only when header is not too-big.
            (when (or (null wl-highlight-max-header-size)
                      (< (point) wl-highlight-max-header-size))
@@ -1193,15 +1195,15 @@ interpreted as cited text.)"
                    (put-text-property
                     p hend 'face 'wl-highlight-message-header-contents)))
                  (goto-char hend))
-                ((looking-at mail-header-separator)
-                 (put-text-property (match-beginning 0) (match-end 0)
-                                    'face 'wl-highlight-header-separator-face)
-                 (goto-char (match-end 0)))
                 ;; ignore non-header field name lines
                 (t (forward-line 1))))))
          (let (prefix prefix-face-alist pair end)
            (while (not (eobp))
              (cond
+              ((looking-at mail-header-separator)
+               (put-text-property (match-beginning 0) (match-end 0)
+                                  'face 'wl-highlight-header-separator-face)
+               (goto-char (match-end 0)))
               ((null wl-highlight-force-citation-header-regexp)
                nil)
               ((looking-at wl-highlight-force-citation-header-regexp)
@@ -1237,7 +1239,8 @@ interpreted as cited text.)"
              (cond (current
                     (setq p (point))
                     (forward-line 1) ; this is to put the \n in the face too
-                    (let ();(inhibit-read-only t))
+                    (let ()
+;;;                   ((inhibit-read-only t))
                       (put-text-property p (or end (point))
                                          'face current)
                       (setq end nil))