*** dist/vm-mime.el.dist Sun Nov 18 23:57:24 2001 --- vm-mime.el Thu Nov 22 20:29:09 2001 *************** *** 2482,2484 **** (vm-mime-display-internal-image-fsfemacs-21-xxxx layout image-type name)) ! ((and vm-fsfemacs-p (stringp vm-imagemagick-convert-program)) (vm-mime-display-internal-image-fsfemacs-19-xxxx layout image-type name)))) --- 2482,2484 ---- (vm-mime-display-internal-image-fsfemacs-21-xxxx layout image-type name)) ! (vm-fsfemacs-p (vm-mime-display-internal-image-fsfemacs-19-xxxx layout image-type name)))) *************** *** 2490,2491 **** --- 2490,2492 ---- (selective-display nil) + (incremental vm-mime-display-image-strips-incrementally) do-strips *************** *** 2519,2521 **** (face-font 'default)) ! t)) process image-list extent-list --- 2520,2523 ---- (face-font 'default)) ! image-type ! t incremental)) process image-list extent-list *************** *** 2552,2553 **** --- 2554,2559 ---- (nreverse extent-list))) + (if incremental + (set-process-filter + process + 'vm-process-filter-display-some-image-strips)) (set-process-sentinel *************** *** 2580,2582 **** (set-glyph-baseline g 100) ! (set-glyph-face g 'vm-xface) (setq e (vm-make-extent (1- (point)) (point))) --- 2586,2588 ---- (set-glyph-baseline g 100) ! (set-glyph-face g 'vm-monochrome-image) (setq e (vm-make-extent (1- (point)) (point))) *************** *** 2591,2592 **** --- 2597,2599 ---- (selective-display nil) + (incremental vm-mime-display-image-strips-incrementally) do-strips *************** *** 2619,2623 **** (condition-case error-data ! (let ((strips (vm-make-image-strips tempfile ! (frame-char-height) ! t)) (first t) --- 2626,2631 ---- (condition-case error-data ! (let ((strips (vm-make-image-strips ! tempfile ! (* 2 (frame-char-height)) ! image-type t incremental)) (first t) *************** *** 2647,2648 **** --- 2655,2660 ---- (nreverse overlay-list))) + (if incremental + (set-process-filter + process + 'vm-process-filter-display-some-image-strips)) (set-process-sentinel *************** *** 2652,2654 **** (setq do-strips nil)) ! (error (message "Failed making image strips: %s" error-data) --- 2664,2666 ---- (setq do-strips nil)) ! (x-error (message "Failed making image strips: %s" error-data) *************** *** 2768,2770 **** (setq image-list strips) ! (setq strips (vm-make-image-strips tempfile char-height t hroll vroll) --- 2780,2783 ---- (setq image-list strips) ! (setq strips (vm-make-image-strips tempfile char-height ! image-type t nil hroll vroll) *************** *** 2781,2782 **** --- 2794,2796 ---- (insert-char ?\ (/ width char-width)) + (put-text-property start (point) 'face 'vm-image-placeholder) (setq o (make-overlay start (point) nil t)) *************** *** 2795,2796 **** --- 2809,2814 ---- (nreverse overlay-list)) + ;; incremental strip display intentionally + ;; omitted because it makes the Emacs 19 + ;; display completely repaint for each new + ;; strip. (set-process-sentinel *************** *** 2813,2821 **** (set-buffer work-buffer) ! (call-process vm-imagemagick-convert-program nil t nil ! "-verbose" file "/dev/null") (goto-char (point-min)) (or (search-forward file nil t) ! (error "file name missing from 'convert' output")) ! (if (not (looking-at " \\([0-9]+\\)x\\([0-9]+\\)")) ! (error "file dimensions missing from 'convert' output")) (setq width (string-to-int (match-string 1)) --- 2831,2840 ---- (set-buffer work-buffer) ! (call-process vm-imagemagick-identify-program nil t nil file) (goto-char (point-min)) (or (search-forward file nil t) ! (error "file name missing from 'identify' output: %s" ! (buffer-string))) ! (if (not (re-search-forward "\\b\\([0-9]+\\)x\\([0-9]+\\)\\b" nil t)) ! (error "file dimensions missing from 'identify' output: %s" ! (buffer-string))) (setq width (string-to-int (match-string 1)) *************** *** 2825,2827 **** ! (defun vm-make-image-strips (file min-height async &optional hroll vroll) (or hroll (setq hroll 0)) --- 2844,2857 ---- ! (defun vm-imagemagick-type-indicator-for (image-type) ! (cond ((eq image-type 'jpeg) "jpeg:") ! ((eq image-type 'gif) "gif:") ! ((eq image-type 'png) "png:") ! ((eq image-type 'tiff) "tiff:") ! ((eq image-type 'xpm) "xpm:") ! ((eq image-type 'pbm) "pbm:") ! ((eq image-type 'xbm) "xbm:") ! (t ""))) ! ! (defun vm-make-image-strips (file min-height image-type async incremental ! &optional hroll vroll) (or hroll (setq hroll 0)) *************** *** 2829,2839 **** (let ((process-connection-type nil) image-list dimensions width height starty newfile work-buffer ! remainder process) (setq dimensions (vm-get-image-dimensions file) width (car dimensions) ! height (car (cdr dimensions)) ! remainder (% height min-height) ! starty 0) (if (< height min-height) (signal 'vm-image-too-small nil)) (unwind-protect --- 2859,2874 ---- (let ((process-connection-type nil) + (i 0) + (output-type (vm-imagemagick-type-indicator-for image-type)) image-list dimensions width height starty newfile work-buffer ! quotient remainder adjustment process) (setq dimensions (vm-get-image-dimensions file) width (car dimensions) ! height (car (cdr dimensions))) (if (< height min-height) (signal 'vm-image-too-small nil)) + (setq quotient (/ height min-height) + remainder (% height min-height) + adjustment (/ remainder quotient) + remainder (% remainder quotient) + starty 0) (unwind-protect *************** *** 2844,2857 **** (while (< starty height) ! (setq newfile (vm-make-tempfile-name)) (if async ! (insert vm-imagemagick-convert-program ! " -crop" ! (format " %dx%d+0+%d" ! width ! (if (zerop remainder) ! min-height ! (+ min-height 1)) ! starty) ! (format " -roll +%d+%d" hroll vroll) ! " '" file "' '" newfile "'\n") (call-process vm-imagemagick-convert-program nil nil nil --- 2879,2896 ---- (while (< starty height) ! (setq newfile (vm-make-tempfile)) (if async ! (progn ! (insert vm-imagemagick-convert-program ! " -crop" ! (format " %dx%d+0+%d" ! width ! (+ min-height adjustment ! (if (zerop remainder) 0 1)) ! starty) ! (format " -roll +%d+%d" hroll vroll) ! " '" file "' '" output-type newfile "'\n") ! (if incremental ! (progn ! (insert "echo XZXX" (int-to-string i) "XZXX\n"))) ! (setq i (1+ i))) (call-process vm-imagemagick-convert-program nil nil nil *************** *** 2860,2862 **** width ! (min min-height (- height starty)) starty) --- 2899,2902 ---- width ! (+ min-height adjustment ! (if (zerop remainder) 0 1)) starty) *************** *** 2864,2873 **** (format "+%d+%d" hroll vroll) ! file newfile)) (setq image-list (cons newfile image-list) ! starty (+ starty min-height (if (zerop remainder) ! 0 ! (setq remainder (1- remainder)) ! 1 )))) (if (not async) nil (insert "exit\n") --- 2904,2913 ---- (format "+%d+%d" hroll vroll) ! file (concat output-type newfile))) (setq image-list (cons newfile image-list) ! starty (+ starty min-height adjustment ! (if (zerop remainder) 0 1)) ! remainder (if (= 0 remainder) 0 (1- remainder)))) (if (not async) nil + (goto-char (point-max)) (insert "exit\n") *************** *** 2931,2933 **** (set-glyph-baseline g 50) ! (set-glyph-face g 'vm-xface) (set-extent-begin-glyph (car extents) g) --- 2971,2973 ---- (set-glyph-baseline g 50) ! (set-glyph-face g 'vm-monochrome-image) (set-extent-begin-glyph (car extents) g) *************** *** 2937,2941 **** (defun vm-display-image-strips-on-overlay-regions (strips overlays image-type) ! (let (prop value (omodified (buffer-modified-p))) (save-excursion (set-buffer (overlay-buffer (car vm-overlay-list))) (save-restriction --- 2977,2982 ---- (defun vm-display-image-strips-on-overlay-regions (strips overlays image-type) ! (let (prop value omodified) (save-excursion (set-buffer (overlay-buffer (car vm-overlay-list))) + (setq omodified (buffer-modified-p)) (save-restriction *************** *** 2953,2955 **** ':file (car strips) ! ':ascent 80)) (setq value (make-face (make-symbol ""))) --- 2994,2996 ---- ':file (car strips) ! ':ascent 50)) (setq value (make-face (make-symbol ""))) *************** *** 2961,2962 **** --- 3002,3090 ---- overlays (cdr overlays)))) + (set-buffer-modified-p omodified)))))) + + (defun vm-process-filter-display-some-image-strips (process output) + (let (which-strips (i 0)) + (while (string-match "XZXX\\([0-9]+\\)XZXX" output i) + (setq which-strips (cons (string-to-int (match-string 1 output)) + which-strips) + i (match-end 0))) + (save-excursion + (set-buffer (process-buffer process)) + (cond ((and (boundp 'vm-extent-list) + (boundp 'vm-image-list)) + (let ((strips vm-image-list) + (extents vm-extent-list) + (image-type vm-image-type) + (type-name vm-image-type-name)) + (vm-display-some-image-strips-on-extents strips extents + image-type + type-name + which-strips))) + ((and (boundp 'vm-overlay-list) + (overlay-buffer (car vm-overlay-list)) + (boundp 'vm-image-list)) + (let ((strips vm-image-list) + (overlays vm-overlay-list) + (image-type vm-image-type)) + (vm-display-some-image-strips-on-overlay-regions + strips overlays image-type which-strips))))))) + + (defun vm-display-some-image-strips-on-extents + (strips extents image-type type-name which-strips) + (let (g sss eee) + (while which-strips + (setq sss (nthcdr (car which-strips) strips) + eee (nthcdr (car which-strips) extents)) + (cond ((and sss + (file-exists-p (car sss)) + (extent-live-p (car eee)) + (extent-object (car eee))) + (setq g (make-glyph + (list + (cons (list 'win) + (vector image-type ':file (car sss))) + (cons (list 'win) + (vector + 'string + ':data + (format "[Unknown/Bad %s image encoding]" + type-name))) + (cons nil + (vector 'string + ':data + (format "[%s image]\n" type-name)))))) + (set-glyph-baseline g 50) + (set-glyph-face g 'vm-monochrome-image) + (set-extent-begin-glyph (car eee) g))) + (setq which-strips (cdr which-strips))))) + + (defun vm-display-some-image-strips-on-overlay-regions + (strips overlays image-type which-strips) + (let (sss ooo prop value omodified) + (save-excursion + (set-buffer (overlay-buffer (car vm-overlay-list))) + (setq omodified (buffer-modified-p)) + (save-restriction + (widen) + (unwind-protect + (let ((buffer-read-only nil)) + (if (fboundp 'image-type-available-p) + (setq prop 'display) + (setq prop 'face)) + (while which-strips + (setq sss (nthcdr (car which-strips) strips) + ooo (nthcdr (car which-strips) overlays)) + (cond ((and sss + (file-exists-p (car sss)) + (overlay-end (car ooo))) + (if (fboundp 'image-type-available-p) + (setq value (list 'image ':type image-type + ':file (car sss) + ':ascent 50)) + (setq value (make-face (make-symbol ""))) + (set-face-stipple value (car sss))) + (put-text-property (overlay-start (car ooo)) + (overlay-end (car ooo)) + prop value))) + (setq which-strips (cdr which-strips)))) (set-buffer-modified-p omodified)))))) *** dist/vm-page.el.dist Sun Nov 18 23:57:25 2001 --- vm-page.el Mon Nov 19 23:42:21 2001 *************** *** 242,243 **** --- 242,253 ---- + (defun vm-scroll-forward-one-line () + "Scroll forward one line." + (interactive) + (vm-scroll-forward 1)) + + (defun vm-scroll-backward-one-line () + "Scroll backward one line." + (interactive) + (vm-scroll-forward -1)) + (defun vm-highlight-headers () *** dist/vm-reply.el.dist Sun Nov 18 23:57:25 2001 --- vm-reply.el Sun Nov 25 12:53:47 2001 *************** *** 1216,1227 **** (insert mail-header-separator "\n") ! (cond ((stringp mail-signature) ! (save-excursion ! (insert mail-signature))) ! ((eq mail-signature t) ! (save-excursion ! (insert "\n-- \n") ! (insert-file-contents (or (and (boundp 'mail-signature-file) ! (stringp mail-signature-file) ! mail-signature-file) ! "~/.signature"))))) ;; move this buffer to the head of the buffer list so window --- 1216,1237 ---- (insert mail-header-separator "\n") ! (if mail-signature ! (save-excursion ! (save-restriction ! (narrow-to-region (point) (point)) ! (cond ((stringp mail-signature) ! (insert mail-signature)) ! ((eq mail-signature t) ! (insert-file-contents (or (and (boundp 'mail-signature-file) ! (stringp mail-signature-file) ! mail-signature-file) ! "~/.signature"))) ! (t ! (let ((str (eval mail-signature))) ! (if (stringp str) ! (insert str))))) ! (goto-char (point-min)) ! (if (looking-at "\n*-- \n") ! nil ! (insert "\n-- \n")) ! (goto-char (point-max))))) ;; move this buffer to the head of the buffer list so window *** dist/vm-startup.el.dist Sun Nov 18 23:57:25 2001 --- vm-startup.el Sun Nov 25 22:05:20 2001 *************** *** 339,341 **** ! This is VM 6.98. --- 339,341 ---- ! This is VM 6.99. *************** *** 1427,1428 **** --- 1427,1447 ---- (setq vm-buffers-needing-display-update (make-vector 29 0)) + (if (if (fboundp 'find-face) + (find-face 'vm-monochrome-image) + (facep 'vm-monochrome-image)) + nil + (make-face 'vm-monochrome-image) + (set-face-background 'vm-monochrome-image "white") + (set-face-foreground 'vm-monochrome-image "black")) + (if (or (not vm-fsfemacs-p) + ;; don't need this face under Emacs 21. + (fboundp 'vm-image-type-available-p) + (facep 'vm-image-placeholder)) + nil + (make-face 'vm-image-placeholder) + (if (fboundp 'set-face-stipple) + (set-face-stipple 'vm-image-placeholder + (list 16 16 + (concat "UU\377\377UU\377\377UU\377\377" + "UU\377\377UU\377\377UU\377\377" + "UU\377\377UU\377\377"))))) ;; default value of vm-mime-button-face is 'gui-button-face *** dist/vm-summary.el.dist Sun Oct 28 22:13:05 2001 --- vm-summary.el Thu Nov 22 21:40:23 2001 *************** *** 748,768 **** (setq hour (substring date (match-beginning 0) (match-end 0)))) ! (if (or (string-match "[^a-z][+---][0-9][0-9][0-9][0-9]" date) ! (string-match "e[ds]t\\|c[ds]t\\|p[ds]t\\|m[ds]t" date) ! (string-match "ast\\|nst\\|met\\|eet\\|jst\\|bst\\|ut" date) ! (string-match "gmt\\([+---][0-9]+\\)?" date)) ! (setq timezone (substring date (match-beginning 0) (match-end 0)))) ! (while (string-match "\\(\\`\\|[^:+---0-9]\\|[a-z]-\\)[0-9]+\\(\\'\\|[^:]\\)" ! date start) ! (setq string (substring date (match-end 1) (match-beginning 2)) start (match-end 0)) ! (cond ((string-match "\\`[4-9]." string) ! ;; Assume that any two digits less than 40 are a date and not ! ;; 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) (setq monthday string)) (t (setq year string)))) --- 748,767 ---- (setq hour (substring date (match-beginning 0) (match-end 0)))) ! (cond ((string-match "[^a-z][+---][0-9][0-9][0-9][0-9]" date) ! (setq timezone (substring date (1+ (match-beginning 0)) ! (match-end 0)))) ! ((or (string-match "e[ds]t\\|c[ds]t\\|p[ds]t\\|m[ds]t" date) ! (string-match "ast\\|nst\\|met\\|eet\\|jst\\|bst\\|ut" date) ! (string-match "gmt\\([+---][0-9]+\\)?" date)) ! (setq timezone (substring date (match-beginning 0) (match-end 0))))) ! (while (and (or (zerop (length monthday)) ! (zerop (length year))) ! (string-match " \\([0-9]+\\) " date start)) ! (setq string (substring date (match-beginning 1) (match-end 1)) start (match-end 0)) ! (cond ((zerop (length monthday)) (setq monthday string)) + ((= (length string) 2) + (if (< (string-to-int string) 70) + (setq year (concat "20" string)) + (setq year (concat "19" string)))) (t (setq year string)))) *************** *** 1488,1495 **** (insert (car dp) ":\n")) ! (setq fp (sort (vm-delete-backup-file-names ! (vm-delete-auto-save-file-names ! (vm-delete-index-file-names ! (vm-delete-directory-names ! (directory-files (car dp)))))) ! (function string-lessp))) (while fp --- 1487,1495 ---- (insert (car dp) ":\n")) ! (let ((default-directory (car dp))) ! (setq fp (sort (vm-delete-backup-file-names ! (vm-delete-auto-save-file-names ! (vm-delete-index-file-names ! (vm-delete-directory-names ! (directory-files (car dp)))))) ! (function string-lessp)))) (while fp *** dist/vm-thread.el.dist Sun Oct 28 22:13:05 2001 --- vm-thread.el Fri Nov 23 08:23:02 2001 *************** *** 201,202 **** --- 201,207 ---- (while (not done) + ;; save the date of the oldest message in this thread + (setq root-date (get id-sym 'oldest-date)) + (if (or (null root-date) + (string< (vm-so-sortable-datestring message) root-date)) + (put id-sym 'oldest-date (vm-so-sortable-datestring message))) (if (and (boundp id-sym) (symbol-value id-sym)) *************** *** 216,218 **** (if (null vm-thread-using-subject) ! nil (setq subject-sym --- 221,223 ---- (if (null vm-thread-using-subject) ! (setq done t) (setq subject-sym *************** *** 237,243 **** m (car (get id-sym 'messages))))))))) - ;; save the date of the oldest message in this thread - (setq root-date (get id-sym 'oldest-date)) - (if (or (null root-date) - (string< (vm-so-sortable-datestring message) root-date)) - (put id-sym 'oldest-date (vm-so-sortable-datestring message))) thread-list ))) --- 242,243 ---- *** dist/vm-vars.el.dist Sun Nov 18 23:57:26 2001 --- vm-vars.el Thu Nov 22 19:48:33 2001 *************** *** 998,1006 **** "*Non-nil means chop an image into horizontal strip for display. ! Emacs treats a displayed image as a single large character and ! cannot scroll vertically within an image. To work around this ! limitation VM can display an image as a series of contiguous ! horizontal strips that Emacs' scrolling routines can better ! handle. To do this VM needs to have the ImageMagick program ! 'convert' installed; `vm-imagemagick-convert-program' must point ! to it. --- 998,1006 ---- "*Non-nil means chop an image into horizontal strip for display. ! Emacs treats a displayed image as a single large character and cannot ! scroll vertically within an image. To work around this limitation VM ! can display an image as a series of contiguous horizontal strips that ! Emacs' scrolling routines can better handle. To do this VM needs to ! have the ImageMagick programs 'convert' and 'identify' installed; ! `vm-imagemagick-convert-program' and `vm-imagemagick-identify-program ! must point to them. *************** *** 1009,1010 **** --- 1009,1015 ---- + (defvar vm-mime-display-image-strips-incrementally t + "*Non-nil means display image strips as they are created + rather than waiting until all the strips are created and displaying + them all at once. See `vm-mime-use-image-strips'.") + (defun vm-locate-executable-file (name) *************** *** 1023,1029 **** "*Name of ImageMagick 'convert' program. ! VM uses this to gather information about images and to slice up ! images for display. It may also use this program to convert ! between various image types if Emacs can display one type but ! not another. Set this to nil and VM will not use the 'convert' ! program.") --- 1028,1037 ---- "*Name of ImageMagick 'convert' program. ! VM uses this toconvert between image formats and to slice up ! images for display. Set this to nil and VM will not use the ! 'convert' program.") ! ! (defvar vm-imagemagick-identify-program (vm-locate-executable-file "identify") ! "*Name of ImageMagick 'identify' program. ! VM uses this to gather information about images. Set this to nil ! and VM will not use the 'convert' program.") *************** *** 1037,1039 **** (list "image" "image/tiff" (format "%s - tiff:-" x)) ! (list "image" "image/pbm" (format "%s - xbm:-" x)) (list "image" "image/xpm" (format "%s - xpm:-" x)) --- 1045,1047 ---- (list "image" "image/tiff" (format "%s - tiff:-" x)) ! (list "image" "image/pbm" (format "%s - pbm:-" x)) (list "image" "image/xpm" (format "%s - xpm:-" x)) *** dist/vm-version.el.dist Sun Nov 18 23:57:26 2001 --- vm-version.el Sun Nov 25 22:05:20 2001 *************** *** 4,6 **** ! (defconst vm-version "6.98" "Version number of VM.") --- 4,6 ---- ! (defconst vm-version "6.99" "Version number of VM.") *************** *** 101,103 **** (or (fboundp 'image-type-available-p) ! (stringp vm-imagemagick-convert-program))))) --- 101,104 ---- (or (fboundp 'image-type-available-p) ! (and (stringp vm-imagemagick-convert-program) ! (stringp vm-imagemagick-identify-program))))))