* elmo-msgdb.el (elmo-msgdb-get-parent-entity): New inline function.
+2002-04-30  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * 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  <okada@opaopa.org>
 
        * elmo-utils.el (elmo-make-directory): Add option.
 
   ;; 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)))
 
 
         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))