From: Jani Nikula <jani@nikula.org>
To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>, notmuch@notmuchmail.org
Subject: Re: [RFC PATCH 4/4] emacs: add notmuch hello refresh hook to place point in a widget
Date: Tue, 17 Apr 2012 09:38:57 +0000 [thread overview]
Message-ID: <87bomqvgsu.fsf@nikula.org> (raw)
In-Reply-To: <871unmoh0l.fsf@gmail.com>
On Tue, 17 Apr 2012 13:16:10 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:
> Jani Nikula <jani@nikula.org> writes:
>
> > Add support for putting point to a widget after refresh through a
> > hook. This approximates the old behaviour.
>
> I may be wrong, but this looks to me like a hack that cannot work well.
> See my first reply in the thread for ideas on how to better implement
> this functionality.
This isn't very much unlike how the current code finds a widget before
refreshing. The difference is that this is based on a saved and restored
point, which indeed does have it's inaccuracies.
Jani.
>
> Regards,
> Dmitry
>
> > ---
> > emacs/notmuch-hello.el | 8 +++++++-
> > 1 files changed, 7 insertions(+), 1 deletions(-)
> >
> > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
> > index 13da146..07e64d4 100644
> > --- a/emacs/notmuch-hello.el
> > +++ b/emacs/notmuch-hello.el
> > @@ -148,7 +148,8 @@ International Bureau of Weights and Measures."
> > (defcustom notmuch-hello-refresh-hook nil
> > "Functions called after updating a `notmuch-hello' buffer."
> > :type 'hook
> > - :options '(notmuch-hello-refresh-status-message)
> > + :options '(notmuch-hello-refresh-status-message
> > + notmuch-hello-refresh-point-to-widget)
> > :group 'notmuch-hello
> > :group 'notmuch-hooks)
> >
> > @@ -752,6 +753,11 @@ Used internally by `notmuch-hello-refresh-status-message'.")
> > (notmuch-hello-nice-number (- diff-count))))))
> > (setq notmuch-hello-refresh-count new-count))))
> >
> > +(defun notmuch-hello-refresh-point-to-widget (no-display)
> > + "Hook to place point to widget after notmuch-hello refresh."
> > + (widget-backward 1)
> > + (widget-forward 1))
> > +
> > ;;;###autoload
> > (defun notmuch-hello (&optional no-display)
> > "Run notmuch and display saved searches, known tags, etc."
> > --
> > 1.7.1
> >
> > _______________________________________________
> > notmuch mailing list
> > notmuch@notmuchmail.org
> > http://notmuchmail.org/mailman/listinfo/notmuch
next prev parent reply other threads:[~2012-04-17 9:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-17 8:35 [RFC PATCH 1/4] emacs: simplify point placement in notmuch-hello Jani Nikula
2012-04-17 8:35 ` [RFC PATCH 2/4] emacs: add no-display arg to notmuch-hello-refresh-hook Jani Nikula
2012-04-17 9:06 ` Dmitry Kurochkin
2012-04-17 9:30 ` Jani Nikula
2012-04-17 9:31 ` Dmitry Kurochkin
2012-04-17 8:35 ` [RFC PATCH 3/4] emacs: add notmuch hello refresh hook to display message count change Jani Nikula
2012-04-17 9:13 ` Dmitry Kurochkin
2012-04-17 9:35 ` Jani Nikula
2012-04-17 9:43 ` Dmitry Kurochkin
2012-04-17 8:35 ` [RFC PATCH 4/4] emacs: add notmuch hello refresh hook to place point in a widget Jani Nikula
2012-04-17 9:16 ` Dmitry Kurochkin
2012-04-17 9:38 ` Jani Nikula [this message]
2012-04-17 9:04 ` [RFC PATCH 1/4] emacs: simplify point placement in notmuch-hello Dmitry Kurochkin
2012-04-17 9:58 ` Jani Nikula
2012-04-17 14:17 ` Tomi Ollila
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bomqvgsu.fsf@nikula.org \
--to=jani@nikula.org \
--cc=dmitry.kurochkin@gmail.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).