;ELC ;;; compiled by jwz@thalidomide on Wed Mar 23 19:10:38 1994 ;;; from file /th/jwz/emacs19/lisp/packages/mime-compose.el ;;; emacs version 19.10 Lucid (beta8). ;;; bytecomp version 2.22; 22-dec-93. ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "This file was compiled for Emacs 19.")) (provide 'mime-compose) (defvar mime-running-mh-e (boundp 'mh-letter-mode-hook) "\ Non-nil if running under mh-e.") (byte-code "!" [mime-running-mh-e require sendmail] 2) (defvar mime-compose-hook nil "\ *Invoked exactly once by first invocation of mime-mimify-message, before any processing is done.") (defvar mime-use-selective-display t "\ *Flag for using selective-display to hide bodies of MIME enclosures. If non-NIL, selective-display will be used; if NIL, it will not be used.") (defvar mime-default-charset "US-ASCII" "\ *Default character set for MIME messages elements. According to the MIME specification, this can be either US-ASCII or ISO-8859-x, where x must be between 1 and 9 inclusive.") (defvar mime-encode-plaintext-on-send nil "\ *Non-NIL if plaintext bodyparts should be encoded in quoted-printable and labeled with mime-default-charset when a message is sent; NIL otherwise.") (defvar mime-use-highlighting t "\ *Flag to use highlighting for MIME headers and content types in Epoch or Lucid Emacs; if non-NIL, highlighting will be used.") (defvar mime-deemphasize-color "grey80" "\ *Color for de-highlighting MIME headers in Epoch or Lucid Emacs.") (defvar mime-emphasize-color "yellow" "\ *Color for highlighting MIME content types in Epoch or Lucid Emacs.") (defvar mime-name-included-files t "\ *If non-NIL, use name attribute for included files.") (defvar mime-use-waiting-messages t "\ *If non-NIL, enable waiting messages feature.") (defvar mime-primary-boundary "mysteryboxofun" "\ *Word used as the primary MIME boundary.") (defvar mime-xwd-command "xwd -frame" "\ *Command used to do a window dump under the X Window System.") (defvar mime-encode-base64-command "mmencode" "\ *Command used to encode data in base64 format.") (defvar mime-encode-qp-command "mmencode -q" "\ *Command used to encode data in quoted-printable format.") (defvar mime-babbling-description "talking" "\ *Adjective(s) (or gerunds; I never could tell them apart) applying to audio snippets.") (defvar mime-sgi-record-program "/usr/sbin/recordaiff" "\ *Full name of SGI audio record program.") (defvar mime-sun-record-program "/usr/demo/SOUND/record" "\ *Full name of Sun audio record program, patched with the context diff found at the end of mime-compose.el.") (defvar mime-compose-hook-was-run nil "\ NIL implies we haven't yet run mime-compose-hook.") (defvar mime-valid-include-types '(("image/gif" 1) ("image/jpeg" 2) ("application/postscript" 3) ("application/andrew-inset" 4) ("application/octet-stream" 5) ("text/richtext" 6) ("text/plain" 7) ("audio/basic" 8) ("video/mpeg" 9) ("message/rfc822" 10) ("application/x-emacs-lisp" 11) ("application/x-unix-tar-z" 12) ("application/x-dvi" 13) ("image/x-xbm" 14) ("image/x-xwd" 15) ("image/x-tiff" 16) ("audio/x-aiff" 17) ("text/x-html" 18)) "\ A list of valid content types for minibuffer completion.") (defvar mime-valid-charsets '(("US-ASCII" 1) ("ISO-8859-1" 2) ("ISO-8859-2" 3) ("ISO-8859-3" 4) ("ISO-8859-4" 5) ("ISO-8859-5" 6) ("ISO-8859-6" 7) ("ISO-8859-7" 8) ("ISO-8859-8" 9) ("ISO-8859-9" 10)) "\ A list of valid charset names for minibuffer completion.") (defvar mime-using-silicon-graphics (eq system-type 'silicon-graphics-unix) "\ Flag to indicate use of Silicon Graphics platform. If T, Emacs is being run on a Silicon Graphics workstation; else it is not.") (defvar mime-running-lemacs (string-match "Lucid" emacs-version) "\ Non-nil if running Lucid Emacs.") (defvar mime-running-epoch (boundp 'epoch::version) "\ Non-nil if running Epoch.") (byte-code " !  \"! \" !! \"!!\"‡" [mime-running-epoch mime-use-highlighting boundp mime-deemphasize-style make-style set-style-foreground mime-deemphasize-color mime-emphasize-style mime-emphasize-color mime-running-lemacs make-face mime-deemphasize-face set-face-foreground mime-emphasize-face] 3) (defvar mime-audio-file "/tmp/.fooblatz" "\ Filename to store audio snippets recorded on the fly.") (defvar mime-audio-tmp-file "/tmp/.fooblatz.aiff" "\ Filename to store audio snippets recorded on the fly.") (defconst mime-waiting-message-lines '("Mail mime-compose bug reports to marca@ncsa.uiuc.edu and pray for help." "For the daring: ftp.ncsa.uiuc.edu:/outgoing/marca/mime-compose.el" "Feature requests? Fervent wishes? Unfulfilled desires? Write code!" "mime-compose.el: the Kitchen Sink(tm) of mail composers." "Q: How many Elisp hackers does it take to change a light bulb?" "A: None -- we glow in the dark." ".gnol oot yaw rof scamE gnisu neeb ev'uoy ,siht daer nac uoy fI" "Macs? We don' need no steenkin Macs! We got MIME!" "All hail MIME. All hail MIME. Yay. Yay. Woo. Woo.") "\ List of stupid strings to display while waiting for more to do.") (defun mime-primary-boundary nil "\ Return the current primary boundary. Note that in the current version of mime-compose.el, there is no support for secondary boundaries (for parallel or alternate bodyparts, etc.). In the future, there may be." mime-primary-boundary) (fset 'mime-hide-region #[(from to hideflag) "ª ǎ \n %," [hideflag 10 13 buffer-modified-p modp new old ((set-buffer-modified-p modp)) subst-char-in-region from to t] 6 "\ Hides or shows lines from FROM to TO, according to HIDEFLAG: If T, region is hidden, else if NIL, region is shown."]) (fset 'mime-maybe-hide-region #[(start end) "\n #" [mime-use-selective-display mime-hide-region start end t] 4 "\ Hide the current region if mime-use-selective-display is T."]) (fset 'mime-add-description #[(description) " Pe#!ȱ)" [re-search-backward "--" mime-primary-boundary t next-line 2 "Content-Description: " description "\n"] 4 "\ Add a description to the current MIME message element." "sDescription: "]) (fset 'mime-display-waiting-messages #[nil "! !! @! An)! ?! ? " [mime-use-waiting-messages sit-for 2 mime-waiting-message-lines lines message "mime-compose.el $Revision: 1.5 $, by marca@ncsa.uiuc.edu" 4 "" input-pending-p mime-display-waiting-messages] 2 "\ Display cute messages until input arrives. Shamelessly stolen from VM, the Kitchen Sink(tm) of mail readers."]) (byte-code " M M‡" [mime-use-highlighting mime-running-lemacs mime-add-zone #[(start end style) " \n\" \" #)" [make-extent start end extent set-extent-face style set-extent-property mime-compose t] 4 "Add a Lucid Emacs extent from START to END with STYLE."] mime-running-epoch #[(start end style) " \n # \")" [add-zone start end style zone epoch::set-zone-data mime-compose] 4 "Add an Epoch zone from START to END with STYLE."]] 2) (fset 'mime-maybe-highlight-region #[(start end) " \n # b #ʕ ! ʕZ#))" [mime-running-epoch mime-running-lemacs mime-use-highlighting mime-add-zone start end mime-deemphasize-style re-search-forward "Content-Type: " t 0 s "[;\n]" 1 mime-emphasize-style] 4 "\ Maybe highlight a region of text. Region is from START to END."]) (fset 'mime-mimify-message #[nil "! =ƪebɊeb!`)#)!!) ceb!ycc αԊ!`)`Z\"!`ccc`Z\"*cdbcc ߱Ԋ!`)`Z\")eb!y !! αcԊ!`)`Z\"c) !*)t " [mime-compose-hook-was-run t run-hooks mime-compose-hook major-mode mh-letter-mode "\n\n\\|^-+$" mail-header-separator re-search-forward "^Mime-Version: " next-line -1 looking-at mime-virgin-message "\n" 0 "Mime-Version: 1.0\n" "Content-Description: A MIME message created by mime-compose.el.\n" "Content-Type: multipart/mixed; boundary=" mime-primary-boundary mime-maybe-highlight-region -3 1 nil end start "> THIS IS A MESSAGE IN 'MIME' FORMAT.\n" "> If you are reading this, your mail reader may not support MIME.\n" "> Some parts of this message will be readable as plain text.\n" mime-maybe-hide-region "--" "--\n" mime-use-selective-display 3 5 "Content-Type: text/plain\n" -2 backward-delete-char mime-display-waiting-messages] 5 "\ Add MIME headers to a message. Add an initial informational message for mail readers that don't process MIME messages automatically. Add an initial area for plaintext. Add a closing boundary at the end of the message. This function is safe to call more than once." nil]) (fset 'mime-open-text-bodypart #[nil " ` DZc`c \"* " [mime-mimify-message push-mark nil end start "--" mime-primary-boundary "\n" "Content-Type: text/plain" "\n\n" mime-maybe-highlight-region mime-display-waiting-messages] 3 "\ At current point, just open up a new plaintext bodypart." nil]) (fset 'mime-include-file #[(filename content-type binary &optional charset) " ı \n \n!αc\n \nıccӊ P!`)`Z\"c`!!\n!)`$!$`Z\"c ıcӊ P!`)`Z\"c!+" [mime-mimify-message push-mark "--" mime-primary-boundary "\n" "Content-Type: " content-type charset "; charset=" mime-name-included-files filename mime-audio-file "; name=\"" file-name-nondirectory "\"" "Content-Description: " binary "Content-Transfer-Encoding: base64\n" "Content-Transfer-Encoding: quoted-printable\n" mime-maybe-highlight-region re-search-backward 1 nil selective-display seldisp end start next-line -1 insert-file shell-command-on-region mime-encode-base64-command t mime-encode-qp-command mime-maybe-hide-region "Content-Type: text/plain\n" "\n\n"] 5 "\ Include a file named by FILENAME and with MIME content type CONTENT-TYPE. If third argument BINARY is T, then the file is binary; else it's text. Optional fourth arg CHARSET names character set for data. Data will be encoded in base64 or quoted-printable format as appropriate."]) (fset 'mime-include-binary-file #[(filename content-type) " \n#" [mime-include-file filename content-type t] 4 "\ Include a binary file named by FILENAME at point in a MIME message. CONTENT-TYPE names MIME content type of file. Data will be encoded in base64 format."]) (fset 'mime-include-nonbinary-file #[(filename content-type &optional charset) " \n $" [mime-include-file filename content-type nil charset] 5 "\ Include a nonbinary file named by FILENAME at point in a MIME message. CONTENT-TYPE names MIME content type of file; optional third arg CHARSET names MIME character set. Data will be encoded in quoted-printable format."]) (fset 'mime-include-external #[(site directory name content-type description access-type) " ıcȱ\nȱ ȱϱıcıԊ P!`)`Z\"cc ıcԊ P!`)`Z\"c" [mime-mimify-message push-mark "--" mime-primary-boundary "\n" "Content-Type: message/external-body;\n" " access-type=\"" access-type "\";\n" " site=\"" site " directory=\"" directory " name=\"" name "\"\n" "Content-Description: " description "Content-Type: " content-type mime-maybe-highlight-region re-search-backward 1 "Content-Type: text/plain\n"] 4 "\ Include an external pointer in a MIME message. Args are SITE, DIRECTORY, NAME, CONTENT-TYPE, DESCRIPTION, and ACCESS-TYPE; these are all strings."]) (fset 'mime-include-external-anonftp #[(site directory name description) "\nÉ%Ř \n  &) " [completing-read "Content type: " mime-valid-include-types nil content-type "" "application/octet-stream" mime-include-external site directory name description "anon-ftp" mime-display-waiting-messages] 8 "\ Include an external pointer (anonymous FTP) in a MIME message. Args are SITE, DIRECTORY, NAME, and DESCRIPTION; these are all strings, and if interactive, will be prompted for." "sFTP site: \nsRemote directory name: \nsRemote filename: \nsDescription: "]) (fset 'mime-include-external-ftp #[(site directory name description) "\nÉ%Ř \n  &) " [completing-read "Content type: " mime-valid-include-types nil content-type "" "application/octet-stream" mime-include-external site directory name description "ftp" mime-display-waiting-messages] 8 "\ Include an external pointer (regular FTP) in a MIME message. Args are SITE, DIRECTORY, NAME, and DESCRIPTION; these are all strings, and if interactive, will be prompted for." "sFTP site: \nsRemote directory name: \nsRemote filename: \nsDescription: "]) (fset 'mime-include-xwd-dump #[nil " ıc ıcɊ P!`)`Z\"c` !!!!&!!)` $ `Z\"c ıcɊ P!`)`Z\"c!+ " [mime-mimify-message push-mark "--" mime-primary-boundary "\n" "Content-Type: image/x-xwd\n" "Content-Description: Window dump from " system-name "Content-Transfer-Encoding: base64\n" mime-maybe-highlight-region re-search-backward 1 nil selective-display seldisp end start next-line -1 message "When crosshair cursor appears, click on window..." sit-for 0 call-process "/bin/sh" t "-c" mime-xwd-command "" shell-command-on-region mime-encode-base64-command mime-maybe-hide-region "Content-Type: text/plain\n" "\n\n" mime-display-waiting-messages] 7 "\ Run program named by 'mime-xwd-command' and include the results in a MIME message." nil]) (fset 'mime-sgi-grab-audio-snippet #[nil "ĉ  &\n!!!=!!o!!!&  & & *" [nil done-flag audio-process start-process "snippet" mime-sgi-record-program "-n" "1" "-s" "8" "-r" "8000" mime-audio-tmp-file y-or-n-p "Press y when done recording (n to abort): " interrupt-process process-status run message "Waiting..." sleep-for 1 "Done waiting." delete-process kill-buffer call-process "/bin/rm" "-f" mime-audio-file "/usr/sbin/sfconvert" "-o" "mulaw"] 11 "\ Grab an audio snippet into file named in 'mime-audio-file'. This routine works on SGI Indigo's and 4D/35's."]) (fset 'mime-sun-grab-audio-snippet #[nil "ĉ %!!!=!!o!!! *" [nil done-flag audio-process start-process "snippet" mime-sun-record-program "-m" mime-audio-file y-or-n-p "Press y when done recording (n to abort): " interrupt-process process-status run message "Waiting..." sleep-for 1 "Done waiting." delete-process kill-buffer] 6 "\ Grab an audio snippet into file named in 'mime-audio-file'. This is the Sun version. I don't know how well it works. It also requires a patched version of /usr/demo/SOUND/record.c; see the context diff at the end of mime-compose.el. Courtesy Christopher Davis ."]) (fset 'mime-include-audio-snippet #[nil "‰ =\"!  R!)) " [mime-using-silicon-graphics mime-sgi-grab-audio-snippet mime-sun-grab-audio-snippet mime-grab-audio-snippet t mime-include-binary-file mime-audio-file "audio/basic" next-line -4 mime-add-description user-full-name " " mime-babbling-description "." mime-display-waiting-messages] 6 "\ Record a snippet of audio in a MIME message. This should work on both Silicon Graphics and Sun platforms. Code contributions for other platforms are welcome." nil]) (fset 'mime-include-gif #[(filename) " \" " [mime-include-binary-file filename "image/gif" mime-display-waiting-messages] 3 "\ Include a GIF file named by FILENAME." "fGIF image filename: "]) (fset 'mime-include-jpeg #[(filename) " \" " [mime-include-binary-file filename "image/jpeg" mime-display-waiting-messages] 3 "\ Include a JPEG file named by FILENAME." "fJPEG image filename: "]) (fset 'mime-include-audio #[(filename &optional prefix-arg) "\n\"\n\" " [prefix-arg mime-include-binary-file filename "audio/x-aiff" "audio/basic" mime-display-waiting-messages] 3 "\ Include an audio file named by FILENAME. Note that to match the MIME specification for audio/basic, this should be an 8-bit mulaw file. With prefix arg, use AIFF format (unofficial MIME subtype audio/x-aiff) instead of audio/basic." "fAudio filename: \nP"]) (fset 'mime-include-mpeg #[(filename) " \" " [mime-include-binary-file filename "video/mpeg" mime-display-waiting-messages] 3 "\ Include a MPEG file named by FILENAME." "fMPEG animation filename: "]) (fset 'mime-include-postscript #[(filename) " \" " [mime-include-nonbinary-file filename "application/postscript" mime-display-waiting-messages] 3 "\ Include a PostScript file named by FILENAME." "fPostScript filename: "]) (fset 'mime-include-raw-binary #[(filename) "\nÉ%Ř \") " [completing-read "Content type (RET for default): " mime-valid-include-types nil content-type "" "application/octet-stream" mime-include-binary-file filename mime-display-waiting-messages] 7 "\ Include a raw binary file named by FILENAME." "fRaw binary filename: "]) (fset 'mime-include-raw-nonbinary #[(filename &optional prefix-arg) " ĉ% ĉ% ʘ ʘ  #* " [prefix-arg completing-read "Character set: " mime-valid-charsets nil mime-default-charset "Content type (RET for default): " mime-valid-include-types content-type charset "" "text/plain" "asdfasdfdfsdafs" mime-include-nonbinary-file filename mime-display-waiting-messages] 7 "\ Include a raw nonbinary file named by FILENAME. With prefix arg, prompt for character set." "fRaw nonbinary filename: \nP"]) (fset 'mime-encode-region #[(start end content-type charset) "b  $\n)` b ˱ ˱cъ P!`)`Z\"c)`c ˱cъ P!`)`Z\"c )" [end selective-display seldisp nil shell-command-on-region start mime-encode-qp-command t push-mark "--" mime-primary-boundary "\n" "Content-Type: " content-type "; charset=" charset "Content-Transfer-Encoding: quoted-printable\n" mime-maybe-highlight-region re-search-backward 1 "Content-Type: text/plain\n" mime-mimify-message] 5 "\ Encode a region specified by START and END. CONTENT-TYPE and CHARSET name the content type and character set of the data in the region."]) (fset 'mime-region-to-richtext #[(start end &optional prefix-arg) " ʼn%ǘ  \n$) " [prefix-arg mime-default-charset completing-read "Character set: " mime-valid-charsets nil charset "" mime-encode-region start end "text/richtext" mime-display-waiting-messages] 7 "\ Convert the current region to MIME richtext. MIME headers are added if necessary; a MIME boundary is added at the start of the region to indicate richtext; the conversion (see below) is done; a new boundary is added for more text. With prefix arg, prompt for character set; else use value of mime-default-charset. Currently no textual conversion is done, other than encoding in quoted-printable format. Instead, you use directives such as and in the text, as described in the MIME RFC. The alternative would be to parse tilde sequences as is done in the mailto program. Let me know if you think the latter would be more appropriate for mime-compose.el." "r\nP"]) (fset 'mime-region-to-charset #[(start end) "\nÉ%Ř $) " [completing-read "Character set: " mime-valid-charsets nil charset "" mime-default-charset mime-encode-region start end "text/plain" mime-display-waiting-messages] 7 "\ Convert the current region to plaintext in a non-default character set. You are prompted for a character set, and the text in the region is encoded in quoted-printable format and identified as being in that character set." "r"]) (byte-code "!\n  \n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#! \n###$#$#$#$#$#$#$#$#$#$#$#$#! $###242M" [mime-running-mh-e boundp mh-letter-mode-mime-map make-sparse-keymap define-key mh-letter-mode-map " " "m" mime-mimify-message "g" mime-include-gif "j" mime-include-jpeg "a" mime-include-audio "v" mime-include-mpeg "p" mime-include-postscript "r" mime-include-raw-binary "n" mime-include-raw-nonbinary "x" mime-include-xwd-dump "e" mime-include-external-anonftp "f" mime-include-external-ftp "s" mime-include-audio-snippet mime-region-map "" mime-region-to-richtext "i" mime-region-to-charset mail-mode-map "m" "g" "j" "a" "p" "r" "n" "x" "e" "f" "s" "v" "" mime-running-lemacs ("Mail Mode" "Sending Mail:" "----" ["Send and Exit" mail-send-and-exit t] ["Send Mail" mail-send t] ["Sent Via" mail-sent-via t] "----" "Go to Field:" "----" ["To:" mail-to t] ["Subject:" mail-subject t] ["CC:" mail-cc t] ["BCC:" mail-bcc t] ["Text" mail-text t] "----" "Miscellaneous Commands:" "----" ["Yank Original" mail-yank-original t] ["Fill Yanked Message" mail-fill-yanked-message t] ["Insert Signature" mail-signature t] "----" "MIME Inclusions:" "----" ["Include GIF File" mime-include-gif t] ["Include JPEG File" mime-include-jpeg t] ["Include MPEG File" mime-include-mpeg t] ["Include Audio File" mime-include-audio t] ["Include PostScript File" mime-include-postscript t] ["Include XWD Dump" mime-include-xwd-dump t] ["Include Audio Snippet" mime-include-audio-snippet t] ["Include Raw Binary File" mime-include-raw-binary t] ["Include Raw Nonbinary File" mime-include-raw-nonbinary t] ["Include External AnonFTP" mime-include-external-anonftp t] ["Include External FTP" mime-include-external-ftp t] "----" ["Abort" kill-buffer t]) mail-mode-menu mail-send #[nil "!! ! !" [message "Sending..." run-hooks mail-send-hook send-mail-function set-buffer-modified-p nil delete-auto-save-file-if-necessary "Sending...done"] 2 "Send the message in the current buffer.\nIf mail-interactive is non-nil, wait for success indication\nor error messages, and inform user.\nOtherwise any failure is reported in a message back to\nthe user from the mailer." nil]] 4) (fset 'mime-postpend-unique-hook #[(hook-var hook-function) " ! J<\n@= \n>? \n C\"L \n=? \n C\"L) CL" [boundp hook-var value lambda hook-function append] 5 "\ Postpend HOOK-VAR with HOOK-FUNCTION, if it is not already an element. hook-var's value may be a single function or a list of functions."]) (fset 'mime-unfrob-selective-display #[nil "!ed#" [mime-use-selective-display message "Unfrobbing selective-display..." mime-hide-region nil] 4 "\ Turn off selective display throughout this buffer."]) (fset 'mime-strip-useless-bodyparts #[nil "eb Rd# Pĉ#ebe)" [re-search-forward "^--" mime-primary-boundary "\nContent-Type: text.*[\n]*--" t replace-match "--"] 5 "\ Strip useless (empty) bodyparts out of a message."]) (fset 'mime-encode-region-qp #[(start end) "b  $\n)" [end selective-display seldisp nil shell-command-on-region start mime-encode-qp-command t] 5 "\ Encode a region specified by START and END in quoted-printable format. Return the new endpoint. Do not use save-excursion."]) (fset 'mime-encode-plaintext #[nil "eb Qd#Ŕŕ P!ŔZ)  # \") b!`ұc`\"++))" [re-search-forward "^--" mime-primary-boundary "\nContent-Type: text/plain\n" t 0 head start 1 end "^Content-Transfer-Encoding: " mime-encode-region-qp new-end next-line nil s "; charset=" mime-default-charset "\n" "Content-Transfer-Encoding: quoted-printable" mime-maybe-highlight-region] 4 "\ Encode all plaintext bodyparts in the message in quoted-printable and set the charset to mime-default-charset."]) (fset 'mime-send-hook-function #[nil " \n " [mime-unfrob-selective-display mime-strip-useless-bodyparts mime-encode-plaintext-on-send mime-encode-plaintext] 1 "\ Function to be called from mail-send-hook. Unfrob selective display if active, strip out empty (useless) bodyparts, and optionally encode plaintext bodyparts in quoted-printable with a given charset."]) (byte-code "\"\"M\"\"" [mime-running-mh-e mime-postpend-unique-hook mh-before-send-letter-hook mime-send-hook-function mail-send-hook mime-setup-hook-function #[nil "" [mime-use-selective-display t selective-display] 2] mh-letter-mode-hook mail-mode-hook] 3)