;;; @ entity information
;;;
-(defun mime-raw-point-to-entity-number (position &optional message-info)
- "Return entity-number from POTION in mime-raw-buffer.
+(defsubst mime-raw-find-entity-from-node-id (entity-node-id
+ &optional message-info)
+ "Return entity from ENTITY-NODE-ID 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))
- (let ((b (mime-entity-point-min message-info))
- (e (mime-entity-point-max message-info))
- (c (mime-entity-children message-info))
- )
- (if (and (<= b position)(<= position e))
- (or (let (entity ret (sn 0))
- (catch 'tag
- (while c
- (setq entity (car c))
- (setq ret (mime-raw-point-to-entity-number position entity))
- (cond ((eq ret t) (throw 'tag (list sn)))
- (ret (throw 'tag (cons sn ret)))
- )
- (setq c (cdr c))
- (setq sn (1+ sn))
- )))
- t))))
+ (mime-raw-find-entity-from-number (reverse entity-node-id) message-info))
-(defun mime-raw-point-to-entity-node-id (position &optional message-info)
- "Return entity-node-id from POTION in mime-raw-buffer.
+(defun mime-raw-find-entity-from-number (entity-number &optional message-info)
+ "Return entity from ENTITY-NUMBER in mime-raw-buffer.
If optional argument MESSAGE-INFO is not specified,
`mime-raw-message-info' is used."
- (reverse (mime-raw-point-to-entity-number position message-info)))
+ (or message-info
+ (setq message-info mime-raw-message-info))
+ (if (eq entity-number t)
+ message-info
+ (let ((sn (car entity-number)))
+ (if (null sn)
+ message-info
+ (let ((rc (nth sn (mime-entity-children message-info))))
+ (if rc
+ (mime-raw-find-entity-from-number (cdr entity-number) rc)
+ ))
+ ))))
(defun mime-raw-find-entity-from-point (point &optional message-info)
"Return entity from POINT in mime-raw-buffer.
(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.
+(defsubst mime-raw-point-to-entity-node-id (point &optional message-info)
+ "Return entity-node-id from POINT in mime-raw-buffer.
If optional argument MESSAGE-INFO is not specified,
`mime-raw-message-info' is used."
- (mime-raw-find-entity-from-number (reverse entity-node-id) message-info))
+ (mime-entity-node-id (mime-raw-find-entity-from-point point message-info)))
-(defun mime-raw-find-entity-from-number (entity-number &optional message-info)
- "Return entity from ENTITY-NUMBER in mime-raw-buffer.
+(defsubst mime-raw-point-to-entity-number (point &optional message-info)
+ "Return entity-number 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 (eq entity-number t)
- message-info
- (let ((sn (car entity-number)))
- (if (null sn)
- message-info
- (let ((rc (nth sn (mime-entity-children message-info))))
- (if rc
- (mime-raw-find-entity-from-number (cdr entity-number) rc)
- ))
- ))))
+ (reverse (mime-raw-point-to-entity-node-id point message-id)))
(defun mime-raw-flatten-message-info (&optional message-info)
"Return list of entity in mime-raw-buffer.