]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: add invisible dot instead of space at the end of notmuch-hello search box
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Thu, 19 Jan 2012 23:52:14 +0000 (00:52 +0100)
committerDavid Bremner <bremner@debian.org>
Sat, 21 Jan 2012 12:50:48 +0000 (08:50 -0400)
This makes `show-trailing-whitespace' happy, i.e. it does not mark the
whole search box line as trailing spaces.

Since the dot is invisible, this change makes no visible difference
for `notmuch-hello'.

Edited-by: Pieter Praet <pieter@praet.org> to fix the tests.
emacs/notmuch-hello.el
test/emacs.expected-output/notmuch-hello
test/emacs.expected-output/notmuch-hello-no-saved-searches
test/emacs.expected-output/notmuch-hello-with-empty

index ba48cd639467e94f824617034ac87c68169dfdd6..1a61768d50d4c6f4c07827c8bff4f34fdc0f133c 100644 (file)
@@ -511,9 +511,12 @@ Complete list of currently available key bindings:
                                       (length "Search: ")))
                       :action (lambda (widget &rest ignore)
                                 (notmuch-hello-search (widget-value widget))))
                                       (length "Search: ")))
                       :action (lambda (widget &rest ignore)
                                 (notmuch-hello-search (widget-value widget))))
-       ;; add an invisible space to make `widget-end-of-line' ignore
-       ;; trailine spaces in the search widget field
-       (widget-insert " ")
+       ;; Add an invisible dot to make `widget-end-of-line' ignore
+       ;; trailing spaces in the search widget field.  A dot is used
+       ;; instead of a space to make `show-trailing-whitespace'
+       ;; happy, i.e. avoid it marking the whole line as trailing
+       ;; spaces.
+       (widget-insert ".")
        (put-text-property (1- (point)) (point) 'invisible t)
        (widget-insert "\n")
 
        (put-text-property (1- (point)) (point) 'invisible t)
        (widget-insert "\n")
 
index de57de250b2c938cf5fc4f68e2954b1f9c319240..196112e85a2308c2ce98794291b04da15726e634 100644 (file)
@@ -4,7 +4,7 @@ Saved searches: [edit]
 
          52 inbox           52 unread    
 
 
          52 inbox           52 unread    
 
-Search:                                                                      
+Search:                                                                     .
 
 [Show all tags]
 
 
 [Show all tags]
 
index f1fc4d6a956051b2778c7a5638ce92b839519beb..f4cfe49c4556f0de6839adfa55c59b2e055868a2 100644 (file)
@@ -1,6 +1,6 @@
    Welcome to notmuch. You have 52 messages.
 
    Welcome to notmuch. You have 52 messages.
 
-Search:                                                                      
+Search:                                                                     .
 
 [Show all tags]
 
 
 [Show all tags]
 
index dd8728b17cfc35438f9a086acc08eac8bb3e5103..a860a7237389333234476d386a13f025ae5eca6d 100644 (file)
@@ -4,7 +4,7 @@ Saved searches: [edit]
 
          52 inbox           52 unread           0 empty     
 
 
          52 inbox           52 unread           0 empty     
 
-Search:                                                                      
+Search:                                                                     .
 
 [Show all tags]
 
 
 [Show all tags]