* [PATCH] emacs: add insisible space after the search widget field in notmuch-hello
@ 2011-07-04 6:47 Dmitry Kurochkin
2011-07-04 7:24 ` Pieter Praet
2011-11-16 11:00 ` Pieter Praet
0 siblings, 2 replies; 6+ messages in thread
From: Dmitry Kurochkin @ 2011-07-04 6:47 UTC (permalink / raw)
To: notmuch
It is very convenient when C-e (bound to `widget-end-of-line') ignores
trailing spaces inside the search widget. But it only does so if a
widget is not followed by a newline (that is why it works in the saved
search widgets). The patch just adds an insisible space after the
search widget to get the desirable behavior of `widget-end-of-line'.
The extra space is also added to expected results of emacs tests.
---
emacs/notmuch-hello.el | 4 ++++
test/emacs.expected-output/notmuch-hello | 2 +-
.../notmuch-hello-no-saved-searches | 2 +-
.../emacs.expected-output/notmuch-hello-with-empty | 2 +-
4 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 65fde75..1a76c30 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -462,6 +462,10 @@ Complete list of currently available key bindings:
(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 " ")
+ (put-text-property (1- (point)) (point) 'invisible t)
(widget-insert "\n")
(when notmuch-hello-recent-searches
diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello
index 64b7e42..48143bd 100644
--- a/test/emacs.expected-output/notmuch-hello
+++ b/test/emacs.expected-output/notmuch-hello
@@ -4,7 +4,7 @@ Saved searches: [edit]
50 inbox 50 unread
-Search:
+Search:
[Show all tags]
diff --git a/test/emacs.expected-output/notmuch-hello-no-saved-searches b/test/emacs.expected-output/notmuch-hello-no-saved-searches
index 7f8206a..7c09e40 100644
--- a/test/emacs.expected-output/notmuch-hello-no-saved-searches
+++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches
@@ -1,6 +1,6 @@
Welcome to notmuch. You have 50 messages.
-Search:
+Search:
[Show all tags]
diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty
index a9ed630..2a267c9 100644
--- a/test/emacs.expected-output/notmuch-hello-with-empty
+++ b/test/emacs.expected-output/notmuch-hello-with-empty
@@ -4,7 +4,7 @@ Saved searches: [edit]
50 inbox 50 unread 0 empty
-Search:
+Search:
[Show all tags]
--
1.7.5.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] emacs: add insisible space after the search widget field in notmuch-hello
2011-07-04 6:47 [PATCH] emacs: add insisible space after the search widget field in notmuch-hello Dmitry Kurochkin
@ 2011-07-04 7:24 ` Pieter Praet
2011-07-04 7:37 ` Dmitry Kurochkin
2011-11-16 11:00 ` Pieter Praet
1 sibling, 1 reply; 6+ messages in thread
From: Pieter Praet @ 2011-07-04 7:24 UTC (permalink / raw)
To: Dmitry Kurochkin, notmuch
On Mon, 4 Jul 2011 10:47:05 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:
> It is very convenient when C-e (bound to `widget-end-of-line') ignores
> trailing spaces inside the search widget. But it only does so if a
> widget is not followed by a newline (that is why it works in the saved
> search widgets). The patch just adds an insisible space after the
> search widget to get the desirable behavior of `widget-end-of-line'.
> The extra space is also added to expected results of emacs tests.
> ---
> emacs/notmuch-hello.el | 4 ++++
> test/emacs.expected-output/notmuch-hello | 2 +-
> .../notmuch-hello-no-saved-searches | 2 +-
> .../emacs.expected-output/notmuch-hello-with-empty | 2 +-
> 4 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
> index 65fde75..1a76c30 100644
> --- a/emacs/notmuch-hello.el
> +++ b/emacs/notmuch-hello.el
> @@ -462,6 +462,10 @@ Complete list of currently available key bindings:
> (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 " ")
> + (put-text-property (1- (point)) (point) 'invisible t)
> (widget-insert "\n")
>
> (when notmuch-hello-recent-searches
> diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello
> index 64b7e42..48143bd 100644
> --- a/test/emacs.expected-output/notmuch-hello
> +++ b/test/emacs.expected-output/notmuch-hello
> @@ -4,7 +4,7 @@ Saved searches: [edit]
>
> 50 inbox 50 unread
>
> -Search:
> +Search:
>
> [Show all tags]
>
> diff --git a/test/emacs.expected-output/notmuch-hello-no-saved-searches b/test/emacs.expected-output/notmuch-hello-no-saved-searches
> index 7f8206a..7c09e40 100644
> --- a/test/emacs.expected-output/notmuch-hello-no-saved-searches
> +++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches
> @@ -1,6 +1,6 @@
> Welcome to notmuch. You have 50 messages.
>
> -Search:
> +Search:
>
> [Show all tags]
>
> diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty
> index a9ed630..2a267c9 100644
> --- a/test/emacs.expected-output/notmuch-hello-with-empty
> +++ b/test/emacs.expected-output/notmuch-hello-with-empty
> @@ -4,7 +4,7 @@ Saved searches: [edit]
>
> 50 inbox 50 unread 0 empty
>
> -Search:
> +Search:
>
> [Show all tags]
>
> --
> 1.7.5.4
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
Definitely an improvement!
But Kan-Ru Chen posted a similar patch [1] about a year ago,
which I've been keeping in my personal branch (and rebasing)
for way too long.
Care to comment on the differences in approach?
Peace
--
Pieter
[1] id:"1280195325-9066-2-git-send-email-kanru@kanru.info"
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] emacs: add insisible space after the search widget field in notmuch-hello
2011-07-04 7:24 ` Pieter Praet
@ 2011-07-04 7:37 ` Dmitry Kurochkin
2011-07-04 8:09 ` Pieter Praet
0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Kurochkin @ 2011-07-04 7:37 UTC (permalink / raw)
To: Pieter Praet, notmuch
On Mon, 04 Jul 2011 09:24:17 +0200, Pieter Praet <pieter@praet.org> wrote:
> On Mon, 4 Jul 2011 10:47:05 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:
> > It is very convenient when C-e (bound to `widget-end-of-line') ignores
> > trailing spaces inside the search widget. But it only does so if a
> > widget is not followed by a newline (that is why it works in the saved
> > search widgets). The patch just adds an insisible space after the
> > search widget to get the desirable behavior of `widget-end-of-line'.
> > The extra space is also added to expected results of emacs tests.
> > ---
> > emacs/notmuch-hello.el | 4 ++++
> > test/emacs.expected-output/notmuch-hello | 2 +-
> > .../notmuch-hello-no-saved-searches | 2 +-
> > .../emacs.expected-output/notmuch-hello-with-empty | 2 +-
> > 4 files changed, 7 insertions(+), 3 deletions(-)
> >
> > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
> > index 65fde75..1a76c30 100644
> > --- a/emacs/notmuch-hello.el
> > +++ b/emacs/notmuch-hello.el
> > @@ -462,6 +462,10 @@ Complete list of currently available key bindings:
> > (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 " ")
> > + (put-text-property (1- (point)) (point) 'invisible t)
> > (widget-insert "\n")
> >
> > (when notmuch-hello-recent-searches
> > diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello
> > index 64b7e42..48143bd 100644
> > --- a/test/emacs.expected-output/notmuch-hello
> > +++ b/test/emacs.expected-output/notmuch-hello
> > @@ -4,7 +4,7 @@ Saved searches: [edit]
> >
> > 50 inbox 50 unread
> >
> > -Search:
> > +Search:
> >
> > [Show all tags]
> >
> > diff --git a/test/emacs.expected-output/notmuch-hello-no-saved-searches b/test/emacs.expected-output/notmuch-hello-no-saved-searches
> > index 7f8206a..7c09e40 100644
> > --- a/test/emacs.expected-output/notmuch-hello-no-saved-searches
> > +++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches
> > @@ -1,6 +1,6 @@
> > Welcome to notmuch. You have 50 messages.
> >
> > -Search:
> > +Search:
> >
> > [Show all tags]
> >
> > diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty
> > index a9ed630..2a267c9 100644
> > --- a/test/emacs.expected-output/notmuch-hello-with-empty
> > +++ b/test/emacs.expected-output/notmuch-hello-with-empty
> > @@ -4,7 +4,7 @@ Saved searches: [edit]
> >
> > 50 inbox 50 unread 0 empty
> >
> > -Search:
> > +Search:
> >
> > [Show all tags]
> >
> > --
> > 1.7.5.4
> >
> > _______________________________________________
> > notmuch mailing list
> > notmuch@notmuchmail.org
> > http://notmuchmail.org/mailman/listinfo/notmuch
>
>
> Definitely an improvement!
>
>
> But Kan-Ru Chen posted a similar patch [1] about a year ago,
> which I've been keeping in my personal branch (and rebasing)
> for way too long.
>
ouch. I hope Carl reads this and feels your pain :)
> Care to comment on the differences in approach?
>
It is very similar. If I saw this patch earlier, I would not care to
write mine. Comments below.
:size (max 8 (- (window-width) notmuch-hello-indent
- (length "Search: ")))
+ (length "Search: ") 1 ))
Looks like this results in search widget field 1 character shorter than
we have now. And hence not aligned with the recent search lines. I do
not see why we need this.
- (widget-insert "\n")
+ (widget-insert " \n")
That was my first implementation of the patch. Later I changed it to
make the space invisible, so you can not get to it with C-f and C-b. A
small improvement IMO.
I wish I saw Kan-Ru Chen's patches earlier.
Regards,
Dmitry
>
> Peace
>
> --
> Pieter
>
> [1] id:"1280195325-9066-2-git-send-email-kanru@kanru.info"
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] emacs: add insisible space after the search widget field in notmuch-hello
2011-07-04 7:37 ` Dmitry Kurochkin
@ 2011-07-04 8:09 ` Pieter Praet
2011-07-04 8:19 ` Pieter Praet
0 siblings, 1 reply; 6+ messages in thread
From: Pieter Praet @ 2011-07-04 8:09 UTC (permalink / raw)
To: Dmitry Kurochkin, notmuch
On Mon, 04 Jul 2011 11:37:06 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:
> On Mon, 04 Jul 2011 09:24:17 +0200, Pieter Praet <pieter@praet.org> wrote:
> > On Mon, 4 Jul 2011 10:47:05 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:
> > > It is very convenient when C-e (bound to `widget-end-of-line') ignores
> > > trailing spaces inside the search widget. But it only does so if a
> > > widget is not followed by a newline (that is why it works in the saved
> > > search widgets). The patch just adds an insisible space after the
> > > search widget to get the desirable behavior of `widget-end-of-line'.
> > > The extra space is also added to expected results of emacs tests.
> > > ---
> > > emacs/notmuch-hello.el | 4 ++++
> > > test/emacs.expected-output/notmuch-hello | 2 +-
> > > .../notmuch-hello-no-saved-searches | 2 +-
> > > .../emacs.expected-output/notmuch-hello-with-empty | 2 +-
> > > 4 files changed, 7 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
> > > index 65fde75..1a76c30 100644
> > > --- a/emacs/notmuch-hello.el
> > > +++ b/emacs/notmuch-hello.el
> > > @@ -462,6 +462,10 @@ Complete list of currently available key bindings:
> > > (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 " ")
> > > + (put-text-property (1- (point)) (point) 'invisible t)
> > > (widget-insert "\n")
> > >
> > > (when notmuch-hello-recent-searches
> > > diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello
> > > index 64b7e42..48143bd 100644
> > > --- a/test/emacs.expected-output/notmuch-hello
> > > +++ b/test/emacs.expected-output/notmuch-hello
> > > @@ -4,7 +4,7 @@ Saved searches: [edit]
> > >
> > > 50 inbox 50 unread
> > >
> > > -Search:
> > > +Search:
> > >
> > > [Show all tags]
> > >
> > > diff --git a/test/emacs.expected-output/notmuch-hello-no-saved-searches b/test/emacs.expected-output/notmuch-hello-no-saved-searches
> > > index 7f8206a..7c09e40 100644
> > > --- a/test/emacs.expected-output/notmuch-hello-no-saved-searches
> > > +++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches
> > > @@ -1,6 +1,6 @@
> > > Welcome to notmuch. You have 50 messages.
> > >
> > > -Search:
> > > +Search:
> > >
> > > [Show all tags]
> > >
> > > diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty
> > > index a9ed630..2a267c9 100644
> > > --- a/test/emacs.expected-output/notmuch-hello-with-empty
> > > +++ b/test/emacs.expected-output/notmuch-hello-with-empty
> > > @@ -4,7 +4,7 @@ Saved searches: [edit]
> > >
> > > 50 inbox 50 unread 0 empty
> > >
> > > -Search:
> > > +Search:
> > >
> > > [Show all tags]
> > >
> > > --
> > > 1.7.5.4
> > >
> > > _______________________________________________
> > > notmuch mailing list
> > > notmuch@notmuchmail.org
> > > http://notmuchmail.org/mailman/listinfo/notmuch
> >
> >
> > Definitely an improvement!
> >
> >
> > But Kan-Ru Chen posted a similar patch [1] about a year ago,
> > which I've been keeping in my personal branch (and rebasing)
> > for way too long.
> >
>
> ouch. I hope Carl reads this and feels your pain :)
No biggie, I fully exempt Carl.
Besides, nobody commented on it except a noob like myself.
Just by keeping half an eye on all that gets merged, imagining what
a maintainer's job must be like sends shivers down my spine.
> > Care to comment on the differences in approach?
> >
>
> It is very similar. If I saw this patch earlier, I would not care to
> write mine. Comments below.
>
> :size (max 8 (- (window-width) notmuch-hello-indent
> - (length "Search: ")))
> + (length "Search: ") 1 ))
>
> Looks like this results in search widget field 1 character shorter than
> we have now. And hence not aligned with the recent search lines. I do
> not see why we need this.
>
> - (widget-insert "\n")
> + (widget-insert " \n")
While useless at first sight, it nullifies the need to update any tests.
> That was my first implementation of the patch. Later I changed it to
> make the space invisible, so you can not get to it with C-f and C-b. A
> small improvement IMO.
Whichever approach you choose, please do steal (part of) his commit message ;)
> I wish I saw Kan-Ru Chen's patches earlier.
>
> Regards,
> Dmitry
>
> >
> > Peace
> >
> > --
> > Pieter
> >
> > [1] id:"1280195325-9066-2-git-send-email-kanru@kanru.info"
Peace
--
Pieter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] emacs: add insisible space after the search widget field in notmuch-hello
2011-07-04 8:09 ` Pieter Praet
@ 2011-07-04 8:19 ` Pieter Praet
0 siblings, 0 replies; 6+ messages in thread
From: Pieter Praet @ 2011-07-04 8:19 UTC (permalink / raw)
To: Dmitry Kurochkin, notmuch
> Besides, nobody commented on it except a noob like myself.
>
> Just by keeping half an eye on all that gets merged, imagining what
> a maintainer's job must be like sends shivers down my spine.
^ The following was sent in true top-posting style, for your personal
bewilderment. Please stand on your head to read it (don't do this on
a swiveling chair!).
Peace
--
Pieter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] emacs: add insisible space after the search widget field in notmuch-hello
2011-07-04 6:47 [PATCH] emacs: add insisible space after the search widget field in notmuch-hello Dmitry Kurochkin
2011-07-04 7:24 ` Pieter Praet
@ 2011-11-16 11:00 ` Pieter Praet
1 sibling, 0 replies; 6+ messages in thread
From: Pieter Praet @ 2011-11-16 11:00 UTC (permalink / raw)
To: Dmitry Kurochkin, notmuch
On Mon, 4 Jul 2011 10:47:05 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:
> It is very convenient when C-e (bound to `widget-end-of-line') ignores
> trailing spaces inside the search widget. But it only does so if a
> widget is not followed by a newline (that is why it works in the saved
> search widgets). The patch just adds an insisible space after the
> search widget to get the desirable behavior of `widget-end-of-line'.
> The extra space is also added to expected results of emacs tests.
> ---
> emacs/notmuch-hello.el | 4 ++++
> test/emacs.expected-output/notmuch-hello | 2 +-
> .../notmuch-hello-no-saved-searches | 2 +-
> .../emacs.expected-output/notmuch-hello-with-empty | 2 +-
> 4 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
> index 65fde75..1a76c30 100644
> --- a/emacs/notmuch-hello.el
> +++ b/emacs/notmuch-hello.el
> @@ -462,6 +462,10 @@ Complete list of currently available key bindings:
> (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 " ")
> + (put-text-property (1- (point)) (point) 'invisible t)
> (widget-insert "\n")
>
> (when notmuch-hello-recent-searches
> diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello
> index 64b7e42..48143bd 100644
> --- a/test/emacs.expected-output/notmuch-hello
> +++ b/test/emacs.expected-output/notmuch-hello
> @@ -4,7 +4,7 @@ Saved searches: [edit]
>
> 50 inbox 50 unread
>
> -Search:
> +Search:
>
> [Show all tags]
>
> diff --git a/test/emacs.expected-output/notmuch-hello-no-saved-searches b/test/emacs.expected-output/notmuch-hello-no-saved-searches
> index 7f8206a..7c09e40 100644
> --- a/test/emacs.expected-output/notmuch-hello-no-saved-searches
> +++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches
> @@ -1,6 +1,6 @@
> Welcome to notmuch. You have 50 messages.
>
> -Search:
> +Search:
>
> [Show all tags]
>
> diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty
> index a9ed630..2a267c9 100644
> --- a/test/emacs.expected-output/notmuch-hello-with-empty
> +++ b/test/emacs.expected-output/notmuch-hello-with-empty
> @@ -4,7 +4,7 @@ Saved searches: [edit]
>
> 50 inbox 50 unread 0 empty
>
> -Search:
> +Search:
>
> [Show all tags]
>
> --
> 1.7.5.4
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
Appears to have been merged in by the powers that be: commit e972d752
Thanks!
Peace
--
Pieter
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-11-16 11:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-04 6:47 [PATCH] emacs: add insisible space after the search widget field in notmuch-hello Dmitry Kurochkin
2011-07-04 7:24 ` Pieter Praet
2011-07-04 7:37 ` Dmitry Kurochkin
2011-07-04 8:09 ` Pieter Praet
2011-07-04 8:19 ` Pieter Praet
2011-11-16 11:00 ` Pieter Praet
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).