[mew-dist 18454] Re: mew-summary-sort (was: sort by x-* problem)

Tatsuya Kinoshita tats at example.com
2001年 8月 11日 (土) 01:26:07 JST


In message [mew-dist 18450], on Fri, 10 Aug 2001,
Kazu Yamamoto (山本和彦) <kazu at example.com> wrote:

> > > 	* その一覧(mewls の結果)を、リージョンと置き換える
> > 
> > そうしようと途中まで頑張ったのですが、頑張りきれませんでした (^_^;;
> 
> 作ってみました。anon cvs の HEAD ブランチで、お試しあれ。

バグをいくつか見つけました。

  * regionが無いとき、mew-summary-buffer-processがtのままエラー。

  * Summaryの先頭か末尾で、begとendが同じ位置のとき、行が余分に付く。

  * endがパート位置のとき、「Args out of range」のエラー。

  * endの位置に下線(highlight-cursor-line)が付いているとき、置き
    換え後の各行にも下線が付く。

mew-summary-mark-regionの修正と合わせて、anon cvsへのパッチを作り
ました。

-- 
木下達也
-------------- next part --------------

 This patch is written by Tatsuya Kinoshita.  Copyright is disclaimed.

diff -ur mew/mew-mark.el mew-tats/mew-mark.el
--- mew/mew-mark.el	Fri Aug 10 20:03:35 2001
+++ mew-tats/mew-mark.el	Sat Aug 11 01:04:29 2001
@@ -449,6 +449,7 @@
 (defun mew-summary-mark-all (&optional arg)
   "Put the '*' mark onto all messages which are not marked."
   (interactive "P")
+  (mew-decode-syntax-delete)
   (if arg
       (let ((begend (mew-summary-get-region)))
 	(mew-summary-mark-region (car begend) (cdr begend)))
@@ -458,7 +459,6 @@
   "Put the '*' mark onto all messages which are not marked between
 BEG and END."
   (interactive "r")
-  (mew-decode-syntax-delete)
   (let ((regex (concat mew-regex-msg " "))
 	(mark mew-mark-review) ;; someday ...
 	fld msg alist)
diff -ur mew/mew-sort.el mew-tats/mew-sort.el
--- mew/mew-sort.el	Fri Aug 10 20:03:35 2001
+++ mew-tats/mew-sort.el	Sat Aug 11 01:04:24 2001
@@ -89,6 +89,23 @@
      (mew-mark-clean)
      (let* ((buf (current-buffer))
 	    (folder (mew-summary-folder-name))
+	    (region (when arg
+		      (mew-decode-syntax-delete)
+		      (mew-summary-get-region)))
+	    (beg (when arg
+		   (goto-char (car region))
+		   (mew-summary-message-number)))
+	    (end (when (and arg (> (cdr region) (car region)))
+		   (goto-char (cdr region))
+		   (forward-line -1)
+		   (mew-summary-message-number)))
+	    (range (if arg
+		       (if (or (null beg) (null end))
+			   (error "There is no region now")
+			 (goto-char (car region))
+			 (mew-highlight-cursor-line)
+			 (concat beg "-" end))
+		     mew-range-all))
 	    (sort-key (or (cdr (assoc folder mew-sort-default-key-alist))
 			  mew-sort-default-key))
 	    (key-type (mew-input-sort-key sort-key))
@@ -101,17 +118,8 @@
 	    (tmp (mew-folder-new-message folder 'num-only))
 	    (i 0)
 	    (tmpbuf (generate-new-buffer mew-buffer-prefix))
-	    (range mew-range-all)
-	    ent idx med num value files region beg end)
+	    ent idx med num value files)
        (setq mew-summary-buffer-process t)
-       (when arg
-	 (setq region (mew-summary-get-region))
-	 (goto-char (car region))
-	 (setq beg (mew-summary-message-number))
-	 (goto-char (cdr region))
-	 (forward-line -1)
-	 (setq end (mew-summary-message-number))
-	 (setq range (concat beg "-" end)))
        (if arg
 	   (message "Sorting %s: %s ... " folder range)
 	 (message "Sorting %s ... " folder))


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