unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH v2] emacs: display tags in notmuch-show with links
@ 2012-11-18 19:18 Damien Cassou
  2012-11-18 19:18 ` [PATCH 1/4] Add a thread's tags to emacs header-line Damien Cassou
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Damien Cassou @ 2012-11-18 19:18 UTC (permalink / raw)
  To: notmuch mailing list

This patch obsoletes
id:1352565719-12397-1-git-send-email-damien.cassou@gmail.com

[PATCH 1/4] emacs: Add a thread's tags to emacs header-line
[PATCH 2/4] emacs: Make tags in header-line clickable
[PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable
[PATCH 4/4] emacs: Add unit-tests for clickable tags in notmuch-show

This patch makes clickable all tags that appear in notmuch-show
buffers. Each tag is a link to open a new notmuch-search buffer for
this tag. Additionally, the buffer's header-line now shows the
thread's tags (clickable only if the `header-button' library is loaded
or loadable).

This patch is the first one of an upcoming series whose goal is to
integrate notmuch-labeler into notmuch. See the following for more
details:
https://github.com/DamienCassou/notmuch-labeler

With respect to v2, I took care of the comments you made:
- The header-button library is not attached to the patch anymore. The
  tags in the header-line are always displayed but made clickable only
  if the library is loaded or loadable.
- The large patch is separated into a series of 4 smaller patches.

You can follow this patch series on
https://github.com/DamienCassou/notmuch/tree/labeler-integration-slow

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 1/4] Add a thread's tags to emacs header-line
  2012-11-18 19:18 [PATCH v2] emacs: display tags in notmuch-show with links Damien Cassou
@ 2012-11-18 19:18 ` Damien Cassou
  2012-11-20  5:13   ` Austin Clements
  2012-11-18 19:18 ` [PATCH 2/4] Make tags in header-line clickable Damien Cassou
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 21+ messages in thread
From: Damien Cassou @ 2012-11-18 19:18 UTC (permalink / raw)
  To: notmuch mailing list

Signed-off-by: Damien Cassou <damien.cassou@gmail.com>
---
 emacs/notmuch-show.el   |   24 +++++++++++++++++++++---
 emacs/notmuch-tagger.el |   44 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+), 3 deletions(-)
 create mode 100644 emacs/notmuch-tagger.el

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 5b3e70e..988e27c 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -36,6 +36,7 @@
 (require 'notmuch-mua)
 (require 'notmuch-crypto)
 (require 'notmuch-print)
+(require 'notmuch-tagger)
 
 (declare-function notmuch-call-notmuch-process "notmuch" (&rest args))
 (declare-function notmuch-fontify-headers "notmuch" nil)
@@ -1121,11 +1122,28 @@ function is used."
 
       (jit-lock-register #'notmuch-show-buttonise-links)
 
-      ;; Set the header line to the subject of the first message.
-      (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-subject)))
-
+      (notmuch-show-update-header-line)
       (run-hooks 'notmuch-show-hook))))
 
+(defun notmuch-show-thread-tags ()
+  "Return the list of tags for the current thread."
+  (let ((tags (list)))
+    (notmuch-show-mapc (lambda ()
+			 (mapcar (lambda (elt)
+				   ;; Avoid adding duplicate tags
+				   (add-to-list 'tags elt))
+				 (notmuch-show-get-tags))))
+    tags))
+
+(defun notmuch-show-update-header-line ()
+  "Make the header-line show the thread's subject and tags."
+  (let ((thread-subject (notmuch-show-strip-re (notmuch-show-get-subject))))
+    (setq header-line-format
+	  (list
+	   thread-subject
+	   " "
+	   (notmuch-tagger-present-tags-header-line (notmuch-show-thread-tags))))))
+
 (defun notmuch-show-capture-state ()
   "Capture the state of the current buffer.
 
diff --git a/emacs/notmuch-tagger.el b/emacs/notmuch-tagger.el
new file mode 100644
index 0000000..5ca190e
--- /dev/null
+++ b/emacs/notmuch-tagger.el
@@ -0,0 +1,44 @@
+;; notmuch-tagger.el --- Library to improve the way tags are displayed
+;;
+;; Copyright © Damien Cassou
+;;
+;; This file is part of Notmuch.
+;;
+;; Notmuch is free software: you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; Notmuch is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with Notmuch.  If not, see <http://www.gnu.org/licenses/>.
+;;
+;; Authors: Damien Cassou <damien.cassou@gmail.com>
+;;; Commentary:
+;;
+;;; Code:
+;;
+(defun notmuch-tagger-separate-elems (list sep)
+  "Return a list with all elements of LIST separated by SEP."
+  (let ((first t)
+        (res nil))
+    (dolist (elt (reverse list) res)
+      (unless first
+        (push sep res))
+      (setq first nil)
+      (push elt res))))
+
+(defun notmuch-tagger-present-tags-header-line (tags)
+  "Return a property list to present TAGS in emacs header-line."
+  (list
+   "("
+   (notmuch-tagger-separate-elems tags " ")
+   ")"))
+
+
+(provide 'notmuch-tagger)
+;;; notmuch-tagger.el ends here
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 2/4] Make tags in header-line clickable
  2012-11-18 19:18 [PATCH v2] emacs: display tags in notmuch-show with links Damien Cassou
  2012-11-18 19:18 ` [PATCH 1/4] Add a thread's tags to emacs header-line Damien Cassou
@ 2012-11-18 19:18 ` Damien Cassou
  2012-11-18 19:18 ` [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable Damien Cassou
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 21+ messages in thread
From: Damien Cassou @ 2012-11-18 19:18 UTC (permalink / raw)
  To: notmuch mailing list

Signed-off-by: Damien Cassou <damien.cassou@gmail.com>
---
 emacs/notmuch-tagger.el |   54 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 53 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-tagger.el b/emacs/notmuch-tagger.el
index 5ca190e..19a6c7e 100644
--- a/emacs/notmuch-tagger.el
+++ b/emacs/notmuch-tagger.el
@@ -32,11 +32,63 @@
       (setq first nil)
       (push elt res))))
 
+(defun notmuch-tagger-header-button-present-p ()
+  "Check if `header-button' can be loaded or is already loaded.
+
+`header-button' is a third-party library which facilitates the
+creation of links in emacs header-line. This function tries to
+`require' `header-button' and returns nil if and only if this
+fails."
+  (require 'header-button nil t))
+
+(defun notmuch-tagger-goto-target (tag)
+  "Show a `notmuch-search' buffer for the TAG."
+  (notmuch-search (concat "tag:" tag)))
+
+(defun notmuch-tagger-header-button-action (button)
+  "Open `notmuch-search' for the tag referenced by BUTTON.
+This function depends on the presence of the `header-button'
+library. Please call `notmuch-tagger-header-button-present-p' to
+test if the library is present before calling this function."
+  (let ((tag (header-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))
+
+(defun notmuch-tagger-really-make-header-link (tag)
+   "Return a property list that presents a link to TAG.
+
+The returned property list will only work in the header-line.
+Additionally, this function depends on the presence of the
+`header-button' library. Please call
+`notmuch-tagger-header-button-present-p' to test if library is
+present before calling this function."
+   (header-button-format
+    tag
+    :type 'notmuch-tagger-header-button-type
+    'notmuch-tagger-tag tag
+    'help-echo (format "%s: Search other messages like this" tag)))
+
+(defun notmuch-tagger-make-header-link (tag)
+  "Return a property list to present TAG as a link to search.
+
+This only works if `header-button' is loaded. Simply returns tag
+if not."
+  (if (notmuch-tagger-header-button-present-p)
+      (notmuch-tagger-really-make-header-link tag)
+    tag))
+
 (defun notmuch-tagger-present-tags-header-line (tags)
   "Return a property list to present TAGS in emacs header-line."
   (list
    "("
-   (notmuch-tagger-separate-elems tags " ")
+   (notmuch-tagger-separate-elems
+    (mapcar #'notmuch-tagger-make-header-link tags)
+            " ")
    ")"))
 
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable
  2012-11-18 19:18 [PATCH v2] emacs: display tags in notmuch-show with links Damien Cassou
  2012-11-18 19:18 ` [PATCH 1/4] Add a thread's tags to emacs header-line Damien Cassou
  2012-11-18 19:18 ` [PATCH 2/4] Make tags in header-line clickable Damien Cassou
@ 2012-11-18 19:18 ` Damien Cassou
  2012-11-18 23:06   ` Mark Walters
  2012-11-20  5:32   ` Austin Clements
  2012-11-18 19:18 ` [PATCH 4/4] emacs: Add unit-tests for clickable tags in notmuch-show Damien Cassou
  2012-11-18 22:59 ` [PATCH v2] emacs: display tags in notmuch-show with links Ethan Glasser-Camp
  4 siblings, 2 replies; 21+ messages in thread
From: Damien Cassou @ 2012-11-18 19:18 UTC (permalink / raw)
  To: notmuch mailing list

Signed-off-by: Damien Cassou <damien.cassou@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 4/4] emacs: Add unit-tests for clickable tags in notmuch-show
  2012-11-18 19:18 [PATCH v2] emacs: display tags in notmuch-show with links Damien Cassou
                   ` (2 preceding siblings ...)
  2012-11-18 19:18 ` [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable Damien Cassou
@ 2012-11-18 19:18 ` Damien Cassou
  2012-11-18 22:59 ` [PATCH v2] emacs: display tags in notmuch-show with links Ethan Glasser-Camp
  4 siblings, 0 replies; 21+ messages in thread
From: Damien Cassou @ 2012-11-18 19:18 UTC (permalink / raw)
  To: notmuch mailing list

Signed-off-by: Damien Cassou <damien.cassou@gmail.com>
---
 test/emacs |   62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/test/emacs b/test/emacs
index 77265b0..2335bc4 100755
--- a/test/emacs
+++ b/test/emacs
@@ -813,5 +813,67 @@ test_emacs "(let ((mm-text-html-renderer
 test_expect_success "Rendering HTML mail with images" \
     'grep -q smiley OUTPUT'
 
+test_begin_subtest "Extracting all tags from a thread"
+add_message \
+    '[subject]="Extracting all tags from a thread"' \
+    '[body]="body 1"'
+parent=${gen_msg_id}
+add_message \
+    '[subject]="Extracting all tags from a thread"' \
+    '[body]="body 2"' \
+    "[in-reply-to]=\<$parent\>"
+add_message \
+    '[subject]="Extracting all tags from a thread"' \
+    '[body]="body 3"' \
+    "[in-reply-to]=\<$parent\>"
+latest=${gen_msg_id}
+# Extract the thread-id from one of the emails
+thread_id=$(notmuch search --output=threads id:${latest})
+echo THREAD ID: '"'$thread_id'"'
+# Add tag "mytagfoo" to one of the emails
+notmuch tag +mytagfoo id:${latest}
+test_emacs_expect_t \
+    "(notmuch-show \"${thread_id}\")
+     (let ((output (notmuch-show-thread-tags))
+           (expected '(\"inbox\" \"mytagfoo\" \"unread\")))
+      (notmuch-test-expect-equal
+         (sort output #'string<)
+         (sort expected #'string<)))"
+
+test_begin_subtest "The tags appear in the header-line of notmuch-show"
+add_message \
+    '[subject]="foo bar"' \
+    '[body]="body 1"'
+parent=${gen_msg_id}
+# Add tag "mytagfoo" to one of the emails
+notmuch tag +mytagfoo id:${parent}
+# Extract the thread-id from one of the emails
+thread_id=$(notmuch search --output=threads id:${latest})
+test_emacs_expect_t \
+    "(notmuch-show \"${thread_id}\")
+     (if (string-match-p \"mytagfoo\" (format-mode-line header-line-format))
+         t
+       \"The tag mytagfoo was not in the header-line-format\")"
+
+test_begin_subtest "The tags of notmuch-show emails are clickable"
+add_message \
+    '[subject]="foo bar"' \
+    '[body]="body 1"'
+parent=${gen_msg_id}
+# Add tag "mytagfoo" to one of the emails
+notmuch tag +mytagfoo id:${parent}
+# Extract the thread-id from one of the emails
+thread_id=$(notmuch search --output=threads id:${latest})
+test_emacs_expect_t \
+    "(notmuch-show \"${thread_id}\")
+    (goto-char (point-min))
+    (re-search-forward \"mytagfoo\")
+    (backward-char) ;; to be 'in' the tag
+    (unless (eq major-mode 'notmuch-show-mode)
+       (error \"We must be in notmuch-show at this point but we are in %s.\" major-mode))
+    (push-button) ;; simulate a press on the RET key
+    (if (eq major-mode 'notmuch-search-mode)
+        t
+       (format \"We must be in notmuch-search at this point but we are in %s.\" major-mode))"
 
 test_done
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH v2] emacs: display tags in notmuch-show with links
  2012-11-18 19:18 [PATCH v2] emacs: display tags in notmuch-show with links Damien Cassou
                   ` (3 preceding siblings ...)
  2012-11-18 19:18 ` [PATCH 4/4] emacs: Add unit-tests for clickable tags in notmuch-show Damien Cassou
@ 2012-11-18 22:59 ` Ethan Glasser-Camp
  2012-11-19  0:10   ` Aaron Ecay
                     ` (2 more replies)
  4 siblings, 3 replies; 21+ messages in thread
From: Ethan Glasser-Camp @ 2012-11-18 22:59 UTC (permalink / raw)
  To: Damien Cassou, notmuch mailing list

Damien Cassou <damien.cassou@gmail.com> writes:

> This patch obsoletes
> id:1352565719-12397-1-git-send-email-damien.cassou@gmail.com
>
> [PATCH 1/4] emacs: Add a thread's tags to emacs header-line
> [PATCH 2/4] emacs: Make tags in header-line clickable
> [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable
> [PATCH 4/4] emacs: Add unit-tests for clickable tags in notmuch-show
>
> This patch makes clickable all tags that appear in notmuch-show
> buffers. Each tag is a link to open a new notmuch-search buffer for
> this tag. Additionally, the buffer's header-line now shows the
> thread's tags (clickable only if the `header-button' library is loaded
> or loadable).

Looks fine to me. Let me just get the notes from my bikeshed, in case
you get asked to roll another version :)

- You might want to use #' on lambdas.

- It bothers me how similar notmuch-tagger-{body,header}-button-action
  are. I thought it might be better to unify them by seeing what type
  the button argument was. Here's my (untested) approach which you might
  find prettier or uglier.

(notmuch-tagger-all-button-get (button attrib)
  "Utility function to do button-get on different kinds of buttons."
  (cond
    ((integer-or-marker-p button)
      (button-get button attrib))
    ((and (featurep 'header-button)
          (listp button))
      (header-button-get button attrib))
    (t (error "unknown type of button %s" button))

- The comment for notmuch-tagger-make-body-link reads that it will work
  "everywhere except in the header-line". Does this mean mode-line, menu
  bar, or what? How about just "won't work in the header-line"?

- In patch 3:

 +If tags the result of this function is to be used within the

I think this should just read "If the result".

Ethan

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable
  2012-11-18 19:18 ` [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable Damien Cassou
@ 2012-11-18 23:06   ` Mark Walters
  2012-11-22 18:40     ` Damien Cassou
  2012-11-20  5:32   ` Austin Clements
  1 sibling, 1 reply; 21+ messages in thread
From: Mark Walters @ 2012-11-18 23:06 UTC (permalink / raw)
  To: Damien Cassou, notmuch mailing list


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 <damien.cassou@gmail.com> wrote:
> Signed-off-by: Damien Cassou <damien.cassou@gmail.com>
> ---
>  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@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2] emacs: display tags in notmuch-show with links
  2012-11-18 22:59 ` [PATCH v2] emacs: display tags in notmuch-show with links Ethan Glasser-Camp
@ 2012-11-19  0:10   ` Aaron Ecay
  2012-11-20  4:23   ` Austin Clements
  2012-11-22 18:11   ` Damien Cassou
  2 siblings, 0 replies; 21+ messages in thread
From: Aaron Ecay @ 2012-11-19  0:10 UTC (permalink / raw)
  To: Ethan Glasser-Camp, Damien Cassou, notmuch mailing list

2012ko azaroak 18an, Ethan Glasser-Camp-ek idatzi zuen:
> 
> - You might want to use #' on lambdas.

This is actually unnecessary – as the info node "(elisp) Anonymous
Functions" says, the forms with and without #' are equivalent.  The
current notmuch style is not to have #' on lambdas (that is, there are 0
instances of #'(lambda ...) in the code base).  IMO that’s correct:
the unnecessary #' is just line-noise-ish.

-- 
Aaron Ecay

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2] emacs: display tags in notmuch-show with links
  2012-11-18 22:59 ` [PATCH v2] emacs: display tags in notmuch-show with links Ethan Glasser-Camp
  2012-11-19  0:10   ` Aaron Ecay
@ 2012-11-20  4:23   ` Austin Clements
  2012-11-20  4:50     ` Ethan
  2012-11-22 18:11   ` Damien Cassou
  2 siblings, 1 reply; 21+ messages in thread
From: Austin Clements @ 2012-11-20  4:23 UTC (permalink / raw)
  To: Ethan Glasser-Camp; +Cc: notmuch mailing list

Quoth Ethan Glasser-Camp on Nov 18 at  5:59 pm:
> Damien Cassou <damien.cassou@gmail.com> writes:
> 
> > This patch obsoletes
> > id:1352565719-12397-1-git-send-email-damien.cassou@gmail.com
> >
> > [PATCH 1/4] emacs: Add a thread's tags to emacs header-line
> > [PATCH 2/4] emacs: Make tags in header-line clickable
> > [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable
> > [PATCH 4/4] emacs: Add unit-tests for clickable tags in notmuch-show
> >
> > This patch makes clickable all tags that appear in notmuch-show
> > buffers. Each tag is a link to open a new notmuch-search buffer for
> > this tag. Additionally, the buffer's header-line now shows the
> > thread's tags (clickable only if the `header-button' library is loaded
> > or loadable).
> 
> Looks fine to me. Let me just get the notes from my bikeshed, in case
> you get asked to roll another version :)
> 
> - You might want to use #' on lambdas.
> 
> - It bothers me how similar notmuch-tagger-{body,header}-button-action
>   are. I thought it might be better to unify them by seeing what type
>   the button argument was. Here's my (untested) approach which you might
>   find prettier or uglier.
> 
> (notmuch-tagger-all-button-get (button attrib)
>   "Utility function to do button-get on different kinds of buttons."
>   (cond
>     ((integer-or-marker-p button)
>       (button-get button attrib))
>     ((and (featurep 'header-button)
>           (listp button))
>       (header-button-get button attrib))
>     (t (error "unknown type of button %s" button))

This seems like overkill given that all of the common code in
notmuch-tagger-{body,header}-button-action is already abstracted into
a common function.  Were there other places where code was duplicated
because of the difference between regular buttons and header buttons?

> - The comment for notmuch-tagger-make-body-link reads that it will work
>   "everywhere except in the header-line". Does this mean mode-line, menu
>   bar, or what? How about just "won't work in the header-line"?
> 
> - In patch 3:
> 
>  +If tags the result of this function is to be used within the
> 
> I think this should just read "If the result".
> 
> Ethan

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2] emacs: display tags in notmuch-show with links
  2012-11-20  4:23   ` Austin Clements
@ 2012-11-20  4:50     ` Ethan
  0 siblings, 0 replies; 21+ messages in thread
From: Ethan @ 2012-11-20  4:50 UTC (permalink / raw)
  To: Austin Clements; +Cc: notmuch mailing list

[-- Attachment #1: Type: text/plain, Size: 446 bytes --]

On Mon, Nov 19, 2012 at 11:23 PM, Austin Clements <amdragon@mit.edu> wrote:

> This seems like overkill given that all of the common code in
> notmuch-tagger-{body,header}-button-action is already abstracted into
> a common function.  Were there other places where code was duplicated
> because of the difference between regular buttons and header buttons?
>

I guess you're right, that's the only place and it isn't worth worrying
about.

Ethan

[-- Attachment #2: Type: text/html, Size: 731 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 1/4] Add a thread's tags to emacs header-line
  2012-11-18 19:18 ` [PATCH 1/4] Add a thread's tags to emacs header-line Damien Cassou
@ 2012-11-20  5:13   ` Austin Clements
  2012-11-20  5:32     ` Austin Clements
  0 siblings, 1 reply; 21+ messages in thread
From: Austin Clements @ 2012-11-20  5:13 UTC (permalink / raw)
  To: Damien Cassou; +Cc: notmuch mailing list

Quoth Damien Cassou on Nov 18 at  8:18 pm:
> Signed-off-by: Damien Cassou <damien.cassou@gmail.com>
> ---
>  emacs/notmuch-show.el   |   24 +++++++++++++++++++++---
>  emacs/notmuch-tagger.el |   44 ++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 65 insertions(+), 3 deletions(-)
>  create mode 100644 emacs/notmuch-tagger.el
> 
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index 5b3e70e..988e27c 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -36,6 +36,7 @@
>  (require 'notmuch-mua)
>  (require 'notmuch-crypto)
>  (require 'notmuch-print)
> +(require 'notmuch-tagger)
>  
>  (declare-function notmuch-call-notmuch-process "notmuch" (&rest args))
>  (declare-function notmuch-fontify-headers "notmuch" nil)
> @@ -1121,11 +1122,28 @@ function is used."
>  
>        (jit-lock-register #'notmuch-show-buttonise-links)
>  
> -      ;; Set the header line to the subject of the first message.
> -      (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-subject)))
> -
> +      (notmuch-show-update-header-line)
>        (run-hooks 'notmuch-show-hook))))
>  
> +(defun notmuch-show-thread-tags ()
> +  "Return the list of tags for the current thread."
> +  (let ((tags (list)))
> +    (notmuch-show-mapc (lambda ()
> +			 (mapcar (lambda (elt)
> +				   ;; Avoid adding duplicate tags
> +				   (add-to-list 'tags elt))
> +				 (notmuch-show-get-tags))))
> +    tags))
> +
> +(defun notmuch-show-update-header-line ()
> +  "Make the header-line show the thread's subject and tags."
> +  (let ((thread-subject (notmuch-show-strip-re (notmuch-show-get-subject))))
> +    (setq header-line-format
> +	  (list
> +	   thread-subject
> +	   " "
> +	   (notmuch-tagger-present-tags-header-line (notmuch-show-thread-tags))))))
> +
>  (defun notmuch-show-capture-state ()
>    "Capture the state of the current buffer.
>  
> diff --git a/emacs/notmuch-tagger.el b/emacs/notmuch-tagger.el
> new file mode 100644
> index 0000000..5ca190e
> --- /dev/null
> +++ b/emacs/notmuch-tagger.el
> @@ -0,0 +1,44 @@
> +;; notmuch-tagger.el --- Library to improve the way tags are displayed
> +;;
> +;; Copyright © Damien Cassou
> +;;
> +;; This file is part of Notmuch.
> +;;
> +;; Notmuch is free software: you can redistribute it and/or modify it
> +;; under the terms of the GNU General Public License as published by
> +;; the Free Software Foundation, either version 3 of the License, or
> +;; (at your option) any later version.
> +;;
> +;; Notmuch is distributed in the hope that it will be useful, but
> +;; WITHOUT ANY WARRANTY; without even the implied warranty of
> +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +;; General Public License for more details.
> +;;
> +;; You should have received a copy of the GNU General Public License
> +;; along with Notmuch.  If not, see <http://www.gnu.org/licenses/>.
> +;;
> +;; Authors: Damien Cassou <damien.cassou@gmail.com>
> +;;; Commentary:
> +;;
> +;;; Code:
> +;;
> +(defun notmuch-tagger-separate-elems (list sep)

notmuch-tagger-intersperse?

This could also reasonably go in notmuch-lib.el as a general utility.

(How do neither Elisp nor 'cl have an intersperse?)

> +  "Return a list with all elements of LIST separated by SEP."
> +  (let ((first t)
> +        (res nil))
> +    (dolist (elt (reverse list) res)

(dolist (elt list (nreverse res)) ...) to save a list copy?

> +      (unless first
> +        (push sep res))
> +      (setq first nil)
> +      (push elt res))))
> +
> +(defun notmuch-tagger-present-tags-header-line (tags)
> +  "Return a property list to present TAGS in emacs header-line."
> +  (list
> +   "("
> +   (notmuch-tagger-separate-elems tags " ")
> +   ")"))
> +
> +
> +(provide 'notmuch-tagger)
> +;;; notmuch-tagger.el ends here

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 1/4] Add a thread's tags to emacs header-line
  2012-11-20  5:13   ` Austin Clements
@ 2012-11-20  5:32     ` Austin Clements
  2012-11-22 18:36       ` Damien Cassou
  0 siblings, 1 reply; 21+ messages in thread
From: Austin Clements @ 2012-11-20  5:32 UTC (permalink / raw)
  To: Damien Cassou; +Cc: notmuch mailing list

Sorry, I was a little trigger-happy on the send.  A few more comments
below.

Quoth myself on Nov 20 at 12:13 am:
> Quoth Damien Cassou on Nov 18 at  8:18 pm:
> > Signed-off-by: Damien Cassou <damien.cassou@gmail.com>
> > ---
> >  emacs/notmuch-show.el   |   24 +++++++++++++++++++++---
> >  emacs/notmuch-tagger.el |   44 ++++++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 65 insertions(+), 3 deletions(-)
> >  create mode 100644 emacs/notmuch-tagger.el
> > 
> > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> > index 5b3e70e..988e27c 100644
> > --- a/emacs/notmuch-show.el
> > +++ b/emacs/notmuch-show.el
> > @@ -36,6 +36,7 @@
> >  (require 'notmuch-mua)
> >  (require 'notmuch-crypto)
> >  (require 'notmuch-print)
> > +(require 'notmuch-tagger)
> >  
> >  (declare-function notmuch-call-notmuch-process "notmuch" (&rest args))
> >  (declare-function notmuch-fontify-headers "notmuch" nil)
> > @@ -1121,11 +1122,28 @@ function is used."
> >  
> >        (jit-lock-register #'notmuch-show-buttonise-links)
> >  
> > -      ;; Set the header line to the subject of the first message.
> > -      (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-subject)))
> > -
> > +      (notmuch-show-update-header-line)
> >        (run-hooks 'notmuch-show-hook))))
> >  
> > +(defun notmuch-show-thread-tags ()
> > +  "Return the list of tags for the current thread."
> > +  (let ((tags (list)))
> > +    (notmuch-show-mapc (lambda ()
> > +			 (mapcar (lambda (elt)
> > +				   ;; Avoid adding duplicate tags
> > +				   (add-to-list 'tags elt))
> > +				 (notmuch-show-get-tags))))
> > +    tags))
> > +
> > +(defun notmuch-show-update-header-line ()
> > +  "Make the header-line show the thread's subject and tags."
> > +  (let ((thread-subject (notmuch-show-strip-re (notmuch-show-get-subject))))
> > +    (setq header-line-format
> > +	  (list
> > +	   thread-subject
> > +	   " "
> > +	   (notmuch-tagger-present-tags-header-line (notmuch-show-thread-tags))))))
> > +
> >  (defun notmuch-show-capture-state ()
> >    "Capture the state of the current buffer.
> >  
> > diff --git a/emacs/notmuch-tagger.el b/emacs/notmuch-tagger.el
> > new file mode 100644
> > index 0000000..5ca190e
> > --- /dev/null
> > +++ b/emacs/notmuch-tagger.el
> > @@ -0,0 +1,44 @@
> > +;; notmuch-tagger.el --- Library to improve the way tags are displayed
> > +;;
> > +;; Copyright © Damien Cassou
> > +;;
> > +;; This file is part of Notmuch.
> > +;;
> > +;; Notmuch is free software: you can redistribute it and/or modify it
> > +;; under the terms of the GNU General Public License as published by
> > +;; the Free Software Foundation, either version 3 of the License, or
> > +;; (at your option) any later version.
> > +;;
> > +;; Notmuch is distributed in the hope that it will be useful, but
> > +;; WITHOUT ANY WARRANTY; without even the implied warranty of
> > +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> > +;; General Public License for more details.
> > +;;
> > +;; You should have received a copy of the GNU General Public License
> > +;; along with Notmuch.  If not, see <http://www.gnu.org/licenses/>.
> > +;;
> > +;; Authors: Damien Cassou <damien.cassou@gmail.com>
> > +;;; Commentary:
> > +;;
> > +;;; Code:
> > +;;
> > +(defun notmuch-tagger-separate-elems (list sep)
> 
> notmuch-tagger-intersperse?
> 
> This could also reasonably go in notmuch-lib.el as a general utility.
> 
> (How do neither Elisp nor 'cl have an intersperse?)
> 
> > +  "Return a list with all elements of LIST separated by SEP."
> > +  (let ((first t)
> > +        (res nil))
> > +    (dolist (elt (reverse list) res)
> 
> (dolist (elt list (nreverse res)) ...) to save a list copy?
> 
> > +      (unless first
> > +        (push sep res))
> > +      (setq first nil)
> > +      (push elt res))))
> > +
> > +(defun notmuch-tagger-present-tags-header-line (tags)

notmuch-tagger-format-tags-header-line?  It doesn't actually present
them (though "format" isn't great either.)

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

This doesn't return a property list, it returns a mode-line-format
template.  Maybe something like,

  "Format TAGS as a mode-line-format template.
The result is suitable for inclusion in `header-line-format' or
`mode-line-format'."

(Is it actually suitable for mode-line-format or do header-line
buttons really only work in the header line?)

> > +  (list
> > +   "("
> > +   (notmuch-tagger-separate-elems tags " ")
> > +   ")"))
> > +
> > +
> > +(provide 'notmuch-tagger)
> > +;;; notmuch-tagger.el ends here

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable
  2012-11-18 19:18 ` [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable Damien Cassou
  2012-11-18 23:06   ` Mark Walters
@ 2012-11-20  5:32   ` Austin Clements
  2012-11-30 16:13     ` Damien Cassou
  1 sibling, 1 reply; 21+ messages in thread
From: Austin Clements @ 2012-11-20  5:32 UTC (permalink / raw)
  To: Damien Cassou; +Cc: notmuch mailing list

Quoth Damien Cassou on Nov 18 at  8:18 pm:
> Signed-off-by: Damien Cassou <damien.cassou@gmail.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2] emacs: display tags in notmuch-show with links
  2012-11-18 22:59 ` [PATCH v2] emacs: display tags in notmuch-show with links Ethan Glasser-Camp
  2012-11-19  0:10   ` Aaron Ecay
  2012-11-20  4:23   ` Austin Clements
@ 2012-11-22 18:11   ` Damien Cassou
  2 siblings, 0 replies; 21+ messages in thread
From: Damien Cassou @ 2012-11-22 18:11 UTC (permalink / raw)
  To: Ethan Glasser-Camp; +Cc: notmuch mailing list

[-- Attachment #1: Type: text/plain, Size: 461 bytes --]

On Sun, Nov 18, 2012 at 11:59 PM, Ethan Glasser-Camp <
ethan.glasser.camp@gmail.com> wrote:

> Looks fine to me. Let me just get the notes from my bikeshed, in case
> you get asked to roll another version :)
>

thanks to all of you for taking the time to review. I will improve and get
back to you.

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

"Success is the ability to go from one failure to another without losing
enthusiasm."
Winston Churchill

[-- Attachment #2: Type: text/html, Size: 882 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 1/4] Add a thread's tags to emacs header-line
  2012-11-20  5:32     ` Austin Clements
@ 2012-11-22 18:36       ` Damien Cassou
  0 siblings, 0 replies; 21+ messages in thread
From: Damien Cassou @ 2012-11-22 18:36 UTC (permalink / raw)
  To: Austin Clements; +Cc: notmuch mailing list

[-- Attachment #1: Type: text/plain, Size: 319 bytes --]

On Tue, Nov 20, 2012 at 6:32 AM, Austin Clements <amdragon@mit.edu> wrote:

> A few more comments


thank you for all your comments, I'm taking care of them

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

"Success is the ability to go from one failure to another without losing
enthusiasm."
Winston Churchill

[-- Attachment #2: Type: text/html, Size: 711 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable
  2012-11-18 23:06   ` Mark Walters
@ 2012-11-22 18:40     ` Damien Cassou
  2012-11-22 18:46       ` Mark Walters
  2012-11-23  8:02       ` Bernard Hurley
  0 siblings, 2 replies; 21+ messages in thread
From: Damien Cassou @ 2012-11-22 18:40 UTC (permalink / raw)
  To: Mark Walters; +Cc: notmuch mailing list

[-- Attachment #1: Type: text/plain, Size: 861 bytes --]

Hi,

On Mon, Nov 19, 2012 at 12:06 AM, Mark Walters <markwalters1009@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?

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

"Success is the ability to go from one failure to another without losing
enthusiasm."
Winston Churchill

[-- Attachment #2: Type: text/html, Size: 1300 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable
  2012-11-22 18:40     ` Damien Cassou
@ 2012-11-22 18:46       ` Mark Walters
  2012-11-23  8:02       ` Bernard Hurley
  1 sibling, 0 replies; 21+ messages in thread
From: Mark Walters @ 2012-11-22 18:46 UTC (permalink / raw)
  To: Damien Cassou; +Cc: notmuch mailing list


On Thu, 22 Nov 2012, Damien Cassou <damien.cassou@gmail.com> wrote:
> Hi,
>
> On Mon, Nov 19, 2012 at 12:06 AM, Mark Walters <markwalters1009@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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable
  2012-11-22 18:40     ` Damien Cassou
  2012-11-22 18:46       ` Mark Walters
@ 2012-11-23  8:02       ` Bernard Hurley
  2012-11-23 11:18         ` Tomi Ollila
  2012-11-30 16:15         ` Damien Cassou
  1 sibling, 2 replies; 21+ messages in thread
From: Bernard Hurley @ 2012-11-23  8:02 UTC (permalink / raw)
  To: Damien Cassou; +Cc: notmuch mailing list

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable
  2012-11-23  8:02       ` Bernard Hurley
@ 2012-11-23 11:18         ` Tomi Ollila
  2012-11-30 16:15         ` Damien Cassou
  1 sibling, 0 replies; 21+ messages in thread
From: Tomi Ollila @ 2012-11-23 11:18 UTC (permalink / raw)
  To: Bernard Hurley; +Cc: notmuch mailing list

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&paste 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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable
  2012-11-20  5:32   ` Austin Clements
@ 2012-11-30 16:13     ` Damien Cassou
  0 siblings, 0 replies; 21+ messages in thread
From: Damien Cassou @ 2012-11-30 16:13 UTC (permalink / raw)
  To: Austin Clements; +Cc: notmuch mailing list

[-- Attachment #1: Type: text/plain, Size: 805 bytes --]

 On Tue, Nov 20, 2012 at 6:32 AM, Austin Clements <amdragon@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

[-- Attachment #2: Type: text/html, Size: 1236 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable
  2012-11-23  8:02       ` Bernard Hurley
  2012-11-23 11:18         ` Tomi Ollila
@ 2012-11-30 16:15         ` Damien Cassou
  1 sibling, 0 replies; 21+ messages in thread
From: Damien Cassou @ 2012-11-30 16:15 UTC (permalink / raw)
  To: Bernard Hurley; +Cc: notmuch mailing list

[-- Attachment #1: Type: text/plain, Size: 810 bytes --]

On Fri, Nov 23, 2012 at 9:02 AM, Bernard Hurley <bernard@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

[-- Attachment #2: Type: text/html, Size: 1247 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2012-11-30 16:15 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-18 19:18 [PATCH v2] emacs: display tags in notmuch-show with links Damien Cassou
2012-11-18 19:18 ` [PATCH 1/4] Add a thread's tags to emacs header-line Damien Cassou
2012-11-20  5:13   ` Austin Clements
2012-11-20  5:32     ` Austin Clements
2012-11-22 18:36       ` Damien Cassou
2012-11-18 19:18 ` [PATCH 2/4] Make tags in header-line clickable Damien Cassou
2012-11-18 19:18 ` [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable Damien Cassou
2012-11-18 23:06   ` Mark Walters
2012-11-22 18:40     ` Damien Cassou
2012-11-22 18:46       ` Mark Walters
2012-11-23  8:02       ` Bernard Hurley
2012-11-23 11:18         ` Tomi Ollila
2012-11-30 16:15         ` Damien Cassou
2012-11-20  5:32   ` Austin Clements
2012-11-30 16:13     ` Damien Cassou
2012-11-18 19:18 ` [PATCH 4/4] emacs: Add unit-tests for clickable tags in notmuch-show Damien Cassou
2012-11-18 22:59 ` [PATCH v2] emacs: display tags in notmuch-show with links Ethan Glasser-Camp
2012-11-19  0:10   ` Aaron Ecay
2012-11-20  4:23   ` Austin Clements
2012-11-20  4:50     ` Ethan
2012-11-22 18:11   ` Damien Cassou

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).