Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / d9 / e14acbdaf7a7d3798c8c1b860a9ee12ad8e2b8
1 Return-Path: <Sebastian@SSpaeth.de>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id EDCA04196F0\r
6         for <notmuch@notmuchmail.org>; Mon,  3 May 2010 03:29:38 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.9\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9] autolearn=ham\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 2tv4rR3RvZ4W for <notmuch@notmuchmail.org>;\r
16         Mon,  3 May 2010 03:29:37 -0700 (PDT)\r
17 Received: from homiemail-a15.g.dreamhost.com (caiajhbdccah.dreamhost.com\r
18         [208.97.132.207])\r
19         by olra.theworths.org (Postfix) with ESMTP id D8E5F431FC1\r
20         for <notmuch@notmuchmail.org>; Mon,  3 May 2010 03:29:37 -0700 (PDT)\r
21 Received: from localhost.localdomain (mtec-hg-docking-1-dhcp-204.ethz.ch\r
22         [129.132.133.204]) (Authenticated sender: sebastian@sspaeth.de)\r
23         by homiemail-a15.g.dreamhost.com (Postfix) with ESMTPA id E6C9E76C065; \r
24         Mon,  3 May 2010 03:29:35 -0700 (PDT)\r
25 From: Sebastian Spaeth <Sebastian@SSpaeth.de>\r
26 To: Notmuch developer list <notmuch@notmuchmail.org>\r
27 Subject: [PATCHv2 1/2] Make notmuch-hello a mode.\r
28 Date: Mon,  3 May 2010 12:29:32 +0200\r
29 Message-Id: <1272882573-9864-1-git-send-email-Sebastian@SSpaeth.de>\r
30 X-Mailer: git-send-email 1.7.0.4\r
31 In-Reply-To: <1272879900-8285-1-git-send-email-Sebastian@SSpaeth.de>\r
32 References: <1272879900-8285-1-git-send-email-Sebastian@SSpaeth.de>\r
33 X-BeenThere: notmuch@notmuchmail.org\r
34 X-Mailman-Version: 2.1.13\r
35 Precedence: list\r
36 List-Id: "Use and development of the notmuch mail system."\r
37         <notmuch.notmuchmail.org>\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
39         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
41 List-Post: <mailto:notmuch@notmuchmail.org>\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
45 X-List-Received-Date: Mon, 03 May 2010 10:29:39 -0000\r
46 \r
47 This enables the nifty '?' key binding to work in notmuch-hello\r
48 (although for some strange reasons I don't see any descriptions for\r
49 specific key bindings yet. Not sure how that is supposed to work\r
50 though.\r
51 But this starts, runs and behaves identical to the existing code.\r
52 \r
53 Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>\r
54 ---\r
55 v2 actually includes the key bindings descriptions and also works. \r
56 Patch 2/2 adds doc strings for two used functions that did not have \r
57 one previously.\r
58  \r
59  emacs/notmuch-hello.el |   41 ++++++++++++++++++++++++++++++++---------\r
60  1 files changed, 32 insertions(+), 9 deletions(-)\r
61 \r
62 diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
63 index 6a1c56e..1042f31 100644\r
64 --- a/emacs/notmuch-hello.el\r
65 +++ b/emacs/notmuch-hello.el\r
66 @@ -213,6 +213,35 @@ diagonal."\r
67    (notmuch-poll)\r
68    (notmuch-hello-update))\r
69  \r
70 +\r
71 +(defvar notmuch-hello-mode-map\r
72 +  (let ((map (copy-keymap widget-keymap)))\r
73 +    (define-key map "v" '(lambda () "Display the notmuch version" (interactive)\r
74 +                           (message "notmuch version %s" (notmuch-version))))\r
75 +    (define-key map "?" 'notmuch-help)\r
76 +    (define-key map "q" 'kill-this-buffer)\r
77 +    (define-key map "=" 'notmuch-hello-update)\r
78 +    (define-key map "G" 'notmuch-hello-poll-and-update)\r
79 +    (define-key map "m" 'notmuch-mua-mail)\r
80 +    (define-key map "s" 'notmuch-hello-goto-search)\r
81 +    map)\r
82 +  "Keymap for \"notmuch hello\" buffers.")\r
83 +(fset 'notmuch-hello-mode-map notmuch-hello-mode-map)\r
84 +\r
85 +(defun notmuch-hello-mode ()\r
86 + "Major mode for convenient notmuch navigation. This is your entry portal into notmuch.\r
87 +\r
88 +Complete list of currently available key bindings:\r
89 +\r
90 +\\{notmuch-hello-mode-map}"\r
91 + (interactive)\r
92 + (kill-all-local-variables)\r
93 + (use-local-map notmuch-hello-mode-map)\r
94 + (setq major-mode 'notmuch-hello-mode\r
95 +       mode-name "notmuch-hello")\r
96 + ;;(setq buffer-read-only t)\r
97 +)\r
98 +\r
99  (defun notmuch-hello (&optional no-display)\r
100    (interactive)\r
101  \r
102 @@ -237,6 +266,9 @@ diagonal."\r
103      (let ((inhibit-read-only t))\r
104        (erase-buffer))\r
105  \r
106 +    (unless (eq major-mode 'notmuch-hello-mode)\r
107 +      (notmuch-hello-mode))\r
108 +\r
109      (let ((all (overlay-lists)))\r
110        ;; Delete all the overlays.\r
111        (mapc 'delete-overlay (car all))\r
112 @@ -397,15 +429,6 @@ diagonal."\r
113         (let ((fill-column (- (window-width) notmuch-hello-indent)))\r
114           (center-region start (point))))\r
115  \r
116 -      (use-local-map widget-keymap)\r
117 -      (local-set-key "=" 'notmuch-hello-update)\r
118 -      (local-set-key "G" 'notmuch-hello-poll-and-update)\r
119 -      (local-set-key "m" 'notmuch-mua-mail)\r
120 -      (local-set-key "q" '(lambda () (interactive) (kill-buffer (current-buffer))))\r
121 -      (local-set-key "s" 'notmuch-hello-goto-search)\r
122 -      (local-set-key "v" '(lambda () (interactive)\r
123 -                           (message "notmuch version %s" (notmuch-version))))\r
124 -\r
125        (widget-setup)\r
126  \r
127        (goto-char final-target-pos)\r
128 -- \r
129 1.7.0.4\r
130 \r