* wl-folder.el (wl-folder-goto-top-of-current-folder):Simplified.
authorueno <ueno>
Tue, 29 Aug 2000 05:30:15 +0000 (05:30 +0000)
committerueno <ueno>
Tue, 29 Aug 2000 05:30:15 +0000 (05:30 +0000)
Add interactive spec.
(wl-folder-goto-bottom-of-current-folder): Ditto.
(wl-folder-mode-map): Bind them.

wl/ChangeLog
wl/wl-folder.el

index 0621155..bad8e3e 100644 (file)
@@ -1,5 +1,10 @@
 2000-08-29   Daiki Ueno  <ueno@unixuser.org>
 
+       * wl-folder.el (wl-folder-goto-top-of-current-folder):Simplified.
+       Add interactive spec.
+       (wl-folder-goto-bottom-of-current-folder): Ditto.
+       (wl-folder-mode-map): Bind them.
+
        * wl-vars.el (wl-message-ignored-field-list): New variable.
        (wl-message-visible-field-list): New variable.
 
index 8e51f40..f1d22e6 100644 (file)
   (define-key wl-folder-mode-map "\C-x\C-s" 'wl-save)
   (define-key wl-folder-mode-map "\M-s"     'wl-save)
   (define-key wl-folder-mode-map "\C-xk"    'wl-folder-mimic-kill-buffer)
+  (define-key wl-folder-mode-map "\M-\C-a"
+    'wl-folder-goto-top-of-current-folder)
+  (define-key wl-folder-mode-map "\M-\C-e"
+    'wl-folder-goto-bottom-of-current-folder)
+
   (wl-folder-setup-mouse)
   (easy-menu-define
    wl-folder-mode-menu
       (and trash-buf 
           (kill-buffer trash-buf)))))
 
-(defun wl-folder-goto-top-of-current-folder ()
-  (if (re-search-backward "^\\([ ]*\\)\\[\\([\\+-]\\)\\]\\(.+\\)\n" nil t)
-      (beginning-of-line)
+(defun wl-folder-goto-top-of-current-folder (&optional arg)
+  "Move backward to the top of the current folder group.
+Optional argument ARG is repeart count."
+  (interactive "P")
+  (if (re-search-backward
+       "^ *\\[[\\+-]\\]" nil t (if arg (prefix-numeric-value arg)))
+      (beginning-of-line) 
     (goto-char (point-min))))
 
 (defun wl-folder-goto-bottom-of-current-folder (indent)
+  "Move forward to the bottom of the current folder group."
+  (interactive
+   (let ((indent
+         (save-excursion
+           (beginning-of-line)
+           (if (looking-at "^ *")
+               (buffer-substring (match-beginning 0)(1- (match-end 0)))
+             ""))))
+     (list indent)))
   (if (catch 'done
-       (while (re-search-forward "^\\([ ]*\\)[^ ]" nil t)
-         (if (<= (length (wl-match-buffer 1))
+       (while (re-search-forward "^ *" nil t)
+         (if (<= (length (match-string 0))
                  (length indent))
              (throw 'done nil)))
        (throw 'done t))