[PATCH] emacs: notmuch-hello: Use our own keymap.

2010-05-14 Thread Sebastian Spaeth
On 2010-05-14, Nelson Elhage wrote:
> Ah, I failed to properly search the mail archives before sending
> this. 

No problem, I admit that my subject title does not obviously point out
that it creates a proper keymap ;-).

> Your patch looks preferable with one exception: I think that
> making widget-keymap a parent of notmuch-hello-mode-map is probably
> better than just copying widget-keymap.

That sounds good to me. I am generally an elisp newbie and was just
using the first approach that worked for me. Do you want to update the
patch?

Sebastian


[PATCH] emacs: notmuch-hello: Make widget-keymap a parent of notmuch-hello-keymap

2010-05-14 Thread Nelson Elhage
This lets us pick up later changes to widget-keymap if the user
customizes it in some way. This is the recommended way to use
`widget-keymap', according to its help.
---

This goes on top of Sebastian's patch. See
id:1273805175-6660-1-git-send-email-nelhage at ksplice.com, where I
submitted a similar, but less thorough, patch as his.

 emacs/notmuch-hello.el |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 1042f31..5ec2aa4 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -215,7 +215,8 @@ diagonal."


 (defvar notmuch-hello-mode-map
-  (let ((map (copy-keymap widget-keymap)))
+  (let ((map (make-sparse-keymap)))
+(set-keymap-parent map widget-keymap)
 (define-key map "v" '(lambda () "Display the notmuch version" (interactive)
(message "notmuch version %s" (notmuch-version
 (define-key map "?" 'notmuch-help)
-- 
1.6.6.30.g1e6fd



utf-8 in author field

2010-05-14 Thread Igor Shenderovich
Hello all,

I'm using the latest version of notmuch (cloned from git on May 13), but I
can't handle with utf-8 symbols in the authors field. For example, I have a
letter with the field

"authors":
"=?UTF-8?B?Z3JpZmZvbiAtINCa0L7QvNC80LXQvdGC0LDRgNC40Lkg0LIg0JbQlg==?=",

(got it from usual emacs interface).

However, the body of this letter is pretty readable (it also contains some
utf-8 characters).

What should one do to see the true list of authors?
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20100514/6e139077/attachment.html>


[PATCH 0/2]: emacs: Improve notmuch-help

2010-05-14 Thread Nelson Elhage
This patch set makes notmuch-help integrate with the built-in emacs
help system, resulting in behaviors more familiar and more natural to
most emacs users.

If other people preferred the old behavior of *notmuch-help* buffers
that kept spawning new buffers every time you hit '?', they should
speak up, but as long long-time emacs user, I find this behavior much
more preferable.



[PATCH 1/2] emacs: notmuch-help: Integrate into the emacs help system.

2010-05-14 Thread Nelson Elhage
Use a *help* buffer like other help commands, and make the [back] and
[forward] links work.
---
 emacs/notmuch.el |   14 ++
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 57e1140..6bf8251 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -174,16 +174,14 @@ For a mouse binding, return nil."
   (setq beg (match-end 0)))
 doc))

-(defun notmuch-help ()
+(defun notmuch-help (&optional mode)
   "Display help for the current notmuch mode."
   (interactive)
-  (let* ((mode major-mode)
-(doc (substitute-command-keys (notmuch-substitute-command-keys 
(documentation mode t)
-(with-current-buffer (generate-new-buffer "*notmuch-help*")
-  (insert doc)
-  (goto-char (point-min))
-  (set-buffer-modified-p nil)
-  (view-buffer (current-buffer) 'kill-buffer-if-not-modified
+  (let ((mode (or mode major-mode)))
+(help-setup-xref `(notmuch-help ,mode) (interactive-p))
+(with-help-window (help-buffer)
+  (princ (substitute-command-keys
+  (notmuch-substitute-command-keys (documentation mode t)))

 (defcustom notmuch-search-hook '(hl-line-mode)
   "List of functions to call when notmuch displays the search results."
-- 
1.6.6.30.g1e6fd



[PATCH 2/2] emacs: notmuch-search-mode: wrap the documentation string

2010-05-14 Thread Nelson Elhage
This makes for easier reading in the *help* window.
---
 emacs/notmuch.el |   21 -
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 6bf8251..1149d1b 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -306,16 +306,19 @@ number of matched messages and total messages in the 
thread,
 participants in the thread, a representative subject line, and
 any tags).

-Pressing \\[notmuch-search-show-thread] on any line displays that thread. The 
'\\[notmuch-search-add-tag]' and '\\[notmuch-search-remove-tag]'
-keys can be used to add or remove tags from a thread. The 
'\\[notmuch-search-archive-thread]' key
+Pressing \\[notmuch-search-show-thread] on any line displays that
+thread. The '\\[notmuch-search-add-tag]' and
+'\\[notmuch-search-remove-tag]' keys can be used to add or remove
+tags from a thread. The '\\[notmuch-search-archive-thread]' key
 is a convenience for archiving a thread (removing the \"inbox\"
-tag). The '\\[notmuch-search-operate-all]' key can be used to add or remove a 
tag from all
-threads in the current buffer.
-
-Other useful commands are '\\[notmuch-search-filter]' for filtering the 
current search
-based on an additional query string, '\\[notmuch-search-filter-by-tag]' for 
filtering to include
-only messages with a given tag, and '\\[notmuch-search]' to execute a new, 
global
-search.
+tag). The '\\[notmuch-search-operate-all]' key can be used to add
+or remove a tag from all threads in the current buffer.
+
+Other useful commands are '\\[notmuch-search-filter]' for
+filtering the current search based on an additional query string,
+'\\[notmuch-search-filter-by-tag]' for filtering to include only
+messages with a given tag, and '\\[notmuch-search]' to execute a
+new, global search.

 Complete list of currently available key bindings:

-- 
1.6.6.30.g1e6fd



[PATCH 0/2]: emacs: Improve notmuch-help

2010-05-14 Thread Nelson Elhage

Oops; I realized I haven't been signing off on last few patches I've
sent.

Signed-off-by: Nelson Elhage 

for

id:1273869727-32740-2-git-send-email-nelhage at mit.edu
id:1273869727-32740-3-git-send-email-nelhage at mit.edu
id:1273857338-20127-1-git-send-email-nelhage at mit.edu
id:1273805175-6660-1-git-send-email-nelhage at ksplice.com

(Although the last one is probably superceded by the patch in
id:1272882573-9864-1-git-send-email-Sebastian at SSpaeth.de)

I can resend the entire patches with the signoffs if you prefer.

- Nelson

On Fri, 14 May 2010 16:42:05 -0400, Nelson Elhage  wrote:
> This patch set makes notmuch-help integrate with the built-in emacs
> help system, resulting in behaviors more familiar and more natural to
> most emacs users.
> 
> If other people preferred the old behavior of *notmuch-help* buffers
> that kept spawning new buffers every time you hit '?', they should
> speak up, but as long long-time emacs user, I find this behavior much
> more preferable.
> 
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
> 


[PATCH 1/2] emacs: notmuch-help: Integrate into the emacs help system.

2010-05-14 Thread Sebastian Spaeth
On 2010-05-14, Nelson Elhage wrote:
> Use a *help* buffer like other help commands, and make the [back] and
> [forward] links work.

I just tried this and one thing I did not like is that it opens a new
split help window but does not focus it immediately. I need to scroll
down the list of keybindings to see all but that requires manual buffer
switching. Can we focus it by default or is that un-emacsy?

Also, when closing with "q" the buffer split remains and I am left with
an empty split buffer, which is not what I want. I usually press "?" as
a key binding reference and want to get back to the state I was working
when I close the help window.

Also, -and that might be related to my additional notmuch-hello mode
patch that I am running- I get a "wrong type argument: listp, keymap"
when I press "?" in notmuch-hello although it works in notmuch-search
and notmuch-show. So that point might be moot.

I am sure there is a variable that customizes the help-buffer behavior,
isn't there? :-)

Sebastian
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20100514/9de76ea5/attachment.pgp>


[PATCH 1/2] emacs: notmuch-help: Integrate into the emacs help system.

2010-05-14 Thread Sebastian Spaeth
On 2010-05-14, Sebastian Spaeth wrote:
> I just tried this and one thing I did not like...

> I am sure there is a variable that customizes the help-buffer behavior,
> isn't there? :-)

DOH, I should have known :-). Emacs 23.1 has: "help-window-select" which
when set to 't behaves as I want it. It creates a split help window and
selects it. When pressing 'q' it deletes the frame.

This should go into the wiki or some other documentation. Or we should
set it locally for notmuch-help.

For notmuch-help I actually don't need a split window (I want
temporarily see as much info as possible and close the buffer quickly),
does the help-window thing also allow for that?

Thanks in any case.
Sebastian
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20100514/30f59b7e/attachment.pgp>


Re: [PATCH] emacs: notmuch-hello: Use our own keymap.

2010-05-14 Thread Sebastian Spaeth
On 2010-05-14, Nelson Elhage wrote:
> Ah, I failed to properly search the mail archives before sending
> this. 

No problem, I admit that my subject title does not obviously point out
that it creates a proper keymap ;-).

> Your patch looks preferable with one exception: I think that
> making widget-keymap a parent of notmuch-hello-mode-map is probably
> better than just copying widget-keymap.

That sounds good to me. I am generally an elisp newbie and was just
using the first approach that worked for me. Do you want to update the
patch?

Sebastian
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] emacs: notmuch-hello: Make widget-keymap a parent of notmuch-hello-keymap

2010-05-14 Thread Nelson Elhage
This lets us pick up later changes to widget-keymap if the user
customizes it in some way. This is the recommended way to use
`widget-keymap', according to its help.
---

This goes on top of Sebastian's patch. See
id:1273805175-6660-1-git-send-email-nelh...@ksplice.com, where I
submitted a similar, but less thorough, patch as his.

 emacs/notmuch-hello.el |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 1042f31..5ec2aa4 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -215,7 +215,8 @@ diagonal."
 
 
 (defvar notmuch-hello-mode-map
-  (let ((map (copy-keymap widget-keymap)))
+  (let ((map (make-sparse-keymap)))
+(set-keymap-parent map widget-keymap)
 (define-key map "v" '(lambda () "Display the notmuch version" (interactive)
(message "notmuch version %s" (notmuch-version
 (define-key map "?" 'notmuch-help)
-- 
1.6.6.30.g1e6fd

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


utf-8 in author field

2010-05-14 Thread Igor Shenderovich
Hello all,

I'm using the latest version of notmuch (cloned from git on May 13), but I
can't handle with utf-8 symbols in the authors field. For example, I have a
letter with the field

"authors":
"=?UTF-8?B?Z3JpZmZvbiAtINCa0L7QvNC80LXQvdGC0LDRgNC40Lkg0LIg0JbQlg==?=",

(got it from usual emacs interface).

However, the body of this letter is pretty readable (it also contains some
utf-8 characters).

What should one do to see the true list of authors?
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 0/2]: emacs: Improve notmuch-help

2010-05-14 Thread Nelson Elhage
This patch set makes notmuch-help integrate with the built-in emacs
help system, resulting in behaviors more familiar and more natural to
most emacs users.

If other people preferred the old behavior of *notmuch-help* buffers
that kept spawning new buffers every time you hit '?', they should
speak up, but as long long-time emacs user, I find this behavior much
more preferable.

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 1/2] emacs: notmuch-help: Integrate into the emacs help system.

2010-05-14 Thread Nelson Elhage
Use a *help* buffer like other help commands, and make the [back] and
[forward] links work.
---
 emacs/notmuch.el |   14 ++
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 57e1140..6bf8251 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -174,16 +174,14 @@ For a mouse binding, return nil."
   (setq beg (match-end 0)))
 doc))
 
-(defun notmuch-help ()
+(defun notmuch-help (&optional mode)
   "Display help for the current notmuch mode."
   (interactive)
-  (let* ((mode major-mode)
-(doc (substitute-command-keys (notmuch-substitute-command-keys 
(documentation mode t)
-(with-current-buffer (generate-new-buffer "*notmuch-help*")
-  (insert doc)
-  (goto-char (point-min))
-  (set-buffer-modified-p nil)
-  (view-buffer (current-buffer) 'kill-buffer-if-not-modified
+  (let ((mode (or mode major-mode)))
+(help-setup-xref `(notmuch-help ,mode) (interactive-p))
+(with-help-window (help-buffer)
+  (princ (substitute-command-keys
+  (notmuch-substitute-command-keys (documentation mode t)))
 
 (defcustom notmuch-search-hook '(hl-line-mode)
   "List of functions to call when notmuch displays the search results."
-- 
1.6.6.30.g1e6fd

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 2/2] emacs: notmuch-search-mode: wrap the documentation string

2010-05-14 Thread Nelson Elhage
This makes for easier reading in the *help* window.
---
 emacs/notmuch.el |   21 -
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 6bf8251..1149d1b 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -306,16 +306,19 @@ number of matched messages and total messages in the 
thread,
 participants in the thread, a representative subject line, and
 any tags).
 
-Pressing \\[notmuch-search-show-thread] on any line displays that thread. The 
'\\[notmuch-search-add-tag]' and '\\[notmuch-search-remove-tag]'
-keys can be used to add or remove tags from a thread. The 
'\\[notmuch-search-archive-thread]' key
+Pressing \\[notmuch-search-show-thread] on any line displays that
+thread. The '\\[notmuch-search-add-tag]' and
+'\\[notmuch-search-remove-tag]' keys can be used to add or remove
+tags from a thread. The '\\[notmuch-search-archive-thread]' key
 is a convenience for archiving a thread (removing the \"inbox\"
-tag). The '\\[notmuch-search-operate-all]' key can be used to add or remove a 
tag from all
-threads in the current buffer.
-
-Other useful commands are '\\[notmuch-search-filter]' for filtering the 
current search
-based on an additional query string, '\\[notmuch-search-filter-by-tag]' for 
filtering to include
-only messages with a given tag, and '\\[notmuch-search]' to execute a new, 
global
-search.
+tag). The '\\[notmuch-search-operate-all]' key can be used to add
+or remove a tag from all threads in the current buffer.
+
+Other useful commands are '\\[notmuch-search-filter]' for
+filtering the current search based on an additional query string,
+'\\[notmuch-search-filter-by-tag]' for filtering to include only
+messages with a given tag, and '\\[notmuch-search]' to execute a
+new, global search.
 
 Complete list of currently available key bindings:
 
-- 
1.6.6.30.g1e6fd

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 0/2]: emacs: Improve notmuch-help

2010-05-14 Thread Nelson Elhage

Oops; I realized I haven't been signing off on last few patches I've
sent.

Signed-off-by: Nelson Elhage 

for

id:1273869727-32740-2-git-send-email-nelh...@mit.edu
id:1273869727-32740-3-git-send-email-nelh...@mit.edu
id:1273857338-20127-1-git-send-email-nelh...@mit.edu
id:1273805175-6660-1-git-send-email-nelh...@ksplice.com

(Although the last one is probably superceded by the patch in
id:1272882573-9864-1-git-send-email-sebast...@sspaeth.de)

I can resend the entire patches with the signoffs if you prefer.

- Nelson

On Fri, 14 May 2010 16:42:05 -0400, Nelson Elhage  wrote:
> This patch set makes notmuch-help integrate with the built-in emacs
> help system, resulting in behaviors more familiar and more natural to
> most emacs users.
> 
> If other people preferred the old behavior of *notmuch-help* buffers
> that kept spawning new buffers every time you hit '?', they should
> speak up, but as long long-time emacs user, I find this behavior much
> more preferable.
> 
> ___
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
> 
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 1/2] emacs: notmuch-help: Integrate into the emacs help system.

2010-05-14 Thread Sebastian Spaeth
On 2010-05-14, Nelson Elhage wrote:
> Use a *help* buffer like other help commands, and make the [back] and
> [forward] links work.

I just tried this and one thing I did not like is that it opens a new
split help window but does not focus it immediately. I need to scroll
down the list of keybindings to see all but that requires manual buffer
switching. Can we focus it by default or is that un-emacsy?

Also, when closing with "q" the buffer split remains and I am left with
an empty split buffer, which is not what I want. I usually press "?" as
a key binding reference and want to get back to the state I was working
when I close the help window.

Also, -and that might be related to my additional notmuch-hello mode
patch that I am running- I get a "wrong type argument: listp, keymap"
when I press "?" in notmuch-hello although it works in notmuch-search
and notmuch-show. So that point might be moot.

I am sure there is a variable that customizes the help-buffer behavior,
isn't there? :-)

Sebastian


pgpxdCrxkwXsX.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 1/2] emacs: notmuch-help: Integrate into the emacs help system.

2010-05-14 Thread Sebastian Spaeth
On 2010-05-14, Sebastian Spaeth wrote:
> I just tried this and one thing I did not like...

> I am sure there is a variable that customizes the help-buffer behavior,
> isn't there? :-)

DOH, I should have known :-). Emacs 23.1 has: "help-window-select" which
when set to 't behaves as I want it. It creates a split help window and
selects it. When pressing 'q' it deletes the frame.

This should go into the wiki or some other documentation. Or we should
set it locally for notmuch-help.

For notmuch-help I actually don't need a split window (I want
temporarily see as much info as possible and close the buffer quickly),
does the help-window thing also allow for that?

Thanks in any case.
Sebastian


pgplC6tKRhn4l.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch