emacs: add invisible dot instead of space at the end of notmuch-hello search box

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.
This commit is contained in:
Dmitry Kurochkin 2012-01-20 00:52:14 +01:00 committed by David Bremner
parent a9a9e374e2
commit d3aa6848da
4 changed files with 9 additions and 6 deletions

View file

@ -511,9 +511,12 @@ Complete list of currently available key bindings:
(length "Search: "))) (length "Search: ")))
:action (lambda (widget &rest ignore) :action (lambda (widget &rest ignore)
(notmuch-hello-search (widget-value widget)))) (notmuch-hello-search (widget-value widget))))
;; add an invisible space to make `widget-end-of-line' ignore ;; Add an invisible dot to make `widget-end-of-line' ignore
;; trailine spaces in the search widget field ;; trailing spaces in the search widget field. A dot is used
(widget-insert " ") ;; 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) (put-text-property (1- (point)) (point) 'invisible t)
(widget-insert "\n") (widget-insert "\n")

View file

@ -4,7 +4,7 @@ Saved searches: [edit]
52 inbox 52 unread 52 inbox 52 unread
Search: Search: .
[Show all tags] [Show all tags]

View 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]

View 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]