~ubuntu-branches/ubuntu/karmic/mew-beta/karmic

« back to all changes in this revision

Viewing changes to mew-gemacs.el

  • Committer: Bazaar Package Importer
  • Author(s): Tatsuya Kinoshita
  • Date: 2008-04-24 00:28:17 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20080424002817-68vgq5lfqr8z0795
Tags: 6.0.51~0.20080421-1
New upstream release. (CVS trunk on 2008-04-21)

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
 
57
57
(defun mew-toolbar-make (map alist)
58
58
  (let ((tool-bar-map (make-sparse-keymap)) ;; for tool-bar-add-item-from-menu
59
 
        (data-directory mew-icon-directory)
60
 
        a)
61
 
    (while alist
62
 
      (setq a (car alist))
63
 
      (setq alist (cdr alist))
 
59
        (data-directory mew-icon-directory))
 
60
    (dolist (a alist)
64
61
      (if (fboundp 'tool-bar-local-item-from-menu)
65
62
          ;; Emacs 21.3.50 or later
66
63
          (tool-bar-local-item-from-menu (car a) (cdr a) tool-bar-map map)
89
86
      (set (make-local-variable 'tool-bar-map)
90
87
           (mew-toolbar-make mew-header-mode-map mew-header-toolbar-spec))))
91
88
 
92
 
(defsubst mew-summary-toolbar-update ())
93
 
(defsubst mew-message-toolbar-update ())
94
 
(defsubst mew-draft-toolbar-update ())
95
 
(defsubst mew-header-toolbar-update ())
 
89
(defun mew-summary-toolbar-update ())
 
90
(defun mew-message-toolbar-update ())
 
91
(defun mew-draft-toolbar-update ())
 
92
(defun mew-header-toolbar-update ())
96
93
 
97
94
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
98
95
;;;
99
96
;;; End of messages
100
97
;;;
101
98
 
102
 
(defsubst mew-message-set-end-of-message ()
 
99
(defun mew-message-set-end-of-message ()
103
100
  (overlay-put (mew-minfo-get-eom) 'before-string mew-end-of-message-string))
104
101
 
105
 
(defsubst mew-message-set-end-of-part ()
 
102
(defun mew-message-set-end-of-part ()
106
103
  (overlay-put (mew-minfo-get-eom) 'before-string mew-end-of-part-string))
107
104
 
108
 
(defsubst mew-message-set-end-of-nil ()
 
105
(defun mew-message-set-end-of-nil ()
109
106
  (overlay-put (mew-minfo-get-eom) 'before-string nil))
110
107
 
111
108
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
136
133
 
137
134
(defcustom mew-image-display-resize t
138
135
  "*If non-nil, image will be displayed with fitting to frame size"
 
136
  :group 'mew-message
139
137
  :type 'boolean)
140
138
 
141
139
(defcustom mew-image-display-resize-care-height t
142
140
  "*If nil, image will be displayed with fitting to only frame width"
 
141
  :group 'mew-message
143
142
  :type 'boolean)
144
143
 
145
144
(defcustom mew-image-width-margin 45
146
145
  "*A value for width margin to display image when resizing"
 
146
  :group 'mew-message
147
147
  :type 'integer)
148
148
 
149
149
(defcustom mew-image-height-margin 200
150
150
  "A value for height margin to display image when resizing"
 
151
  :group 'mew-message
151
152
  :type 'integer)
152
153
 
153
154
(defvar mew-image-l-endian ?\x49)
158
159
  (and window-system (image-type-available-p format)))
159
160
 
160
161
(defun mew-img-get-n (op len)
161
 
  (let* ((n 0) (size 0))
 
162
  (let* ((size 0))
162
163
    (if (eq op ?\x49)   ; I(?\x49) or M(?\x4d)
163
 
        (while (< n len)
 
164
        (dotimes (n len)
164
165
          (setq size (+ size (* (char-after) (expt ?\x100 n))))
165
 
          (forward-char)
166
 
          (setq n (+ n 1)))
167
 
        (while (< 0 len)
 
166
          (forward-char))
 
167
      (while (< 0 len)
168
168
          (setq len (- len 1))
169
169
          (setq size (+ size (* (char-after) (expt ?\x100 len))))
170
170
          (forward-char)))
299
299
             (call-process-region (point-min) (point-max) "pnmscale"
300
300
                                  t '(t nil) nil
301
301
                                  "-xsize" (format "%d" width)))
302
 
           (if (and (string< emacs-version "22")
 
302
           (if (and (string< emacs-version "22") ;; xxx
303
303
                    (mew-which-exec prog2))
304
304
               (call-process-region (point-min) (point-max) prog2
305
305
                                    t '(t nil) nil)
344
344
 
345
345
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
346
346
;;;
347
 
;;; Profile
348
 
;;;
349
 
 
350
 
(defun mew-profile-init ()
351
 
  (when (and mew-profile mew-profile-functions-list)
352
 
    (require 'profile)
353
 
    (let ((profile-functions-list mew-profile-functions-list))
354
 
      (profile-functions))))
355
 
 
356
 
(defun mew-profile-results ()
357
 
  (if (and mew-profile mew-profile-functions-list)
358
 
      (let ((profile-buffer mew-buffer-debug))
359
 
        (profile-results))))
360
 
 
361
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
362
 
;;;
363
347
;;; SSL/SSH/TLS notification
364
348
;;;
365
349
 
366
350
(defvar mew-secure-format nil)
367
351
 
368
 
;; Emacs 21.x has a bug that an image cannot be displayed 
 
352
;; Emacs 21.x has a bug that an image cannot be displayed
369
353
;; if it is specified in mode-line-process.
370
354
 
371
355
(defvar mew-secure-format2
381
365
;;;
382
366
 
383
367
(define-key mew-message-mode-map [mouse-2] 'mew-browse-url-at-mouse)
384
 
(define-key mew-message-mode-map [M-down-mouse-1] 'mew-browse-url-at-mouse) ;; for Mac
 
368
(if (and (featurep 'emacs) ;; preventing XEmacs's byte compiler from hanging
 
369
         (eq system-type 'darwin))
 
370
    ;; for Mac
 
371
    (define-key mew-message-mode-map [M-down-mouse-1] 'mew-browse-url-at-mouse))
385
372
 
386
373
(provide 'mew-gemacs)
387
374
 
388
375
;;; Copyright Notice:
389
376
 
390
 
;; Copyright (C) 1997-2007 Mew developing team.
 
377
;; Copyright (C) 1997-2008 Mew developing team.
391
378
;; All rights reserved.
392
379
 
393
380
;; Redistribution and use in source and binary forms, with or without
394
381
;; modification, are permitted provided that the following conditions
395
382
;; are met:
396
 
;; 
 
383
;;
397
384
;; 1. Redistributions of source code must retain the above copyright
398
385
;;    notice, this list of conditions and the following disclaimer.
399
386
;; 2. Redistributions in binary form must reproduce the above copyright
402
389
;; 3. Neither the name of the team nor the names of its contributors
403
390
;;    may be used to endorse or promote products derived from this software
404
391
;;    without specific prior written permission.
405
 
;; 
 
392
;;
406
393
;; THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND
407
394
;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
408
395
;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR