Re: Strings vs symbols in notmuch-search-result-format

2010-11-11 Thread Carl Worth
On Sat, 11 Sep 2010 18:37:55 -0500, Rob Browning  wrote:
> I've started to look at the elisp, and wondered why
> notmuch-search-result-format expected strings rather than symbols for
> the field names, i.e.:
...
> Perhaps there's a good argument for strings, but if not, the latter is
> more idiomatic, and a bit more efficient too (comparisons will just be
> pointer compares (via assq) rather than something like a strcmp (assoc)).


I'm not sure that this is my code. But I do know that most of the emacs
lisp code I've written is very non-idiomatic and without good
justification.

Please don't look at my elisp code and assume it is sane at all. I'm
looking forward to the day where "git blame -- emacs/*.el" doesn't show
my name at all...

Said another way, please feel free to post improvements for any strange
elisp you see, (C code too, of course).

-Carl

-- 
carl.d.wo...@intel.com


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


Strings vs symbols in notmuch-search-result-format

2010-11-11 Thread Carl Worth
On Sat, 11 Sep 2010 18:37:55 -0500, Rob Browning  
wrote:
> I've started to look at the elisp, and wondered why
> notmuch-search-result-format expected strings rather than symbols for
> the field names, i.e.:
...
> Perhaps there's a good argument for strings, but if not, the latter is
> more idiomatic, and a bit more efficient too (comparisons will just be
> pointer compares (via assq) rather than something like a strcmp (assoc)).


I'm not sure that this is my code. But I do know that most of the emacs
lisp code I've written is very non-idiomatic and without good
justification.

Please don't look at my elisp code and assume it is sane at all. I'm
looking forward to the day where "git blame -- emacs/*.el" doesn't show
my name at all...

Said another way, please feel free to post improvements for any strange
elisp you see, (C code too, of course).

-Carl

-- 
carl.d.worth at intel.com
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 



Strings vs symbols in notmuch-search-result-format

2010-09-11 Thread Rob Browning

I've started to look at the elisp, and wondered why
notmuch-search-result-format expected strings rather than symbols for
the field names, i.e.:

 (("date" . "%s ")
  ("count" . "%-7s ")
  ("authors" . "%-20s ")
  ("subject" . "%s ")
  ("tags" . "(%s)"))

instead of 

 ((date . "%s ")
  (count . "%-7s ")
  (authors . "%-20s ")
  (subject . "%s ")
  (tags . "(%s)"))

Perhaps there's a good argument for strings, but if not, the latter is
more idiomatic, and a bit more efficient too (comparisons will just be
pointer compares (via assq) rather than something like a strcmp (assoc)).

In any case, I imagine this might not be something you'd want to change
at this point -- I'm just trying to make sure I understand the current
code.

Thanks
-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4


Strings vs symbols in notmuch-search-result-format

2010-09-11 Thread Rob Browning

I've started to look at the elisp, and wondered why
notmuch-search-result-format expected strings rather than symbols for
the field names, i.e.:

 (("date" . "%s ")
  ("count" . "%-7s ")
  ("authors" . "%-20s ")
  ("subject" . "%s ")
  ("tags" . "(%s)"))

instead of 

 ((date . "%s ")
  (count . "%-7s ")
  (authors . "%-20s ")
  (subject . "%s ")
  (tags . "(%s)"))

Perhaps there's a good argument for strings, but if not, the latter is
more idiomatic, and a bit more efficient too (comparisons will just be
pointer compares (via assq) rather than something like a strcmp (assoc)).

In any case, I imagine this might not be something you'd want to change
at this point -- I'm just trying to make sure I understand the current
code.

Thanks
-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch