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

[xyzzy:02588] Re: Den8 View buffer



Toyさん、こんにちは。山本です。


 On [xyzzy:02585] Den8 View buffer,
 at Tue, 18 May 1999 00:36:14 +0900, Toyohiro wrote:

> フォーカスが Den8 View の方に持ってかれますよね?
> これを防ぐことはできますでしょうか?

私が作るよりも亀井さんが作るほうがスマートな出来になると思いますが
チョットやってみました。勿論、うまく動く保証はありません。:->

>   j   :  ミニバッファーでメール番号を打つと,
>          そのメールにひとっ飛び

これは挫折しました。help > 誰か

----------------------------------------------------------------
(require "den8view")

(define-key *den8-summary-mode-map* #\RET 'my-den8-summary-jump-to-mail)
(define-key *den8-summary-mode-map* #\SPC 'my-den8-next-page-or-message)
(define-key *den8-summary-mode-map* #\TAB 'my-den8-summary-other-window)
(define-key *den8-summary-mode-map* #\C-n 'my-den8-next-message)
(define-key *den8-summary-mode-map* #\C-p 'my-den8-previous-message)
(define-key *den8-summary-mode-map* #\h 'my-den8-check-header)
(define-key *den8-summary-mode-map* #\n 'my-den8-summary-forward-line)
(define-key *den8-summary-mode-map* #\p 'my-den8-summary-previous-line)
(define-key *den8-summary-mode-map* #\q 'my-den8-escape)
(define-key *den8-summary-mode-map* #\v 'my-den8-toggle-view-window)

(define-key *den8-view-mode-map* #\SPC 'my-den8-next-page-or-message)
(define-key *den8-view-mode-map* #\C-n 'my-den8-next-message)
(define-key *den8-view-mode-map* #\C-p 'my-den8-previous-message)
(define-key *den8-view-mode-map* #\h 'my-den8-check-header)
(define-key *den8-view-mode-map* #\v 'my-den8-toggle-view-window)


(defun my-den8-summary-forward-line ()
  (interactive)
  (forward-line)
  (reverse-region (point)
		  (save-excursion (goto-eol) (point))))

(defun my-den8-summary-previous-line ()
  (interactive)
  (forward-line -1)
  (reverse-region (point)
		  (save-excursion (goto-eol) (point))))

(defun my-den8-summary-other-window ()
  (interactive)
  (let ((a-win (get-buffer-window (find-buffer "*Den8 View*"))))
    (dotimes (n (1- (count-windows)))
      (other-window)
      (unless (eq (selected-window) a-win)
	  (return)))))

(defun my-den8-summary-jump-to-mail ()
  (interactive)
  (unless (get-buffer-window (find-buffer "*Den8 View*"))
    (my-den8-toggle-view-window))
  (den8-summary-jump-to-mail))

(defun my-den8-next-page-or-message ()
  (interactive)
  (unless (get-buffer-window (find-buffer "*Den8 View*"))
    (my-den8-summary-toggle-view-window))
  (handler-case (den8-next-page-or-message)
    (error (set-buffer "*Den8 Summary*")
      (plain-error "次のメールはありません")))
  (pop-to-buffer den8-summary-buffer))

(defun my-den8-next-message ()
  (interactive)
  (unless (get-buffer-window (find-buffer "*Den8 View*"))
    (my-den8-summary-toggle-view-window))
  (handler-case (den8-next-message)
    (error (set-buffer "*Den8 Summary*")
      (plain-error "次のメールはありません")))
  (pop-to-buffer den8-summary-buffer))

(defun my-den8-previous-message ()
  (interactive)
  (unless (get-buffer-window (find-buffer "*Den8 View*"))
    (my-den8-summary-toggle-view-window))
  (handler-case (den8-previous-message)
    (error (set-buffer "*Den8 Summary*")
      (plain-error "前のメールはありません")))
  (pop-to-buffer den8-summary-buffer))

(defun my-den8-toggle-view-window ()
  (interactive)
  (let ((s-win (get-buffer-window (find-buffer "*Den8 View*"))))
    (if s-win
	(progn
	  (set-window s-win)
	  (delete-window))
      (progn
	(split-window (truncate (* (window-height)
				   *den8-summary-window-ratio*)))
	(pop-to-buffer den8-article-buffer)
	(pop-to-buffer den8-summary-buffer)))))

(defun my-den8-check-header ()
  (interactive)
  (pop-to-buffer (find-buffer "*Den8 View*"))
  (goto-char (point-min))
  (pop-to-buffer den8-summary-buffer))

----------------------------------------------------------------


-- 
山本真二   sinj@xxxxxxxxxxxx

Index Home