Re: [PATCH 1/2] emacs: add defsubst notmuch-address--message-insinuated

2015-08-30 Thread David Bremner
Tomi Ollila tomi.oll...@iki.fi writes:

 +(defsubst notmuch-address--message-insinuated ()
 +  (memq notmuch-address-message-alist-member message-completion-alist))
 +

Is there some advantage to defsubst other than (maybe?) performance?  It
just seems like one more construct for people to get up to speed with
the codebase.

d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 1/2] emacs: add defsubst notmuch-address--message-insinuated

2015-08-30 Thread Tomi Ollila
On Sun, Aug 30 2015, David Bremner da...@tethera.net wrote:

 Tomi Ollila tomi.oll...@iki.fi writes:

 +(defsubst notmuch-address--message-insinuated ()
 +  (memq notmuch-address-message-alist-member message-completion-alist))
 +

 Is there some advantage to defsubst other than (maybe?) performance?  It
 just seems like one more construct for people to get up to speed with
 the codebase.

No advantage. The reason for defsubst may originally be that I did it for
least execution chance -- and iirc I was reading some (gnus?) code that
had quite a few defsubsts which infected my coding. Now that I checked
there is no (other) defsubsts code in notmuch-emacs... so that can be
just be changed to `defun' to be consistent in that sense.


 d

Tomi
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 1/2] emacs: add defsubst notmuch-address--message-insinuated

2015-08-26 Thread Tomi Ollila
This inline function is currently used in
notmuch-address-message-insinuate (to not enable address completion if
it is already enabled). In some functions later this will be called
to know whether address completion can be used there, too.
---

Previous version of this 2-patch series is at
id:1423229911-14784-1-git-send-email-...@guru.guru-group.fi

 emacs/notmuch-address.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index fde3c1b2b861..6c93b2a7a820 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -54,8 +54,11 @@ (defvar notmuch-address-message-alist-member
 
 (defvar notmuch-address-history nil)
 
+(defsubst notmuch-address--message-insinuated ()
+  (memq notmuch-address-message-alist-member message-completion-alist))
+
 (defun notmuch-address-message-insinuate ()
-  (unless (memq notmuch-address-message-alist-member message-completion-alist)
+  (unless (notmuch-address--message-insinuated)
 (setq message-completion-alist
  (push notmuch-address-message-alist-member 
message-completion-alist
 
-- 
2.0.0

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch