*** dist/qp-encode.c.dist Thu Jun 29 11:24:06 2000 --- qp-encode.c Sun Mar 5 12:59:04 2000 *************** *** 0 **** --- 1,82 ---- + /* public domain */ + + /* + * arbitrary data on stdin -> Quoted-Printable data on stdout + * + * UNIX's newline convention is used, i.e. one ASCII control-j (10 decimal). + */ + + #include + + #ifdef _WIN32 + #ifndef WIN32 + #define WIN32 + #endif + #endif + + #ifdef WIN32 + #include + #include + #endif + + char *hexdigits = "0123456789ABCDEF"; + + int + main() + { + int c; + int cols = 0; + + #ifdef WIN32 + _setmode( _fileno(stdout), _O_BINARY); + #endif + + while ((c = getchar()) != EOF) { + if (c == '\n') { + putchar(c); + cols = 0; + } else if (c == ' ') { + int nextc = getchar(); + if (nextc != '\n' && nextc != EOF) { + putchar(c); + cols++; + } else { + putchar('='); + putchar(hexdigits[c >> 4]); + putchar(hexdigits[c & 0xf]); + cols += 3; + } + if (nextc != EOF) + ungetc(nextc, stdin); + } else if (c < 33 || c > 126 || c == '=' || + /* these are for RFC 2047 Q encoding */ + c == '?' || c == '_') { + putchar('='); + putchar(hexdigits[c >> 4]); + putchar(hexdigits[c & 0xf]); + cols += 3; + } else if (c == '.' && cols == 0) { + int nextc = getchar(); + if (nextc == EOF || nextc == '\n') { + putchar('='); + putchar(hexdigits[c >> 4]); + putchar(hexdigits[c & 0xf]); + cols += 3; + } else { + putchar(c); + cols++; + } + if (nextc != EOF) + ungetc(nextc, stdin); + } else { + putchar(c); + cols++; + } + if (cols > 70) { + putchar('='); + putchar('\n'); + cols = 0; + } + } + exit(0); + } *** dist/qp-decode.c.dist Thu Jun 29 11:24:06 2000 --- qp-decode.c Sun Mar 5 12:59:04 2000 *************** *** 0 **** --- 1,98 ---- + /* public domain */ + + /* Quoted Printable on stdin -> converted data on stdout */ + + #include + #include + + #ifdef _WIN32 + #ifndef WIN32 + #define WIN32 + #endif + #endif + + #ifdef WIN32 + #include + #include + #endif + + char *hexdigits = "0123456789ABCDEF"; + char *hexdigits2 = "0123456789abcdef"; + + int + main() + { + char line[2000], *start, *stop, *copy; + char *d1, *d2, c; + int lineno; + + #ifdef WIN32 + _setmode( _fileno(stdout), _O_BINARY); + #endif + + line[sizeof line - 1] = 0; + lineno = 1; + while (fgets(line, sizeof line - 1, stdin)) { + lineno++; + start = line; + keep_processing: + for (stop = start; *stop && *stop != '=' && *stop != '\n'; stop++) + ; + if (stop != line && *stop == '\n') { + copy = stop; + do { + copy--; + if (*copy != ' ' && *copy != '\t') { + copy++; + break; + } + } while (copy != line); + } else { + copy = stop; + } + while (start != copy) { + putchar(*start); + start++; + } + if (*stop == '\n') { + putchar(*stop); + lineno++; + continue; + } else if (*stop == 0) { + continue; + } else { /* *stop == '=' */ + stop++; + if ((d1 = strchr(hexdigits, *(stop))) && + (d2 = strchr(hexdigits, *(stop+1)))) { + c = (d1 - hexdigits) * 16 + (d2 - hexdigits); + putchar(c); + stop += 2; + } else if ((d1 = strchr(hexdigits2, *(stop))) && + (d2 = strchr(hexdigits2, *(stop+1)))) { + c = (d1 - hexdigits2) * 16 + (d2 - hexdigits2); + putchar(c); + stop += 2; + } else if (*stop == '\n') { + /* soft line break */ + stop++; + } else if (*stop == '\r') { + /* + * Assume the user's lousy delivery software + * didn't convert from Internet's CRLF newline + * convention to the local LF convention. + */ + stop++; + } else if (*stop == ' ' || *stop == '\t') { + /* garbage added in transit */ + for (stop++; *stop && (*stop == ' ' || *stop == '\t'); stop++) + ; + } else { + fprintf(stderr, "line %d: something other than line break or hex digits after = in quoted-printable encoding\n", lineno); + exit(1); + } + start = stop; + goto keep_processing; + } + } + exit(0); + } *** dist/base64-encode.c.dist Thu Jun 29 11:24:06 2000 --- base64-encode.c Sun Mar 5 12:59:04 2000 *************** *** 0 **** --- 1,75 ---- + /* public domain */ + + /* + * arbitrary data on stdin -> BASE64 data on stdout + * + * UNIX's newline convention is used, i.e. one ASCII control-j (10 decimal). + */ + + #include + + #ifdef _WIN32 + #ifndef WIN32 + #define WIN32 + #endif + #endif + + #ifdef WIN32 + #include + #include + #endif + + unsigned char alphabet[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + + int + main() + { + int cols, bits, c, char_count; + + #ifdef WIN32 + _setmode( _fileno(stdin), _O_BINARY); + #endif + + char_count = 0; + bits = 0; + cols = 0; + while ((c = getchar()) != EOF) { + if (c > 255) { + fprintf(stderr, "encountered char > 255 (decimal %d)", c); + exit(1); + } + bits += c; + char_count++; + if (char_count == 3) { + putchar(alphabet[bits >> 18]); + putchar(alphabet[(bits >> 12) & 0x3f]); + putchar(alphabet[(bits >> 6) & 0x3f]); + putchar(alphabet[bits & 0x3f]); + cols += 4; + if (cols == 72) { + putchar('\n'); + cols = 0; + } + bits = 0; + char_count = 0; + } else { + bits <<= 8; + } + } + if (char_count != 0) { + bits <<= 16 - (8 * char_count); + putchar(alphabet[bits >> 18]); + putchar(alphabet[(bits >> 12) & 0x3f]); + if (char_count == 1) { + putchar('='); + putchar('='); + } else { + putchar(alphabet[(bits >> 6) & 0x3f]); + putchar('='); + } + if (cols > 0) + putchar('\n'); + } + + exit(0); + } *** dist/base64-decode.c.dist Thu Jun 29 11:24:43 2000 --- base64-decode.c Sun Mar 5 12:59:04 2000 *************** *** 0 **** --- 1,76 ---- + /* public domain */ + + /* BASE64 on stdin -> converted data on stdout */ + + #include + + #ifdef _WIN32 + #ifndef WIN32 + #define WIN32 + #endif + #endif + + #ifdef WIN32 + #include + #include + #endif + + unsigned char alphabet[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + + int + main() + { + static char inalphabet[256], decoder[256]; + int i, bits, c, char_count, errors = 0; + + #ifdef WIN32 + _setmode( _fileno(stdout), _O_BINARY); + #endif + + for (i = (sizeof alphabet) - 1; i >= 0 ; i--) { + inalphabet[alphabet[i]] = 1; + decoder[alphabet[i]] = i; + } + + char_count = 0; + bits = 0; + while ((c = getchar()) != EOF) { + if (c == '=') + break; + if (c > 255 || ! inalphabet[c]) + continue; + bits += decoder[c]; + char_count++; + if (char_count == 4) { + putchar((bits >> 16)); + putchar(((bits >> 8) & 0xff)); + putchar((bits & 0xff)); + bits = 0; + char_count = 0; + } else { + bits <<= 6; + } + } + if (c == EOF) { + if (char_count) { + fprintf(stderr, "base64 encoding incomplete: at least %d bits truncated", + ((4 - char_count) * 6)); + errors++; + } + } else { /* c == '=' */ + switch (char_count) { + case 1: + fprintf(stderr, "base64 encoding incomplete: at least 2 bits missing"); + errors++; + break; + case 2: + putchar((bits >> 10)); + break; + case 3: + putchar((bits >> 16)); + putchar(((bits >> 8) & 0xff)); + break; + } + } + exit(errors ? 1 : 0); + } *** dist/vm-edit.el.dist Fri Feb 5 01:41:58 1999 --- vm-edit.el Thu Feb 24 11:08:48 2000 *************** *** 141,142 **** --- 141,143 ---- (setq m (vm-real-message-of (car mlist))) + (vm-garbage-collect-message) (if vm-thread-obarray *** dist/vm-folder.el.dist Fri May 21 01:07:41 1999 --- vm-folder.el Sun Mar 26 02:28:13 2000 *************** *** 521,523 **** (condition-case nil ! (let ((coding-system-for-read 'binary)) (insert-file-contents file nil 0 4096)) --- 521,524 ---- (condition-case nil ! (let ((coding-system-for-read ! (vm-binary-coding-system))) (insert-file-contents file nil 0 4096)) *************** *** 1051,1053 **** (vm-headers-of message) ! (1- (vm-text-of message))))) (setq work-buffer (generate-new-buffer "*vm-work*")) --- 1052,1059 ---- (vm-headers-of message) ! (1- (vm-text-of message))) ! ;; Yep, messages can come in ! ;; without the two newlines after ! ;; the header section. ! (if (not (eq (char-after (1- (point))) ?\n)) ! (insert ?\n)))) (setq work-buffer (generate-new-buffer "*vm-work*")) *************** *** 1415,1416 **** --- 1421,1423 ---- (let ((case-fold-search t) + (time nil) time lim oldpoint) *************** *** 2448,2450 **** time2 (vm-gobble-last-modified)) ! (if (> 0 (vm-time-difference time time2)) (throw 'done nil)) --- 2455,2457 ---- time2 (vm-gobble-last-modified)) ! (if (and time2 (> 0 (vm-time-difference time time2))) (throw 'done nil)) *************** *** 2462,2464 **** (widen) ! (let ((step (/ (point-max) 11)) (pos (1- (point-max))) --- 2469,2471 ---- (widen) ! (let ((step (max 1 (/ (point-max) 11))) (pos (1- (point-max))) *************** *** 2622,2624 **** (condition-case data ! (let ((coding-system-for-write 'binary) (selective-display nil)) --- 2629,2631 ---- (condition-case data ! (let ((coding-system-for-write (vm-binary-coding-system)) (selective-display nil)) *************** *** 3221,3224 **** (setq status ! (call-process vm-movemail-program nil error-buffer t ! source destination)) (save-excursion --- 3228,3234 ---- (setq status ! (apply 'call-process ! (nconc ! (list vm-movemail-program nil error-buffer t) ! (copy-sequence vm-movemail-program-switches) ! (list source destination)))) (save-excursion *************** *** 3257,3259 **** (enable-local-variables nil) ! (coding-system-for-read 'no-conversion)) (find-file-noselect crash-box))) --- 3267,3269 ---- (enable-local-variables nil) ! (coding-system-for-read (vm-line-ending-coding-system))) (find-file-noselect crash-box))) *************** *** 3311,3313 **** nil ! (let ((coding-system-for-write 'binary) (selective-display nil)) --- 3321,3323 ---- nil ! (let ((coding-system-for-write (vm-binary-coding-system)) (selective-display nil)) *************** *** 3614,3616 **** (setq folder (read-file-name "Gather mail from folder: " ! vm-folder-directory t)) (if (and vm-check-folder-types --- 3624,3626 ---- (setq folder (read-file-name "Gather mail from folder: " ! vm-folder-directory nil t)) (if (and vm-check-folder-types *************** *** 3623,3625 **** (goto-char (point-max)) ! (let ((coding-system-for-read 'binary)) (insert-file-contents folder)))) --- 3633,3635 ---- (goto-char (point-max)) ! (let ((coding-system-for-read (vm-binary-coding-system))) (insert-file-contents folder)))) *************** *** 3839,3840 **** --- 3849,3851 ---- ;; mail again. + (make-local-hook 'after-save-hook) (add-hook 'after-save-hook 'vm-unblock-new-mail) *** dist/vm-imap.el.dist Fri May 21 01:07:41 1999 --- vm-imap.el Thu Dec 30 16:55:09 1999 *************** *** 369,372 **** (imapdrop (vm-safe-imapdrop-string source)) ! (coding-system-for-read 'binary) ! (coding-system-for-write 'binary) greeting timestamp --- 369,372 ---- (imapdrop (vm-safe-imapdrop-string source)) ! (coding-system-for-read (vm-binary-coding-system)) ! (coding-system-for-write (vm-binary-coding-system)) greeting timestamp *************** *** 432,434 **** (if (or vm-xemacs-mule-p vm-fsfemacs-mule-p) ! (set-buffer-file-coding-system 'binary t)) (if (equal auth "preauth") --- 432,434 ---- (if (or vm-xemacs-mule-p vm-fsfemacs-mule-p) ! (set-buffer-file-coding-system (vm-binary-coding-system) t)) (if (equal auth "preauth") *************** *** 478,482 **** (if process-to-shutdown ! (vm-imap-end-session process-to-shutdown))))) ! (defun vm-imap-end-session (process) (save-excursion --- 478,482 ---- (if process-to-shutdown ! (vm-imap-end-session process-to-shutdown t))))) ! (defun vm-imap-end-session (process &optional keep-buffer) (save-excursion *************** *** 486,489 **** ;;(vm-imap-read-ok-response process) ! (if (not vm-imap-keep-trace-buffer) ! (kill-buffer (process-buffer process))) (if (fboundp 'add-async-timeout) --- 486,494 ---- ;;(vm-imap-read-ok-response process) ! (if (not keep-buffer) ! (kill-buffer (process-buffer process)) ! (save-excursions ! (set-buffer (process-buffer process)) ! (rename-buffer (concat "saved " (buffer-name)) t) ! (vm-keep-some-buffers (current-buffer) 'vm-kept-imap-buffers ! vm-imap-keep-failed-trace-buffers))) (if (fboundp 'add-async-timeout) *** dist/vm-macro.el.dist Thu Feb 25 23:30:52 1999 --- vm-macro.el Thu Dec 30 16:06:05 1999 *************** *** 108 **** --- 108,116 ---- body)) + + (defsubst vm-binary-coding-system () + (cond (vm-xemacs-mule-p 'binary) + (t 'no-conversion))) + + (defsubst vm-line-ending-coding-system () + (cond (vm-xemacs-mule-p 'no-conversion) + (t 'raw-text))) *** dist/vm-menu.el.dist Fri May 21 01:07:42 1999 --- vm-menu.el Wed Sep 15 16:19:38 1999 *************** *** 393,395 **** 'vm-mime-pipe-body-to-queried-command-discard-output) t] ! ["Delete object" 'vm-delete-mime-object t])))) --- 393,395 ---- 'vm-mime-pipe-body-to-queried-command-discard-output) t] ! ["Delete object" vm-delete-mime-object t])))) *** dist/vm-mime.el.dist Fri Aug 27 16:50:52 1999 --- vm-mime.el Thu Aug 31 11:12:13 2000 *************** *** 84,88 **** (goto-char (vm-headers-of m)) ! (or (re-search-forward vm-mime-encoded-word-regexp ! (vm-text-of m) t) ! 'none))))) (vm-mime-encoded-header-flag-of m)))) --- 84,89 ---- (goto-char (vm-headers-of m)) ! (let ((case-fold-search t)) ! (or (re-search-forward vm-mime-encoded-word-regexp ! (vm-text-of m) t) ! 'none)))))) (vm-mime-encoded-header-flag-of m)))) *************** *** 194,197 **** ;; use binary coding system in FSF Emacs/MULE ! (coding-system-for-read 'binary) ! (coding-system-for-write 'binary) (status (apply 'vm-run-command-on-region --- 195,198 ---- ;; use binary coding system in FSF Emacs/MULE ! (coding-system-for-read (vm-binary-coding-system)) ! (coding-system-for-write (vm-binary-coding-system)) (status (apply 'vm-run-command-on-region *************** *** 353,356 **** ;; use binary coding system in FSF Emacs/MULE ! (coding-system-for-read 'binary) ! (coding-system-for-write 'binary) (status (apply 'vm-run-command-on-region --- 354,357 ---- ;; use binary coding system in FSF Emacs/MULE ! (coding-system-for-read (vm-binary-coding-system)) ! (coding-system-for-write (vm-binary-coding-system)) (status (apply 'vm-run-command-on-region *************** *** 434,437 **** ;; use binary coding system in FSF Emacs/MULE ! (coding-system-for-read 'binary) ! (coding-system-for-write 'binary) (status (apply 'vm-run-command-on-region --- 435,438 ---- ;; use binary coding system in FSF Emacs/MULE ! (coding-system-for-read (vm-binary-coding-system)) ! (coding-system-for-write (vm-binary-coding-system)) (status (apply 'vm-run-command-on-region *************** *** 540,544 **** ;; use binary coding system in FSF Emacs/MULE ! (coding-system-for-read 'binary) ! (coding-system-for-write 'binary) ! (process-coding-system-alist '(("." . binary))) (status (apply 'vm-run-command-on-region --- 541,546 ---- ;; use binary coding system in FSF Emacs/MULE ! (coding-system-for-read (vm-binary-coding-system)) ! (coding-system-for-write (vm-binary-coding-system)) ! (process-coding-system-alist ! (list (cons "." (vm-binary-coding-system)))) (status (apply 'vm-run-command-on-region *************** *** 971,974 **** (modified (buffer-modified-p)) ! (coding-system-for-read 'binary) ! (coding-system-for-write 'binary)) (cond ((or (null vm-presentation-buffer-handle) --- 973,976 ---- (modified (buffer-modified-p)) ! (coding-system-for-read (vm-binary-coding-system)) ! (coding-system-for-write (vm-binary-coding-system))) (cond ((or (null vm-presentation-buffer-handle) *************** *** 1002,1004 **** (if (or vm-xemacs-mule-p vm-fsfemacs-mule-p) ! (set-buffer-file-coding-system 'binary t)) (cond ((and vm-fsfemacs-p (not vm-fsfemacs-mule-p)) --- 1004,1006 ---- (if (or vm-xemacs-mule-p vm-fsfemacs-mule-p) ! (set-buffer-file-coding-system (vm-binary-coding-system) t)) (cond ((and vm-fsfemacs-p (not vm-fsfemacs-mule-p)) *************** *** 1169,1171 **** ((vm-mime-types-match "text/html" type) ! (fboundp 'w3-region)) ((vm-mime-types-match "text" type) --- 1171,1176 ---- ((vm-mime-types-match "text/html" type) ! (and (fboundp 'w3-region) ! ;; this because GNUS bogusly sets up autoloads ! ;; for w3-region ewven if W3 isn't installed. ! (fboundp 'w3-about))) ((vm-mime-types-match "text" type) *************** *** 1331,1333 **** is called as a function with no arguments, and none of the ! actions mentioned in the preceding paragraphs are done. At the time of the call, the current buffer will be the presentation --- 1336,1338 ---- is called as a function with no arguments, and none of the ! actions mentioned in the preceding paragraphs are taken. At the time of the call, the current buffer will be the presentation *************** *** 1587,1590 **** start ! (coding-system-for-read 'binary) ! (coding-system-for-write 'binary) (append-file t) --- 1592,1595 ---- start ! (coding-system-for-read (vm-binary-coding-system)) ! (coding-system-for-write (vm-binary-coding-system)) (append-file t) *************** *** 1615,1618 **** (if (vm-mime-text-type-layout-p layout) ! (set-buffer-file-coding-system 'no-conversion nil) ! (set-buffer-file-coding-system 'binary t))) ;; Write an empty tempfile out to disk and set its --- 1620,1625 ---- (if (vm-mime-text-type-layout-p layout) ! (set-buffer-file-coding-system ! (vm-line-ending-coding-system) nil) ! (set-buffer-file-coding-system ! (vm-binary-coding-system) t))) ;; Write an empty tempfile out to disk and set its *************** *** 2044,2045 **** --- 2051,2055 ---- (message "") + ;; XEmacs 21.2 can pixel scroll images if the entire + ;; image is above the baseline. + (set-glyph-baseline g 100) (vm-set-mm-layout-cache *************** *** 2292,2295 **** (unwind-protect ! (let ((coding-system-for-read 'binary) ! (coding-system-for-write 'binary)) (let ((default-enable-multibyte-characters nil)) --- 2302,2305 ---- (unwind-protect ! (let ((coding-system-for-read (vm-binary-coding-system)) ! (coding-system-for-write (vm-binary-coding-system))) (let ((default-enable-multibyte-characters nil)) *************** *** 2305,2308 **** (if (vm-mime-text-type-layout-p layout) ! (set-buffer-file-coding-system 'no-conversion nil) ! (set-buffer-file-coding-system 'binary t))) (vm-with-unibyte-buffer --- 2315,2319 ---- (if (vm-mime-text-type-layout-p layout) ! (set-buffer-file-coding-system ! (vm-line-ending-coding-system) nil) ! (set-buffer-file-coding-system (vm-binary-coding-system) t))) (vm-with-unibyte-buffer *************** *** 2354,2356 **** nil ! '(("." . binary)))) ;; Tell DOS/Windows NT whether the input is binary --- 2365,2367 ---- nil ! (list (cons "." (vm-binary-coding-system))))) ;; Tell DOS/Windows NT whether the input is binary *************** *** 2788,2790 **** (set-buffer ! (let ((coding-system-for-read 'binary)) (find-file-noselect file))) --- 2799,2801 ---- (set-buffer ! (let ((coding-system-for-read (vm-binary-coding-system))) (find-file-noselect file))) *************** *** 3347,3350 **** (extent-property e 'vm-mime-type)) ! 'no-conversion ! 'binary)) ;; no transformations! --- 3358,3361 ---- (extent-property e 'vm-mime-type)) ! (vm-line-ending-coding-system) ! (vm-binary-coding-system))) ;; no transformations! *************** *** 3356,3358 **** ;; value we bind to it to here isn't important. ! (buffer-file-coding-system 'binary)) (insert-file-contents object)))) --- 3367,3369 ---- ;; value we bind to it to here isn't important. ! (buffer-file-coding-system (vm-binary-coding-system))) (insert-file-contents object)))) *************** *** 3706,3709 **** (overlay-get o 'vm-mime-type)) ! 'no-conversion ! 'binary)) ;; no transformations! --- 3717,3720 ---- (overlay-get o 'vm-mime-type)) ! (vm-line-ending-coding-system) ! (vm-binary-coding-system))) ;; no transformations! *************** *** 3716,3718 **** ;; important. ! (buffer-file-coding-system 'binary) ;; For NTEmacs 19: need to do this to make --- 3727,3729 ---- ;; important. ! (buffer-file-coding-system (vm-binary-coding-system)) ;; For NTEmacs 19: need to do this to make *** dist/vm-misc.el.dist Fri May 21 01:07:43 1999 --- vm-misc.el Thu Dec 30 16:55:10 1999 *************** *** 184,187 **** (let ((temp-buffer nil) ! (coding-system-for-read 'no-conversion) ! (coding-system-for-write 'no-conversion)) (unwind-protect --- 184,187 ---- (let ((temp-buffer nil) ! (coding-system-for-read (vm-line-ending-coding-system)) ! (coding-system-for-write (vm-line-ending-coding-system))) (unwind-protect *************** *** 197,199 **** (if (or vm-xemacs-mule-p vm-fsfemacs-mule-p) ! (set-buffer-file-coding-system 'no-conversion nil)) (write-region (point-min) (point-max) where t 'quiet)) --- 197,200 ---- (if (or vm-xemacs-mule-p vm-fsfemacs-mule-p) ! (set-buffer-file-coding-system ! (vm-line-ending-coding-system) nil)) (write-region (point-min) (point-max) where t 'quiet)) *************** *** 722 **** --- 723,742 ---- hostname))) + + (defun vm-keep-some-buffers (buffer ring-variable number-to-keep) + (if (memq buffer (symbol-value ring-variable)) + (set ring-variable (delq buffer (symbol-value ring-variable)))) + (set ring-variable (cons buffer (symbol-value ring-variable))) + (set ring-variable (vm-delete 'buffer-name + (symbol-value ring-variable) t)) + (if (not (eq number-to-keep t)) + (let ((extras (nthcdr (or number-to-keep 0) + (symbol-value ring-variable)))) + (mapcar (function + (lambda (b) + (and (buffer-name b) + (not (buffer-modified-p b)) + (kill-buffer b)))) + extras) + (and (symbol-value ring-variable) extras + (setcdr (memq (car extras) (symbol-value ring-variable)) + nil))))) *** dist/vm-mouse.el.dist Thu Mar 18 18:42:13 1999 --- vm-mouse.el Thu Dec 30 16:55:08 1999 *************** *** 217,220 **** (work-buffer " *mosaic work*") ! (coding-system-for-read 'no-conversion) ! (coding-system-for-write 'no-conversion) pid) --- 217,220 ---- (work-buffer " *mosaic work*") ! (coding-system-for-read (vm-line-ending-coding-system)) ! (coding-system-for-write (vm-line-ending-coding-system)) pid) *************** *** 233,235 **** (if (or vm-xemacs-mule-p vm-fsfemacs-mule-p) ! (set-buffer-file-coding-system 'no-conversion nil)) (write-region (point-min) (point-max) --- 233,236 ---- (if (or vm-xemacs-mule-p vm-fsfemacs-mule-p) ! (set-buffer-file-coding-system ! (vm-line-ending-coding-system) nil)) (write-region (point-min) (point-max) *************** *** 274,277 **** ;; use binary coding system in FSF Emacs/MULE ! (coding-system-for-read 'binary) ! (coding-system-for-write 'binary) ;; for DOS/Windows command to tell it that its input is --- 275,278 ---- ;; use binary coding system in FSF Emacs/MULE ! (coding-system-for-read (vm-binary-coding-system)) ! (coding-system-for-write (vm-binary-coding-system)) ;; for DOS/Windows command to tell it that its input is *** dist/vm-pop.el.dist Fri Aug 27 16:50:54 1999 --- vm-pop.el Thu Dec 30 16:55:08 1999 *************** *** 331,334 **** (popdrop (vm-safe-popdrop-string source)) ! (coding-system-for-read 'binary) ! (coding-system-for-write 'binary) greeting timestamp --- 331,334 ---- (popdrop (vm-safe-popdrop-string source)) ! (coding-system-for-read (vm-binary-coding-system)) ! (coding-system-for-write (vm-binary-coding-system)) greeting timestamp *************** *** 392,394 **** (if (or vm-xemacs-mule-p vm-fsfemacs-mule-p) ! (set-buffer-file-coding-system 'binary t)) (insert "starting POP session " (current-time-string) "\n") --- 392,394 ---- (if (or vm-xemacs-mule-p vm-fsfemacs-mule-p) ! (set-buffer-file-coding-system (vm-binary-coding-system) t)) (insert "starting POP session " (current-time-string) "\n") *************** *** 434,435 **** --- 434,437 ---- (insert-before-markers "<<< ooops, no timestamp found in greeting! >>>\n") + (message "Server of %s does not support APOP" popdrop) + (sleep-for 2) (throw 'done nil))) *************** *** 446,450 **** (if process-to-shutdown ! (vm-pop-end-session process-to-shutdown))))) ! (defun vm-pop-end-session (process) (save-excursion --- 448,452 ---- (if process-to-shutdown ! (vm-pop-end-session process-to-shutdown t))))) ! (defun vm-pop-end-session (process &optional keep-buffer) (save-excursion *************** *** 454,456 **** ;;(vm-pop-read-response process) ! (kill-buffer (process-buffer process)) (if (fboundp 'add-async-timeout) --- 456,464 ---- ;;(vm-pop-read-response process) ! (if (not keep-buffer) ! (kill-buffer (process-buffer process)) ! (save-excursions ! (set-buffer (process-buffer process)) ! (rename-buffer (concat "saved " (buffer-name)) t) ! (vm-keep-some-buffers (current-buffer) 'vm-kept-pop-buffers ! vm-pop-keep-failed-trace-buffers))) (if (fboundp 'add-async-timeout) *** dist/vm-reply.el.dist Fri Aug 27 16:50:54 1999 --- vm-reply.el Mon Jul 10 14:07:56 2000 *************** *** 370,389 **** (defun vm-keep-mail-buffer (buffer) ! ;; keep this buffer if the user demands it ! (if (memq buffer vm-kept-mail-buffers) ! (setq vm-kept-mail-buffers ! (delq buffer vm-kept-mail-buffers))) ! (setq vm-kept-mail-buffers (cons buffer vm-kept-mail-buffers) ! vm-kept-mail-buffers (vm-delete 'buffer-name ! vm-kept-mail-buffers t)) ! (if (not (eq vm-keep-sent-messages t)) ! (let ((extras (nthcdr (or vm-keep-sent-messages 0) ! vm-kept-mail-buffers))) ! (mapcar (function ! (lambda (b) ! (and (buffer-name b) ! (not (buffer-modified-p b)) ! (kill-buffer b)))) ! extras) ! (and vm-kept-mail-buffers extras ! (setcdr (memq (car extras) vm-kept-mail-buffers) nil))))) --- 370,372 ---- (defun vm-keep-mail-buffer (buffer) ! (vm-keep-some-buffers buffer 'vm-kept-mail-buffers vm-keep-sent-messages)) *************** *** 460,462 **** (abs min)) ! (format-time-string " (%Z)" time) "\n")))))) --- 443,447 ---- (abs min)) ! ;; localization in Europe and elsewhere can cause %Z to return ! ;; 8-bit chars, which are forbidden in headers. ! ;; (format-time-string " (%Z)" time) "\n")))))) *************** *** 1391,1393 **** (or (vm-mail-mode-get-header-contents "Message-ID") ! (insert "Message-ID: \n")) (or (vm-mail-mode-get-header-contents "Date") --- 1376,1379 ---- (or (vm-mail-mode-get-header-contents "Message-ID") ! (insert (format "Message-ID: \n" ! (random 1000000) (random 1000000)))) (or (vm-mail-mode-get-header-contents "Date") *************** *** 1443,1444 **** --- 1429,1431 ---- to subject))) + (goto-char (point-min)) (re-search-forward (concat "^" mail-header-separator "$")) *** dist/vm-save.el.dist Fri Feb 5 01:42:01 1999 --- vm-save.el Tue Mar 14 10:59:54 2000 *************** *** 23,31 **** (defun vm-match-data () ! (let ((index '(9 8 7 6 5 4 3 2 1 0)) ! (list)) ! (while index ! (setq list (cons (match-beginning (car index)) ! (cons (match-end (car index)) list)) ! index (cdr index))) ! list )) --- 23,31 ---- (defun vm-match-data () ! (let ((n (1- (/ (length (match-data)) 2))) ! (list nil)) ! (while (>= n 0) ! (setq list (cons (match-beginning n) ! (cons (match-end n) list)) ! n (1- n))) ! list)) *************** *** 477,480 **** (list (car vm-message-pointer))))) ! (set-buffer buffer) ! (erase-buffer) (while mlist --- 477,481 ---- (list (car vm-message-pointer))))) ! (save-excursion ! (set-buffer buffer) ! (erase-buffer)) (while mlist *************** *** 503,510 **** (setq mlist (cdr mlist))) ! (set-buffer buffer) ! (if (not (zerop (buffer-size))) ! (vm-display buffer t '(vm-pipe-message-to-command) ! '(vm-pipe-message-to-command)) ! (vm-display nil nil '(vm-pipe-message-to-command) ! '(vm-pipe-message-to-command))))) --- 504,509 ---- (setq mlist (cdr mlist))) ! (vm-display nil nil '(vm-pipe-message-to-command) ! '(vm-pipe-message-to-command)) ! (if (not (zerop (save-excursion (set-buffer buffer) (buffer-size)))) ! (display-buffer buffer)))) *************** *** 542,545 **** (mlist (vm-select-marked-or-prefixed-messages count))) ! (set-buffer buffer) ! (erase-buffer) (while mlist --- 541,545 ---- (mlist (vm-select-marked-or-prefixed-messages count))) ! (save-excursion ! (set-buffer buffer) ! (erase-buffer)) (while mlist *************** *** 596,602 **** (setq mlist (cdr mlist))) ! (set-buffer buffer) ! (if (not (zerop (buffer-size))) ! (vm-display buffer t '(vm-pipe-message-to-command) ! '(vm-pipe-message-to-command)) ! (vm-display nil nil '(vm-pipe-message-to-command) ! '(vm-pipe-message-to-command))))) --- 596,599 ---- (setq mlist (cdr mlist))) ! (vm-display nil nil '(vm-print-message) '(vm-print-message)) ! (if (not (zerop (save-excursion (set-buffer buffer) (buffer-size)))) ! (display-buffer buffer)))) *** dist/vm-sort.el.dist Tue Jul 27 10:52:40 1999 --- vm-sort.el Fri May 19 12:57:20 2000 *************** *** 340,341 **** --- 340,349 ---- (setq key-list (cdr key-list))) + ;; if this is not a thread sort and threading is enabled, + ;; then disable threading and make sure the whole summary is + ;; regenerated (to recalculate %I everywhere). + (if (and vm-summary-show-threads + (not (equal key-funcs '(vm-sort-compare-thread))) + (progn + (setq vm-summary-show-threads nil) + (vm-set-summary-redo-start-point t)))) (message "Sorting...") *** dist/vm-startup.el.dist Fri Aug 27 16:50:55 1999 --- vm-startup.el Tue Sep 5 12:06:05 2000 *************** *** 71,73 **** ;; for XEmacs/Mule ! (coding-system-for-read 'no-conversion)) (message "Reading %s..." file) --- 71,74 ---- ;; for XEmacs/Mule ! (coding-system-for-read ! (vm-line-ending-coding-system))) (message "Reading %s..." file) *************** *** 83,91 **** (set-buffer-multibyte nil)) ! ;; for XEmacs/MULE ;; ;; If the file coding system is not a no-conversion variant, ! ;; make it so by encoding all the text, then setting ! ;; the file coding system and decoding it. ! ;; This is only possible if a file is visited and then vm-mode ! ;; is run on it afterwards. (defvar buffer-file-coding-system) --- 84,95 ---- (set-buffer-multibyte nil)) ! ;; for MULE ;; ;; If the file coding system is not a no-conversion variant, ! ;; make it so by encoding all the text, then setting the ! ;; file coding system and decoding it. This situation is ! ;; only possible if a file is visited and then vm-mode is ! ;; run on it afterwards. ! ;; ! ;; There are seaprate code blocks for FSF Emacs and XEmacs ! ;; because the coding systems have different names. (defvar buffer-file-coding-system) *************** *** 110,116 **** (set-buffer-modified-p omodified)))) (if (and vm-fsfemacs-mule-p (not (eq (coding-system-base buffer-file-coding-system) ! (coding-system-base 'no-conversion))) (not (eq (coding-system-base buffer-file-coding-system) ! (coding-system-base 'binary)))) (let ((buffer-read-only nil) --- 114,126 ---- (set-buffer-modified-p omodified)))) + (if (and vm-fsfemacs-mule-p (null buffer-file-coding-system)) + (set-buffer-file-coding-system 'raw-text nil)) (if (and vm-fsfemacs-mule-p (not (eq (coding-system-base buffer-file-coding-system) ! (coding-system-base 'raw-text-unix))) ! (not (eq (coding-system-base buffer-file-coding-system) ! (coding-system-base 'raw-text-mac))) ! (not (eq (coding-system-base buffer-file-coding-system) ! (coding-system-base 'raw-text-dos))) (not (eq (coding-system-base buffer-file-coding-system) ! (coding-system-base 'no-conversion)))) (let ((buffer-read-only nil) *************** *** 121,123 **** buffer-file-coding-system) ! (set-buffer-file-coding-system 'no-conversion nil) (decode-coding-region (point-min) (point-max) --- 131,133 ---- buffer-file-coding-system) ! (set-buffer-file-coding-system 'raw-text nil) (decode-coding-region (point-min) (point-max) *************** *** 317,319 **** ! This is VM 6.75. --- 327,329 ---- ! This is VM 6.76. *************** *** 1170,1172 **** nil ! "Please change the Subject header to a concise bug description.\nRemember to cover the basics, that is, what you expected to\nhappen and what in fact did happen. Please remove these\ninstructions from your message.") (save-excursion --- 1180,1182 ---- nil ! "Please change the Subject header to a concise bug description.\nIn this report, remember to cover the basics, that is, what you expected to\nhappen and what in fact did happen. Please remove these\ninstructions from your message.") (save-excursion *************** *** 1200,1204 **** (error "VM %s must be run on Emacs 19.34 or a later v19 version." ! vm-version)) ! ((and vm-fsfemacs-p (= emacs-major-version 20)) ! (error "VM has not been ported to v20 Emacs.")))) --- 1210,1212 ---- (error "VM %s must be run on Emacs 19.34 or a later v19 version." ! vm-version)))) *************** *** 1220,1222 **** (vm-note-emacs-version) ! ;; (vm-check-emacs-version) ;; (vm-set-debug-flags) --- 1228,1230 ---- (vm-note-emacs-version) ! (vm-check-emacs-version) ;; (vm-set-debug-flags) *** dist/vm-summary.el.dist Fri May 21 01:07:45 1999 --- vm-summary.el Wed May 24 00:24:03 2000 *************** *** 715,717 **** ;; a year. The world will surely end soon. ! (setq year (concat "19" string))) ((< (length string) 3) --- 715,721 ---- ;; a year. The world will surely end soon. ! (setq year (concat "19" string)) ! ;; assume any 2-digit year before 1970 is really a date past ! ;; the year 2000. ! (if (< (string-to-int year) 1970) ! (setq year (int-to-string (+ 100 (string-to-int year)))))) ((< (length string) 3) *************** *** 1036,1037 **** --- 1040,1042 ---- (vm-mark-for-summary-update (car mp)) + (vm-set-modflag-of (car mp) t) (setq mp (cdr mp))) *** dist/vm-vars.el.dist Fri Aug 27 16:50:57 1999 --- vm-vars.el Thu Jun 29 11:23:50 2000 *************** *** 258,260 **** ! This variable only affects POP mailbox not listed in `vm-pop-auto-expunge-alist' (which see).") --- 258,260 ---- ! This variable only affects POP mailboxes not listed in `vm-pop-auto-expunge-alist' (which see).") *************** *** 1161,1162 **** --- 1161,1163 ---- ;; vm-summarize = folder on bottom, summary on top + ;; vm-pipe-message-to-command = summary on top, shell output on bottom '( *************** *** 2820,2823 **** "*Name of program to use to move mail from the system spool ! to another location. Normally this should be the movemail program ! distributed with Emacs.") --- 2821,2831 ---- "*Name of program to use to move mail from the system spool ! to another location. Normally this should be the movemail ! program distributed with Emacs. If you use another prgoram, it must ! accept as its last two arguments the spool file (or maildrop) from which ! mail is retrieved, and the local file where the retrieved mail ! should be stored.") ! ! (defvar vm-movemail-program-switches nil ! "*List of command line flags to pass to the movemail program ! named by `vm-movemail-program'.") *************** *** 3525,3527 **** (make-variable-buffer-local 'vm-imap-retrieved-messages) ! (defvar vm-imap-keep-trace-buffer nil) (defvar vm-reply-list nil) --- 3533,3538 ---- (make-variable-buffer-local 'vm-imap-retrieved-messages) ! (defvar vm-pop-keep-failed-trace-buffers 5) ! (defvar vm-imap-keep-failed-trace-buffers 5) ! (defvar vm-kept-pop-buffers nil) ! (defvar vm-kept-imap-buffers nil) (defvar vm-reply-list nil) *************** *** 3570,3572 **** ("sat" "Saturday" "6"))) - (make-variable-buffer-local 'vm-pop-retrieved-messages) (defvar pop-up-frames nil) --- 3581,3582 ---- *************** *** 3673,3675 **** (make-variable-buffer-local 'vm-folder-garbage-alist) - ;; Environment primitives, needed for MULE code that follows (defconst vm-mime-header-list '("MIME-Version:" "Content-")) --- 3683,3684 ---- *************** *** 3688,3690 **** (setq coding-systems (cdr coding-systems))) ! (setq alist (append '(("us-ascii" no-conversion)) alist)) alist)) --- 3697,3699 ---- (setq coding-systems (cdr coding-systems))) ! (setq alist (append '(("us-ascii" raw-text)) alist)) alist)) *************** *** 3744,3746 **** (setq coding-systems (cdr coding-systems))) ! (setq alist (append '((no-conversion "us-ascii")) alist)) alist)) --- 3753,3755 ---- (setq coding-systems (cdr coding-systems))) ! (setq alist (append '((raw-text "us-ascii")) alist)) alist)) *** dist/vm-version.el.dist Fri Aug 27 16:50:57 1999 --- vm-version.el Tue Sep 5 12:06:05 2000 *************** *** 4,6 **** ! (defconst vm-version "6.75" "Version number of VM.") --- 4,6 ---- ! (defconst vm-version "6.76" "Version number of VM.") *** dist/vm-window.el.dist Fri Feb 5 01:42:02 1999 --- vm-window.el Tue Mar 14 10:32:27 2000 *************** *** 64,65 **** --- 64,66 ---- ;; this-command is found in the COMMANDS list. + (and (stringp buffer) (setq buffer (get-buffer buffer))) (vm-save-buffer-excursion *************** *** 67,69 **** (wf (and w (vm-window-frame w)))) - (and buffer (set-buffer buffer)) (if (and w display (not do-not-raise)) --- 68,69 ---- *************** *** 75,77 **** (null (vm-get-visible-buffer-window buffer))) ! (progn (run-hooks 'vm-display-buffer-hook) (switch-to-buffer buffer)) --- 75,79 ---- (null (vm-get-visible-buffer-window buffer))) ! (progn (save-excursion ! (set-buffer buffer) ! (run-hooks 'vm-display-buffer-hook)) (switch-to-buffer buffer)) *************** *** 84,87 **** (vm-get-visible-buffer-window buffer)) ! (progn (set-buffer buffer) ! (run-hooks 'vm-undisplay-buffer-hook)) (if (not (and (memq this-command commands) --- 86,90 ---- (vm-get-visible-buffer-window buffer)) ! (progn (save-excursion ! (set-buffer buffer) ! (run-hooks 'vm-undisplay-buffer-hook))) (if (not (and (memq this-command commands) *************** *** 124,126 **** (progn ! (let ((coding-system-for-read 'no-conversion)) (insert-file-contents file)) --- 127,130 ---- (progn ! (let ((coding-system-for-read ! (vm-line-ending-coding-system))) (insert-file-contents file)) *************** *** 140,145 **** (if (or vm-xemacs-mule-p vm-fsfemacs-mule-p) ! (set-buffer-file-coding-system 'no-conversion)) (erase-buffer) (print vm-window-configurations (current-buffer)) ! (let ((coding-system-for-write 'no-conversion) (selective-display nil)) --- 144,149 ---- (if (or vm-xemacs-mule-p vm-fsfemacs-mule-p) ! (set-buffer-file-coding-system (vm-line-ending-coding-system))) (erase-buffer) (print vm-window-configurations (current-buffer)) ! (let ((coding-system-for-write (vm-line-ending-coding-system)) (selective-display nil)) *************** *** 411,413 **** (setq start f))) ! (if delete-me (progn --- 415,417 ---- (setq start f))) ! (if (and delete-me (vm-created-this-frame-p delete-me)) (progn