[PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable

2012-11-30 Thread Damien Cassou
On Fri, Nov 23, 2012 at 9:02 AM, Bernard Hurley  wrote:

> Can I add one little caveat - although from what you say it probably
> doesn't apply in this case. I have set up my computer so that as much as
> possible can be done from the keyboard. I have arthritis in my rignt
> hand and although I can still type as well as before I find it very
> difficult to use a mouse. I have recently discovered I am far from alone
> in this. So it is important for me and others that when mouse options
> are added to software, convienient keyboard options still exist.
>

don't worry, you can still press RET on a tag to follow the link.

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without losing
enthusiasm."
Winston Churchill
-- next part --
An HTML attachment was scrubbed...
URL: 



[PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable

2012-11-30 Thread Damien Cassou
 On Tue, Nov 20, 2012 at 6:32 AM, Austin Clements  wrote:

> Though is this really the right interface?  Is it useful to return a
> mode-line-format template from this, given that it can't be used in
> the mode-line or header-line since the buttons won't work?  Should
> this just return a string that can be inserted into a buffer?
> Something like (untested),
>

I agree, it might look strange. Nevertheless, I want to keep consistency
between header-line and body. That's not important at all now, but in the
next series of patches I will add the possibility to replace tags by
pictures and consistency will help I think.

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without losing
enthusiasm."
Winston Churchill
-- next part --
An HTML attachment was scrubbed...
URL: 



Re: [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable

2012-11-30 Thread Damien Cassou
 On Tue, Nov 20, 2012 at 6:32 AM, Austin Clements amdra...@mit.edu wrote:

 Though is this really the right interface?  Is it useful to return a
 mode-line-format template from this, given that it can't be used in
 the mode-line or header-line since the buttons won't work?  Should
 this just return a string that can be inserted into a buffer?
 Something like (untested),


I agree, it might look strange. Nevertheless, I want to keep consistency
between header-line and body. That's not important at all now, but in the
next series of patches I will add the possibility to replace tags by
pictures and consistency will help I think.

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

Success is the ability to go from one failure to another without losing
enthusiasm.
Winston Churchill
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable

2012-11-30 Thread Damien Cassou
On Fri, Nov 23, 2012 at 9:02 AM, Bernard Hurley bern...@marcade.biz wrote:

 Can I add one little caveat - although from what you say it probably
 doesn't apply in this case. I have set up my computer so that as much as
 possible can be done from the keyboard. I have arthritis in my rignt
 hand and although I can still type as well as before I find it very
 difficult to use a mouse. I have recently discovered I am far from alone
 in this. So it is important for me and others that when mouse options
 are added to software, convienient keyboard options still exist.


don't worry, you can still press RET on a tag to follow the link.

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

Success is the ability to go from one failure to another without losing
enthusiasm.
Winston Churchill
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable

2012-11-23 Thread Tomi Ollila
On Fri, Nov 23 2012, Bernard Hurley wrote:

> On Thu, Nov 22, 2012 at 07:40:36PM +0100, Damien Cassou wrote:
>> Hi,
>> 
>> 
>> you are perfectly right. In the upcoming patch I made the buttons so that
>> TAB won't stop at them ('skip t) but you can still activate them with RET
>> or a mouse click. Is that ok?
>> 
>
> Can I add one little caveat - although from what you say it probably
> doesn't apply in this case. I have set up my computer so that as much as
> possible can be done from the keyboard. I have arthritis in my rignt 
> hand and although I can still type as well as before I find it very 
> difficult to use a mouse. I have recently discovered I am far from alone
> in this. So it is important for me and others that when mouse options 
> are added to software, convienient keyboard options still exist.

I run my 2 notmuch emacs instances on urxvt terminals over ssh connection
-- I don't have any mouse access there (except window focus and some 
cut operations).

I'd be disappointed if my email experience got worse -- and I don't
think that is going to happen :D

> Bernard Hurley

Tomi

>
>> -- 
>> Damien Cassou
>> http://damiencassou.seasidehosting.st


[PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable

2012-11-23 Thread Bernard Hurley
On Thu, Nov 22, 2012 at 07:40:36PM +0100, Damien Cassou wrote:
> Hi,
> 
> 
> you are perfectly right. In the upcoming patch I made the buttons so that
> TAB won't stop at them ('skip t) but you can still activate them with RET
> or a mouse click. Is that ok?
> 

Can I add one little caveat - although from what you say it probably
doesn't apply in this case. I have set up my computer so that as much as
possible can be done from the keyboard. I have arthritis in my rignt 
hand and although I can still type as well as before I find it very 
difficult to use a mouse. I have recently discovered I am far from alone
in this. So it is important for me and others that when mouse options 
are added to software, convienient keyboard options still exist.

Bernard Hurley

> -- 
> Damien Cassou
> http://damiencassou.seasidehosting.st
> 
> "Success is the ability to go from one failure to another without losing
> enthusiasm."
> Winston Churchill

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



Re: [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable

2012-11-23 Thread Bernard Hurley
On Thu, Nov 22, 2012 at 07:40:36PM +0100, Damien Cassou wrote:
 Hi,
 
 
 you are perfectly right. In the upcoming patch I made the buttons so that
 TAB won't stop at them ('skip t) but you can still activate them with RET
 or a mouse click. Is that ok?
 

Can I add one little caveat - although from what you say it probably
doesn't apply in this case. I have set up my computer so that as much as
possible can be done from the keyboard. I have arthritis in my rignt 
hand and although I can still type as well as before I find it very 
difficult to use a mouse. I have recently discovered I am far from alone
in this. So it is important for me and others that when mouse options 
are added to software, convienient keyboard options still exist.

Bernard Hurley

 -- 
 Damien Cassou
 http://damiencassou.seasidehosting.st
 
 Success is the ability to go from one failure to another without losing
 enthusiasm.
 Winston Churchill

 ___
 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 3/4] emacs: Make tags that appear in `notmuch-show' clickable

2012-11-23 Thread Tomi Ollila
On Fri, Nov 23 2012, Bernard Hurley wrote:

 On Thu, Nov 22, 2012 at 07:40:36PM +0100, Damien Cassou wrote:
 Hi,
 
 
 you are perfectly right. In the upcoming patch I made the buttons so that
 TAB won't stop at them ('skip t) but you can still activate them with RET
 or a mouse click. Is that ok?
 

 Can I add one little caveat - although from what you say it probably
 doesn't apply in this case. I have set up my computer so that as much as
 possible can be done from the keyboard. I have arthritis in my rignt 
 hand and although I can still type as well as before I find it very 
 difficult to use a mouse. I have recently discovered I am far from alone
 in this. So it is important for me and others that when mouse options 
 are added to software, convienient keyboard options still exist.

I run my 2 notmuch emacs instances on urxvt terminals over ssh connection
-- I don't have any mouse access there (except window focus and some 
cutpaste operations).

I'd be disappointed if my email experience got worse -- and I don't
think that is going to happen :D

 Bernard Hurley

Tomi


 -- 
 Damien Cassou
 http://damiencassou.seasidehosting.st
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable

2012-11-22 Thread Damien Cassou
Hi,

On Mon, Nov 19, 2012 at 12:06 AM, Mark Walters wrote:

> This patch adds buttons for every tag in show mode which means that
> tabbing down to an attachment (or other button) is rather slower. As
> someone who is not going to use the tag buttons (at least not very
> often) Is it possible to avoid this? perhaps by making the button
> optional or making the button only mouse clickable? (Since the buttons
> in the headerline are not tabbable to then the latter might be
> reasonable.)
>

you are perfectly right. In the upcoming patch I made the buttons so that
TAB won't stop at them ('skip t) but you can still activate them with RET
or a mouse click. Is that ok?

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without losing
enthusiasm."
Winston Churchill
-- next part --
An HTML attachment was scrubbed...
URL: 



[PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable

2012-11-22 Thread Mark Walters

On Thu, 22 Nov 2012, Damien Cassou  wrote:
> Hi,
>
> On Mon, Nov 19, 2012 at 12:06 AM, Mark Walters  gmail.com>wrote:
>
>> This patch adds buttons for every tag in show mode which means that
>> tabbing down to an attachment (or other button) is rather slower. As
>> someone who is not going to use the tag buttons (at least not very
>> often) Is it possible to avoid this? perhaps by making the button
>> optional or making the button only mouse clickable? (Since the buttons
>> in the headerline are not tabbable to then the latter might be
>> reasonable.)
>>
>
> you are perfectly right. In the upcoming patch I made the buttons so that
> TAB won't stop at them ('skip t) but you can still activate them with RET
> or a mouse click. Is that ok?

That sounds perfect.

Many thanks for all the work!

Mark

>
> -- 
> Damien Cassou
> http://damiencassou.seasidehosting.st
>
> "Success is the ability to go from one failure to another without losing
> enthusiasm."
> Winston Churchill


Re: [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable

2012-11-22 Thread Damien Cassou
Hi,

On Mon, Nov 19, 2012 at 12:06 AM, Mark Walters markwalters1...@gmail.comwrote:

 This patch adds buttons for every tag in show mode which means that
 tabbing down to an attachment (or other button) is rather slower. As
 someone who is not going to use the tag buttons (at least not very
 often) Is it possible to avoid this? perhaps by making the button
 optional or making the button only mouse clickable? (Since the buttons
 in the headerline are not tabbable to then the latter might be
 reasonable.)


you are perfectly right. In the upcoming patch I made the buttons so that
TAB won't stop at them ('skip t) but you can still activate them with RET
or a mouse click. Is that ok?

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

Success is the ability to go from one failure to another without losing
enthusiasm.
Winston Churchill
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable

2012-11-20 Thread Austin Clements
Quoth Damien Cassou on Nov 18 at  8:18 pm:
> Signed-off-by: Damien Cassou 
> ---
>  emacs/notmuch-show.el   |9 +
>  emacs/notmuch-tagger.el |   33 +
>  2 files changed, 38 insertions(+), 4 deletions(-)
> 
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index 988e27c..379c8cd 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -431,10 +431,11 @@ message at DEPTH in the current thread."
>   (notmuch-show-clean-address (plist-get headers :From))
>   " ("
>   date
> - ") ("
> - (propertize (mapconcat 'identity tags " ")
> - 'face 'notmuch-tag-face)
> - ")\n")
> + ") "
> + (propertize
> +  (format-mode-line (notmuch-tagger-present-tags tags))
> +  'face 'notmuch-tag-face)
> + "\n")
>  (overlay-put (make-overlay start (point)) 'face 
> 'notmuch-message-summary-face)))
>  
>  (defun notmuch-show-insert-header (header header-value)
> diff --git a/emacs/notmuch-tagger.el b/emacs/notmuch-tagger.el
> index 19a6c7e..379a905 100644
> --- a/emacs/notmuch-tagger.el
> +++ b/emacs/notmuch-tagger.el
> @@ -53,12 +53,21 @@ test if the library is present before calling this 
> function."
>(let ((tag (header-button-get button 'notmuch-tagger-tag)))
>  (notmuch-tagger-goto-target tag)))
>  
> +(defun notmuch-tagger-body-button-action (button)
> +  "Open `notmuch-search' for the tag referenced by BUTTON."
> +  (let ((tag (button-get button 'notmuch-tagger-tag)))
> +(notmuch-tagger-goto-target tag)))
> +
>  (eval-after-load "header-button"
>'(define-button-type 'notmuch-tagger-header-button-type
>   'supertype 'header
>   'action#'notmuch-tagger-header-button-action
>   'follow-link t))
>  
> +(define-button-type 'notmuch-tagger-body-button-type
> +  'action#'notmuch-tagger-body-button-action
> +  'follow-link t)
> +
>  (defun notmuch-tagger-really-make-header-link (tag)
> "Return a property list that presents a link to TAG.
>  
> @@ -82,6 +91,19 @@ if not."
>(notmuch-tagger-really-make-header-link tag)
>  tag))
>  
> +(defun notmuch-tagger-make-body-link (tag)
> +  "Return a property list that presents a link to TAG.
> +The returned property list will work everywhere except in the
> +header-line. For a link that works on the header-line, prefer
> +`notmuch-tagger-make-header-link'."
> +  (let ((button (copy-sequence tag)))
> +(make-text-button
> + button nil
> + 'type 'notmuch-tagger-body-button-type
> + 'notmuch-tagger-tag tag
> + 'help-echo (format "%s: Search other messages like this" tag))
> +button))
> +
>  (defun notmuch-tagger-present-tags-header-line (tags)
>"Return a property list to present TAGS in emacs header-line."
>(list
> @@ -91,6 +113,17 @@ if not."
>  " ")
> ")"))
>  
> +(defun notmuch-tagger-present-tags (tags)

notmuch-tagger-format-tags?

> +  "Return a property list to present TAGS in emacs.

Same comment about the comment as in patch 1.

Though is this really the right interface?  Is it useful to return a
mode-line-format template from this, given that it can't be used in
the mode-line or header-line since the buttons won't work?  Should
this just return a string that can be inserted into a buffer?
Something like (untested),

(defun notmuch-tagger-format-tags (tags)
  "Format TAGS as a string suitable for insertion in a buffer."
  (concat "(" (mapconcat #'notmuch-tagger-make-body-link tags " ") ")"))

> +If tags the result of this function is to be used within the
> +header-line, prefer `notmuch-tagger-present-tags-header-line'
> +instead of this function."
> +  (list
> +   "("
> +   (notmuch-tagger-separate-elems
> +(mapcar #'notmuch-tagger-make-body-link tags)
> +" ")
> +   ")"))
>  
>  (provide 'notmuch-tagger)
>  ;;; notmuch-tagger.el ends here


[PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable

2012-11-18 Thread Mark Walters

Hi

This patch adds buttons for every tag in show mode which means that
tabbing down to an attachment (or other button) is rather slower. As
someone who is not going to use the tag buttons (at least not very
often) Is it possible to avoid this? perhaps by making the button
optional or making the button only mouse clickable? (Since the buttons
in the headerline are not tabbable to then the latter might be
reasonable.)

Best wishes

Mark


On Sun, 18 Nov 2012, Damien Cassou  wrote:
> Signed-off-by: Damien Cassou 
> ---
>  emacs/notmuch-show.el   |9 +
>  emacs/notmuch-tagger.el |   33 +
>  2 files changed, 38 insertions(+), 4 deletions(-)
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index 988e27c..379c8cd 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -431,10 +431,11 @@ message at DEPTH in the current thread."
>   (notmuch-show-clean-address (plist-get headers :From))
>   " ("
>   date
> - ") ("
> - (propertize (mapconcat 'identity tags " ")
> - 'face 'notmuch-tag-face)
> - ")\n")
> + ") "
> + (propertize
> +  (format-mode-line (notmuch-tagger-present-tags tags))
> +  'face 'notmuch-tag-face)
> + "\n")
>  (overlay-put (make-overlay start (point)) 'face 
> 'notmuch-message-summary-face)))
>  
>  (defun notmuch-show-insert-header (header header-value)
> diff --git a/emacs/notmuch-tagger.el b/emacs/notmuch-tagger.el
> index 19a6c7e..379a905 100644
> --- a/emacs/notmuch-tagger.el
> +++ b/emacs/notmuch-tagger.el
> @@ -53,12 +53,21 @@ test if the library is present before calling this 
> function."
>(let ((tag (header-button-get button 'notmuch-tagger-tag)))
>  (notmuch-tagger-goto-target tag)))
>  
> +(defun notmuch-tagger-body-button-action (button)
> +  "Open `notmuch-search' for the tag referenced by BUTTON."
> +  (let ((tag (button-get button 'notmuch-tagger-tag)))
> +(notmuch-tagger-goto-target tag)))
> +
>  (eval-after-load "header-button"
>'(define-button-type 'notmuch-tagger-header-button-type
>   'supertype 'header
>   'action#'notmuch-tagger-header-button-action
>   'follow-link t))
>  
> +(define-button-type 'notmuch-tagger-body-button-type
> +  'action#'notmuch-tagger-body-button-action
> +  'follow-link t)
> +
>  (defun notmuch-tagger-really-make-header-link (tag)
> "Return a property list that presents a link to TAG.
>  
> @@ -82,6 +91,19 @@ if not."
>(notmuch-tagger-really-make-header-link tag)
>  tag))
>  
> +(defun notmuch-tagger-make-body-link (tag)
> +  "Return a property list that presents a link to TAG.
> +The returned property list will work everywhere except in the
> +header-line. For a link that works on the header-line, prefer
> +`notmuch-tagger-make-header-link'."
> +  (let ((button (copy-sequence tag)))
> +(make-text-button
> + button nil
> + 'type 'notmuch-tagger-body-button-type
> + 'notmuch-tagger-tag tag
> + 'help-echo (format "%s: Search other messages like this" tag))
> +button))
> +
>  (defun notmuch-tagger-present-tags-header-line (tags)
>"Return a property list to present TAGS in emacs header-line."
>(list
> @@ -91,6 +113,17 @@ if not."
>  " ")
> ")"))
>  
> +(defun notmuch-tagger-present-tags (tags)
> +  "Return a property list to present TAGS in emacs.
> +If tags the result of this function is to be used within the
> +header-line, prefer `notmuch-tagger-present-tags-header-line'
> +instead of this function."
> +  (list
> +   "("
> +   (notmuch-tagger-separate-elems
> +(mapcar #'notmuch-tagger-make-body-link tags)
> +" ")
> +   ")"))
>  
>  (provide 'notmuch-tagger)
>  ;;; notmuch-tagger.el ends here
> -- 
> 1.7.10.4
>
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable

2012-11-18 Thread Damien Cassou
Signed-off-by: Damien Cassou 
---
 emacs/notmuch-show.el   |9 +
 emacs/notmuch-tagger.el |   33 +
 2 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 988e27c..379c8cd 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -431,10 +431,11 @@ message at DEPTH in the current thread."
(notmuch-show-clean-address (plist-get headers :From))
" ("
date
-   ") ("
-   (propertize (mapconcat 'identity tags " ")
-   'face 'notmuch-tag-face)
-   ")\n")
+   ") "
+   (propertize
+(format-mode-line (notmuch-tagger-present-tags tags))
+'face 'notmuch-tag-face)
+   "\n")
 (overlay-put (make-overlay start (point)) 'face 
'notmuch-message-summary-face)))

 (defun notmuch-show-insert-header (header header-value)
diff --git a/emacs/notmuch-tagger.el b/emacs/notmuch-tagger.el
index 19a6c7e..379a905 100644
--- a/emacs/notmuch-tagger.el
+++ b/emacs/notmuch-tagger.el
@@ -53,12 +53,21 @@ test if the library is present before calling this 
function."
   (let ((tag (header-button-get button 'notmuch-tagger-tag)))
 (notmuch-tagger-goto-target tag)))

+(defun notmuch-tagger-body-button-action (button)
+  "Open `notmuch-search' for the tag referenced by BUTTON."
+  (let ((tag (button-get button 'notmuch-tagger-tag)))
+(notmuch-tagger-goto-target tag)))
+
 (eval-after-load "header-button"
   '(define-button-type 'notmuch-tagger-header-button-type
  'supertype 'header
  'action#'notmuch-tagger-header-button-action
  'follow-link t))

+(define-button-type 'notmuch-tagger-body-button-type
+  'action#'notmuch-tagger-body-button-action
+  'follow-link t)
+
 (defun notmuch-tagger-really-make-header-link (tag)
"Return a property list that presents a link to TAG.

@@ -82,6 +91,19 @@ if not."
   (notmuch-tagger-really-make-header-link tag)
 tag))

+(defun notmuch-tagger-make-body-link (tag)
+  "Return a property list that presents a link to TAG.
+The returned property list will work everywhere except in the
+header-line. For a link that works on the header-line, prefer
+`notmuch-tagger-make-header-link'."
+  (let ((button (copy-sequence tag)))
+(make-text-button
+ button nil
+ 'type 'notmuch-tagger-body-button-type
+ 'notmuch-tagger-tag tag
+ 'help-echo (format "%s: Search other messages like this" tag))
+button))
+
 (defun notmuch-tagger-present-tags-header-line (tags)
   "Return a property list to present TAGS in emacs header-line."
   (list
@@ -91,6 +113,17 @@ if not."
 " ")
")"))

+(defun notmuch-tagger-present-tags (tags)
+  "Return a property list to present TAGS in emacs.
+If tags the result of this function is to be used within the
+header-line, prefer `notmuch-tagger-present-tags-header-line'
+instead of this function."
+  (list
+   "("
+   (notmuch-tagger-separate-elems
+(mapcar #'notmuch-tagger-make-body-link tags)
+" ")
+   ")"))

 (provide 'notmuch-tagger)
 ;;; notmuch-tagger.el ends here
-- 
1.7.10.4