From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.bugs Subject: bug#55014: 29.0.50; mml-generate-mime gets error Date: Mon, 18 Apr 2022 23:47:22 -0400 Message-ID: Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12856"; mail-complaints-to="usenet@ciao.gmane.io" To: 55014@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 19 05:48:11 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ngeqY-000387-MX for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Apr 2022 05:48:10 +0200 Original-Received: from localhost ([::1]:45278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ngeqX-0007j4-AB for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 18 Apr 2022 23:48:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ngeqQ-0007io-6p for bug-gnu-emacs@gnu.org; Mon, 18 Apr 2022 23:48:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47413) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ngeqP-00033g-U7 for bug-gnu-emacs@gnu.org; Mon, 18 Apr 2022 23:48:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ngeqP-0004Tk-QZ for bug-gnu-emacs@gnu.org; Mon, 18 Apr 2022 23:48:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Richard Stallman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Apr 2022 03:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55014 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.165034004717015 (code B ref -1); Tue, 19 Apr 2022 03:48:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Apr 2022 03:47:27 +0000 Original-Received: from localhost ([127.0.0.1]:41306 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ngepq-0004QK-Uz for submit@debbugs.gnu.org; Mon, 18 Apr 2022 23:47:27 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:32772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ngepo-0004QC-Sa for submit@debbugs.gnu.org; Mon, 18 Apr 2022 23:47:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ngepn-0007bM-HV for bug-gnu-emacs@gnu.org; Mon, 18 Apr 2022 23:47:24 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58302) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ngepn-0002z6-8l for bug-gnu-emacs@gnu.org; Mon, 18 Apr 2022 23:47:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:Subject:To:From:mime-version:in-reply-to: references; bh=UZV7k7QpYCmMSSzuDr9hrOL8fOEZiPICA1vGcKmiils=; b=IhJ7M+msREyvCS xRM85Np60ImGrVj3ZqWbNQnU+gUmNurxOVuH55xUkRTdaFZ1JXpF4/b9VWiZY1tt2imTn1Fe4NThv PsY0M44KjLgJsAuIRAvCNfP4u6nI2hMs8LxZWzJSdUUc2MccIs99JLyMEiZA1T4U0vyEzLo1rlH/n cJGNfbg/t06IvulPsPc/hlBZysfuBnpaxOV9tHhbMLYviwC/YLKVuv33bzOjoL7mmRaUfmylX3VTU iKuRmbs6hq/nYDQFpm38IBiPccGRWYlMUHrsWw38rz+Jo8FH7jGxk/qA5kI+WMIuh+sy2dFdytpdy oFqS53ewLGVGSRdaRiSg==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1ngepm-00076n-TK; Mon, 18 Apr 2022 23:47:23 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:230213 Archived-At: I had this in my *mail* buffer (in Mail mode): ====================================================================== Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: rms Subject: Reply-To: rms@gnu.org Test. <#part type="application/pdf" filename="~/foo.pdf" disposition=attachment> <#/part> ====================================================================== I ran (mml-secure-message-sign-pgpmime), then typed C-c C-c and got an error from mml-generate-mime, that assq returned nil here: (setcdr (assq 'type (cdr (car cont))) content-type)) cont contained this. ====================================================================== ((multipart (sign . "pgpmime") (tag-location . 119) (part (type . "text/plain") (contents . "Test. ")) (part (type . "application/pdf") (filename . "~/foo.pdf") (disposition . "attachment") (tag-location . 152) (contents . "")))) ====================================================================== The code there is kludgy, but in the absence of a precise description of that data structure, I can't directly tell what's wrong. Is there a description somewhere? The rest of the backtrace: setcdr(nil "text/plain; charset=Utf-8") (progn (setcdr (assq 'type (cdr (car cont))) content-type)) (if (and (consp (car cont)) (= (length cont) 1) content-type) (progn (setcdr (assq 'type (cdr (car cont))) content-type))) (if (not cont) nil (if (and (consp (car cont)) (= (length cont) 1) content-type) (progn (setcdr (assq 'type (cdr (car cont))) content-type))) (if (fboundp 'libxml-parse-html-region) (progn (setq cont (mapcar #'mml-expand-all-html-into-multipart-related cont)))) (prog1 (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (set-buffer-multibyte nil) (setq message-options options) (cond (... ...) (... ...) (t ...)) (setq options message-options) (buffer-string)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (setq message-options options))) (let ((cont (mml-parse)) (mml-multipart-number mml-multipart-number) (options message-options)) (if (not cont) nil (if (and (consp (car cont)) (= (length cont) 1) content-type) (progn (setcdr (assq 'type (cdr (car cont))) content-type))) (if (fboundp 'libxml-parse-html-region) (progn (setq cont (mapcar #'mml-expand-all-html-into-multipart-related cont)))) (prog1 (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (set-buffer-multibyte nil) (setq message-options options) (cond ... ... ...) (setq options message-options) (buffer-string)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (setq message-options options)))) mml-generate-mime(nil "text/plain; charset=Utf-8") message-encode-message-body() mml-to-mime() mail-send() mail-send-and-exit(nil) In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32, cairo version 1.16.0) of 2022-04-13 built on freetop Repository revision: ed6237e039e6fb51229054d0fce74df074903f19 Repository branch: master System Description: Trisquel GNU/Linux Nabia (10.0) Configured using: 'configure 'CFLAGS=-O0 -g' --with-gnutls=ifavailable' Configured features: CAIRO DBUS FREETYPE GIF GLIB GPM GSETTINGS HARFBUZZ JPEG LIBOTF LIBSELINUX LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK2 ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Mail Minor modes in effect: gpm-mouse-mode: t tooltip-mode: t global-eldoc-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: linux auto-encryption-mode: t auto-compression-mode: t abbrev-mode: t Load-path shadows: None found. Features: (shadow dabbrev emacsbug shortdoc thingatpt misearch multi-isearch cl-extra vc-git diff-mode easy-mmode vc-dispatcher bug-reference help-fns radix-tree cl-print debug backtrace help-mode find-func cus-start cus-load mailalias qp rmailmm message sendmail yank-media rmc puny rfc822 mml mml-sec epa epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader mail-parse rfc2231 rmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils dired-aux dired dired-loaddefs t-mouse term/linux view derived advice finder-inf package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map url-vars seq gv subr-x byte-opt bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice simple cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 353614 44925) (symbols 48 10482 5) (strings 32 36669 1027) (string-bytes 1 1029513) (vectors 16 19555) (vector-slots 8 219774 25967) (floats 8 97 267) (intervals 56 52273 1191) (buffers 992 35)) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)