From bb3aba55ca1ee38e62c1fffc013f46dd5588bbf8 Mon Sep 17 00:00:00 2001 From: morioka Date: Wed, 10 Jun 1998 08:49:35 +0000 Subject: [PATCH] Sync up with semi-1_5_4_9. --- ChangeLog | 37 +++++++++++++++++++++++++++++++++++++ MIME-View-API-ja.ol | 9 +++++++-- mime-edit.el | 23 +++++++++++------------ mime-parse.el | 5 +++++ mime-play.el | 2 +- mime-view.el | 39 +++++++++++++++++++++------------------ 6 files changed, 82 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1de1782..8af1111 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,42 @@ +1998-06-10 MORIOKA Tomohiko + + * mime-edit.el (mime-edit-enclose-region-internal): Abolish unused + local variable. + +1998-06-09 MORIOKA Tomohiko + + * MIME-View-API-ja.ol (entity): Add description of + `mime-entity-number'. + + * mime-play.el (mime-method-to-display-caesar): Use + `mime-entity-number'. + + * mime-parse.el (mime-entity-number): New function. + +1998-06-09 MORIOKA Tomohiko + + * MIME-View-API-ja.ol (entity-button): Modify description of + `mime-view-insert-entity-button'. + + * mime-view.el (mime-view-insert-entity-button): Change interface. + (mime-view-display-entity): Modify for + `mime-view-insert-entity-button'. + 1998-06-09 MORIOKA Tomohiko + * MIME-View-API-ja.ol (entity-button): Modify description of + `mime-view-entity-button-visible-p'. + + * mime-view.el (mime-view-entity-button-visible-p): Change + interface. + (mime-view-display-entity): Modify for + `mime-view-entity-button-visible-p'. + +1998-06-09 MORIOKA Tomohiko + + * MIME-View-API-ja.ol: Add description of `mime-entity-parent' and + abolish description `mime-raw-entity-parent'. + * mime-view.el (mime-entity-parent): New function; abolish `mime-raw-entity-parent'. (mime-view-entity-button-visible-p): Use `mime-entity-parent' diff --git a/MIME-View-API-ja.ol b/MIME-View-API-ja.ol index e85b666..2983211 100644 --- a/MIME-View-API-ja.ol +++ b/MIME-View-API-ja.ol @@ -437,6 +437,11 @@ entity-number $B$H8F$S$^$9!#(Bentity-number $B$O(B S $B<0$H$7$F$O(B (1 2 3 entity $B$N@8@.;R!#(B +[$B4X?t(B] mime-entity-number (ENTITY) + + ENTITY $B$N(B entity-number $B$rJV$9!#(B + + [$B4X?t(B] mime-entity-parent (ENTITY &optional MESSAGE-INFO) ENTITY $B$N?F$N(B entity $B$rJV$9!#(B @@ -505,12 +510,12 @@ media-type/subtype $BEy$N(B entity $B$N9=B$!&7A<0$K4X$9$k>pJs$KBP$7$F!"I=<(( ** entity-button -[$B4X?t(B] mime-view-entity-button-visible-p (ENTITY MESSAGE-INFO) +[$B4X?t(B] mime-view-entity-button-visible-p (ENTITY) $BHs(B nil $B$N>l9g!"(Bentity-button $B$rI=<($9$k$3$H$rI=$9!#(B -[$B4X?t(B] mime-view-insert-entity-button (ENTITY MESSAGE-INFO SUBJECT) +[$B4X?t(B] mime-view-insert-entity-button (ENTITY SUBJECT) ENTITY $B$N(B entity-button $B$rA^F~$9$k!#(B diff --git a/mime-edit.el b/mime-edit.el index 56e77b0..bb48d9c 100644 --- a/mime-edit.el +++ b/mime-edit.el @@ -2177,19 +2177,18 @@ and insert data encoded as ENCODING." (defun mime-edit-enclose-region-internal (type beg end) (save-excursion (goto-char beg) - (let ((current (point))) - (save-restriction - (narrow-to-region beg end) - (insert (format "--<<%s>>-{\n" type)) - (goto-char (point-max)) - (insert (format "--}-<<%s>>\n" type)) - (goto-char (point-max)) + (save-restriction + (narrow-to-region beg end) + (insert (format "--<<%s>>-{\n" type)) + (goto-char (point-max)) + (insert (format "--}-<<%s>>\n" type)) + (goto-char (point-max)) + ) + (or (looking-at mime-edit-beginning-tag-regexp) + (eobp) + (insert (mime-make-text-tag) "\n") ) - (or (looking-at mime-edit-beginning-tag-regexp) - (eobp) - (insert (mime-make-text-tag) "\n") - ) - ))) + )) (defun mime-edit-enclose-quote-region (beg end) (interactive "*r") diff --git a/mime-parse.el b/mime-parse.el index 5ea30dd..213563c 100644 --- a/mime-parse.el +++ b/mime-parse.el @@ -200,14 +200,19 @@ If is is not found, return DEFAULT-ENCODING." (defsubst mime-entity-encoding (entity) (aref entity 8)) (defsubst mime-entity-children (entity) (aref entity 9)) +(defsubst mime-entity-number (entity) + (reverse (mime-entity-node-id entity))) + (defalias 'mime-entity-point-min 'mime-entity-header-start) (defalias 'mime-entity-point-max 'mime-entity-body-end) + (defsubst mime-entity-media-type (entity) (mime-content-type-primary-type (mime-entity-content-type entity))) (defsubst mime-entity-media-subtype (entity) (mime-content-type-subtype (mime-entity-content-type entity))) (defsubst mime-entity-parameters (entity) (mime-content-type-parameters (mime-entity-content-type entity))) + (defsubst mime-entity-type/subtype (entity-info) (mime-type/subtype-string (mime-entity-media-type entity-info) (mime-entity-media-subtype entity-info))) diff --git a/mime-play.el b/mime-play.el index af845c1..da9d9c8 100644 --- a/mime-play.el +++ b/mime-play.el @@ -628,7 +628,7 @@ saved as binary. Otherwise the region is saved by `write-region'." "Internal method for mime-view to display ROT13-47-48 message." (let* ((entity (mime-raw-find-entity-from-point start)) (new-name (format "%s-%s" (buffer-name) - (reverse (mime-entity-node-id entity)))) + (mime-entity-number entity))) (mother mime-preview-buffer)) (let ((pwin (or (get-buffer-window mother) (get-largest-window))) diff --git a/mime-view.el b/mime-view.el index 3e977e7..8c7fb6d 100644 --- a/mime-view.el +++ b/mime-view.el @@ -189,6 +189,17 @@ If optional argument MESSAGE-INFO is not specified, (setq children (cdr children))) message-info)))) +(defsubst mime-entity-parent (entity &optional message-info) + "Return mother entity of ENTITY. +If optional argument MESSAGE-INFO is not specified, +`mime-raw-message-info' in buffer of ENTITY is used." + (mime-raw-find-entity-from-node-id + (cdr (mime-entity-node-id entity)) + (or message-info + (save-excursion + (set-buffer (mime-entity-buffer entity)) + mime-raw-message-info)))) + (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, @@ -199,14 +210,7 @@ If optional argument MESSAGE-INFO is not specified, "Return entity-number from POINT in mime-raw-buffer. If optional argument MESSAGE-INFO is not specified, `mime-raw-message-info' is used." - (reverse (mime-raw-point-to-entity-node-id point message-info))) - -(defsubst mime-raw-entity-parent (entity &optional message-info) - "Return mother entity of ENTITY. -If optional argument MESSAGE-INFO is not specified, -`mime-raw-message-info' is used." - (mime-raw-find-entity-from-node-id (cdr (mime-entity-node-id entity)) - message-info)) + (mime-entity-number (mime-raw-find-entity-from-point point message-info))) (defun mime-raw-flatten-message-info (&optional message-info) "Return list of entity in mime-raw-buffer. @@ -231,7 +235,7 @@ If optional argument MESSAGE-INFO is not specified, ;;; @@@ predicate function ;;; -(defun mime-view-entity-button-visible-p (entity message-info) +(defun mime-view-entity-button-visible-p (entity) "Return non-nil if header of ENTITY is visible. Please redefine this function if you want to change default setting." (let ((media-type (mime-entity-media-type entity)) @@ -239,8 +243,7 @@ Please redefine this function if you want to change default setting." (or (not (eq media-type 'application)) (and (not (eq media-subtype 'x-selection)) (or (not (eq media-subtype 'octet-stream)) - (let ((mother-entity - (mime-raw-entity-parent entity message-info))) + (let ((mother-entity (mime-entity-parent entity))) (or (not (eq (mime-entity-media-type mother-entity) 'multipart)) (not (eq (mime-entity-media-subtype mother-entity) @@ -251,7 +254,7 @@ Please redefine this function if you want to change default setting." ;;; @@@ entity button generator ;;; -(defun mime-view-insert-entity-button (entity message-info subj) +(defun mime-view-insert-entity-button (entity subject) "Insert entity-button of ENTITY." (let ((entity-node-id (mime-entity-node-id entity)) (params (mime-entity-parameters entity))) @@ -271,12 +274,12 @@ Please redefine this function if you want to change default setting." (setq access-type (cdr access-type)) (if server (format "%s %s ([%s] %s)" - num subj access-type (cdr server)) + num subject access-type (cdr server)) (let ((site (cdr (assoc "site" params))) (dir (cdr (assoc "directory" params))) ) (format "%s %s ([%s] %s:%s)" - num subj access-type site dir) + num subject access-type site dir) ))) ) (t @@ -285,7 +288,7 @@ Please redefine this function if you want to change default setting." (charset (cdr (assoc "charset" params))) (encoding (mime-entity-encoding entity))) (concat - num " " subj + num " " subject (let ((rest (format " <%s/%s%s%s>" media-type media-subtype @@ -868,8 +871,8 @@ The compressed face will be piped to this command.") (setq nb (point)) (narrow-to-region nb nb) (or button-is-invisible - (if (mime-view-entity-button-visible-p entity message-info) - (mime-view-insert-entity-button entity message-info subj) + (if (mime-view-entity-button-visible-p entity) + (mime-view-insert-entity-button entity subj) )) (if header-is-visible (save-restriction @@ -897,7 +900,7 @@ The compressed face will be piped to this command.") (t (when button-is-invisible (goto-char (point-max)) - (mime-view-insert-entity-button entity message-info subj) + (mime-view-insert-entity-button entity subj) ) (or header-is-visible (progn -- 1.7.10.4