From: morioka Date: Sat, 14 Mar 1998 22:45:10 +0000 (+0000) Subject: (mime-raw-find-entity-from-point): New function. X-Git-Tag: semi-1_1_0~25 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=891ab00dc07c0e3cc894827556f13faab20e1f4b;p=elisp%2Fsemi.git (mime-raw-find-entity-from-point): New function. --- diff --git a/mime-view.el b/mime-view.el index b229e04..cba3b3c 100644 --- a/mime-view.el +++ b/mime-view.el @@ -647,6 +647,25 @@ If optional argument MESSAGE-INFO is not specified, `mime-raw-message-info' is used." (reverse (mime-raw-point-to-entity-number position message-info))) +(defun mime-raw-find-entity-from-point (point &optional message-info) + "Return entity from POINT in mime-raw-buffer. +If optional argument MESSAGE-INFO is not specified, +`mime-raw-message-info' is used." + (or message-info + (setq message-info mime-raw-message-info)) + (if (and (<= (mime-entity-point-min message-info) point) + (<= point (mime-entity-point-max message-info))) + (let ((children (mime-entity-children message-info))) + (catch 'tag + (while children + (let ((ret + (mime-raw-find-entity-from-point point (car children)))) + (if ret + (throw 'tag ret) + )) + (setq children (cdr children))) + message-info)))) + (defsubst mime-raw-find-entity-from-node-id (entity-node-id &optional message-info) "Return entity from ENTITY-NODE-ID in mime-raw-buffer.