[RFC PATCH 4/4] emacs: add notmuch hello refresh hook to place point in a widget

2012-04-17 Thread Dmitry Kurochkin
Jani Nikula  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.

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 ( no-display)
>"Run notmuch and display saved searches, known tags, etc."
> -- 
> 1.7.1
>
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


[RFC PATCH 4/4] emacs: add notmuch hello refresh hook to place point in a widget

2012-04-17 Thread Jani Nikula
On Tue, 17 Apr 2012 13:16:10 +0400, Dmitry Kurochkin  wrote:
> Jani Nikula  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 ( no-display)
> >"Run notmuch and display saved searches, known tags, etc."
> > -- 
> > 1.7.1
> >
> > ___
> > notmuch mailing list
> > notmuch at notmuchmail.org
> > http://notmuchmail.org/mailman/listinfo/notmuch


[RFC PATCH 4/4] emacs: add notmuch hello refresh hook to place point in a widget

2012-04-17 Thread Jani Nikula
Add support for putting point to a widget after refresh through a
hook. This approximates the old behaviour.
---
 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 ( no-display)
   "Run notmuch and display saved searches, known tags, etc."
-- 
1.7.1



[RFC PATCH 4/4] emacs: add notmuch hello refresh hook to place point in a widget

2012-04-17 Thread Jani Nikula
Add support for putting point to a widget after refresh through a
hook. This approximates the old behaviour.
---
 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


Re: [RFC PATCH 4/4] emacs: add notmuch hello refresh hook to place point in a widget

2012-04-17 Thread Dmitry Kurochkin
Jani Nikula j...@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.

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
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [RFC PATCH 4/4] emacs: add notmuch hello refresh hook to place point in a widget

2012-04-17 Thread Jani Nikula
On Tue, 17 Apr 2012 13:16:10 +0400, Dmitry Kurochkin 
dmitry.kuroch...@gmail.com wrote:
 Jani Nikula j...@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
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch