Re: [PATCH] emacs: get rid of trailing spaces in notmuch-hello view

2012-04-12 Thread David Bremner
Dmitry Kurochkin dmitry.kuroch...@gmail.com writes:

 This patch removes trailing spaces in notmuch-hello view.

pushed,

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


Re: [PATCH] emacs: get rid of trailing spaces in notmuch-hello view

2012-04-10 Thread Adam Wolfe Gordon
On Fri, Mar 9, 2012 at 20:54, Dmitry Kurochkin
dmitry.kuroch...@gmail.com wrote:
 This patch removes trailing spaces in notmuch-hello view.

 A side effect of this change is that tag/query buttons no longer
 include a space at the end.  This means that pressing RET when the
 point is at the first character after the tag/query button no longer
 works (note that this is the standard behavior for buttons).  We may
 change this behavior in the future (without adding trailing spaces
 back) if people would find this change inconvenient.

LGTM, and works as expected.

(Sorry if you get this twice, Dmitry.)
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] emacs: get rid of trailing spaces in notmuch-hello view

2012-04-10 Thread Tomi Ollila
On Sat, Mar 10 2012, Dmitry Kurochkin dmitry.kuroch...@gmail.com wrote:

 This patch removes trailing spaces in notmuch-hello view.

 A side effect of this change is that tag/query buttons no longer
 include a space at the end.  This means that pressing RET when the
 point is at the first character after the tag/query button no longer
 works (note that this is the standard behavior for buttons).  We may
 change this behavior in the future (without adding trailing spaces
 back) if people would find this change inconvenient.
 ---

LGTM.

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


Re: [PATCH] emacs: get rid of trailing spaces in notmuch-hello view

2012-04-09 Thread Dmitry Kurochkin
Hi all.

I am going to remove needs-review tag from this one since there seems to
be no one interested in reviewing it.  The patch itself may not be
trivial, but it is pretty simple and does not make any critical changes.
So I believe it is safe to push it.  If there are any issues with the
patch discovered later, I am committed to fix them.

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


Re: [PATCH] emacs: get rid of trailing spaces in notmuch-hello view

2012-04-09 Thread David Bremner
Dmitry Kurochkin dmitry.kuroch...@gmail.com writes:

 I am going to remove needs-review tag from this one since there seems to
 be no one interested in reviewing it.  The patch itself may not be
 trivial, but it is pretty simple and does not make any critical changes.
 So I believe it is safe to push it.  If there are any issues with the
 patch discovered later, I am committed to fix them.

Sorry, but if I can't take in the patch at a glance, it needs some
review before I am willing to push it.

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


Re: [PATCH] emacs: get rid of trailing spaces in notmuch-hello view

2012-04-09 Thread Dmitry Kurochkin
David Bremner da...@tethera.net writes:

 Dmitry Kurochkin dmitry.kuroch...@gmail.com writes:

 I am going to remove needs-review tag from this one since there seems to
 be no one interested in reviewing it.  The patch itself may not be
 trivial, but it is pretty simple and does not make any critical changes.
 So I believe it is safe to push it.  If there are any issues with the
 patch discovered later, I am committed to fix them.

 Sorry, but if I can't take in the patch at a glance, it needs some
 review before I am willing to push it.


Ok.  Tagged as needs-review again.  Let's see if I can attract some
attention to the patch on IRC.

Regards,
  Dmitry

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


Re: [PATCH] emacs: get rid of trailing spaces in notmuch-hello view

2012-04-09 Thread Mark Walters

This looks fine to me (but I am not a lisp expert).

Mark

On Sat, 10 Mar 2012, Dmitry Kurochkin dmitry.kuroch...@gmail.com wrote:
 This patch removes trailing spaces in notmuch-hello view.

 A side effect of this change is that tag/query buttons no longer
 include a space at the end.  This means that pressing RET when the
 point is at the first character after the tag/query button no longer
 works (note that this is the standard behavior for buttons).  We may
 change this behavior in the future (without adding trailing spaces
 back) if people would find this change inconvenient.
 ---
  emacs/notmuch-hello.el |   30 
 
  test/emacs |2 +-
  test/emacs.expected-output/notmuch-hello   |2 +-
  .../emacs.expected-output/notmuch-hello-long-names |6 ++--
  .../notmuch-hello-new-section  |2 +-
  .../notmuch-hello-section-counts   |4 +-
  .../notmuch-hello-section-hidden-tag   |2 +-
  .../notmuch-hello-section-with-empty   |2 +-
  .../emacs.expected-output/notmuch-hello-with-empty |2 +-
  9 files changed, 23 insertions(+), 29 deletions(-)

 diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
 index 28f39f1..17f7edd 100644
 --- a/emacs/notmuch-hello.el
 +++ b/emacs/notmuch-hello.el
 @@ -429,7 +429,8 @@ Such a list can be computed with 
 `notmuch-hello-query-counts'.
(let* ((widest (notmuch-hello-longest-label searches))
(tags-and-width (notmuch-hello-tags-per-line widest))
(tags-per-line (car tags-and-width))
 -  (widest (cdr tags-and-width))
 +  (column-width (cdr tags-and-width))
 +  (column-indent 0)
(count 0)
(reordered-list (notmuch-hello-reflect searches tags-per-line))
;; Hack the display of the buttons used.
 @@ -441,32 +442,25 @@ Such a list can be computed with 
 `notmuch-hello-query-counts'.
  (mapc (lambda (elem)
   ;; (not elem) indicates an empty slot in the matrix.
   (when elem
 +   (if ( column-indent 0)
 +   (widget-insert (make-string column-indent ? )))
 (let* ((name (first elem))
(query (second elem))
 -  (msg-count (third elem))
 -  (formatted-name (format %s  name)))
 +  (msg-count (third elem)))
   (widget-insert (format %8s 
  (notmuch-hello-nice-number msg-count)))
 - (if (string= formatted-name notmuch-hello-target)
 + (if (string= name notmuch-hello-target)
   (setq found-target-pos (point-marker)))
   (widget-create 'push-button
  :notify #'notmuch-hello-widget-search
  :notmuch-search-terms query
 -formatted-name)
 - (unless (eq (% count tags-per-line) (1- tags-per-line))
 -   ;; If this is not the last tag on the line, insert
 -   ;; enough space to consume the rest of the column.
 -   ;; Because the button for the name is `(1+ (length
 -   ;; name))' long (due to the trailing space) we can
 -   ;; just insert `(- widest (length name))' spaces - the
 -   ;; column separator is included in the button if
 -   ;; `(equal widest (length name)'.
 -   (widget-insert (make-string (max 0
 -(- widest (length name)))
 -   ? )
 +name)
 + (setq column-indent
 +   (1+ (max 0 (- column-width (length name)))
   (setq count (1+ count))
 - (if (eq (% count tags-per-line) 0)
 - (widget-insert \n)))
 + (when (eq (% count tags-per-line) 0)
 +   (setq column-indent 0)
 +   (widget-insert \n)))
 reordered-list)
  
  ;; If the last line was not full (and hence did not include a
 diff --git a/test/emacs b/test/emacs
 index 29a489c..42780af 100755
 --- a/test/emacs
 +++ b/test/emacs
 @@ -39,7 +39,7 @@ test_begin_subtest Navigation of notmuch-hello to search 
 results
  test_emacs '(notmuch-hello)
   (goto-char (point-min))
   (re-search-forward inbox)
 - (widget-button-press (point))
 + (widget-button-press (1- (point)))
   (notmuch-test-wait)
   (test-output)'
  test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-view-inbox
 diff --git a/test/emacs.expected-output/notmuch-hello 
 b/test/emacs.expected-output/notmuch-hello
 index 1470790..2d69891 100644
 --- a/test/emacs.expected-output/notmuch-hello
 +++ b/test/emacs.expected-output/notmuch-hello
 @@ -2,7 +2,7 @@
  
  Saved searches: [edit]
  
 -   52 inbox   52 unread
 +   52 inbox   52 unread
  
  Search: