problem with notmuch-search-authors-width in JSON emacs implementation

2010-04-22 Thread David Edmondson
On Thu, 22 Apr 2010 11:20:33 -0400, Jameson Rollins  wrote:
> On Thu, 22 Apr 2010 15:38:55 +0100, David Edmondson  wrote:
> > The `defcustom' does nothing if the variable already has a value.
> 
> But the defcustom is always going to be called before any customization
> value, since my personal customizations are always loaded last, so I'm
> don't see how this would ever apply.

I see. The original solution assumed that `notmuch.el' would be loaded
on demand rather than ahead of the call to `custom-set-variables'. I'll
find another solution.

dme.
-- 
David Edmondson, http://dme.org


problem with notmuch-search-authors-width in JSON emacs implementation

2010-04-22 Thread David Edmondson
On Thu, 22 Apr 2010 10:12:59 -0400, Jameson Rollins  wrote:
> On Thu, 22 Apr 2010 15:04:45 +0100, David Edmondson  wrote:
> > Ah, when you set `notmuch-search-authors-width' the expression which
> > creates `notmuch-search-result-format' is not re-evaluated.
> > 
> > Do things get better if you restart emacs (sorry for suggesting that)?
> 
> I can't see how that would help, because notmuch-search-result-format is
> always going to be evaluated with the default value of
> notmuch-search-authors-width, which is defined immediately previous to
> it.

The `defcustom' does nothing if the variable already has a value.

dme.
-- 
David Edmondson, http://dme.org


problem with notmuch-search-authors-width in JSON emacs implementation

2010-04-22 Thread David Edmondson
On Thu, 22 Apr 2010 09:22:32 -0400, Jameson Rollins  wrote:
> > Can you show any explicit settings you have for
> > `notmuch-search-authors-width' and `notmuch-search-result-format'? Where
> > do you set them?
> 
> Changing notmuch-search-authors-width to anything longer than 20 (which
> is the default set internally) causes the problem (I had it set to 40
> when I first noticed).  It's very easy to test.  You can
> notmuch-search-authors-width on the fly from the configuration manager
> and see the result.  I have not modified notmuch-search-result-format.
> See my previous email on tracking down the issue.

Ah, when you set `notmuch-search-authors-width' the expression which
creates `notmuch-search-result-format' is not re-evaluated.

Do things get better if you restart emacs (sorry for suggesting that)?

If so then I have an idea how to fix it.

dme.
-- 
David Edmondson, http://dme.org


problem with notmuch-search-authors-width in JSON emacs implementation

2010-04-22 Thread Jameson Rollins
On Thu, 22 Apr 2010 15:38:55 +0100, David Edmondson  wrote:
> The `defcustom' does nothing if the variable already has a value.

But the defcustom is always going to be called before any customization
value, since my personal customizations are always loaded last, so I'm
don't see how this would ever apply.

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



problem with notmuch-search-authors-width in JSON emacs implementation

2010-04-22 Thread Jameson Rollins
On Thu, 22 Apr 2010 15:04:45 +0100, David Edmondson  wrote:
> Ah, when you set `notmuch-search-authors-width' the expression which
> creates `notmuch-search-result-format' is not re-evaluated.
> 
> Do things get better if you restart emacs (sorry for suggesting that)?

I can't see how that would help, because notmuch-search-result-format is
always going to be evaluated with the default value of
notmuch-search-authors-width, which is defined immediately previous to
it.

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



problem with notmuch-search-authors-width in JSON emacs implementation

2010-04-22 Thread Jameson Rollins
On Thu, 22 Apr 2010 08:52:59 +0100, David Edmondson  wrote:
> On Thu, 22 Apr 2010 00:37:25 -0400, Jameson Rollins  finestructure.net> wrote:
> > On Wed, 21 Apr 2010 19:09:35 -0400, Jameson Rollins  > finestructure.net> wrote:
> > > Hey, folks.  I just build from Carl's HEAD which includes the new emacs
> > > JSON interface and I'm noticing a problem with the
> > > notmuch-search-authors-width variable.  If I set the variable as
> > > follows:
> > > 
> > > (setq notmuch-search-authors-width 40)
> > > 
> > > author lists that overrun the specified width start spitting out into
> > > the subject field.  I think bremner just confirmed this on irc.  I'll
> > > try to look into this when I get a chance, but I don't have time right
> > > now.  Maybe someone with more intimate knowledge of this piece of code
> > > could figure it out more quickly.
> 
> I thought that I had this fixed up properly. Sorry for the breakage.

No worries.

> Can you show any explicit settings you have for
> `notmuch-search-authors-width' and `notmuch-search-result-format'? Where
> do you set them?

Changing notmuch-search-authors-width to anything longer than 20 (which
is the default set internally) causes the problem (I had it set to 40
when I first noticed).  It's very easy to test.  You can
notmuch-search-authors-width on the fly from the configuration manager
and see the result.  I have not modified notmuch-search-result-format.
See my previous email on tracking down the issue.

Thanks for the help.

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



problem with notmuch-search-authors-width in JSON emacs implementation

2010-04-22 Thread David Edmondson
On Thu, 22 Apr 2010 00:37:25 -0400, Jameson Rollins  wrote:
> On Wed, 21 Apr 2010 19:09:35 -0400, Jameson Rollins  finestructure.net> wrote:
> > Hey, folks.  I just build from Carl's HEAD which includes the new emacs
> > JSON interface and I'm noticing a problem with the
> > notmuch-search-authors-width variable.  If I set the variable as
> > follows:
> > 
> > (setq notmuch-search-authors-width 40)
> > 
> > author lists that overrun the specified width start spitting out into
> > the subject field.  I think bremner just confirmed this on irc.  I'll
> > try to look into this when I get a chance, but I don't have time right
> > now.  Maybe someone with more intimate knowledge of this piece of code
> > could figure it out more quickly.

I thought that I had this fixed up properly. Sorry for the breakage.

Can you show any explicit settings you have for
`notmuch-search-authors-width' and `notmuch-search-result-format'? Where
do you set them?

The intention was that if you just want a wider display of authors you
set `notmuch-search-authors-width' (which has existed for some time) and
`notmuch-search-result-format' adapts accordingly.

Admittedly, this doesn't cope well if you modify
`notmuch-search-result-format' without also updating
`notmuch-search-authors-width'. Some more thought required...

dme.
-- 
David Edmondson, http://dme.org


problem with notmuch-search-authors-width in JSON emacs implementation

2010-04-22 Thread Jameson Rollins
On Wed, 21 Apr 2010 19:09:35 -0400, Jameson Rollins  wrote:
> Hey, folks.  I just build from Carl's HEAD which includes the new emacs
> JSON interface and I'm noticing a problem with the
> notmuch-search-authors-width variable.  If I set the variable as
> follows:
> 
> (setq notmuch-search-authors-width 40)
> 
> author lists that overrun the specified width start spitting out into
> the subject field.  I think bremner just confirmed this on irc.  I'll
> try to look into this when I get a chance, but I don't have time right
> now.  Maybe someone with more intimate knowledge of this piece of code
> could figure it out more quickly.

So I think I see what might be happening here, but I don't know elisp
well enough to fix it.  Maybe one of the elisp experts out there can
help me figure it out.

notmuch-search-authors-width is actually called three times in
notmuch.el:

0 servo:~/src/notmuch/git [master] $ grep -nH notmuch-search-authors-width 
emacs/*
emacs/notmuch.el:57:(defcustom notmuch-search-authors-width 20
emacs/notmuch.el:65:("authors" . ,(format "%%-%ds " 
notmuch-search-authors-width))
emacs/notmuch.el:626: (if (> authors-length 
notmuch-search-authors-width)
emacs/notmuch.el:627: (set 'authors (concat (substring 
authors 0 (- notmuch-search-authors-width 3)) "...")))
0 servo:~/src/notmuch/git [master] $ 

The first call is inside the defcustom definition for
notmuch-search-result-format.  The second two are in the
notmuch-search-process-filter function.  It's pretty clear from the
behavior that setting notmuch-search-authors-width, either with setq or
with "Customize Options", affects what is returned in
notmuch-search-process-filter, but *not* in the defcustom for
notmuch-search-result-format.  I guess what's happening is that the
value used in the defcustom definition of notmuch-search-result-format
is set when the defcustom is defined, and isn't changed later with the
new user-set value.

Do any elisp experts out there know any way out of this?  Is there a way
to escape the expansion of the variable used in
notmuch-search-result-format until it is actually called?

I guess we're using notmuch-search-authors-width to "nicely" truncate
the author list and add the "..." at the end.  We could just straight
truncate the authors field with something like '%-.40s', I think, which
would make the code a little simpler, but might not be as nice.

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



Re: problem with notmuch-search-authors-width in JSON emacs implementation

2010-04-22 Thread David Edmondson
On Thu, 22 Apr 2010 00:37:25 -0400, Jameson Rollins 
jroll...@finestructure.net wrote:
 On Wed, 21 Apr 2010 19:09:35 -0400, Jameson Rollins 
 jroll...@finestructure.net wrote:
  Hey, folks.  I just build from Carl's HEAD which includes the new emacs
  JSON interface and I'm noticing a problem with the
  notmuch-search-authors-width variable.  If I set the variable as
  follows:
  
  (setq notmuch-search-authors-width 40)
  
  author lists that overrun the specified width start spitting out into
  the subject field.  I think bremner just confirmed this on irc.  I'll
  try to look into this when I get a chance, but I don't have time right
  now.  Maybe someone with more intimate knowledge of this piece of code
  could figure it out more quickly.

I thought that I had this fixed up properly. Sorry for the breakage.

Can you show any explicit settings you have for
`notmuch-search-authors-width' and `notmuch-search-result-format'? Where
do you set them?

The intention was that if you just want a wider display of authors you
set `notmuch-search-authors-width' (which has existed for some time) and
`notmuch-search-result-format' adapts accordingly.

Admittedly, this doesn't cope well if you modify
`notmuch-search-result-format' without also updating
`notmuch-search-authors-width'. Some more thought required...

dme.
-- 
David Edmondson, http://dme.org
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: problem with notmuch-search-authors-width in JSON emacs implementation

2010-04-22 Thread Jameson Rollins
On Thu, 22 Apr 2010 08:52:59 +0100, David Edmondson d...@dme.org wrote:
 On Thu, 22 Apr 2010 00:37:25 -0400, Jameson Rollins 
 jroll...@finestructure.net wrote:
  On Wed, 21 Apr 2010 19:09:35 -0400, Jameson Rollins 
  jroll...@finestructure.net wrote:
   Hey, folks.  I just build from Carl's HEAD which includes the new emacs
   JSON interface and I'm noticing a problem with the
   notmuch-search-authors-width variable.  If I set the variable as
   follows:
   
   (setq notmuch-search-authors-width 40)
   
   author lists that overrun the specified width start spitting out into
   the subject field.  I think bremner just confirmed this on irc.  I'll
   try to look into this when I get a chance, but I don't have time right
   now.  Maybe someone with more intimate knowledge of this piece of code
   could figure it out more quickly.
 
 I thought that I had this fixed up properly. Sorry for the breakage.

No worries.

 Can you show any explicit settings you have for
 `notmuch-search-authors-width' and `notmuch-search-result-format'? Where
 do you set them?

Changing notmuch-search-authors-width to anything longer than 20 (which
is the default set internally) causes the problem (I had it set to 40
when I first noticed).  It's very easy to test.  You can
notmuch-search-authors-width on the fly from the configuration manager
and see the result.  I have not modified notmuch-search-result-format.
See my previous email on tracking down the issue.

Thanks for the help.

jamie.


pgpjNCrhjQ0gf.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: problem with notmuch-search-authors-width in JSON emacs implementation

2010-04-22 Thread David Edmondson
On Thu, 22 Apr 2010 09:22:32 -0400, Jameson Rollins 
jroll...@finestructure.net wrote:
  Can you show any explicit settings you have for
  `notmuch-search-authors-width' and `notmuch-search-result-format'? Where
  do you set them?
 
 Changing notmuch-search-authors-width to anything longer than 20 (which
 is the default set internally) causes the problem (I had it set to 40
 when I first noticed).  It's very easy to test.  You can
 notmuch-search-authors-width on the fly from the configuration manager
 and see the result.  I have not modified notmuch-search-result-format.
 See my previous email on tracking down the issue.

Ah, when you set `notmuch-search-authors-width' the expression which
creates `notmuch-search-result-format' is not re-evaluated.

Do things get better if you restart emacs (sorry for suggesting that)?

If so then I have an idea how to fix it.

dme.
-- 
David Edmondson, http://dme.org
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: problem with notmuch-search-authors-width in JSON emacs implementation

2010-04-22 Thread David Edmondson
On Thu, 22 Apr 2010 10:12:59 -0400, Jameson Rollins 
jroll...@finestructure.net wrote:
 On Thu, 22 Apr 2010 15:04:45 +0100, David Edmondson d...@dme.org wrote:
  Ah, when you set `notmuch-search-authors-width' the expression which
  creates `notmuch-search-result-format' is not re-evaluated.
  
  Do things get better if you restart emacs (sorry for suggesting that)?
 
 I can't see how that would help, because notmuch-search-result-format is
 always going to be evaluated with the default value of
 notmuch-search-authors-width, which is defined immediately previous to
 it.

The `defcustom' does nothing if the variable already has a value.

dme.
-- 
David Edmondson, http://dme.org
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: problem with notmuch-search-authors-width in JSON emacs implementation

2010-04-22 Thread David Edmondson
On Thu, 22 Apr 2010 11:20:33 -0400, Jameson Rollins 
jroll...@finestructure.net wrote:
 On Thu, 22 Apr 2010 15:38:55 +0100, David Edmondson d...@dme.org wrote:
  The `defcustom' does nothing if the variable already has a value.
 
 But the defcustom is always going to be called before any customization
 value, since my personal customizations are always loaded last, so I'm
 don't see how this would ever apply.

I see. The original solution assumed that `notmuch.el' would be loaded
on demand rather than ahead of the call to `custom-set-variables'. I'll
find another solution.

dme.
-- 
David Edmondson, http://dme.org
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


problem with notmuch-search-authors-width in JSON emacs implementation

2010-04-21 Thread Jameson Rollins
Hey, folks.  I just build from Carl's HEAD which includes the new emacs
JSON interface and I'm noticing a problem with the
notmuch-search-authors-width variable.  If I set the variable as
follows:

(setq notmuch-search-authors-width 40)

author lists that overrun the specified width start spitting out into
the subject field.  I think bremner just confirmed this on irc.  I'll
try to look into this when I get a chance, but I don't have time right
now.  Maybe someone with more intimate knowledge of this piece of code
could figure it out more quickly.

jamie.

ps: By the way, do we have any official way to keep track of bugs?  Has
anyone looked into any of the distributed, git-based bug tracking
solutions?  We tried doing it with ikiwiki for a different project I was
working on, but it didn't really work that well.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



problem with notmuch-search-authors-width in JSON emacs implementation

2010-04-21 Thread Dirk Hohndel
On Wed, 21 Apr 2010 19:09:35 -0400, Jameson Rollins  wrote:
> Hey, folks.  I just build from Carl's HEAD which includes the new emacs
> JSON interface and I'm noticing a problem with the
> notmuch-search-authors-width variable.  If I set the variable as
> follows:
> 
> (setq notmuch-search-authors-width 40)
> 
> author lists that overrun the specified width start spitting out into
> the subject field.  I think bremner just confirmed this on irc.  I'll
> try to look into this when I get a chance, but I don't have time right
> now.  Maybe someone with more intimate knowledge of this piece of code
> could figure it out more quickly.

I think you are no longer supposed to do that. Here's what I have
instead in my .emacs file

 '(notmuch-search-result-format (quote (("date" . "%s ") ("count" . "%-7s ") 
("authors" . "%-50s ") ("subject" . "%s ") ("tags" . "(%s)"

Actually, I did this from the customize-group -> notmuch settings inside
emacs. I think the overruns come from a conflict between the '20' that's
in the default notmuch-search-result-format and the explicit '40' that
you set here.

Maybe the code should be changed to deal with setting this variable - or
it should be made "internal" :-)

/D

-- 
Dirk Hohndel
Intel Open Source Technology Center


problem with notmuch-search-authors-width in JSON emacs implementation

2010-04-21 Thread Jameson Rollins
Hey, folks.  I just build from Carl's HEAD which includes the new emacs
JSON interface and I'm noticing a problem with the
notmuch-search-authors-width variable.  If I set the variable as
follows:

(setq notmuch-search-authors-width 40)

author lists that overrun the specified width start spitting out into
the subject field.  I think bremner just confirmed this on irc.  I'll
try to look into this when I get a chance, but I don't have time right
now.  Maybe someone with more intimate knowledge of this piece of code
could figure it out more quickly.

jamie.

ps: By the way, do we have any official way to keep track of bugs?  Has
anyone looked into any of the distributed, git-based bug tracking
solutions?  We tried doing it with ikiwiki for a different project I was
working on, but it didn't really work that well.


pgpcrUKLbOons.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: problem with notmuch-search-authors-width in JSON emacs implementation

2010-04-21 Thread Jameson Rollins
On Wed, 21 Apr 2010 19:09:35 -0400, Jameson Rollins 
jroll...@finestructure.net wrote:
 Hey, folks.  I just build from Carl's HEAD which includes the new emacs
 JSON interface and I'm noticing a problem with the
 notmuch-search-authors-width variable.  If I set the variable as
 follows:
 
 (setq notmuch-search-authors-width 40)
 
 author lists that overrun the specified width start spitting out into
 the subject field.  I think bremner just confirmed this on irc.  I'll
 try to look into this when I get a chance, but I don't have time right
 now.  Maybe someone with more intimate knowledge of this piece of code
 could figure it out more quickly.

So I think I see what might be happening here, but I don't know elisp
well enough to fix it.  Maybe one of the elisp experts out there can
help me figure it out.

notmuch-search-authors-width is actually called three times in
notmuch.el:

0 servo:~/src/notmuch/git [master] $ grep -nH notmuch-search-authors-width 
emacs/*
emacs/notmuch.el:57:(defcustom notmuch-search-authors-width 20
emacs/notmuch.el:65:(authors . ,(format %%-%ds  
notmuch-search-authors-width))
emacs/notmuch.el:626: (if ( authors-length 
notmuch-search-authors-width)
emacs/notmuch.el:627: (set 'authors (concat (substring 
authors 0 (- notmuch-search-authors-width 3)) ...)))
0 servo:~/src/notmuch/git [master] $ 

The first call is inside the defcustom definition for
notmuch-search-result-format.  The second two are in the
notmuch-search-process-filter function.  It's pretty clear from the
behavior that setting notmuch-search-authors-width, either with setq or
with Customize Options, affects what is returned in
notmuch-search-process-filter, but *not* in the defcustom for
notmuch-search-result-format.  I guess what's happening is that the
value used in the defcustom definition of notmuch-search-result-format
is set when the defcustom is defined, and isn't changed later with the
new user-set value.

Do any elisp experts out there know any way out of this?  Is there a way
to escape the expansion of the variable used in
notmuch-search-result-format until it is actually called?

I guess we're using notmuch-search-authors-width to nicely truncate
the author list and add the ... at the end.  We could just straight
truncate the authors field with something like '%-.40s', I think, which
would make the code a little simpler, but might not be as nice.

jamie.


pgpV4NCgC3rKe.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch