[Mew-dist 15989] Re: b98

KOIE Hidetaka ( 鯉江英隆 ) hide at example.com
2001年 1月 19日 (金) 14:21:24 JST


 From:       Kazu Yamamoto (山本和彦) <kazu at example.com>
 Subject:    [Mew-dist 15980] Re: b98
 Date:       Fri, 19 Jan 2001 02:13:48 +0900
 Message-Id: <20010119.014702.104080981.kazu at example.com>

  | > lazy-lockモードのようにfontifyを
  | > input-pending-p()で中断できるようにしたらいけそうです。
  | 
  | Done.
  | 
  | これでもまだ気に入らないなら、オプションにします。> 白井さん

input-pending-pをもっと頻繁に調べるなら、こんなかんじでしょうか。

━━━━━━━━━━━━━━ここから━━━━━━━━━━━━━━
--- mew-summary.el.~1~	Fri Jan 19 01:40:47 2001
+++ mew-summary.el	Fri Jan 19 13:12:29 2001
@@ -1965,19 +1965,31 @@ (defun mew-summary-flush-queue (&optiona
 ;;; invisible
 ;;;
 
-(defun mew-summary-make-invisible-region (beg end)
+(defun mew-summary-make-invisible-region (beg end &optional stealthily)
   (if (and (or (eq major-mode 'mew-summary-mode)
 	       (eq major-mode 'mew-virtual-mode))
 	   mew-summary-buffer-visible)
-      (let ((inhibit-point-motion-hooks t))
+      (let ((inhibit-point-motion-hooks t) vis)
 	(mew-elet
+         (if stealthily
+             (message "Making invisible stealthily %s... "
+                      (buffer-name (current-buffer))))
 	 (goto-char beg)
-	 (while (and (<= (point) end) ;; xxx Emacs 21's bug < or <= ?
-		     (search-forward "\r" end t))
-	   (put-text-property (match-beginning 0)
-			      (progn (end-of-line) (point))
-			      'invisible t))
-	 (set-buffer-modified-p nil)))))
+         (setq vis
+               (catch 'quit
+                 (while (and (<= (point) end) ;; xxx Emacs 21's bug < or <= ?
+                             (search-forward "\r" end t))
+                   (if (input-pending-p)
+                       (throw 'quit t))
+                   (put-text-property (match-beginning 0)
+                                      (progn (end-of-line) (point))
+                                      'invisible t))
+                 (if stealthily
+                       (message "Making invisible stealthily %s... done"
+                                (buffer-name (current-buffer))))
+                 nil))
+         (set-buffer-modified-p nil))
+        vis)))
 
 (defun mew-summary-make-invisible ()
   (let ((bufs mew-buffers) buf)
@@ -1988,8 +2000,10 @@ (defun mew-summary-make-invisible ()
 	(if (and (get-buffer buf) (not (input-pending-p)))
 	    (progn
 	      (set-buffer buf)
-	      (mew-summary-make-invisible-region (point-min) (point-max))
-	      (setq mew-summary-buffer-visible nil)))))))
+	      (setq mew-summary-buffer-visible 
+                    (mew-summary-make-invisible-region (point-min) (point-max) t)))))))
+  (if (not (input-pending-p))
+      (garbage-collect)))
 
 (defvar mew-idle-timer-id nil)
 
━━━━━━━━━━━━━━ここまで━━━━━━━━━━━━━━

--
KOIE Hidetaka 鯉江英隆 <hide at example.com>



Mew-dist メーリングリストの案内