From 41242deaeed40e847e485e944d1e2df5f2aa23b6 Mon Sep 17 00:00:00 2001 From: teranisi Date: Tue, 30 Apr 2002 04:54:27 +0000 Subject: [PATCH] * elmo-util.el (elmo-get-hash-val): Check the 1st argument is string. * elmo-msgdb.el (elmo-msgdb-get-parent-entity): New inline function. --- elmo/ChangeLog | 6 ++++++ elmo/elmo-msgdb.el | 5 +++++ elmo/elmo-util.el | 7 ++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 0c6c6b5..802cabd 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,9 @@ +2002-04-30 Yuuichi Teranishi + + * elmo-util.el (elmo-get-hash-val): Check the 1st argument is string. + + * elmo-msgdb.el (elmo-msgdb-get-parent-entity): New inline function. + 2002-04-26 Kenichi OKADA * elmo-utils.el (elmo-make-directory): Add option. diff --git a/elmo/elmo-msgdb.el b/elmo/elmo-msgdb.el index 87c63d2..357c7d5 100644 --- a/elmo/elmo-msgdb.el +++ b/elmo/elmo-msgdb.el @@ -426,6 +426,11 @@ content of MSGDB is changed." ;; entity is parent-id. (and entity (assoc entity database))) +(defsubst elmo-msgdb-get-parent-entity (entity msgdb) + (setq entity (elmo-msgdb-overview-entity-get-references entity)) + ;; entity is parent-id. + (and entity (elmo-msgdb-overview-get-entity entity msgdb))) + (defsubst elmo-msgdb-overview-entity-get-number (entity) (and entity (aref (cdr entity) 0))) diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index a4840e2..6fe0b61 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -939,9 +939,10 @@ Return value is a cons cell of (STRUCTURE . REST)" file (nth 2 condition) number number-list))))) (defmacro elmo-get-hash-val (string hashtable) - (let ((sym (list 'intern-soft string hashtable))) - (list 'if (list 'boundp sym) - (list 'symbol-value sym)))) + `(and (stringp ,string) + (let ((sym (intern-soft ,string ,hashtable))) + (if (boundp sym) + (symbol-value sym))))) (defmacro elmo-set-hash-val (string value hashtable) (list 'set (list 'intern string hashtable) value)) -- 1.7.10.4