X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fgnus-art.el;h=44b026ab830f5976949d77e1b2e4a1fa645b0353;hb=4b3bd6c2717eaec8fc48bf729db7ce9580d5bc24;hp=a7140cf1760968946ffde85dd365d62ca2f1263a;hpb=7a783418c081e681aa35d06bd1ffc3521849dd5d;p=gnus diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index a7140cf17..44b026ab8 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -51,6 +51,7 @@ (autoload 'ansi-color-apply-on-region "ansi-color") (autoload 'mm-url-insert-file-contents-external "mm-url") (autoload 'mm-extern-cache-contents "mm-extern") +(autoload 'url-expand-file-name "url-expand") (defgroup gnus-article nil "Article display." @@ -255,12 +256,10 @@ This can also be a list of the above values." :group 'gnus-article-signature) (defcustom gnus-hidden-properties - (if (featurep 'xemacs) - ;; `intangible' is evil, but I keep it here in case it's useful. - '(invisible t intangible t) - ;; Emacs's command loop moves point out of invisible text anyway, so - ;; `intangible' is clearly not needed there. - '(invisible t)) + ;; We use to have `intangible' here as well, but Emacs's command loop moves + ;; point out of invisible text anyway, so `intangible' is clearly not + ;; needed there. And XEmacs doesn't handle `intangible' anyway. + '(invisible t) "Property list to use for hiding text." :type 'sexp :group 'gnus-article-hiding) @@ -1629,8 +1628,11 @@ It is a string, such as \"PGP\". If nil, ask user." (defvar idna-program) -(defcustom gnus-use-idna (and (condition-case nil (require 'idna) (file-error)) - (mm-coding-system-p 'utf-8) +(defcustom gnus-use-idna (and (mm-coding-system-p 'utf-8) + (condition-case nil + (require 'idna) + (file-error) + (invalid-operation)) idna-program (executable-find idna-program)) "Whether IDNA decoding of headers is used when viewing messages. @@ -1772,19 +1774,12 @@ Initialized from `text-mode-syntax-table.") (re-search-forward (concat "^\\(" header "\\):") nil t)) (defsubst gnus-article-hide-text (b e props) - "Set text PROPS on the B to E region, extending `intangible' 1 past B." - (gnus-add-text-properties-when 'article-type nil b e props) - (when (memq 'intangible props) - (put-text-property - (max (1- b) (point-min)) - b 'intangible (cddr (memq 'intangible props))))) + "Set text PROPS on the B to E region." + (gnus-add-text-properties-when 'article-type nil b e props)) (defsubst gnus-article-unhide-text (b e) "Remove hidden text properties from region between B and E." - (remove-text-properties b e gnus-hidden-properties) - (when (memq 'intangible gnus-hidden-properties) - (put-text-property (max (1- b) (point-min)) - b 'intangible nil))) + (remove-text-properties b e gnus-hidden-properties)) (defun gnus-article-hide-text-type (b e type) "Hide text of TYPE between B and E." @@ -1796,10 +1791,7 @@ Initialized from `text-mode-syntax-table.") "Unhide text of TYPE between B and E." (gnus-delete-wash-type type) (remove-text-properties - b e (cons 'article-type (cons type gnus-hidden-properties))) - (when (memq 'intangible gnus-hidden-properties) - (put-text-property (max (1- b) (point-min)) - b 'intangible nil))) + b e (cons 'article-type (cons type gnus-hidden-properties)))) (defun gnus-article-delete-text-of-type (type) "Delete text of TYPE in the current buffer." @@ -2329,7 +2321,7 @@ long lines if and only if arg is positive." (goto-char (point-max)) (let ((start (point))) (insert "X-Boundary: ") - (gnus-add-text-properties start (point) '(invisible t intangible t)) + (gnus-add-text-properties start (point) gnus-hidden-properties) (insert (let (str (max (window-width))) (if (featurep 'xemacs) (setq max (1- max))) @@ -2795,9 +2787,9 @@ summary buffer." (defun gnus-article-browse-html-save-cid-content (cid handles directory) "Find CID content in HANDLES and save it in a file in DIRECTORY. -Return file name." +Return file name relative to the parent of DIRECTORY." (save-match-data - (let (file) + (let (file afile) (catch 'found (dolist (handle handles) (cond @@ -2810,16 +2802,16 @@ Return file name." cid handle directory)) (throw 'found file))) ((equal (concat "<" cid ">") (mm-handle-id handle)) - (setq file - (expand-file-name - (or (mm-handle-filename handle) - (concat - (make-temp-name "cid") - (car (rassoc (car (mm-handle-type handle)) - mailcap-mime-extensions)))) - directory)) - (mm-save-part-to-file handle file) - (throw 'found file)))))))) + (setq file (or (mm-handle-filename handle) + (concat + (make-temp-name "cid") + (car (rassoc (car (mm-handle-type handle)) + mailcap-mime-extensions)))) + afile (expand-file-name file directory)) + (mm-save-part-to-file handle afile) + (throw 'found (concat (file-name-nondirectory + (directory-file-name directory)) + "/" file))))))))) (defun gnus-article-browse-html-parts (list &optional header) "View all \"text/html\" parts from LIST. @@ -2855,8 +2847,32 @@ message header will be added to the bodies of the \"text/html\" parts." (insert content) ;; resolve cid contents (let ((case-fold-search t) - cid-file) + st base regexp cid-file) (goto-char (point-min)) + (when (and (re-search-forward "
]" nil t) + (progn + (setq st (match-end 0)) + (re-search-forward "]" nil t)) + (re-search-backward "