* lisp/gnus: Use lexical-binding in all the files
* lisp/gnus/gnus-group.el (features): Use `dlet`.
(gnus-tmp-level, gnus-tmp-marked, gnus-tmp-group): Declare vars.
(gnus-group-insert-group-line): Bind dynbound vars via `let` rather
than as formal args. Bind `number` as dynbound.
(gnus-visual, gnus-score-find-score-files-function)
(gnus-home-score-file, gnus-apply-kill-hook)
(gnus-summary-expunge-below): Declare vars.
(gnus-group-restart, gnus-group-list-plus): Fix `interactive` spec
since the arg is unused.
* lisp/gnus/mail-source.el (mail-source-bind, mail-source-bind-common):
Use `dlet` and suppress the warnings about the non-prefixed dynbound vars.
(mail-source-set-1): Remove unused var `auth-info`.
(mail-source-call-script): Remove unused var `background`.
(mail-source-fetch-pop, mail-source-check-pop): Bind pop3 vars with `dlet`.
* lisp/gnus/gnus-int.el (mail-source-plugged, gnus-inhibit-demon):
Declare vars.
(gnus-server-opened, gnus-status-message)
(gnus-open-server, gnus-close-server, gnus-request-list)
(gnus-finish-retrieve-group-infos, gnus-retrieve-group-data-early)
(gnus-request-list-newsgroups, gnus-request-newgroups)
(gnus-request-regenerate, gnus-request-compact, gnus-request-group)
(gnus-retrieve-groups, gnus-request-post, gnus-request-expunge-group)
(gnus-request-scan, gnus-request-update-info, gnus-request-marks)
(gnus-request-accept-article, gnus-request-create-group)
(gnus-asynchronous-p, gnus-remove-denial):
Bind `gnus-command-method` via `let` rather than as formal args.
* lisp/gnus/gnus-topic.el (gnus-topic-insert-topic-line):
Pass documented vars to eval for `gnus-topic-line-format-spec`.
* lisp/gnus/message.el (message-yank-original): Use `cl-progv` rather
than `eval` to bind the vars from `message-cite-style`.
* lisp/gnus/mml.el (mml-parse-1): Use `apply` instead of `eval`.
(gnus-newsgroup-name, gnus-displaying-mime, gnus-newsgroup-name)
(gnus-article-prepare-hook, gnus-newsgroup-charset)
(gnus-original-article-buffer, gnus-message-buffer)
(message-this-is-news, message-this-is-mail): Declare vars.
* lisp/gnus/deuglify.el (gnus-outlook-rearrange-article): Remove unused
var `cite-marks`.
* lisp/gnus/gnus-art.el (ansi-color-context-region): Declare var.
(gnus-mime-display-attachment-buttons-in-header): Move declaration
before first use.
(gnus-mime-display-alternative): Remove unused var `from`.
* lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-list): Remove unused
var `start` `end`.
* lisp/gnus/gnus-cache.el (gnus-article-decode-hook)
(nnml-generate-active-function): Declare var.
* lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Remove unused
var `keywords`.
* lisp/gnus/gnus-cloud.el (gnus-cloud-encode-data): Remove unused var
`cipher`.
(gnus-cloud-ensure-cloud-group): Remove unused var `method`.
* lisp/gnus/gnus-delay.el (gnus-delay-article): Remove unused var `days`.
* lisp/gnus/gnus-html.el (gnus-html-wash-images): Remove unused vars
`tag`, `string`, and `images`.
(gnus-html-wash-tags): Remove unused vars `string` and `images`.
* lisp/gnus/gnus-msg.el (gnus-msg-mail): Remove unused var `group-name`.
(gnus-group-mail, gnus-group-news, gnus-summary-mail-other-window)
(gnus-summary-news-other-window):
Remove unused vars `group` and `buffer`.
(gnus-configure-posting-styles): Remove unused vars `style` and `attribute`.
* lisp/gnus/gnus-picon.el (gnus-picon-find-face): Remove unused vars
`database`, `directory`, and `instance`.
(gnus-picon-transform-newsgroups): Remove unused var `point`.
* lisp/gnus/gnus-range.el (gnus-range-difference): Remove unused var `safe`.
* lisp/gnus/gnus-score.el (gnus-score-load-file): Remove unused var
`score-fn`.
* lisp/gnus/gnus-sum.el (message-options-set-recipient): Declare var.
* lisp/gnus/gnus-undo.el (gnus-undo): Fix docstring lie.
* lisp/gnus/gnus-util.el (print-string-length)
(iswitchb-make-buflist-hook): Declare vars.
(gnus-emacs-version): Remove unused var `codename`.
(gnus-rename-file): Remove unused vars `old-name` and `new-name`.
* lisp/gnus/gnus-uu.el (gnus-uu-yenc-article): Remove unused var
`start-char`.
(gnus-asynchronous): Declare var.
* lisp/gnus/mm-partial.el (gnus-displaying-mime): Declare var.
(mm-inline-partial): Remove unused var `buffer`.
* lisp/gnus/mm-view.el (w3m-force-redisplay, w3m-safe-url-regexp)
(gnus-displaying-mime, gnus-original-article-buffer)
(gnus-article-prepare-hook): Declare vars.
* lisp/gnus/mml-smime.el (mml-smime-epg-encrypt): Remove unused var
`boundary`.
(mml-smime-epg-verify): Remove unused vars `plain` and `signature-file`.
* lisp/gnus/mml1991.el (pgg-text-mode): Declare var.
* lisp/gnus/mml2015.el (pgg-text-mode): Declare var.
(mml2015-pgg-decrypt): Remove unused var `result`.
(mml2015-epg-key-image-to-string): Remove unused var `error`.
(mml2015-epg-decrypt): Remove unused var `result`.
(mml2015-epg-verify): Remove unused vars `plain` and `signature-file`.
* lisp/gnus/nnbabyl.el (nnml-current-directory): Declare var.
* lisp/gnus/nndiary.el (nndiary-files): Move declaration before first use.
* lisp/gnus/nnfolder.el (nnfolder-request-accept-article):
Remove unused var `buf`.
* lisp/gnus/nnmail.el (nnmail-parse-active): Remove unused var `err`.
* lisp/gnus/nnmairix.el (nnmairix-request-group): Remove unused var `args`.
(nnmairix-request-create-group): Remove unused var `info`.
(nnmairix-request-list): Remove unused var `folder`.
(nnmairix-request-set-mark): Remove unused var `propto`.
(nnmairix-request-set-mark): Remove unused vars `number` and `method`.
(nnmairix-close-group): Remove unused var `method`.
(nnmairix-create-search-group-from-message): Remove unused var `cq`.
(nnmairix-create-server-and-default-group): Remove unused var `create`.
(nnmairix-purge-old-groups): Remove unused var `folder`.
(nnmairix-remove-tick-mark-original-article, nnmairix-get-valid-servers):
Remove unused var `cur`.
(nnmairix-replace-group-and-numbers): Remove unused var `header`.
(nnmairix-goto-original-article): Remove unused var `rval`.
(nnmairix-widget-create-query): Remove unused var `allwidgets`.
* lisp/gnus/nnmbox.el (nnml-current-directory): Declare var.
* lisp/gnus/nnmh.el (nnmh-toplev): Move declaration before first use.
(nnmh-request-list-1): Remove unused var `rdir`.
* lisp/gnus/nnml.el (nnml-generate-nov-file): Remove unused var `file`.
* lisp/gnus/nnrss.el (nnrss-request-article): Remove unused var `post`.
(nnrss-request-article): Remove unused var `fn`.
(nnrss-check-group): Remove unused var `rdf-ns`.
* lisp/gnus/nnweb.el (nnweb-request-article): Remove unused var `active`.
(nnweb-google-parse-1): Remove unused var `Score`.
* lisp/gnus/spam-stat.el (spam-stat-error-holder): Remove var.
(spam-stat-buffer-words-with-scores): Remove unused var `word`.
(spam-stat-score-buffer): Remove unused var `spam-stat-error-holder`.
(spam-stat-split-fancy): Use `err` instead of `spam-stat-error-holder`.
* lisp/gnus/spam-wash.el (spam-wash): Remove unused var `handle`.
* lisp/gnus/spam.el (spam-copy-or-move-routine): Remove unused vars
`article` and `mark`.
(spam-register-routine): Remove unused var `article`.
(spam-log-undo-registration): Remove unused var `found`.
(spam-ifile-register-with-ifile): Remove unused var `parameters`.
(spam-check-stat): Remove unused vars `category` and `return`.
(spam-parse-list): Remove unused var `found`.
(spam-filelist-register-routine): Remove unused var `from`.
2021-01-30 18:44:00 -05:00
|
|
|
;;; mm-view.el --- functions for viewing MIME objects -*- lexical-binding: t; -*-
|
2005-08-06 19:51:42 +00:00
|
|
|
|
2022-01-01 02:45:51 -05:00
|
|
|
;; Copyright (C) 1998-2022 Free Software Foundation, Inc.
|
2000-09-19 13:40:08 +00:00
|
|
|
|
|
|
|
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
2008-05-06 03:56:49 +00:00
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
2000-09-19 13:40:08 +00:00
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 03:56:49 +00:00
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
2000-09-19 13:40:08 +00:00
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2008-05-06 03:56:49 +00:00
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2000-09-19 13:40:08 +00:00
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2017-09-13 15:52:52 -07:00
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2000-09-19 13:40:08 +00:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;;; Code:
|
2010-10-11 23:29:33 +00:00
|
|
|
|
2019-06-22 16:25:36 +02:00
|
|
|
(require 'cl-lib)
|
2000-09-19 13:40:08 +00:00
|
|
|
(require 'mail-parse)
|
|
|
|
(require 'mailcap)
|
|
|
|
(require 'mm-bodies)
|
|
|
|
(require 'mm-decode)
|
2007-10-28 09:18:39 +00:00
|
|
|
(require 'smime)
|
2011-01-02 11:23:02 +00:00
|
|
|
(require 'mml-smime)
|
2000-09-19 13:40:08 +00:00
|
|
|
|
Merge changes made in Gnus trunk.
nndraft.el (nndraft-request-expire-articles): Use the group name instead if "nndraft".
gnus.texi (Using IMAP): Remove the @acronyms from the headings.
nnregistry.el: Added.
nnimap.el (nnimap-insert-partial-structure): Be way more permissive when interpreting the structures.
GNUS-NEWS: Minor error in GNUS-NEWS - password-cache.el.
nnimap.el (nnimap-request-accept-article): Add \r\n to the lines to make this work with Cyrus.
gnus-registry.el: Don't prompt on load, which makes it impossible to build Gnus.
gnus-gravatar.el: Add gnus-gravatar-properties.
gnus-agent.el, gnus-art.el, gnus-bookmark.el, gnus-dired.el, gnus-group.el,\
gnus-int.el, gnus-msg.el, gnus-registry.el, gnus-score.el, gnus-srvr.el,\
gnus-sum.el, gnus-topic.el, gnus-util.el, gnus.el, mm-decode.el, mm-util.el,\
mm-view.el, mml-smime.el, mml.el, nnmairix.el, nnrss.el, smime.el:\
Introduce gnus-completing-read.
gnus-util.el: Make completing-read function configurable.
gnus-util.el: Add requires and fix history for iswitchb.
webmail.el: Remove netscape/my-deja, since they no longer exist.
gnus.el (gnus-local-domain): Declare variable obsolete.
nnimap.el (nnimap-insert-partial-structure): Get the type from the correct slot, too.
pop3.el (pop3-send-streaming-command, pop3-stream-length): New variable.
nnimap.el (nnimap-open-connection): Revert the auto-network->starttls code.
nnimap.el (nnimap-request-set-mark): Erase the buffer before issuing commands.
nnimap.el (nnimap-split-rule): Mark as obsolete.
gnus-sum.el (gnus-valid-move-group-p): Make sure that `group' is a symbol.
nnimap.el (nnimap-split-incoming-mail): Allow `default' as nnimap-split-methods value.
nnimap.el (nnimap-request-article): Downcase the NILs so that they are nil.
nndoc.el (nndoc-retrieve-groups): New function.
gnus.texi: Fix Gravatar documentation.
2010-09-30 08:39:23 +00:00
|
|
|
(autoload 'gnus-completing-read "gnus-util")
|
2008-06-11 03:13:28 +00:00
|
|
|
(autoload 'gnus-article-prepare-display "gnus-art")
|
|
|
|
(autoload 'vcard-parse-string "vcard")
|
|
|
|
(autoload 'vcard-format-string "vcard")
|
|
|
|
(autoload 'fill-flowed "flow-fill")
|
|
|
|
(autoload 'html2text "html2text" nil t)
|
2000-09-19 13:40:08 +00:00
|
|
|
|
2005-08-31 13:07:49 +00:00
|
|
|
(defvar gnus-article-mime-handles)
|
|
|
|
(defvar gnus-newsgroup-charset)
|
|
|
|
(defvar smime-keys)
|
|
|
|
(defvar w3m-cid-retrieve-function-alist)
|
|
|
|
(defvar w3m-current-buffer)
|
|
|
|
(defvar w3m-display-inline-images)
|
|
|
|
(defvar w3m-minor-mode-map)
|
|
|
|
|
2004-09-04 13:13:48 +00:00
|
|
|
(defvar mm-text-html-renderer-alist
|
2010-10-20 22:29:38 +00:00
|
|
|
'((shr . mm-shr)
|
2004-09-04 13:13:48 +00:00
|
|
|
(w3m . mm-inline-text-html-render-with-w3m)
|
2006-01-16 09:27:43 +00:00
|
|
|
(w3m-standalone . mm-inline-text-html-render-with-w3m-standalone)
|
2010-10-20 22:29:38 +00:00
|
|
|
(gnus-w3m . gnus-article-html)
|
2021-09-26 08:29:38 +02:00
|
|
|
(links . mm-inline-render-with-links)
|
2010-10-20 22:29:38 +00:00
|
|
|
(lynx mm-inline-render-with-stdin nil
|
|
|
|
"lynx" "-dump" "-force_html" "-stdin" "-nolist")
|
|
|
|
(html2text mm-inline-render-with-function html2text))
|
2004-09-04 13:13:48 +00:00
|
|
|
"The attributes of renderer types for text/html.")
|
|
|
|
|
2006-02-24 05:02:12 +00:00
|
|
|
(defcustom mm-fill-flowed t
|
2020-08-02 19:44:30 +02:00
|
|
|
"If non-nil, format=flowed articles will be displayed flowed."
|
2006-02-24 05:02:12 +00:00
|
|
|
:type 'boolean
|
|
|
|
:version "22.1"
|
|
|
|
:group 'mime-display)
|
|
|
|
|
2020-08-02 19:44:30 +02:00
|
|
|
;; Not a defcustom, since it's usually overridden by the callers of
|
|
|
|
;; the mm functions.
|
|
|
|
(defvar mm-inline-font-lock t
|
|
|
|
"If non-nil, do font locking of inline media types that support it.")
|
|
|
|
|
2010-10-04 00:17:16 +00:00
|
|
|
(defcustom mm-inline-large-images-proportion 0.9
|
2019-09-16 22:31:29 +02:00
|
|
|
"Maximum proportion large images can occupy in the buffer.
|
|
|
|
This is only used if `mm-inline-large-images' is set to
|
|
|
|
`resize'."
|
2010-10-04 00:17:16 +00:00
|
|
|
:type 'float
|
|
|
|
:version "24.1"
|
|
|
|
:group 'mime-display)
|
|
|
|
|
2004-09-04 13:13:48 +00:00
|
|
|
;;; Internal variables.
|
|
|
|
|
2000-09-19 13:40:08 +00:00
|
|
|
;;;
|
|
|
|
;;; Functions for displaying various formats inline
|
|
|
|
;;;
|
2004-09-04 13:13:48 +00:00
|
|
|
|
2010-10-31 18:49:16 -07:00
|
|
|
(autoload 'gnus-rescale-image "gnus-util")
|
|
|
|
|
2016-02-12 15:02:32 +11:00
|
|
|
(defun mm-inline-image (handle)
|
2000-09-19 13:40:08 +00:00
|
|
|
(let ((b (point-marker))
|
2008-03-12 19:04:56 +00:00
|
|
|
(inhibit-read-only t))
|
2010-10-04 00:17:16 +00:00
|
|
|
(put-image
|
|
|
|
(let ((image (mm-get-image handle)))
|
|
|
|
(if (eq mm-inline-large-images 'resize)
|
2011-09-17 06:53:25 +02:00
|
|
|
(gnus-rescale-image
|
|
|
|
image
|
2016-02-10 09:53:13 +11:00
|
|
|
(let ((edges (window-inside-pixel-edges
|
2011-09-17 06:53:25 +02:00
|
|
|
(get-buffer-window (current-buffer)))))
|
|
|
|
(cons (truncate (* mm-inline-large-images-proportion
|
|
|
|
(- (nth 2 edges) (nth 0 edges))))
|
|
|
|
(truncate (* mm-inline-large-images-proportion
|
|
|
|
(- (nth 3 edges) (nth 1 edges)))))))
|
2010-10-04 00:17:16 +00:00
|
|
|
image))
|
|
|
|
b)
|
2014-05-02 09:44:34 +00:00
|
|
|
(insert "\n")
|
2000-09-19 13:40:08 +00:00
|
|
|
(mm-handle-set-undisplayer
|
|
|
|
handle
|
2021-01-30 18:56:37 -05:00
|
|
|
(lambda ()
|
|
|
|
(let ((inhibit-read-only t))
|
|
|
|
(remove-images b b)
|
|
|
|
(delete-region b (1+ b)))))))
|
2000-09-19 13:40:08 +00:00
|
|
|
|
2004-09-04 13:13:48 +00:00
|
|
|
(defvar mm-w3m-setup nil
|
|
|
|
"Whether gnus-article-mode has been setup to use emacs-w3m.")
|
|
|
|
|
2007-12-09 02:10:57 +00:00
|
|
|
;; External.
|
|
|
|
(declare-function w3m-detect-meta-charset "ext:w3m" ())
|
|
|
|
(declare-function w3m-region "ext:w3m" (start end &optional url charset))
|
|
|
|
|
2004-09-04 13:13:48 +00:00
|
|
|
(defun mm-setup-w3m ()
|
|
|
|
"Setup gnus-article-mode to use emacs-w3m."
|
|
|
|
(unless mm-w3m-setup
|
|
|
|
(require 'w3m)
|
|
|
|
(unless (assq 'gnus-article-mode w3m-cid-retrieve-function-alist)
|
|
|
|
(push (cons 'gnus-article-mode 'mm-w3m-cid-retrieve)
|
|
|
|
w3m-cid-retrieve-function-alist))
|
|
|
|
(setq mm-w3m-setup t))
|
2016-02-08 22:41:25 +00:00
|
|
|
(setq w3m-display-inline-images (not mm-html-inhibit-images)))
|
2004-09-04 13:13:48 +00:00
|
|
|
|
|
|
|
(defun mm-w3m-cid-retrieve-1 (url handle)
|
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Merge from gnus--rel--5.10
Patches applied:
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-55
Update from CVS
2004-10-19 Katsumi Yamaoka <yamaoka@jpl.org>
* lisp/gnus/gnus-sum.el (gnus-update-summary-mark-positions): Search for
dummy marks in the right way.
2004-10-18 Kevin Greiner <kgreiner@compsol.cc>
* lisp/gnus/nnagent.el (nnagent-request-type): Bind gnus-agent to nil to
avoid infinite recursion via gnus-get-function.
2004-10-18 Kevin Greiner <kgreiner@compsol.cc>
* lisp/gnus/gnus-agent.el (gnus-agent-synchronize-group-flags): When
necessary, pass full group name to gnus-request-set-marks.
(gnus-agent-synchronize-group-flags): Added support for sync'ing
tick marks.
(gnus-agent-synchronize-flags-server): Be silent when writing file.
2004-10-18 Kevin Greiner <kgreiner@compsol.cc>
* lisp/gnus/gnus-agent.el (gnus-agent-synchronize-group-flags): Replaced
gnus-request-update-info with explicit code to sync the in-memory
info read flags with the marks being sync'd to the backend.
2004-10-18 Kevin Greiner <kgreiner@compsol.cc>
* lisp/gnus/gnus-agent.el (gnus-agent-possibly-synchronize-flags): Ignore
servers that are offline. Avoids having gnus-agent-toggle-plugged
first ask if you want to open a server and then, even when you
responded with no, asking if you want to synchronize the server's
flags.
(gnus-agent-synchronize-flags-server): Rewrote read loop to handle
multi-line expressions.
(gnus-agent-synchronize-group-flags): New internal function.
Updates marks in memory (in the info structure) AND in the
backend.
(gnus-agent-check-overview-buffer): Fixed range of
deletion to remove entire duplicate line. Fixes merged article
number bug.
* lisp/gnus/gnus-util.el (gnus-remassoc): Fixed typo in documentation.
* lisp/gnus/nnagent.el (nnagent-request-set-mark): Use
gnus-agent-synchronize-group-flags, not backend's request-set-mark
method, to ensure that synchronization updates marks in the
backend and in the info (in memory) structure.
2004-10-18 Kevin Greiner <kgreiner@compsol.cc>
* lisp/gnus/gnus-agent.el (gnus-agent-synchronize-flags-server): Do nothing
unless plugged. Disable the agent so that an open failure causes
an error.
2004-10-18 Kevin Greiner <kevin.greiner@compsol.cc> for Reiner Steib <Reiner.Steib@gmx.de>
* lisp/gnus/gnus-agent.el (gnus-agent-fetched-hook): Add :version.
(gnus-agent-go-online): Change :version.
(gnus-agent-expire-unagentized-dirs)
(gnus-agent-auto-agentize-methods): Add :version.
2004-10-18 Kevin Greiner <kgreiner@compsol.cc>
* lisp/gnus/legacy-gnus-agent.el (gnus-agent-convert-to-compressed-agentview-prompt):
New function. Used internally to only display 'gnus converting
files' message when actually necessary.
* lisp/gnus/gnus-sum.el (): Removed (require 'gnus-agent) as required
methods now autoloaded.
* lisp/gnus/gnus-int.el (gnus-request-move-article): Use
gnus-agent-unfetch-articles in place of gnus-agent-expire to
improve performance.
2004-10-18 Kevin Greiner <kgreiner@compsol.cc>
* lisp/gnus/gnus-agent.el (gnus-agent-cat-groups): rewrote avoiding defsetf
to avoid run-time CL dependencies.
(gnus-agent-unfetch-articles): New function.
(gnus-agent-fetch-headers): Use gnus-agent-braid-nov to validate
article numbers even when local .overview file is missing.
(gnus-agent-read-article-number): New function. Only accepts
27-bit article numbers.
(gnus-agent-copy-nov-line, gnus-agent-uncached-articles): Use
gnus-agent-read-article-number.
(gnus-agent-braid-nov): Rewrote to validate article numbers coming
from backend while recognizing that article numbers in .overview
must be valid.
* lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): Changed message text as
some users confused by references to .newsrc when they only have a
.newsrc.eld file.
(gnus-convert-mark-converter-prompt,
gnus-convert-converter-needs-prompt): Fixed use of property list.
2004-10-18 Kevin Greiner <kevin.greiner@compsol.cc> for Katsumi Yamaoka <yamaoka@jpl.org>
* lisp/gnus/gnus-agent.el (gnus-agent-restore-gcc): Use ^ and regexp-quote.
2004-10-18 Kevin Greiner <kevin.greiner@compsol.cc> for Lars Magne Ingebrigtsen <larsi@gnus.org>
* lisp/gnus/gnus-start.el (gnus-get-unread-articles-in-group): Don't do
stuff for non-living groups.
2004-10-18 Kevin Greiner <kevin.greiner@compsol.cc> for Lars Magne Ingebrigtsen <larsi@gnus.org>
* lisp/gnus/gnus-agent.el (gnus-agent-synchronize-flags): Default to nil.
(gnus-agent-regenerate-group): Using nil messages aren't valid.
2004-10-18 Kevin Greiner <kevin.greiner@compsol.cc> for Lars Magne Ingebrigtsen <larsi@gnus.org>
* lisp/gnus/gnus-agent.el (gnus-agent-read-agentview): Inline
gnus-uncompress-range.
2004-10-18 Kevin Greiner <kgreiner@xpediantsolutions.com>
* lisp/gnus/legacy-gnus-agent.el
(gnus-agent-convert-to-compressed-agentview): Fixed typos with
help from Florian Weimer <fw@deneb.enyo.de>
* lisp/gnus/gnus-agent.el (gnus-agentize):
gnus-agent-send-mail-real-function no longer set to current value
of message-send-mail-function but rather a lambda that calls
message-send-mail-function. The change makes the agent real-time
responsive to user changes to message-send-mail-function.
2004-10-18 Kevin Greiner <kevin.greiner@compsol.cc> for Reiner Steib <Reiner.Steib@gmx.de>
* lisp/gnus/gnus-start.el (gnus-get-unread-articles): Fix last commit.
2004-10-18 Kevin Greiner <kgreiner@xpediantsolutions.com>
* lisp/gnus/gnus-cache.el (gnus-cache-rename-group): New function.
(gnus-cache-delete-group): New function.
* lisp/gnus/gnus-agent.el (gnus-agent-rename-group): New function.
(gnus-agent-delete-group): New function.
(gnus-agent-save-group-info): Use gnus-command-method when
`method' parameter is nil. Don't write nil entries into the
active file.
(gnus-agent-get-group-info): New function.
(gnus-agent-get-local): Added optional parameters to avoid calling
gnus-group-real-name and gnus-find-method-for-group.
(gnus-agent-set-local): Delete stored entry if either min, or max,
are nil.
(gnus-agent-fetch-session): Reworded error/quit messages. On
quit, use gnus-agent-regenerate-group to record existance of any
articles fetched to disk before the quit occurred.
* lisp/gnus/gnus-int.el (gnus-request-delete-group): Use
gnus-cache-delete-group and gnus-agent-delete-group to keep the
local disk in sync with the server.
(gnus-request-rename-group): Use
gnus-cache-rename-group and gnus-agent-rename-group to keep the
local disk in sync with the server.
* lisp/gnus/gnus-start.el (gnus-get-unread-articles): Cosmetic
simplification to logic.
* lisp/gnus/gnus-group.el (): (gnus-group-delete-group): No longer update
gnus-cache-active-altered as gnus-request-delete-group now keeps
the cache in sync.
(gnus-group-list-active): Let the agent store a server's active
list if currently plugged.
* lisp/gnus/gnus-util.el (gnus-rename-file): New function.
2004-10-18 Kevin Greiner <kevin.greiner@compsol.cc> for Katsumi Yamaoka <yamaoka@jpl.org>
* lisp/gnus/gnus-agent.el (gnus-agent-regenerate-group): Activate the group
when the group's active is not available.
2004-10-18 Kevin Greiner <kevin.greiner@compsol.cc> for Katsumi Yamaoka <yamaoka@jpl.org>
* lisp/gnus/gnus-agent.el (gnus-agent-read-agentview): Add a missing arg to
error.
2004-10-18 Kevin Greiner <kevin.greiner@compsol.cc>
* lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): Only write the
conversion message to newsrc-dribble when an actual conversion is
performed.
2004-10-18 Kevin Greiner <kevin.greiner@compsol.cc>
* lisp/gnus/gnus-agent.el (gnus-agent-read-local): Bind
nnheader-file-coding-system to gnus-agent-file-coding-system to
avoid the implicit assumption that they will always be equal.
(gnus-agent-save-local): Bind buffer-file-coding-system, not
coding-system-for-write, as the with-temp-file macro first prints
to a buffer then saves the buffer.
2004-10-18 Kevin Greiner <kgreiner@xpediantsolutions.com>
* lisp/gnus/legacy-gnus-agent.el (): New. Provides converters that are only
loaded when gnus-convert-old-newsrc needs to call them.
* lisp/gnus/gnus-agent.el (gnus-agent-read-agentview): Removed support for
old file versions.
(gnus-group-prepare-hook): Removed function that converted list
form of gnus-agent-expire-days to group properties.
* lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): Registered new
converters to handle old agent file formats. Added logic for a
"backup before upgrading warning".
(gnus-convert-mark-converter-prompt): Developers can mark
functions as needing (default), or not needing,
gnus-convert-old-newsrc's "backup before upgrading warning".
(gnus-convert-converter-needs-prompt): Tests whether the user
should be protected from potentially irreversable changes by the
function.
2004-10-18 Kevin Greiner <kgreiner@xpediantsolutions.com>
* lisp/gnus/gnus-int.el (gnus-request-accept-article): Inform the agent that
articles are being added to a group.
(gnus-request-replace-article): Inform the agent that articles
need to be uncached as the cached contents are no longer valid.
* lisp/gnus/gnus-agent.el (gnus-agent-file-header-cache): Removed.
(gnus-agent-possibly-alter-active): Avoid null in numeric
comparison.
(gnus-agent-set-local): Refuse to save null in local object table.
(gnus-agent-regenerate-group): The REREAD parameter can now be a
list of articles that will be marked as unread.
2004-10-18 Kevin Greiner <kevin.greiner@compsol.cc>
* lisp/gnus/gnus-range.el (gnus-sorted-range-intersection): Now accepts
single-interval range of the form (min . max). Previously the
range had to look like ((min . max)). Likewise, return
(min . max) rather than ((min . max)).
(gnus-range-map): Use gnus-range-normalize to accept
single-interval range.
* lisp/gnus/gnus-sum.el (gnus-summary-highlight-line): Articles stored in
the cache, but not the agent, now appear with their usual face.
2004-10-18 Kevin Greiner <kevin.greiner@compsol.cc>
* lisp/gnus/gnus-sum.el (gnus-adjust-marks): Now correctly handles a list of
marks consisting of a single range {for example, (3 . 5)} rather
than a list of a single range { ((3 . 5)) }.
2004-10-18 Kevin Greiner <kevin.greiner@compsol.cc>
* lisp/gnus/gnus-sum.el (gnus-adjust-marks): Avoid splicing null INTO the
uncompressed list.
2004-10-18 Kevin Greiner <kevin.greiner@compsol.cc>
* lisp/gnus/gnus-draft.el (gnus-group-send-queue): Pass the group name
"nndraft:queue" along to gnus-draft-send. Use
gnus-agent-prompt-send-queue.
(gnus-draft-send): Rebind gnus-agent-queue-mail to nil when group
is "nndraft:queue". Suggested by Gaute Strokkenes
<gs234@srcf.ucam.org>
* lisp/gnus/gnus-group.el (gnus-group-catchup): Use new
gnus-sequence-of-unread-articles, not
gnus-list-of-unread-articles, to avoid exhausting memory with huge
numbers of articles. Use gnus-range-map to avoid having to
uncompress the unread list.
(gnus-group-archive-directory,
gnus-group-recent-archive-directory): Fixed invalid ange-ftp
reference.
* lisp/gnus/gnus-range.el (gnus-range-map): Iterate over list or sequence.
(gnus-sorted-range-intersection): Intersection of two ranges
without requiring that they first be uncompressed.
* lisp/gnus/gnus-start.el (gnus-activate-group): Unless blocked by the
caller, possibly expand the active range to include both cached
and agentized articles.
(gnus-convert-old-newsrc): Rewrote in anticipation of having
multiple version-dependent converters.
(gnus-groups-to-gnus-format): Replaced gnus-agent-save-groups with
gnus-agent-save-active.
(gnus-save-newsrc-file): Save dirty agent range limits.
* lisp/gnus/gnus-sum.el (gnus-select-newgroup): Replaced inline code with
gnus-agent-possibly-alter-active.
(gnus-adjust-marked-articles): Faster handling of simple lists
2004-10-18 David Edmondson <dme@dme.org>
* lisp/gnus/mm-view.el (mm-w3m-cid-retrieve-1): Don't use recursive call
excessively.
2004-10-19 22:38:28 +00:00
|
|
|
(dolist (elem handle)
|
2006-03-06 10:27:26 +00:00
|
|
|
(when (consp elem)
|
|
|
|
(when (equal url (mm-handle-id elem))
|
|
|
|
(mm-insert-part elem)
|
|
|
|
(throw 'found-handle (mm-handle-media-type elem)))
|
|
|
|
(when (and (stringp (car elem))
|
|
|
|
(equal "multipart" (mm-handle-media-supertype elem)))
|
|
|
|
(mm-w3m-cid-retrieve-1 url elem)))))
|
2004-09-04 13:13:48 +00:00
|
|
|
|
* lisp/gnus: Use lexical-binding in all the files
* lisp/gnus/gnus-group.el (features): Use `dlet`.
(gnus-tmp-level, gnus-tmp-marked, gnus-tmp-group): Declare vars.
(gnus-group-insert-group-line): Bind dynbound vars via `let` rather
than as formal args. Bind `number` as dynbound.
(gnus-visual, gnus-score-find-score-files-function)
(gnus-home-score-file, gnus-apply-kill-hook)
(gnus-summary-expunge-below): Declare vars.
(gnus-group-restart, gnus-group-list-plus): Fix `interactive` spec
since the arg is unused.
* lisp/gnus/mail-source.el (mail-source-bind, mail-source-bind-common):
Use `dlet` and suppress the warnings about the non-prefixed dynbound vars.
(mail-source-set-1): Remove unused var `auth-info`.
(mail-source-call-script): Remove unused var `background`.
(mail-source-fetch-pop, mail-source-check-pop): Bind pop3 vars with `dlet`.
* lisp/gnus/gnus-int.el (mail-source-plugged, gnus-inhibit-demon):
Declare vars.
(gnus-server-opened, gnus-status-message)
(gnus-open-server, gnus-close-server, gnus-request-list)
(gnus-finish-retrieve-group-infos, gnus-retrieve-group-data-early)
(gnus-request-list-newsgroups, gnus-request-newgroups)
(gnus-request-regenerate, gnus-request-compact, gnus-request-group)
(gnus-retrieve-groups, gnus-request-post, gnus-request-expunge-group)
(gnus-request-scan, gnus-request-update-info, gnus-request-marks)
(gnus-request-accept-article, gnus-request-create-group)
(gnus-asynchronous-p, gnus-remove-denial):
Bind `gnus-command-method` via `let` rather than as formal args.
* lisp/gnus/gnus-topic.el (gnus-topic-insert-topic-line):
Pass documented vars to eval for `gnus-topic-line-format-spec`.
* lisp/gnus/message.el (message-yank-original): Use `cl-progv` rather
than `eval` to bind the vars from `message-cite-style`.
* lisp/gnus/mml.el (mml-parse-1): Use `apply` instead of `eval`.
(gnus-newsgroup-name, gnus-displaying-mime, gnus-newsgroup-name)
(gnus-article-prepare-hook, gnus-newsgroup-charset)
(gnus-original-article-buffer, gnus-message-buffer)
(message-this-is-news, message-this-is-mail): Declare vars.
* lisp/gnus/deuglify.el (gnus-outlook-rearrange-article): Remove unused
var `cite-marks`.
* lisp/gnus/gnus-art.el (ansi-color-context-region): Declare var.
(gnus-mime-display-attachment-buttons-in-header): Move declaration
before first use.
(gnus-mime-display-alternative): Remove unused var `from`.
* lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-list): Remove unused
var `start` `end`.
* lisp/gnus/gnus-cache.el (gnus-article-decode-hook)
(nnml-generate-active-function): Declare var.
* lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Remove unused
var `keywords`.
* lisp/gnus/gnus-cloud.el (gnus-cloud-encode-data): Remove unused var
`cipher`.
(gnus-cloud-ensure-cloud-group): Remove unused var `method`.
* lisp/gnus/gnus-delay.el (gnus-delay-article): Remove unused var `days`.
* lisp/gnus/gnus-html.el (gnus-html-wash-images): Remove unused vars
`tag`, `string`, and `images`.
(gnus-html-wash-tags): Remove unused vars `string` and `images`.
* lisp/gnus/gnus-msg.el (gnus-msg-mail): Remove unused var `group-name`.
(gnus-group-mail, gnus-group-news, gnus-summary-mail-other-window)
(gnus-summary-news-other-window):
Remove unused vars `group` and `buffer`.
(gnus-configure-posting-styles): Remove unused vars `style` and `attribute`.
* lisp/gnus/gnus-picon.el (gnus-picon-find-face): Remove unused vars
`database`, `directory`, and `instance`.
(gnus-picon-transform-newsgroups): Remove unused var `point`.
* lisp/gnus/gnus-range.el (gnus-range-difference): Remove unused var `safe`.
* lisp/gnus/gnus-score.el (gnus-score-load-file): Remove unused var
`score-fn`.
* lisp/gnus/gnus-sum.el (message-options-set-recipient): Declare var.
* lisp/gnus/gnus-undo.el (gnus-undo): Fix docstring lie.
* lisp/gnus/gnus-util.el (print-string-length)
(iswitchb-make-buflist-hook): Declare vars.
(gnus-emacs-version): Remove unused var `codename`.
(gnus-rename-file): Remove unused vars `old-name` and `new-name`.
* lisp/gnus/gnus-uu.el (gnus-uu-yenc-article): Remove unused var
`start-char`.
(gnus-asynchronous): Declare var.
* lisp/gnus/mm-partial.el (gnus-displaying-mime): Declare var.
(mm-inline-partial): Remove unused var `buffer`.
* lisp/gnus/mm-view.el (w3m-force-redisplay, w3m-safe-url-regexp)
(gnus-displaying-mime, gnus-original-article-buffer)
(gnus-article-prepare-hook): Declare vars.
* lisp/gnus/mml-smime.el (mml-smime-epg-encrypt): Remove unused var
`boundary`.
(mml-smime-epg-verify): Remove unused vars `plain` and `signature-file`.
* lisp/gnus/mml1991.el (pgg-text-mode): Declare var.
* lisp/gnus/mml2015.el (pgg-text-mode): Declare var.
(mml2015-pgg-decrypt): Remove unused var `result`.
(mml2015-epg-key-image-to-string): Remove unused var `error`.
(mml2015-epg-decrypt): Remove unused var `result`.
(mml2015-epg-verify): Remove unused vars `plain` and `signature-file`.
* lisp/gnus/nnbabyl.el (nnml-current-directory): Declare var.
* lisp/gnus/nndiary.el (nndiary-files): Move declaration before first use.
* lisp/gnus/nnfolder.el (nnfolder-request-accept-article):
Remove unused var `buf`.
* lisp/gnus/nnmail.el (nnmail-parse-active): Remove unused var `err`.
* lisp/gnus/nnmairix.el (nnmairix-request-group): Remove unused var `args`.
(nnmairix-request-create-group): Remove unused var `info`.
(nnmairix-request-list): Remove unused var `folder`.
(nnmairix-request-set-mark): Remove unused var `propto`.
(nnmairix-request-set-mark): Remove unused vars `number` and `method`.
(nnmairix-close-group): Remove unused var `method`.
(nnmairix-create-search-group-from-message): Remove unused var `cq`.
(nnmairix-create-server-and-default-group): Remove unused var `create`.
(nnmairix-purge-old-groups): Remove unused var `folder`.
(nnmairix-remove-tick-mark-original-article, nnmairix-get-valid-servers):
Remove unused var `cur`.
(nnmairix-replace-group-and-numbers): Remove unused var `header`.
(nnmairix-goto-original-article): Remove unused var `rval`.
(nnmairix-widget-create-query): Remove unused var `allwidgets`.
* lisp/gnus/nnmbox.el (nnml-current-directory): Declare var.
* lisp/gnus/nnmh.el (nnmh-toplev): Move declaration before first use.
(nnmh-request-list-1): Remove unused var `rdir`.
* lisp/gnus/nnml.el (nnml-generate-nov-file): Remove unused var `file`.
* lisp/gnus/nnrss.el (nnrss-request-article): Remove unused var `post`.
(nnrss-request-article): Remove unused var `fn`.
(nnrss-check-group): Remove unused var `rdf-ns`.
* lisp/gnus/nnweb.el (nnweb-request-article): Remove unused var `active`.
(nnweb-google-parse-1): Remove unused var `Score`.
* lisp/gnus/spam-stat.el (spam-stat-error-holder): Remove var.
(spam-stat-buffer-words-with-scores): Remove unused var `word`.
(spam-stat-score-buffer): Remove unused var `spam-stat-error-holder`.
(spam-stat-split-fancy): Use `err` instead of `spam-stat-error-holder`.
* lisp/gnus/spam-wash.el (spam-wash): Remove unused var `handle`.
* lisp/gnus/spam.el (spam-copy-or-move-routine): Remove unused vars
`article` and `mark`.
(spam-register-routine): Remove unused var `article`.
(spam-log-undo-registration): Remove unused var `found`.
(spam-ifile-register-with-ifile): Remove unused var `parameters`.
(spam-check-stat): Remove unused vars `category` and `return`.
(spam-parse-list): Remove unused var `found`.
(spam-filelist-register-routine): Remove unused var `from`.
2021-01-30 18:44:00 -05:00
|
|
|
(defun mm-w3m-cid-retrieve (url &rest _args)
|
2004-09-04 13:13:48 +00:00
|
|
|
"Insert a content pointed by URL if it has the cid: scheme."
|
|
|
|
(when (string-match "\\`cid:" url)
|
2006-03-06 10:27:26 +00:00
|
|
|
(or (catch 'found-handle
|
|
|
|
(mm-w3m-cid-retrieve-1
|
|
|
|
(setq url (concat "<" (substring url (match-end 0)) ">"))
|
|
|
|
(with-current-buffer w3m-current-buffer
|
|
|
|
gnus-article-mime-handles)))
|
|
|
|
(prog1
|
|
|
|
nil
|
|
|
|
(message "Failed to find \"Content-ID: %s\"" url)))))
|
2004-09-04 13:13:48 +00:00
|
|
|
|
* lisp/gnus: Use lexical-binding in all the files
* lisp/gnus/gnus-group.el (features): Use `dlet`.
(gnus-tmp-level, gnus-tmp-marked, gnus-tmp-group): Declare vars.
(gnus-group-insert-group-line): Bind dynbound vars via `let` rather
than as formal args. Bind `number` as dynbound.
(gnus-visual, gnus-score-find-score-files-function)
(gnus-home-score-file, gnus-apply-kill-hook)
(gnus-summary-expunge-below): Declare vars.
(gnus-group-restart, gnus-group-list-plus): Fix `interactive` spec
since the arg is unused.
* lisp/gnus/mail-source.el (mail-source-bind, mail-source-bind-common):
Use `dlet` and suppress the warnings about the non-prefixed dynbound vars.
(mail-source-set-1): Remove unused var `auth-info`.
(mail-source-call-script): Remove unused var `background`.
(mail-source-fetch-pop, mail-source-check-pop): Bind pop3 vars with `dlet`.
* lisp/gnus/gnus-int.el (mail-source-plugged, gnus-inhibit-demon):
Declare vars.
(gnus-server-opened, gnus-status-message)
(gnus-open-server, gnus-close-server, gnus-request-list)
(gnus-finish-retrieve-group-infos, gnus-retrieve-group-data-early)
(gnus-request-list-newsgroups, gnus-request-newgroups)
(gnus-request-regenerate, gnus-request-compact, gnus-request-group)
(gnus-retrieve-groups, gnus-request-post, gnus-request-expunge-group)
(gnus-request-scan, gnus-request-update-info, gnus-request-marks)
(gnus-request-accept-article, gnus-request-create-group)
(gnus-asynchronous-p, gnus-remove-denial):
Bind `gnus-command-method` via `let` rather than as formal args.
* lisp/gnus/gnus-topic.el (gnus-topic-insert-topic-line):
Pass documented vars to eval for `gnus-topic-line-format-spec`.
* lisp/gnus/message.el (message-yank-original): Use `cl-progv` rather
than `eval` to bind the vars from `message-cite-style`.
* lisp/gnus/mml.el (mml-parse-1): Use `apply` instead of `eval`.
(gnus-newsgroup-name, gnus-displaying-mime, gnus-newsgroup-name)
(gnus-article-prepare-hook, gnus-newsgroup-charset)
(gnus-original-article-buffer, gnus-message-buffer)
(message-this-is-news, message-this-is-mail): Declare vars.
* lisp/gnus/deuglify.el (gnus-outlook-rearrange-article): Remove unused
var `cite-marks`.
* lisp/gnus/gnus-art.el (ansi-color-context-region): Declare var.
(gnus-mime-display-attachment-buttons-in-header): Move declaration
before first use.
(gnus-mime-display-alternative): Remove unused var `from`.
* lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-list): Remove unused
var `start` `end`.
* lisp/gnus/gnus-cache.el (gnus-article-decode-hook)
(nnml-generate-active-function): Declare var.
* lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Remove unused
var `keywords`.
* lisp/gnus/gnus-cloud.el (gnus-cloud-encode-data): Remove unused var
`cipher`.
(gnus-cloud-ensure-cloud-group): Remove unused var `method`.
* lisp/gnus/gnus-delay.el (gnus-delay-article): Remove unused var `days`.
* lisp/gnus/gnus-html.el (gnus-html-wash-images): Remove unused vars
`tag`, `string`, and `images`.
(gnus-html-wash-tags): Remove unused vars `string` and `images`.
* lisp/gnus/gnus-msg.el (gnus-msg-mail): Remove unused var `group-name`.
(gnus-group-mail, gnus-group-news, gnus-summary-mail-other-window)
(gnus-summary-news-other-window):
Remove unused vars `group` and `buffer`.
(gnus-configure-posting-styles): Remove unused vars `style` and `attribute`.
* lisp/gnus/gnus-picon.el (gnus-picon-find-face): Remove unused vars
`database`, `directory`, and `instance`.
(gnus-picon-transform-newsgroups): Remove unused var `point`.
* lisp/gnus/gnus-range.el (gnus-range-difference): Remove unused var `safe`.
* lisp/gnus/gnus-score.el (gnus-score-load-file): Remove unused var
`score-fn`.
* lisp/gnus/gnus-sum.el (message-options-set-recipient): Declare var.
* lisp/gnus/gnus-undo.el (gnus-undo): Fix docstring lie.
* lisp/gnus/gnus-util.el (print-string-length)
(iswitchb-make-buflist-hook): Declare vars.
(gnus-emacs-version): Remove unused var `codename`.
(gnus-rename-file): Remove unused vars `old-name` and `new-name`.
* lisp/gnus/gnus-uu.el (gnus-uu-yenc-article): Remove unused var
`start-char`.
(gnus-asynchronous): Declare var.
* lisp/gnus/mm-partial.el (gnus-displaying-mime): Declare var.
(mm-inline-partial): Remove unused var `buffer`.
* lisp/gnus/mm-view.el (w3m-force-redisplay, w3m-safe-url-regexp)
(gnus-displaying-mime, gnus-original-article-buffer)
(gnus-article-prepare-hook): Declare vars.
* lisp/gnus/mml-smime.el (mml-smime-epg-encrypt): Remove unused var
`boundary`.
(mml-smime-epg-verify): Remove unused vars `plain` and `signature-file`.
* lisp/gnus/mml1991.el (pgg-text-mode): Declare var.
* lisp/gnus/mml2015.el (pgg-text-mode): Declare var.
(mml2015-pgg-decrypt): Remove unused var `result`.
(mml2015-epg-key-image-to-string): Remove unused var `error`.
(mml2015-epg-decrypt): Remove unused var `result`.
(mml2015-epg-verify): Remove unused vars `plain` and `signature-file`.
* lisp/gnus/nnbabyl.el (nnml-current-directory): Declare var.
* lisp/gnus/nndiary.el (nndiary-files): Move declaration before first use.
* lisp/gnus/nnfolder.el (nnfolder-request-accept-article):
Remove unused var `buf`.
* lisp/gnus/nnmail.el (nnmail-parse-active): Remove unused var `err`.
* lisp/gnus/nnmairix.el (nnmairix-request-group): Remove unused var `args`.
(nnmairix-request-create-group): Remove unused var `info`.
(nnmairix-request-list): Remove unused var `folder`.
(nnmairix-request-set-mark): Remove unused var `propto`.
(nnmairix-request-set-mark): Remove unused vars `number` and `method`.
(nnmairix-close-group): Remove unused var `method`.
(nnmairix-create-search-group-from-message): Remove unused var `cq`.
(nnmairix-create-server-and-default-group): Remove unused var `create`.
(nnmairix-purge-old-groups): Remove unused var `folder`.
(nnmairix-remove-tick-mark-original-article, nnmairix-get-valid-servers):
Remove unused var `cur`.
(nnmairix-replace-group-and-numbers): Remove unused var `header`.
(nnmairix-goto-original-article): Remove unused var `rval`.
(nnmairix-widget-create-query): Remove unused var `allwidgets`.
* lisp/gnus/nnmbox.el (nnml-current-directory): Declare var.
* lisp/gnus/nnmh.el (nnmh-toplev): Move declaration before first use.
(nnmh-request-list-1): Remove unused var `rdir`.
* lisp/gnus/nnml.el (nnml-generate-nov-file): Remove unused var `file`.
* lisp/gnus/nnrss.el (nnrss-request-article): Remove unused var `post`.
(nnrss-request-article): Remove unused var `fn`.
(nnrss-check-group): Remove unused var `rdf-ns`.
* lisp/gnus/nnweb.el (nnweb-request-article): Remove unused var `active`.
(nnweb-google-parse-1): Remove unused var `Score`.
* lisp/gnus/spam-stat.el (spam-stat-error-holder): Remove var.
(spam-stat-buffer-words-with-scores): Remove unused var `word`.
(spam-stat-score-buffer): Remove unused var `spam-stat-error-holder`.
(spam-stat-split-fancy): Use `err` instead of `spam-stat-error-holder`.
* lisp/gnus/spam-wash.el (spam-wash): Remove unused var `handle`.
* lisp/gnus/spam.el (spam-copy-or-move-routine): Remove unused vars
`article` and `mark`.
(spam-register-routine): Remove unused var `article`.
(spam-log-undo-registration): Remove unused var `found`.
(spam-ifile-register-with-ifile): Remove unused var `parameters`.
(spam-check-stat): Remove unused vars `category` and `return`.
(spam-parse-list): Remove unused var `found`.
(spam-filelist-register-routine): Remove unused var `from`.
2021-01-30 18:44:00 -05:00
|
|
|
(defvar w3m-force-redisplay)
|
|
|
|
(defvar w3m-safe-url-regexp)
|
|
|
|
|
2004-09-04 13:13:48 +00:00
|
|
|
(defun mm-inline-text-html-render-with-w3m (handle)
|
|
|
|
"Render a text/html part using emacs-w3m."
|
|
|
|
(mm-setup-w3m)
|
|
|
|
(let ((text (mm-get-part handle))
|
|
|
|
(b (point))
|
2007-04-19 12:08:53 +00:00
|
|
|
(charset (or (mail-content-type-get (mm-handle-type handle) 'charset)
|
|
|
|
mail-parse-charset)))
|
2004-09-04 13:13:48 +00:00
|
|
|
(save-excursion
|
|
|
|
(insert (if charset (mm-decode-string text charset) text))
|
|
|
|
(save-restriction
|
|
|
|
(narrow-to-region b (point))
|
|
|
|
(unless charset
|
|
|
|
(goto-char (point-min))
|
|
|
|
(when (setq charset (w3m-detect-meta-charset))
|
2000-09-19 13:40:08 +00:00
|
|
|
(delete-region (point-min) (point-max))
|
2004-09-04 13:13:48 +00:00
|
|
|
(insert (mm-decode-string text charset))))
|
|
|
|
(let ((w3m-safe-url-regexp mm-w3m-safe-url-regexp)
|
|
|
|
w3m-force-redisplay)
|
|
|
|
(w3m-region (point-min) (point-max) nil charset))
|
2008-12-04 10:53:18 +00:00
|
|
|
;; Put the mark meaning this part was rendered by emacs-w3m.
|
|
|
|
(put-text-property (point-min) (point-max)
|
|
|
|
'mm-inline-text-html-with-w3m t)
|
2004-09-04 13:13:48 +00:00
|
|
|
(when (and mm-inline-text-html-with-w3m-keymap
|
|
|
|
(boundp 'w3m-minor-mode-map)
|
|
|
|
w3m-minor-mode-map)
|
2008-12-04 01:58:01 +00:00
|
|
|
(if (and (boundp 'w3m-link-map)
|
|
|
|
w3m-link-map)
|
2008-12-04 10:53:18 +00:00
|
|
|
(let* ((start (point-min))
|
|
|
|
(end (point-max))
|
|
|
|
(on (get-text-property start 'w3m-href-anchor))
|
|
|
|
(map (copy-keymap w3m-link-map))
|
|
|
|
next)
|
2008-12-04 01:58:01 +00:00
|
|
|
(set-keymap-parent map w3m-minor-mode-map)
|
2008-12-04 10:53:18 +00:00
|
|
|
(while (< start end)
|
|
|
|
(if on
|
|
|
|
(progn
|
|
|
|
(setq next (or (text-property-any start end
|
|
|
|
'w3m-href-anchor nil)
|
|
|
|
end))
|
|
|
|
(put-text-property start next 'keymap map))
|
|
|
|
(setq next (or (text-property-not-all start end
|
|
|
|
'w3m-href-anchor nil)
|
|
|
|
end))
|
|
|
|
(put-text-property start next 'keymap w3m-minor-mode-map))
|
|
|
|
(setq start next
|
|
|
|
on (not on))))
|
|
|
|
(put-text-property (point-min) (point-max)
|
|
|
|
'keymap w3m-minor-mode-map)))
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-668
Merge from gnus--rel--5.10
Patches applied:
* gnus--rel--5.10 (patch 157-168)
- Merge from emacs--cvs-trunk--0
- Update from CVS
- Update from CVS: texi/message.texi: Fix default values.
2005-12-08 Reiner Steib <Reiner.Steib@gmx.de>
* lisp/gnus/mm-decode.el (mm-discouraged-alternatives): Fix custom type.
Suggest image/.* in the doc string.
2005-12-07 Katsumi Yamaoka <yamaoka@jpl.org>
* lisp/gnus/mm-decode.el (mm-display-external): Use nametemplate (defined in
RFC1524) if it is in mailcap or add a suffix according to
mailcap-mime-extensions when generating a temp filename; postpone
deleting a temp file for 2 seconds for some wrappers, shell
scripts, and so on, which might exit right after having started a
viewer command as a background job.
2005-12-06 Reiner Steib <Reiner.Steib@gmx.de>
* lisp/gnus/gnus-art.el (gnus-default-article-saver): Add user-defined
`function' to custom type.
2005-12-02 ARISAWA Akihiro <ari@mbf.ocn.ne.jp> (tiny change)
* lisp/gnus/mm-view.el (mm-inline-text-html-render-with-w3m): Fix misplaced
parens.
2005-11-29 Reiner Steib <Reiner.Steib@gmx.de>
* lisp/gnus/gnus-cache.el (gnus-cache-rename-group): Wrap doc strings and
long lines.
(gnus-cache-delete-group): Wrap doc strings.
* lisp/gnus/gnus-agent.el (gnus-agent-rename-group)
(gnus-agent-delete-group): Wrap doc strings.
2005-11-24 Pascal Rigaux <pixel@mandriva.com> (tiny change)
* lisp/gnus/rfc2231.el (rfc2231-parse-string): Support non-ascii chars.
2005-11-22 Katsumi Yamaoka <yamaoka@jpl.org>
* lisp/gnus/nnmail.el (nnmail-fancy-expiry-target): Use current-time instead
of current-time-string.
2005-11-20 Stefan Schimanski <schimmi@debian.org> (tiny change)
* lisp/gnus/nnmail.el (nnmail-fancy-expiry-target): Protect against invalid
date header.
2005-11-16 Boris Samorodov <bsam@ipt.ru> (tiny patch)
* lisp/gnus/imap.el (imap-kerberos4-open): Ignore SSL stuff.
2005-11-14 Kevin Greiner <kevin.greiner@compsol.cc>
* lisp/gnus/gnus-agent.el (gnus-agent-article-alist-save-format): Changed
internal variable to a custom variable. Changed default value
from compressed(2) to uncompressed(1).
(gnus-agent-read-agentview): Reversed revision 7.8 to restore
support for uncompressed agentview files. Taken together, reading
the agentview file should now be 6-7 times faster.
(gnus-agent-long-article,
gnus-agent-short-article, gnus-agent-score): Renamed category
keywords to match gnus-cus.
(gnus-agent-summary-fetch-series): Modified to protect against
gnus-agent-summary-fetch-group clearing processable flags.
(gnus-agent-synchronize-group-flags): Update live group buffer as
synchronization may occur due to the user toggling the plugged
status.
(gnus-agent-braid-nov): Now tests new nov entries
for duplicates which are removed. The invalid sort check then
triggers a rescan after the sort as sorting may have moved
duplicate entries such that they can be cheaply detected.
(gnus-agent-read-local): Trivial fix to format of
error message to display actual error condition.
(gnus-agent-save-local): Avoid saving symbols that are bound to
nil as they simply result in a warning message in
gnus-agent-read-local.
(gnus-agent-fetch-group-1): Clear downloadable flag when article
successfully downloaded.
(gnus-agent-regenerate-group): Use
gnus-agent-synchronize-group-flags to reset read status in both
gnus and server.
* lisp/gnus/nntp.el (nntp-end-of-line): Doc fix.
(nntp-authinfo-rejected): New error condition.
(nntp-wait-for): Use new error condition to signal authentication
error.
(nntp-retrieve-data): Rethrow new error condition to break out of
recursive call to nntp-send-authinfo.
2005-11-13 Katsumi Yamaoka <yamaoka@jpl.org>
* lisp/gnus/gnus-start.el (gnus-dribble-read-file): Use make-local-variable
rather than make-variable-buffer-local for file-precious-flag.
2005-11-13 Katsumi Yamaoka <yamaoka@jpl.org>
* lisp/gnus/gnus-start.el (gnus-dribble-read-file): Quote file-precious-flag.
2005-11-11 Jan Nieuwenhuizen <janneke@gnu.org>
* lisp/gnus/gnus-start.el (gnus-dribble-read-file): Set file-precious-flag,
as a buffer-local variable. This avoids creating truncated
dribble files as a result of a hang up, eg.
2005-11-04 Ken Manheimer <ken.manheimer@gmail.com>
* lisp/gnus/pgg-pgp.el (pgg-pgp-encrypt-region, pgg-pgp-decrypt-region)
(pgg-pgp-encrypt-symmetric-region, pgg-pgp-encrypt-symmetric)
(pgg-pgp-encrypt, pgg-pgp-decrypt-region, pgg-pgp-decrypt)
(pgg-pgp-sign-region, pgg-pgp-sign): Add optional 'passphrase'
argument to all these routines, so the passphrase can be managed
externally and passed in to the system.
(pgg-pgp-decrypt-region, pgg-pgp-sign-region): Use new name for
pgg-add-passphrase-to-cache function.
* lisp/gnus/pgg-pgp5.el (pgg-pgp5-encrypt-region, pgg-pgp5-decrypt-region)
(pgg-pgp5-encrypt-symmetric-region, pgg-pgp5-encrypt-symmetric)
(pgg-pgp5-encrypt, pgg-pgp5-decrypt-region, pgg-pgp5-decrypt)
(pgg-pgp5-sign-region, pgg-pgp5-sign): Add optional 'passphrase'
argument to all these routines, so the passphrase can be managed
externally and passed in to the system.
(pgg-pgp5-sign-region): Use new name of pgg-add-passphrase-to-cache
function.
2005-10-30 Chong Yidong <cyd@stupidchicken.com>
* lisp/gnus/imap.el (imap-open): Handle case where buffer is a buffer
object.
2005-10-29 Ken Manheimer <ken.manheimer@gmail.com>
* lisp/gnus/pgg-gpg.el (pgg-gpg-select-matching-key): Fix: look at the right
part of the decoded armor to find the key-identifier.
(pgg-gpg-lookup-key-owner): New function to return the
human-readable identifier of a key owner.
(pgg-gpg-lookup-id-from-key-owner): Make it easy to identify the
key itself.
(pgg-gpg-decrypt-region): Prompt with the key owner (rather than
the key value) if we have a key and can match it against a secret
key. Also, added a note pointing out fact that the prompt only
indicates the first matching key.
* lisp/gnus/pgg.el (pgg-decrypt): Passing along 'passphrase' in call to
pgg-decrypt-region.
(pgg-pending-timers): A new hash for tracking the passphrase cache
timers, so that new ones supercede old ones.
(pgg-add-passphrase-to-cache): Rename from
`pgg-add-passphrase-cache' to reduce confusion (all callers
changed). Modified to cancel old timers when new ones are added.
(pgg-remove-passphrase-from-cache): Rename from
`pgg-remove-passphrase-cache' to reduce confusion (all callers
changed). Modified to cancel old timers when their keys are
removed from the cache.
(pgg-cancel-timer): In Emacs, an alias for cancel-timer; in
XEmacs, an indirection to delete-itimer.
(pgg-read-passphrase-from-cache, pgg-read-passphrase):
Extract pgg-read-passphrase-from-cache from pgg-read-passphrase so
users can only check cache without risk of prompting. Correct bug in
notruncate behavior.
(pgg-read-passphrase-from-cache, pgg-read-passphrase)
(pgg-add-passphrase-cache, pgg-remove-passphrase-cache):
Add informative docstrings.
(pgg-decrypt): Convey provided passphrase in subordinate call to
pgg-decrypt-region.
2005-10-20 Ken Manheimer <ken.manheimer+emacs@gmail.com>
* lisp/gnus/pgg.el (pgg-encrypt-region, pgg-encrypt-symmetric-region)
(pgg-encrypt-symmetric, pgg-encrypt, pgg-decrypt-region)
(pgg-decrypt, pgg-sign-region, pgg-sign): Add optional
'passphrase' argument, so the passphrase can be managed externally
and then passed in to the system.
* lisp/gnus/pgg.el (pgg-read-passphrase, pgg-add-passphrase-cache)
(pgg-remove-passphrase-cache): Add optional 'notruncate' argument,
so the passphrase cache can be used reliably with identifiers
besides a pgp packet's key id.
* lisp/gnus/pgg-gpg.el (pgg-pgp-encrypt-region)
(pgg-pgp-encrypt-symmetric-region, pgg-pgp-encrypt-symmetric)
(pgg-pgp-encrypt, pgg-pgp-decrypt-region, pgg-pgp-decrypt)
(pgg-pgp-sign-region, pgg-pgp-sign): Add optional 'passphrase'
argument to all these routines, so the passphrase can be managed
externally and passed in to the system.
* lisp/gnus/pgg-gpg.el (pgg-gpg-possibly-cache-passphrase): Add optional
'notruncate' argument, so the passphrase cache can be used
reliably with identifiers besides a pgp packet's key id.
2005-10-29 Sascha Wilde <swilde@sha-bang.de>
* lisp/gnus/pgg-gpg.el (pgg-gpg-encrypt-symmetric-region): New function for
symmetric encryption.
(pgg-gpg-symmetric-key-p): New function to check for an symmetric
encrypted session key.
(pgg-gpg-decrypt-region): When decrypting a symmetric encrypted
message ask for the passphrase in a proper way.
* lisp/gnus/pgg.el (pgg-encrypt-symmetric, pgg-encrypt-symmetric-region):
New user commands for symmetric encryption.
2005-12-05 Katsumi Yamaoka <yamaoka@jpl.org>
* man/pgg.texi (User Commands): Fix description of pgg-verify-region.
(Selecting an implementation): Fix descriptions.
2005-11-30 Katsumi Yamaoka <yamaoka@jpl.org>
* man/message.texi (Various Message Variables): Addition.
2005-11-29 Katsumi Yamaoka <yamaoka@jpl.org>
* man/message.texi: Fix default values.
2005-11-25 Katsumi Yamaoka <yamaoka@jpl.org>
* man/message.texi (Header Commands): Clarify descriptions of
message-cross-post-followup-to, message-reduce-to-to-cc, and
message-insert-wide-reply.
(Various Commands): Fix kindex for message-kill-to-signature;
clarify description of message-tab.
2005-11-22 Katsumi Yamaoka <yamaoka@jpl.org>
* man/message.texi (Mailing Lists): Fix description about MFT.
* man/gnus.texi (Emacs Lisp): Use ~/.gnus.el instead of ~/.emacs.
2005-11-17 Katsumi Yamaoka <yamaoka@jpl.org>
* man/gnus.texi (Slow Terminal Connection): Replace old description
with new one.
2005-11-16 Katsumi Yamaoka <yamaoka@jpl.org>
* man/gnus.texi (Oort Gnus): Use ~/.gnus.el instead of ~/.emacs;
replace X-Draft-Headers with X-Draft-From.
2005-11-14 Katsumi Yamaoka <yamaoka@jpl.org>
* man/gnus.texi (Various Various): Fix the default value of
nnheader-max-head-length.
(Gnus Versions): Fix typo.
2005-12-09 08:57:58 +00:00
|
|
|
(mm-handle-set-undisplayer
|
|
|
|
handle
|
2021-01-30 18:56:37 -05:00
|
|
|
(let ((beg (point-min-marker))
|
|
|
|
(end (point-max-marker)))
|
|
|
|
(lambda ()
|
|
|
|
(let ((inhibit-read-only t))
|
|
|
|
(delete-region beg end)))))))))
|
2004-09-04 13:13:48 +00:00
|
|
|
|
Leading "*" in the doc of defvars is long obsolete.
* lisp/plstore.el (plstore-encrypt-to):
* lisp/cedet/semantic/lex-spp.el
(semantic-lex-spp-macro-max-length-to-save):
* lisp/cedet/semantic/symref.el (semantic-symref-tool):
* lisp/cedet/semantic/bovine/el.el
(semantic-elisp-store-documentation-in-tag):
* lisp/cedet/semantic/wisent/comp.el (wisent-verbose-flag)
(wisent-expected-conflicts):
* lisp/cedet/semantic/wisent/wisent.el (wisent-parse-verbose-flag):
* lisp/gnus/gnus-agent.el (gnus-category-menu-hook):
* lisp/gnus/gnus-group.el (gnus-group-listing-limit):
* lisp/gnus/gnus-srvr.el (gnus-server-menu-hook)
(gnus-browse-menu-hook):
* lisp/gnus/message.el (message-shoot-gnksa-feet):
* lisp/gnus/mm-decode.el (mm-path-name-rewrite-functions):
* lisp/gnus/mm-util.el (mm-extra-numeric-entities):
* lisp/gnus/mm-view.el (mm-w3m-standalone-supports-m17n-p):
* lisp/gnus/mml.el (mml-generate-multipart-alist):
* lisp/gnus/nndraft.el (nndraft-required-headers):
* lisp/gnus/nnheader.el (nnheader-max-head-length)
(nnheader-head-chop-length, nnheader-file-name-translation-alist)
(nnheader-directory-separator-character)
(nnheader-pathname-coding-system):
* lisp/gnus/nnmail.el (nnmail-pathname-coding-system)
(nnmail-active-file-coding-system):
* lisp/gnus/nnrss.el (nnrss-file-coding-system):
* lisp/gnus/nntp.el (nntp-record-commands):
* lisp/gnus/score-mode.el (gnus-score-edit-done-hook)
(gnus-score-mode-hook, gnus-score-menu-hook):
* lisp/mail/rfc2047.el (rfc2047-header-encoding-alist)
(rfc2047-allow-irregular-q-encoded-words)
(rfc2047-allow-incomplete-encoded-text):
* lisp/mh-e/mh-alias.el (mh-alias-system-aliases):
* lisp/mh-e/mh-e.el (mh-mail-header-separator, mh-x-mailer-string):
* lisp/mh-e/mh-scan.el (mh-scan-format-mh, mh-scan-format-nmh):
* lisp/net/pop3.el (pop3-password):
* lisp/play/animate.el (animate-n-steps):
* lisp/progmodes/cc-vars.el (c-old-style-variable-behavior):
Convert from defvar with leading * to defcustom.
; * lisp/cedet/semantic/lex.el: Comments.
* lisp/emulation/viper-init.el (viper-heading-end):
* lisp/gnus/mm-url.el (mm-url-html-entities):
* lisp/gnus/nnmaildir.el (nnmaildir-article-file-name):
* lisp/mh-e/mh-e.el (mh-invisible-header-fields-compiled):
* lisp/net/tramp-adb.el (tramp-adb-method): Remove leading * from doc.
* lisp/gnus/messcompat.el: Mark (pointless) file not for compilation.
(message-from-style, message-interactive, message-indentation-spaces)
(message-signature, message-signature-file):
Remove settings that match the defaults.
(message-setup-hook, message-mode-hook, message-default-headers)
(message-send-hook, message-send-mail-function):
Just use setq rather than redefining.
* lisp/gnus/nnrss.el (nnrss):
* lisp/mail/rfc2047.el (rfc2047):
* lisp/play/animate.el (animate): New custom groups.
2016-06-10 00:23:33 -04:00
|
|
|
(defcustom mm-w3m-standalone-supports-m17n-p 'undecided
|
|
|
|
"T means the w3m command supports the m17n feature."
|
|
|
|
:type '(choice (const nil) (const t) (other :tag "detect" undecided))
|
|
|
|
:group 'mime-display)
|
2006-01-25 06:47:24 +00:00
|
|
|
|
|
|
|
(defun mm-w3m-standalone-supports-m17n-p ()
|
|
|
|
"Say whether the w3m command supports the m17n feature."
|
|
|
|
(cond ((eq mm-w3m-standalone-supports-m17n-p t) t)
|
|
|
|
((eq mm-w3m-standalone-supports-m17n-p nil) nil)
|
|
|
|
((condition-case nil
|
|
|
|
(let ((coding-system-for-write 'iso-2022-jp)
|
|
|
|
(coding-system-for-read 'iso-2022-jp)
|
2016-02-12 14:39:30 +11:00
|
|
|
(str (decode-coding-string "\
|
2008-03-10 00:50:22 +00:00
|
|
|
\e$B#D#o#e#s!!#w#3#m!!#s#u#p#p#o#r#t!!#m#1#7#n!)\e(B" 'iso-2022-jp)))
|
2006-01-25 06:47:24 +00:00
|
|
|
(mm-with-multibyte-buffer
|
|
|
|
(insert str)
|
|
|
|
(call-process-region
|
|
|
|
(point-min) (point-max) "w3m" t t nil "-dump"
|
|
|
|
"-T" "text/html" "-I" "iso-2022-jp" "-O" "iso-2022-jp")
|
|
|
|
(goto-char (point-min))
|
|
|
|
(search-forward str nil t)))
|
|
|
|
(error nil))
|
|
|
|
(setq mm-w3m-standalone-supports-m17n-p t))
|
|
|
|
(t
|
|
|
|
;;(message "You had better upgrade your w3m command")
|
|
|
|
(setq mm-w3m-standalone-supports-m17n-p nil))))
|
|
|
|
|
2006-01-16 09:27:43 +00:00
|
|
|
(defun mm-inline-text-html-render-with-w3m-standalone (handle)
|
|
|
|
"Render a text/html part using w3m."
|
2006-01-25 06:47:24 +00:00
|
|
|
(if (mm-w3m-standalone-supports-m17n-p)
|
|
|
|
(let ((source (mm-get-part handle))
|
2007-04-19 12:08:53 +00:00
|
|
|
(charset (or (mail-content-type-get (mm-handle-type handle)
|
|
|
|
'charset)
|
|
|
|
(symbol-name mail-parse-charset)))
|
2006-01-25 06:47:24 +00:00
|
|
|
cs)
|
2013-11-27 06:39:37 +00:00
|
|
|
(if (and charset
|
|
|
|
(setq cs (mm-charset-to-coding-system charset nil t))
|
|
|
|
(not (eq cs 'ascii)))
|
|
|
|
(setq charset (format "%s" (mm-coding-system-to-mime-charset cs)))
|
2006-01-25 06:47:24 +00:00
|
|
|
;; The default.
|
|
|
|
(setq charset "iso-8859-1"
|
|
|
|
cs 'iso-8859-1))
|
|
|
|
(mm-insert-inline
|
|
|
|
handle
|
|
|
|
(mm-with-unibyte-buffer
|
|
|
|
(insert source)
|
|
|
|
(mm-enable-multibyte)
|
|
|
|
(let ((coding-system-for-write 'binary)
|
|
|
|
(coding-system-for-read cs))
|
|
|
|
(call-process-region
|
|
|
|
(point-min) (point-max)
|
|
|
|
"w3m" t t nil "-dump" "-T" "text/html"
|
|
|
|
"-I" charset "-O" charset))
|
|
|
|
(buffer-string))))
|
|
|
|
(mm-inline-render-with-stdin handle nil "w3m" "-dump" "-T" "text/html")))
|
2006-01-16 09:27:43 +00:00
|
|
|
|
2004-09-04 13:13:48 +00:00
|
|
|
(defun mm-links-remove-leading-blank ()
|
2021-09-26 08:29:38 +02:00
|
|
|
(declare (obsolete nil "28.1"))
|
2004-09-04 13:13:48 +00:00
|
|
|
;; Delete the annoying three spaces preceding each line of links
|
|
|
|
;; output.
|
|
|
|
(goto-char (point-min))
|
|
|
|
(while (re-search-forward "^ " nil t)
|
|
|
|
(delete-region (match-beginning 0) (match-end 0))))
|
|
|
|
|
|
|
|
(defun mm-inline-wash-with-file (post-func cmd &rest args)
|
2021-09-26 08:29:38 +02:00
|
|
|
(declare (obsolete nil "28.1"))
|
2021-09-21 07:16:37 +02:00
|
|
|
(with-suppressed-warnings ((lexical file))
|
|
|
|
(dlet ((file (make-temp-file
|
|
|
|
(expand-file-name "mm" mm-tmp-directory))))
|
|
|
|
(let ((coding-system-for-write 'binary))
|
|
|
|
(write-region (point-min) (point-max) file nil 'silent))
|
|
|
|
(delete-region (point-min) (point-max))
|
|
|
|
(unwind-protect
|
|
|
|
(apply #'call-process cmd nil t nil
|
|
|
|
(mapcar (lambda (e) (eval e t)) args))
|
|
|
|
(delete-file file))
|
|
|
|
(and post-func (funcall post-func)))))
|
2004-09-04 13:13:48 +00:00
|
|
|
|
|
|
|
(defun mm-inline-wash-with-stdin (post-func cmd &rest args)
|
|
|
|
(let ((coding-system-for-write 'binary))
|
2021-01-30 00:35:24 -05:00
|
|
|
(apply #'call-process-region (point-min) (point-max)
|
2004-09-04 13:13:48 +00:00
|
|
|
cmd t t nil args))
|
|
|
|
(and post-func (funcall post-func)))
|
|
|
|
|
|
|
|
(defun mm-inline-render-with-file (handle post-func cmd &rest args)
|
2021-09-26 08:29:38 +02:00
|
|
|
(declare (obsolete nil "28.1"))
|
2004-09-04 13:13:48 +00:00
|
|
|
(let ((source (mm-get-part handle)))
|
|
|
|
(mm-insert-inline
|
|
|
|
handle
|
|
|
|
(mm-with-unibyte-buffer
|
|
|
|
(insert source)
|
2021-09-26 08:29:38 +02:00
|
|
|
(with-suppressed-warnings ((obsolete mm-inline-wash-with-file))
|
|
|
|
(apply #'mm-inline-wash-with-file post-func cmd args))
|
|
|
|
(buffer-string)))))
|
|
|
|
|
|
|
|
(defun mm-inline-render-with-links (handle)
|
|
|
|
(let ((source (mm-get-part handle))
|
|
|
|
file charset)
|
|
|
|
(mm-insert-inline
|
|
|
|
handle
|
|
|
|
(with-temp-buffer
|
|
|
|
(setq charset (mail-content-type-get (mm-handle-type handle) 'charset))
|
|
|
|
(insert source)
|
|
|
|
(unwind-protect
|
|
|
|
(progn
|
|
|
|
(setq file (make-temp-file (expand-file-name
|
|
|
|
"mm" mm-tmp-directory)))
|
|
|
|
(let ((coding-system-for-write 'binary))
|
|
|
|
(write-region (point-min) (point-max) file nil 'silent))
|
|
|
|
(delete-region (point-min) (point-max))
|
|
|
|
(if charset
|
|
|
|
(with-environment-variables (("LANG" (format "en-US.%s"
|
|
|
|
charset)))
|
|
|
|
(call-process "links" nil t nil "-dump" file))
|
|
|
|
(call-process "links" nil t nil "-dump" file))
|
|
|
|
(goto-char (point-min))
|
|
|
|
(while (re-search-forward "^ " nil t)
|
|
|
|
(delete-region (match-beginning 0) (match-end 0))))
|
|
|
|
(when (and file (file-exists-p file))
|
|
|
|
(delete-file file)))
|
2004-09-04 13:13:48 +00:00
|
|
|
(buffer-string)))))
|
|
|
|
|
|
|
|
(defun mm-inline-render-with-stdin (handle post-func cmd &rest args)
|
|
|
|
(let ((source (mm-get-part handle)))
|
|
|
|
(mm-insert-inline
|
|
|
|
handle
|
|
|
|
(mm-with-unibyte-buffer
|
|
|
|
(insert source)
|
2021-01-30 00:35:24 -05:00
|
|
|
(apply #'mm-inline-wash-with-stdin post-func cmd args)
|
2004-09-04 13:13:48 +00:00
|
|
|
(buffer-string)))))
|
|
|
|
|
|
|
|
(defun mm-inline-render-with-function (handle func &rest args)
|
|
|
|
(let ((source (mm-get-part handle))
|
2007-04-19 12:08:53 +00:00
|
|
|
(charset (or (mail-content-type-get (mm-handle-type handle) 'charset)
|
|
|
|
mail-parse-charset)))
|
2004-09-04 13:13:48 +00:00
|
|
|
(mm-insert-inline
|
|
|
|
handle
|
|
|
|
(mm-with-multibyte-buffer
|
|
|
|
(insert (if charset
|
|
|
|
(mm-decode-string source charset)
|
|
|
|
source))
|
|
|
|
(apply func args)
|
|
|
|
(buffer-string)))))
|
|
|
|
|
|
|
|
(defun mm-inline-text-html (handle)
|
2013-07-06 23:40:56 +00:00
|
|
|
(if (stringp (car handle))
|
2021-01-30 00:35:24 -05:00
|
|
|
(mapcar #'mm-inline-text-html (cdr handle))
|
2013-07-06 23:40:56 +00:00
|
|
|
(let* ((func mm-text-html-renderer)
|
|
|
|
(entry (assq func mm-text-html-renderer-alist))
|
|
|
|
(inhibit-read-only t))
|
|
|
|
(if entry
|
|
|
|
(setq func (cdr entry)))
|
|
|
|
(cond
|
2018-04-12 19:18:26 +02:00
|
|
|
((null func)
|
|
|
|
(mm-insert-inline handle (mm-get-part handle)))
|
2013-07-06 23:40:56 +00:00
|
|
|
((functionp func)
|
|
|
|
(funcall func handle))
|
|
|
|
(t
|
|
|
|
(apply (car func) handle (cdr func)))))))
|
2004-09-04 13:13:48 +00:00
|
|
|
|
|
|
|
(defun mm-inline-text-vcard (handle)
|
2008-03-12 19:04:56 +00:00
|
|
|
(let ((inhibit-read-only t))
|
2004-09-04 13:13:48 +00:00
|
|
|
(mm-insert-inline
|
|
|
|
handle
|
|
|
|
(concat "\n-- \n"
|
|
|
|
(ignore-errors
|
|
|
|
(if (fboundp 'vcard-pretty-print)
|
|
|
|
(vcard-pretty-print (mm-get-part handle))
|
|
|
|
(vcard-format-string
|
|
|
|
(vcard-parse-string (mm-get-part handle)
|
|
|
|
'vcard-standard-filter))))))))
|
|
|
|
|
|
|
|
(defun mm-inline-text (handle)
|
|
|
|
(let ((b (point))
|
|
|
|
(type (mm-handle-media-subtype handle))
|
|
|
|
(charset (mail-content-type-get
|
|
|
|
(mm-handle-type handle) 'charset))
|
2008-03-12 19:04:56 +00:00
|
|
|
(inhibit-read-only t))
|
2004-09-04 13:13:48 +00:00
|
|
|
(if (or (eq charset 'gnus-decoded)
|
|
|
|
;; This is probably not entirely correct, but
|
|
|
|
;; makes rfc822 parts with embedded multiparts work.
|
|
|
|
(eq mail-parse-charset 'gnus-decoded))
|
2000-09-19 13:40:08 +00:00
|
|
|
(save-restriction
|
2004-09-04 13:13:48 +00:00
|
|
|
(narrow-to-region (point) (point))
|
|
|
|
(mm-insert-part handle)
|
|
|
|
(goto-char (point-max)))
|
2011-03-22 13:40:41 +00:00
|
|
|
(mm-display-inline-fontify handle))
|
2006-02-24 05:02:12 +00:00
|
|
|
(when (and mm-fill-flowed
|
|
|
|
(equal type "plain")
|
2004-09-04 13:13:48 +00:00
|
|
|
(equal (cdr (assoc 'format (mm-handle-type handle)))
|
|
|
|
"flowed"))
|
|
|
|
(save-restriction
|
|
|
|
(narrow-to-region b (point))
|
|
|
|
(goto-char b)
|
2019-06-22 16:25:36 +02:00
|
|
|
(fill-flowed nil (cl-equalp (cdr (assoc 'delsp (mm-handle-type handle)))
|
|
|
|
"yes"))
|
2004-09-04 13:13:48 +00:00
|
|
|
(goto-char (point-max))))
|
|
|
|
(save-restriction
|
|
|
|
(narrow-to-region b (point))
|
2017-09-16 12:45:24 +03:00
|
|
|
(when (member type '("enriched" "richtext"))
|
|
|
|
(set-text-properties (point-min) (point-max) nil)
|
|
|
|
(ignore-errors
|
|
|
|
(enriched-decode (point-min) (point-max))))
|
2004-09-04 13:13:48 +00:00
|
|
|
(mm-handle-set-undisplayer
|
|
|
|
handle
|
2019-02-14 02:16:05 +00:00
|
|
|
(if (= (point-min) (point-max))
|
|
|
|
#'ignore
|
2021-01-30 18:56:37 -05:00
|
|
|
(let ((beg (copy-marker (point-min) t))
|
|
|
|
(end (point-max-marker)))
|
|
|
|
(lambda ()
|
|
|
|
(let ((inhibit-read-only t))
|
|
|
|
(delete-region beg end)))))))))
|
2000-09-19 13:40:08 +00:00
|
|
|
|
|
|
|
(defun mm-insert-inline (handle text)
|
|
|
|
"Insert TEXT inline from HANDLE."
|
2004-09-04 13:13:48 +00:00
|
|
|
(let ((b (point)))
|
2000-09-19 13:40:08 +00:00
|
|
|
(insert text)
|
2007-10-28 09:18:39 +00:00
|
|
|
(unless (bolp)
|
|
|
|
(insert "\n"))
|
2000-09-19 13:40:08 +00:00
|
|
|
(mm-handle-set-undisplayer
|
|
|
|
handle
|
2021-01-30 18:56:37 -05:00
|
|
|
(let ((beg (copy-marker b t))
|
|
|
|
(end (point-marker)))
|
|
|
|
(lambda ()
|
|
|
|
(let ((inhibit-read-only t))
|
|
|
|
(delete-region beg end)))))))
|
2000-09-19 13:40:08 +00:00
|
|
|
|
* lisp/gnus: Use lexical-binding in all the files
* lisp/gnus/gnus-group.el (features): Use `dlet`.
(gnus-tmp-level, gnus-tmp-marked, gnus-tmp-group): Declare vars.
(gnus-group-insert-group-line): Bind dynbound vars via `let` rather
than as formal args. Bind `number` as dynbound.
(gnus-visual, gnus-score-find-score-files-function)
(gnus-home-score-file, gnus-apply-kill-hook)
(gnus-summary-expunge-below): Declare vars.
(gnus-group-restart, gnus-group-list-plus): Fix `interactive` spec
since the arg is unused.
* lisp/gnus/mail-source.el (mail-source-bind, mail-source-bind-common):
Use `dlet` and suppress the warnings about the non-prefixed dynbound vars.
(mail-source-set-1): Remove unused var `auth-info`.
(mail-source-call-script): Remove unused var `background`.
(mail-source-fetch-pop, mail-source-check-pop): Bind pop3 vars with `dlet`.
* lisp/gnus/gnus-int.el (mail-source-plugged, gnus-inhibit-demon):
Declare vars.
(gnus-server-opened, gnus-status-message)
(gnus-open-server, gnus-close-server, gnus-request-list)
(gnus-finish-retrieve-group-infos, gnus-retrieve-group-data-early)
(gnus-request-list-newsgroups, gnus-request-newgroups)
(gnus-request-regenerate, gnus-request-compact, gnus-request-group)
(gnus-retrieve-groups, gnus-request-post, gnus-request-expunge-group)
(gnus-request-scan, gnus-request-update-info, gnus-request-marks)
(gnus-request-accept-article, gnus-request-create-group)
(gnus-asynchronous-p, gnus-remove-denial):
Bind `gnus-command-method` via `let` rather than as formal args.
* lisp/gnus/gnus-topic.el (gnus-topic-insert-topic-line):
Pass documented vars to eval for `gnus-topic-line-format-spec`.
* lisp/gnus/message.el (message-yank-original): Use `cl-progv` rather
than `eval` to bind the vars from `message-cite-style`.
* lisp/gnus/mml.el (mml-parse-1): Use `apply` instead of `eval`.
(gnus-newsgroup-name, gnus-displaying-mime, gnus-newsgroup-name)
(gnus-article-prepare-hook, gnus-newsgroup-charset)
(gnus-original-article-buffer, gnus-message-buffer)
(message-this-is-news, message-this-is-mail): Declare vars.
* lisp/gnus/deuglify.el (gnus-outlook-rearrange-article): Remove unused
var `cite-marks`.
* lisp/gnus/gnus-art.el (ansi-color-context-region): Declare var.
(gnus-mime-display-attachment-buttons-in-header): Move declaration
before first use.
(gnus-mime-display-alternative): Remove unused var `from`.
* lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-list): Remove unused
var `start` `end`.
* lisp/gnus/gnus-cache.el (gnus-article-decode-hook)
(nnml-generate-active-function): Declare var.
* lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Remove unused
var `keywords`.
* lisp/gnus/gnus-cloud.el (gnus-cloud-encode-data): Remove unused var
`cipher`.
(gnus-cloud-ensure-cloud-group): Remove unused var `method`.
* lisp/gnus/gnus-delay.el (gnus-delay-article): Remove unused var `days`.
* lisp/gnus/gnus-html.el (gnus-html-wash-images): Remove unused vars
`tag`, `string`, and `images`.
(gnus-html-wash-tags): Remove unused vars `string` and `images`.
* lisp/gnus/gnus-msg.el (gnus-msg-mail): Remove unused var `group-name`.
(gnus-group-mail, gnus-group-news, gnus-summary-mail-other-window)
(gnus-summary-news-other-window):
Remove unused vars `group` and `buffer`.
(gnus-configure-posting-styles): Remove unused vars `style` and `attribute`.
* lisp/gnus/gnus-picon.el (gnus-picon-find-face): Remove unused vars
`database`, `directory`, and `instance`.
(gnus-picon-transform-newsgroups): Remove unused var `point`.
* lisp/gnus/gnus-range.el (gnus-range-difference): Remove unused var `safe`.
* lisp/gnus/gnus-score.el (gnus-score-load-file): Remove unused var
`score-fn`.
* lisp/gnus/gnus-sum.el (message-options-set-recipient): Declare var.
* lisp/gnus/gnus-undo.el (gnus-undo): Fix docstring lie.
* lisp/gnus/gnus-util.el (print-string-length)
(iswitchb-make-buflist-hook): Declare vars.
(gnus-emacs-version): Remove unused var `codename`.
(gnus-rename-file): Remove unused vars `old-name` and `new-name`.
* lisp/gnus/gnus-uu.el (gnus-uu-yenc-article): Remove unused var
`start-char`.
(gnus-asynchronous): Declare var.
* lisp/gnus/mm-partial.el (gnus-displaying-mime): Declare var.
(mm-inline-partial): Remove unused var `buffer`.
* lisp/gnus/mm-view.el (w3m-force-redisplay, w3m-safe-url-regexp)
(gnus-displaying-mime, gnus-original-article-buffer)
(gnus-article-prepare-hook): Declare vars.
* lisp/gnus/mml-smime.el (mml-smime-epg-encrypt): Remove unused var
`boundary`.
(mml-smime-epg-verify): Remove unused vars `plain` and `signature-file`.
* lisp/gnus/mml1991.el (pgg-text-mode): Declare var.
* lisp/gnus/mml2015.el (pgg-text-mode): Declare var.
(mml2015-pgg-decrypt): Remove unused var `result`.
(mml2015-epg-key-image-to-string): Remove unused var `error`.
(mml2015-epg-decrypt): Remove unused var `result`.
(mml2015-epg-verify): Remove unused vars `plain` and `signature-file`.
* lisp/gnus/nnbabyl.el (nnml-current-directory): Declare var.
* lisp/gnus/nndiary.el (nndiary-files): Move declaration before first use.
* lisp/gnus/nnfolder.el (nnfolder-request-accept-article):
Remove unused var `buf`.
* lisp/gnus/nnmail.el (nnmail-parse-active): Remove unused var `err`.
* lisp/gnus/nnmairix.el (nnmairix-request-group): Remove unused var `args`.
(nnmairix-request-create-group): Remove unused var `info`.
(nnmairix-request-list): Remove unused var `folder`.
(nnmairix-request-set-mark): Remove unused var `propto`.
(nnmairix-request-set-mark): Remove unused vars `number` and `method`.
(nnmairix-close-group): Remove unused var `method`.
(nnmairix-create-search-group-from-message): Remove unused var `cq`.
(nnmairix-create-server-and-default-group): Remove unused var `create`.
(nnmairix-purge-old-groups): Remove unused var `folder`.
(nnmairix-remove-tick-mark-original-article, nnmairix-get-valid-servers):
Remove unused var `cur`.
(nnmairix-replace-group-and-numbers): Remove unused var `header`.
(nnmairix-goto-original-article): Remove unused var `rval`.
(nnmairix-widget-create-query): Remove unused var `allwidgets`.
* lisp/gnus/nnmbox.el (nnml-current-directory): Declare var.
* lisp/gnus/nnmh.el (nnmh-toplev): Move declaration before first use.
(nnmh-request-list-1): Remove unused var `rdir`.
* lisp/gnus/nnml.el (nnml-generate-nov-file): Remove unused var `file`.
* lisp/gnus/nnrss.el (nnrss-request-article): Remove unused var `post`.
(nnrss-request-article): Remove unused var `fn`.
(nnrss-check-group): Remove unused var `rdf-ns`.
* lisp/gnus/nnweb.el (nnweb-request-article): Remove unused var `active`.
(nnweb-google-parse-1): Remove unused var `Score`.
* lisp/gnus/spam-stat.el (spam-stat-error-holder): Remove var.
(spam-stat-buffer-words-with-scores): Remove unused var `word`.
(spam-stat-score-buffer): Remove unused var `spam-stat-error-holder`.
(spam-stat-split-fancy): Use `err` instead of `spam-stat-error-holder`.
* lisp/gnus/spam-wash.el (spam-wash): Remove unused var `handle`.
* lisp/gnus/spam.el (spam-copy-or-move-routine): Remove unused vars
`article` and `mark`.
(spam-register-routine): Remove unused var `article`.
(spam-log-undo-registration): Remove unused var `found`.
(spam-ifile-register-with-ifile): Remove unused var `parameters`.
(spam-check-stat): Remove unused vars `category` and `return`.
(spam-parse-list): Remove unused var `found`.
(spam-filelist-register-routine): Remove unused var `from`.
2021-01-30 18:44:00 -05:00
|
|
|
(defun mm-inline-audio (_handle)
|
2000-09-19 13:40:08 +00:00
|
|
|
(message "Not implemented"))
|
|
|
|
|
|
|
|
(defun mm-view-message ()
|
|
|
|
(mm-enable-multibyte)
|
|
|
|
(let (handles)
|
|
|
|
(let (gnus-article-mime-handles)
|
|
|
|
;; Double decode problem may happen. See mm-inline-message.
|
|
|
|
(run-hooks 'gnus-article-decode-hook)
|
|
|
|
(gnus-article-prepare-display)
|
|
|
|
(setq handles gnus-article-mime-handles))
|
|
|
|
(when handles
|
|
|
|
(setq gnus-article-mime-handles
|
2004-09-04 13:13:48 +00:00
|
|
|
(mm-merge-handles gnus-article-mime-handles handles))))
|
2000-09-19 13:40:08 +00:00
|
|
|
(fundamental-mode)
|
|
|
|
(goto-char (point-min)))
|
|
|
|
|
2021-07-06 16:33:25 +02:00
|
|
|
(defvar mm-inline-message-prepare-function nil
|
|
|
|
"Function called by `mm-inline-message' to do client specific setup.
|
2021-10-29 17:26:53 +02:00
|
|
|
It is called with two parameters -- the MIME handle and the charset.")
|
* lisp/gnus: Use lexical-binding in all the files
* lisp/gnus/gnus-group.el (features): Use `dlet`.
(gnus-tmp-level, gnus-tmp-marked, gnus-tmp-group): Declare vars.
(gnus-group-insert-group-line): Bind dynbound vars via `let` rather
than as formal args. Bind `number` as dynbound.
(gnus-visual, gnus-score-find-score-files-function)
(gnus-home-score-file, gnus-apply-kill-hook)
(gnus-summary-expunge-below): Declare vars.
(gnus-group-restart, gnus-group-list-plus): Fix `interactive` spec
since the arg is unused.
* lisp/gnus/mail-source.el (mail-source-bind, mail-source-bind-common):
Use `dlet` and suppress the warnings about the non-prefixed dynbound vars.
(mail-source-set-1): Remove unused var `auth-info`.
(mail-source-call-script): Remove unused var `background`.
(mail-source-fetch-pop, mail-source-check-pop): Bind pop3 vars with `dlet`.
* lisp/gnus/gnus-int.el (mail-source-plugged, gnus-inhibit-demon):
Declare vars.
(gnus-server-opened, gnus-status-message)
(gnus-open-server, gnus-close-server, gnus-request-list)
(gnus-finish-retrieve-group-infos, gnus-retrieve-group-data-early)
(gnus-request-list-newsgroups, gnus-request-newgroups)
(gnus-request-regenerate, gnus-request-compact, gnus-request-group)
(gnus-retrieve-groups, gnus-request-post, gnus-request-expunge-group)
(gnus-request-scan, gnus-request-update-info, gnus-request-marks)
(gnus-request-accept-article, gnus-request-create-group)
(gnus-asynchronous-p, gnus-remove-denial):
Bind `gnus-command-method` via `let` rather than as formal args.
* lisp/gnus/gnus-topic.el (gnus-topic-insert-topic-line):
Pass documented vars to eval for `gnus-topic-line-format-spec`.
* lisp/gnus/message.el (message-yank-original): Use `cl-progv` rather
than `eval` to bind the vars from `message-cite-style`.
* lisp/gnus/mml.el (mml-parse-1): Use `apply` instead of `eval`.
(gnus-newsgroup-name, gnus-displaying-mime, gnus-newsgroup-name)
(gnus-article-prepare-hook, gnus-newsgroup-charset)
(gnus-original-article-buffer, gnus-message-buffer)
(message-this-is-news, message-this-is-mail): Declare vars.
* lisp/gnus/deuglify.el (gnus-outlook-rearrange-article): Remove unused
var `cite-marks`.
* lisp/gnus/gnus-art.el (ansi-color-context-region): Declare var.
(gnus-mime-display-attachment-buttons-in-header): Move declaration
before first use.
(gnus-mime-display-alternative): Remove unused var `from`.
* lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-list): Remove unused
var `start` `end`.
* lisp/gnus/gnus-cache.el (gnus-article-decode-hook)
(nnml-generate-active-function): Declare var.
* lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Remove unused
var `keywords`.
* lisp/gnus/gnus-cloud.el (gnus-cloud-encode-data): Remove unused var
`cipher`.
(gnus-cloud-ensure-cloud-group): Remove unused var `method`.
* lisp/gnus/gnus-delay.el (gnus-delay-article): Remove unused var `days`.
* lisp/gnus/gnus-html.el (gnus-html-wash-images): Remove unused vars
`tag`, `string`, and `images`.
(gnus-html-wash-tags): Remove unused vars `string` and `images`.
* lisp/gnus/gnus-msg.el (gnus-msg-mail): Remove unused var `group-name`.
(gnus-group-mail, gnus-group-news, gnus-summary-mail-other-window)
(gnus-summary-news-other-window):
Remove unused vars `group` and `buffer`.
(gnus-configure-posting-styles): Remove unused vars `style` and `attribute`.
* lisp/gnus/gnus-picon.el (gnus-picon-find-face): Remove unused vars
`database`, `directory`, and `instance`.
(gnus-picon-transform-newsgroups): Remove unused var `point`.
* lisp/gnus/gnus-range.el (gnus-range-difference): Remove unused var `safe`.
* lisp/gnus/gnus-score.el (gnus-score-load-file): Remove unused var
`score-fn`.
* lisp/gnus/gnus-sum.el (message-options-set-recipient): Declare var.
* lisp/gnus/gnus-undo.el (gnus-undo): Fix docstring lie.
* lisp/gnus/gnus-util.el (print-string-length)
(iswitchb-make-buflist-hook): Declare vars.
(gnus-emacs-version): Remove unused var `codename`.
(gnus-rename-file): Remove unused vars `old-name` and `new-name`.
* lisp/gnus/gnus-uu.el (gnus-uu-yenc-article): Remove unused var
`start-char`.
(gnus-asynchronous): Declare var.
* lisp/gnus/mm-partial.el (gnus-displaying-mime): Declare var.
(mm-inline-partial): Remove unused var `buffer`.
* lisp/gnus/mm-view.el (w3m-force-redisplay, w3m-safe-url-regexp)
(gnus-displaying-mime, gnus-original-article-buffer)
(gnus-article-prepare-hook): Declare vars.
* lisp/gnus/mml-smime.el (mml-smime-epg-encrypt): Remove unused var
`boundary`.
(mml-smime-epg-verify): Remove unused vars `plain` and `signature-file`.
* lisp/gnus/mml1991.el (pgg-text-mode): Declare var.
* lisp/gnus/mml2015.el (pgg-text-mode): Declare var.
(mml2015-pgg-decrypt): Remove unused var `result`.
(mml2015-epg-key-image-to-string): Remove unused var `error`.
(mml2015-epg-decrypt): Remove unused var `result`.
(mml2015-epg-verify): Remove unused vars `plain` and `signature-file`.
* lisp/gnus/nnbabyl.el (nnml-current-directory): Declare var.
* lisp/gnus/nndiary.el (nndiary-files): Move declaration before first use.
* lisp/gnus/nnfolder.el (nnfolder-request-accept-article):
Remove unused var `buf`.
* lisp/gnus/nnmail.el (nnmail-parse-active): Remove unused var `err`.
* lisp/gnus/nnmairix.el (nnmairix-request-group): Remove unused var `args`.
(nnmairix-request-create-group): Remove unused var `info`.
(nnmairix-request-list): Remove unused var `folder`.
(nnmairix-request-set-mark): Remove unused var `propto`.
(nnmairix-request-set-mark): Remove unused vars `number` and `method`.
(nnmairix-close-group): Remove unused var `method`.
(nnmairix-create-search-group-from-message): Remove unused var `cq`.
(nnmairix-create-server-and-default-group): Remove unused var `create`.
(nnmairix-purge-old-groups): Remove unused var `folder`.
(nnmairix-remove-tick-mark-original-article, nnmairix-get-valid-servers):
Remove unused var `cur`.
(nnmairix-replace-group-and-numbers): Remove unused var `header`.
(nnmairix-goto-original-article): Remove unused var `rval`.
(nnmairix-widget-create-query): Remove unused var `allwidgets`.
* lisp/gnus/nnmbox.el (nnml-current-directory): Declare var.
* lisp/gnus/nnmh.el (nnmh-toplev): Move declaration before first use.
(nnmh-request-list-1): Remove unused var `rdir`.
* lisp/gnus/nnml.el (nnml-generate-nov-file): Remove unused var `file`.
* lisp/gnus/nnrss.el (nnrss-request-article): Remove unused var `post`.
(nnrss-request-article): Remove unused var `fn`.
(nnrss-check-group): Remove unused var `rdf-ns`.
* lisp/gnus/nnweb.el (nnweb-request-article): Remove unused var `active`.
(nnweb-google-parse-1): Remove unused var `Score`.
* lisp/gnus/spam-stat.el (spam-stat-error-holder): Remove var.
(spam-stat-buffer-words-with-scores): Remove unused var `word`.
(spam-stat-score-buffer): Remove unused var `spam-stat-error-holder`.
(spam-stat-split-fancy): Use `err` instead of `spam-stat-error-holder`.
* lisp/gnus/spam-wash.el (spam-wash): Remove unused var `handle`.
* lisp/gnus/spam.el (spam-copy-or-move-routine): Remove unused vars
`article` and `mark`.
(spam-register-routine): Remove unused var `article`.
(spam-log-undo-registration): Remove unused var `found`.
(spam-ifile-register-with-ifile): Remove unused var `parameters`.
(spam-check-stat): Remove unused vars `category` and `return`.
(spam-parse-list): Remove unused var `found`.
(spam-filelist-register-routine): Remove unused var `from`.
2021-01-30 18:44:00 -05:00
|
|
|
|
2000-09-19 13:40:08 +00:00
|
|
|
(defun mm-inline-message (handle)
|
2021-07-06 16:33:25 +02:00
|
|
|
"Insert HANDLE (a message/rfc822 part) into the current buffer.
|
|
|
|
This function will call `mm-inline-message-prepare-function'
|
|
|
|
after inserting the part."
|
2000-09-19 13:40:08 +00:00
|
|
|
(let ((b (point))
|
2001-12-05 19:27:45 +00:00
|
|
|
(bolp (bolp))
|
2000-09-19 13:40:08 +00:00
|
|
|
(charset (mail-content-type-get
|
2021-07-06 16:33:25 +02:00
|
|
|
(mm-handle-type handle) 'charset)))
|
2000-09-19 13:40:08 +00:00
|
|
|
(when (and charset
|
|
|
|
(stringp charset))
|
|
|
|
(setq charset (intern (downcase charset)))
|
|
|
|
(when (eq charset 'us-ascii)
|
|
|
|
(setq charset nil)))
|
|
|
|
(save-excursion
|
|
|
|
(save-restriction
|
|
|
|
(narrow-to-region b b)
|
|
|
|
(mm-insert-part handle)
|
2021-07-06 16:33:25 +02:00
|
|
|
(when mm-inline-message-prepare-function
|
2021-10-29 17:26:53 +02:00
|
|
|
(funcall mm-inline-message-prepare-function handle charset))
|
2001-12-05 19:27:45 +00:00
|
|
|
(goto-char (point-min))
|
|
|
|
(unless bolp
|
|
|
|
(insert "\n"))
|
2000-09-19 13:40:08 +00:00
|
|
|
(goto-char (point-max))
|
|
|
|
(unless (bolp)
|
|
|
|
(insert "\n"))
|
|
|
|
(insert "----------\n\n")
|
|
|
|
(mm-handle-set-undisplayer
|
|
|
|
handle
|
2021-01-30 18:56:37 -05:00
|
|
|
(let ((beg (point-min-marker))
|
|
|
|
(end (point-max-marker)))
|
|
|
|
(lambda ()
|
|
|
|
(let ((inhibit-read-only t))
|
|
|
|
(delete-region beg end)))))))))
|
2000-09-19 13:40:08 +00:00
|
|
|
|
2011-11-21 22:08:36 +00:00
|
|
|
;; Shut up byte-compiler.
|
|
|
|
(defvar font-lock-mode-hook)
|
2011-03-22 13:40:41 +00:00
|
|
|
(defun mm-display-inline-fontify (handle &optional mode)
|
|
|
|
"Insert HANDLE inline fontifying with MODE.
|
|
|
|
If MODE is not set, try to find mode automatically."
|
2007-10-28 09:18:39 +00:00
|
|
|
(let ((charset (mail-content-type-get (mm-handle-type handle) 'charset))
|
2018-08-31 01:15:56 +03:00
|
|
|
text coding-system ovs)
|
2007-10-28 09:18:39 +00:00
|
|
|
(unless (eq charset 'gnus-decoded)
|
|
|
|
(mm-with-unibyte-buffer
|
|
|
|
(mm-insert-part handle)
|
|
|
|
(mm-decompress-buffer
|
2011-03-22 13:40:41 +00:00
|
|
|
(mm-handle-filename handle)
|
2007-10-28 09:18:39 +00:00
|
|
|
t t)
|
|
|
|
(unless charset
|
|
|
|
(setq coding-system (mm-find-buffer-file-coding-system)))
|
|
|
|
(setq text (buffer-string))))
|
2016-02-14 17:07:48 +11:00
|
|
|
(with-temp-buffer
|
2007-10-28 09:18:39 +00:00
|
|
|
(insert (cond ((eq charset 'gnus-decoded)
|
|
|
|
(with-current-buffer (mm-handle-buffer handle)
|
|
|
|
(buffer-string)))
|
|
|
|
(coding-system
|
2016-02-12 14:39:30 +11:00
|
|
|
(decode-coding-string text coding-system))
|
2019-05-02 22:06:02 +01:00
|
|
|
(t
|
|
|
|
(mm-decode-string text (or charset 'undecided)))))
|
2019-04-09 12:04:03 -04:00
|
|
|
(let ((font-lock-verbose nil) ; font-lock is a bit too verbose.
|
2017-06-20 03:46:21 +00:00
|
|
|
(enable-local-variables nil))
|
2019-04-09 12:04:03 -04:00
|
|
|
;; We used to set font-lock-mode-hook to nil to avoid enabling
|
|
|
|
;; support modes, but now that we use font-lock-ensure, support modes
|
|
|
|
;; aren't a problem any more. So we could probably get rid of this
|
|
|
|
;; setting now, but it seems harmless and potentially still useful.
|
Prefer setq-local in gnus/*.el
* lisp/gnus/gnus-agent.el (gnus-agent-mode)
(gnus-agent-get-undownloaded-list, gnus-agent-open-history):
* lisp/gnus/gnus-art.el (gnus-article-setup-highlight-words)
(gnus-article-mode, gnus-article-setup-buffer, defsubst)
(gnus-article-describe-bindings, gnus-article-edit-mode):
* lisp/gnus/gnus-cus.el (gnus-custom-mode, gnus-group-customize)
(gnus-score-customize, gnus-agent-customize-category):
* lisp/gnus/gnus-group.el (gnus-group-make-tool-bar):
* lisp/gnus/gnus-msg.el (gnus-setup-message)
(gnus-summary-news-other-window, gnus-configure-posting-styles):
* lisp/gnus/gnus-salt.el (gnus-pick-mode, gnus-binary-mode):
* lisp/gnus/gnus-score.el (gnus-score-edit-current-scores)
(gnus-score-edit-file):
* lisp/gnus/gnus-srvr.el (gnus-server-mode):
* lisp/gnus/gnus-start.el (gnus-no-server-1)
(gnus-dribble-read-file, gnus-save-newsrc-file)
(gnus-gnus-to-newsrc-format):
* lisp/gnus/gnus-sum.el (gnus-summary-make-tool-bar)
(gnus-summary-mode, gnus-summary-setup-buffer)
(gnus-select-newsgroup, gnus-summary-edit-article)
(gnus-summary-setup-default-charset):
* lisp/gnus/gnus-topic.el (gnus-topic-mode):
* lisp/gnus/gnus-undo.el (gnus-undo-mode):
* lisp/gnus/gnus.el (gnus-simplify-mode-line):
* lisp/gnus/message.el (message-cite-reply-position)
(message-cite-style, message-mode, message-setup-fill-variables):
* lisp/gnus/mm-view.el (mm-display-inline-fontify):
* lisp/gnus/mml.el (mml-mode):
* lisp/gnus/nndiary.el (nndiary-open-nov):
* lisp/gnus/nnfolder.el (nnfolder-save-buffer)
(nnfolder-open-nov):
* lisp/gnus/nnheader.el (nnheader-init-server-buffer):
* lisp/gnus/nnimap.el (nnimap-make-process-buffer):
* lisp/gnus/nnml.el (nnml-get-nov-buffer): Prefer setq-local.
2020-12-07 16:27:50 +01:00
|
|
|
(setq-local font-lock-mode-hook nil)
|
2011-03-22 13:40:41 +00:00
|
|
|
(setq buffer-file-name (mm-handle-filename handle))
|
2022-02-04 19:39:53 -05:00
|
|
|
(with-demoted-errors "Error setting mode: %S"
|
|
|
|
(if mode
|
|
|
|
(save-window-excursion
|
|
|
|
;; According to Katsumi Yamaoka <yamaoka@jpl.org>, org-mode
|
|
|
|
;; requires the buffer to be temporarily displayed here, but
|
|
|
|
;; I could not reproduce this problem. Furthermore, if
|
|
|
|
;; there's such a problem, we should fix org-mode rather than
|
|
|
|
;; use switch-to-buffer which can have undesirable
|
|
|
|
;; side-effects!
|
|
|
|
;;(switch-to-buffer (current-buffer))
|
|
|
|
(funcall mode))
|
2011-11-21 22:08:36 +00:00
|
|
|
(let ((auto-mode-alist
|
|
|
|
(delq (rassq 'doc-view-mode-maybe auto-mode-alist)
|
2017-06-20 03:46:21 +00:00
|
|
|
(copy-sequence auto-mode-alist))))
|
2020-02-06 00:38:53 +02:00
|
|
|
;; Don't run hooks that might assume buffer-file-name
|
|
|
|
;; really associates buffer with a file (bug#39190).
|
|
|
|
(delay-mode-hooks (set-auto-mode))
|
2019-02-25 23:27:47 +02:00
|
|
|
(setq mode major-mode)))
|
2011-11-21 22:08:36 +00:00
|
|
|
;; Do not fontify if the guess mode is fundamental.
|
2020-08-02 19:44:30 +02:00
|
|
|
(when (and (not (eq major-mode 'fundamental-mode))
|
|
|
|
mm-inline-font-lock)
|
2016-02-12 17:23:43 +11:00
|
|
|
(font-lock-ensure))))
|
2007-10-28 09:18:39 +00:00
|
|
|
(setq text (buffer-string))
|
2018-08-31 01:15:56 +03:00
|
|
|
(when (eq mode 'diff-mode)
|
|
|
|
(setq ovs (mapcar (lambda (ov) (list ov (overlay-start ov)
|
|
|
|
(overlay-end ov)))
|
|
|
|
(overlays-in (point-min) (point-max)))))
|
2011-03-22 13:40:41 +00:00
|
|
|
;; Set buffer unmodified to avoid confirmation when killing the
|
|
|
|
;; buffer.
|
2016-02-14 17:07:48 +11:00
|
|
|
(set-buffer-modified-p nil))
|
2019-04-09 12:04:03 -04:00
|
|
|
(let ((b (- (point) (save-restriction (widen) (point-min)))))
|
2018-08-31 01:15:56 +03:00
|
|
|
(mm-insert-inline handle text)
|
|
|
|
(dolist (ov ovs)
|
|
|
|
(move-overlay (nth 0 ov) (+ (nth 1 ov) b)
|
|
|
|
(+ (nth 2 ov) b) (current-buffer))))))
|
2000-09-19 13:40:08 +00:00
|
|
|
|
2004-09-04 13:13:48 +00:00
|
|
|
;; Shouldn't these functions check whether the user even wants to use
|
2016-02-12 15:02:32 +11:00
|
|
|
;; font-lock? Also, it would be nice to change for the size of the
|
|
|
|
;; fontified region.
|
2004-09-04 13:13:48 +00:00
|
|
|
|
2000-09-20 11:46:48 +00:00
|
|
|
(defun mm-display-patch-inline (handle)
|
|
|
|
(mm-display-inline-fontify handle 'diff-mode))
|
|
|
|
|
|
|
|
(defun mm-display-elisp-inline (handle)
|
|
|
|
(mm-display-inline-fontify handle 'emacs-lisp-mode))
|
|
|
|
|
2007-10-28 09:18:39 +00:00
|
|
|
(defun mm-display-dns-inline (handle)
|
|
|
|
(mm-display-inline-fontify handle 'dns-mode))
|
|
|
|
|
2011-01-20 23:43:27 +00:00
|
|
|
(defun mm-display-org-inline (handle)
|
|
|
|
"Show an Org mode text from HANDLE inline."
|
|
|
|
(mm-display-inline-fontify handle 'org-mode))
|
|
|
|
|
|
|
|
(defun mm-display-shell-script-inline (handle)
|
2011-01-25 23:51:40 +00:00
|
|
|
"Show a shell script from HANDLE inline."
|
2011-01-20 23:43:27 +00:00
|
|
|
(mm-display-inline-fontify handle 'shell-script-mode))
|
|
|
|
|
2011-01-25 23:51:40 +00:00
|
|
|
(defun mm-display-javascript-inline (handle)
|
2020-09-21 13:29:10 +02:00
|
|
|
"Show JavaScript code from HANDLE inline."
|
2011-01-25 23:51:40 +00:00
|
|
|
(mm-display-inline-fontify handle 'javascript-mode))
|
|
|
|
|
2004-09-04 13:13:48 +00:00
|
|
|
;; id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
|
|
|
|
;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 }
|
|
|
|
(defvar mm-pkcs7-signed-magic
|
2013-06-10 05:17:51 +00:00
|
|
|
(concat
|
|
|
|
"0"
|
|
|
|
"\\(\\(\x80\\)"
|
|
|
|
"\\|\\(\x81\\(.\\|\n\\)\\{1\\}\\)"
|
|
|
|
"\\|\\(\x82\\(.\\|\n\\)\\{2\\}\\)"
|
|
|
|
"\\|\\(\x83\\(.\\|\n\\)\\{3\\}\\)"
|
|
|
|
"\\)"
|
|
|
|
"\x06\x09\\*\x86H\x86\xf7\x0d\x01\x07\x02"))
|
2004-09-04 13:13:48 +00:00
|
|
|
|
|
|
|
;; id-envelopedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
|
|
|
|
;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 3 }
|
|
|
|
(defvar mm-pkcs7-enveloped-magic
|
2013-06-10 05:17:51 +00:00
|
|
|
(concat
|
|
|
|
"0"
|
|
|
|
"\\(\\(\x80\\)"
|
|
|
|
"\\|\\(\x81\\(.\\|\n\\)\\{1\\}\\)"
|
|
|
|
"\\|\\(\x82\\(.\\|\n\\)\\{2\\}\\)"
|
|
|
|
"\\|\\(\x83\\(.\\|\n\\)\\{3\\}\\)"
|
|
|
|
"\\)"
|
|
|
|
"\x06\x09\\*\x86H\x86\xf7\x0d\x01\x07\x03"))
|
2004-09-04 13:13:48 +00:00
|
|
|
|
|
|
|
(defun mm-view-pkcs7-get-type (handle)
|
|
|
|
(mm-with-unibyte-buffer
|
|
|
|
(mm-insert-part handle)
|
|
|
|
(cond ((looking-at mm-pkcs7-enveloped-magic)
|
|
|
|
'enveloped)
|
|
|
|
((looking-at mm-pkcs7-signed-magic)
|
|
|
|
'signed)
|
|
|
|
(t
|
|
|
|
(error "Could not identify PKCS#7 type")))))
|
|
|
|
|
2010-11-11 23:51:05 +00:00
|
|
|
(defun mm-view-pkcs7 (handle &optional from)
|
gnus: replace cl with cl-lib
* lisp/gnus/gnus-agent.el, lisp/gnus/gnus-art.el:
* lisp/gnus/gnus-async.el, lisp/gnus/gnus-cache.el:
* lisp/gnus/gnus-demon.el, lisp/gnus/gnus-group.el:
* lisp/gnus/gnus-icalendar.el, lisp/gnus/gnus-logic.el:
* lisp/gnus/gnus-msg.el, lisp/gnus/gnus-picon.el:
* lisp/gnus/gnus-registry.el, lisp/gnus/gnus-salt.el:
* lisp/gnus/gnus-score.el, lisp/gnus/gnus-spec.el:
* lisp/gnus/gnus-srvr.el, lisp/gnus/gnus-start.el:
* lisp/gnus/gnus-sum.el, lisp/gnus/gnus-topic.el:
* lisp/gnus/gnus-util.el, lisp/gnus/gnus-uu.el, lisp/gnus/gnus-win.el:
* lisp/gnus/mail-source.el, lisp/gnus/mm-decode.el:
* lisp/gnus/mm-encode.el, lisp/gnus/mm-url.el, lisp/gnus/mm-view.el:
* lisp/gnus/mml-smime.el, lisp/gnus/mml.el, lisp/gnus/mml2015.el:
* lisp/gnus/nnbabyl.el, lisp/gnus/nndoc.el, lisp/gnus/nneething.el:
* lisp/gnus/nnheader.el, lisp/gnus/nnimap.el, lisp/gnus/nnmail.el:
* lisp/gnus/nnmaildir.el, lisp/gnus/nnoo.el, lisp/gnus/nnrss.el:
* lisp/gnus/nnspool.el, lisp/gnus/nntp.el, lisp/gnus/nnvirtual.el:
* lisp/gnus/nnweb.el, lisp/gnus/spam.el: Replace cl with cl-lib.
* lisp/gnus/canlock.el, lisp/gnus/gnus-bcklg.el:
* lisp/gnus/gnus-cite.el, lisp/gnus/gnus-cloud.el:
* lisp/gnus/gnus-draft.el, lisp/gnus/gnus-dup.el:
* lisp/gnus/gnus-fun.el, lisp/gnus/gnus-html.el:
* lisp/gnus/gnus-int.el, lisp/gnus/gnus-kill.el, lisp/gnus/gnus-ml.el:
* lisp/gnus/gnus-mlspl.el, lisp/gnus/gnus-range.el:
* lisp/gnus/gnus-undo.el, lisp/gnus/gnus-vm.el:
* lisp/gnus/mm-partial.el, lisp/gnus/mm-uu.el, lisp/gnus/mml1991.el:
* lisp/gnus/nnagent.el, lisp/gnus/nndiary.el, lisp/gnus/nndir.el:
* lisp/gnus/nndraft.el, lisp/gnus/nnfolder.el, lisp/gnus/nngateway.el:
* lisp/gnus/nnmairix.el, lisp/gnus/nnmbox.el, lisp/gnus/nnmh.el:
* lisp/gnus/nnml.el, lisp/gnus/score-mode.el, lisp/gnus/smiley.el:
No need for cl.
2018-03-23 16:13:09 -04:00
|
|
|
(cl-case (mm-view-pkcs7-get-type handle)
|
2010-11-11 23:51:05 +00:00
|
|
|
(enveloped (mm-view-pkcs7-decrypt handle from))
|
2004-09-04 13:13:48 +00:00
|
|
|
(signed (mm-view-pkcs7-verify handle))
|
|
|
|
(otherwise (error "Unknown or unimplemented PKCS#7 type"))))
|
|
|
|
|
|
|
|
(defun mm-view-pkcs7-verify (handle)
|
2007-10-28 09:18:39 +00:00
|
|
|
(let ((verified nil))
|
2019-09-26 16:32:13 +02:00
|
|
|
(if (eq mml-smime-use 'epg)
|
|
|
|
;; Use EPG/gpgsm
|
|
|
|
(insert
|
|
|
|
(with-temp-buffer
|
|
|
|
(insert-buffer-substring (mm-handle-buffer handle))
|
|
|
|
(goto-char (point-min))
|
2020-09-07 16:29:59 +02:00
|
|
|
(let ((part (base64-decode-string (buffer-string)))
|
|
|
|
(context (epg-make-context 'CMS)))
|
|
|
|
(prog1
|
|
|
|
(epg-verify-string context part)
|
2021-12-24 10:43:52 +01:00
|
|
|
(let ((result (epg-context-result-for context 'verify)))
|
2020-09-07 16:29:59 +02:00
|
|
|
(mm-sec-status
|
2021-12-24 10:43:52 +01:00
|
|
|
'gnus-info (epg-verify-result-to-string result)))))))
|
2019-09-26 16:32:13 +02:00
|
|
|
(with-temp-buffer
|
|
|
|
(insert "MIME-Version: 1.0\n")
|
|
|
|
(mm-insert-headers "application/pkcs7-mime" "base64" "smime.p7m")
|
|
|
|
(insert-buffer-substring (mm-handle-buffer handle))
|
|
|
|
(setq verified (smime-verify-region (point-min) (point-max))))
|
|
|
|
(if verified
|
|
|
|
(insert verified)
|
|
|
|
(insert-buffer-substring smime-details-buffer)))
|
|
|
|
t))
|
2004-09-04 13:13:48 +00:00
|
|
|
|
2015-05-04 20:34:09 -04:00
|
|
|
(autoload 'epg-decrypt-string "epg")
|
|
|
|
|
2010-11-11 23:51:05 +00:00
|
|
|
(defun mm-view-pkcs7-decrypt (handle &optional from)
|
2004-09-04 13:13:48 +00:00
|
|
|
(insert-buffer-substring (mm-handle-buffer handle))
|
|
|
|
(goto-char (point-min))
|
2011-01-02 11:23:02 +00:00
|
|
|
(if (eq mml-smime-use 'epg)
|
|
|
|
;; Use EPG/gpgsm
|
|
|
|
(let ((part (base64-decode-string (buffer-string))))
|
|
|
|
(erase-buffer)
|
2021-12-24 10:43:52 +01:00
|
|
|
(insert
|
|
|
|
(let ((context (epg-make-context 'CMS)))
|
|
|
|
(prog1
|
|
|
|
(epg-decrypt-string context part)
|
|
|
|
(mm-sec-status 'gnus-info "OK")))))
|
2011-01-02 11:23:02 +00:00
|
|
|
;; Use openssl
|
|
|
|
(insert "MIME-Version: 1.0\n")
|
|
|
|
(mm-insert-headers "application/pkcs7-mime" "base64" "smime.p7m")
|
|
|
|
(smime-decrypt-region
|
|
|
|
(point-min) (point-max)
|
|
|
|
(if (= (length smime-keys) 1)
|
|
|
|
(cadar smime-keys)
|
|
|
|
(smime-get-key-by-email
|
|
|
|
(gnus-completing-read
|
|
|
|
"Decipher using key"
|
|
|
|
smime-keys nil nil nil (car-safe (car-safe smime-keys)))))
|
|
|
|
from))
|
2004-09-04 13:13:48 +00:00
|
|
|
(goto-char (point-min))
|
|
|
|
(while (search-forward "\r\n" nil t)
|
|
|
|
(replace-match "\n"))
|
|
|
|
(goto-char (point-min)))
|
|
|
|
|
2000-09-19 13:40:08 +00:00
|
|
|
(provide 'mm-view)
|
|
|
|
|
2001-07-15 17:42:53 +00:00
|
|
|
;;; mm-view.el ends here
|