~reddyuday/vm/virtual

« back to all changes in this revision

Viewing changes to lisp/vm-page.el

  • Committer: udr
  • Date: 2010-12-22 20:16:48 UTC
  • Revision ID: udr@maruti-20101222201648-p4bh5zoba7h7uplv
Fixed most undefined function errors using the Emacs 23 byte compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
(provide 'vm-page)
25
25
 
26
26
(eval-when-compile
27
 
  (require 'vm-vars))
 
27
  (require 'vm-misc)
 
28
  (require 'vm-minibuf)
 
29
  (require 'vm-folder)
 
30
  (require 'vm-summary)
 
31
  (require 'vm-thread)
 
32
  (require 'vm-window)
 
33
  (require 'vm-motion)
 
34
  (require 'vm-menu)
 
35
  (require 'vm-mouse)
 
36
  (require 'vm-mime)
 
37
  (require 'vm-undo)
 
38
  )
 
39
 
 
40
(declare-function vm-make-virtual-copy "vm-virtual" (message))
 
41
(declare-function vm-make-presentation-copy "vm-mime" (message))
 
42
(declare-function vm-decode-mime-message "vm-mime" (&optional state))
 
43
(declare-function vm-mime-plain-message-p "vm-mime" (message))
 
44
;; (declare-funciton vm-mm-layout "vm-mime" (message))
 
45
 
 
46
(declare-function delete-extent "vm-xemacs" (extent))
 
47
(declare-function map-extents "vm-xemacs" 
 
48
                  (function &optional object from to maparg 
 
49
                            flags property value))
 
50
(declare-function find-face "vm-xemacs" (face-or-name))
 
51
(declare-function make-glyph "vm-xemacs" (&optional spec-list type))
 
52
(declare-function set-glyph-face "vm-xemacs" (glyph face))
 
53
(declare-function glyphp "vm-xemacs" (object))
 
54
(declare-function set-extent-begin-glyph "vm-xemacs" 
 
55
                  (extent begin-glyph &optional layout))
 
56
(declare-function highlight-headers "vm-xemacs" (start end hack-sig))
28
57
 
29
58
;;;###autoload
30
59
(defun vm-scroll-forward (&optional arg)
295
324
    (let (e)
296
325
      (map-extents (function
297
326
                    (lambda (e ignore)
298
 
                      (if (extent-property e 'vm-highlight)
 
327
                      (if (vm-extent-property e 'vm-highlight)
299
328
                          (delete-extent e))
300
329
                      nil))
301
330
                   (current-buffer) (point-min) (point-max))
302
331
      (goto-char (point-min))
303
332
      (while (vm-match-header)
304
333
        (cond ((vm-match-header vm-highlighted-header-regexp)
305
 
               (setq e (make-extent (vm-matched-header-contents-start)
 
334
               (setq e (vm-make-extent (vm-matched-header-contents-start)
306
335
                                    (vm-matched-header-contents-end)))
307
 
               (set-extent-property e 'face vm-highlighted-header-face)
308
 
               (set-extent-property e 'vm-highlight t)))
 
336
               (vm-set-extent-property e 'face vm-highlighted-header-face)
 
337
               (vm-set-extent-property e 'vm-highlight t)))
309
338
        (goto-char (vm-matched-header-end)))))
310
339
   ((fboundp 'overlay-put)
311
340
    (let (o-lists p)
348
377
      (let (e)
349
378
        (map-extents (function
350
379
                      (lambda (e ignore)
351
 
                        (if (extent-property e 'vm-url)
 
380
                        (if (vm-extent-property e 'vm-url)
352
381
                            (delete-extent e))
353
382
                        nil))
354
383
                     (current-buffer) (point-min) (point-max))
359
388
            (setq n 1)
360
389
            (while (null (match-beginning n))
361
390
              (vm-increment n))
362
 
            (setq e (make-extent (match-beginning n) (match-end n)))
363
 
            (set-extent-property e 'vm-url t)
 
391
            (setq e (vm-make-extent (match-beginning n) (match-end n)))
 
392
            (vm-set-extent-property e 'vm-url t)
364
393
            (if vm-highlight-url-face
365
 
                (set-extent-property e 'face vm-highlight-url-face))
 
394
                (vm-set-extent-property e 'face vm-highlight-url-face))
366
395
            (if vm-url-browser
367
396
                (let ((keymap (make-sparse-keymap))
368
397
                      (popup-function
377
406
                  (define-key keymap "\r"
378
407
                    (function (lambda () (interactive)
379
408
                                (vm-mouse-send-url-at-position (point)))))
380
 
                  (set-extent-property e 'vm-button t)
381
 
                  (set-extent-property e 'keymap keymap)
382
 
                  (set-extent-property e 'balloon-help 'vm-url-help)
383
 
                  (set-extent-property e 'highlight t)
 
409
                  (vm-set-extent-property e 'vm-button t)
 
410
                  (vm-set-extent-property e 'keymap keymap)
 
411
                  (vm-set-extent-property e 'balloon-help 'vm-url-help)
 
412
                  (vm-set-extent-property e 'highlight t)
384
413
                  ;; for vm-continue-postponed-message
385
 
;                 (set-extent-property e 'duplicable t)
 
414
;                 (vm-set-extent-property e 'duplicable t)
386
415
                  )))
387
416
          (setq search-pairs (cdr search-pairs))))))
388
417
     ((and vm-fsfemacs-p
436
465
          regexp menu keymap e)
437
466
      (map-extents (function
438
467
                    (lambda (e ignore)
439
 
                      (if (extent-property e 'vm-header)
 
468
                      (if (vm-extent-property e 'vm-header)
440
469
                          (delete-extent e))
441
470
                      nil))
442
471
                   (current-buffer) (point-min) (point-max))
446
475
              menu (symbol-value (nth 1 (car search-tuples))))
447
476
        (while (re-search-forward regexp nil t)
448
477
          (save-excursion (goto-char (match-beginning 0)) (vm-match-header))
449
 
          (setq e (make-extent (vm-matched-header-contents-start)
 
478
          (setq e (vm-make-extent (vm-matched-header-contents-start)
450
479
                               (vm-matched-header-contents-end)))
451
 
          (set-extent-property e 'vm-header t)
 
480
          (vm-set-extent-property e 'vm-header t)
452
481
          (setq keymap (make-sparse-keymap))
453
482
          ;; Might as well make button2 do what button3 does in
454
483
          ;; this case, since there is no default 'select'
460
489
              (define-key keymap 'button3
461
490
                (list 'lambda () '(interactive)
462
491
                      (list 'popup-menu (list 'quote menu)))))
463
 
          (set-extent-property e 'keymap keymap)
464
 
          (set-extent-property e 'balloon-help 'vm-mouse-3-help)
465
 
          (set-extent-property e 'highlight t))
 
492
          (vm-set-extent-property e 'keymap keymap)
 
493
          (vm-set-extent-property e 'balloon-help 'vm-mouse-3-help)
 
494
          (vm-set-extent-property e 'highlight t))
466
495
        (setq search-tuples (cdr search-tuples)))))
467
496
   ((and vm-fsfemacs-p
468
497
         (fboundp 'overlay-put))
505
534
  (let ((case-fold-search t) e g h)
506
535
    (if (map-extents (function
507
536
                      (lambda (e ignore)
508
 
                        (if (extent-property e 'vm-xface)
 
537
                        (if (vm-extent-property e 'vm-xface)
509
538
                            t
510
539
                          nil)))
511
540
                     (current-buffer) (point-min) (point-max))
533
562
              ;; bottom of the glyph in 19.12
534
563
              ;;(set-glyph-baseline g 100)
535
564
              (set-glyph-face g 'vm-xface))
536
 
            (setq e (make-extent (vm-vheaders-of (car vm-message-pointer))
 
565
            (setq e (vm-make-extent (vm-vheaders-of (car vm-message-pointer))
537
566
                                 (vm-vheaders-of (car vm-message-pointer))))
538
 
            (set-extent-property e 'vm-xface t)
 
567
            (vm-set-extent-property e 'vm-xface t)
539
568
            (set-extent-begin-glyph e g))))))
540
569
 
541
570
(defun vm-display-xface-fsfemacs ()
991
1020
               (overlay-put vm-page-end-overlay 'evaporate nil))))
992
1021
        (vm-xemacs-p
993
1022
         (if (not (and vm-page-end-overlay
994
 
                       (extent-end-position vm-page-end-overlay)))
 
1023
                       (vm-extent-end-position vm-page-end-overlay)))
995
1024
             (let ((g vm-page-continuation-glyph))
996
1025
               (cond ((not (glyphp g))
997
1026
                      (setq g (make-glyph g))
998
1027
                      (set-glyph-face g 'italic)))
999
 
               (setq vm-page-end-overlay (make-extent (point) (point)))
 
1028
               (setq vm-page-end-overlay (vm-make-extent (point) (point)))
1000
1029
               (vm-set-extent-property vm-page-end-overlay 'vm-glyph g)
1001
1030
               (vm-set-extent-property vm-page-end-overlay 'begin-glyph g)
1002
 
               (set-extent-property vm-page-end-overlay 'detachable nil)))))
 
1031
               (vm-set-extent-property vm-page-end-overlay 'detachable nil)))))
1003
1032
  (save-excursion
1004
1033
    (let (min max (e vm-page-end-overlay))
1005
1034
      (if (or (bolp) (not (save-excursion