-;;; semi-def.el --- definition module for REMI
+;;; semi-def.el --- definition module for SEMI -*- coding: iso-8859-4; -*-
-;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
+;; Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc.
-;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Author: MORIOKA Tomohiko <tomo@m17n.org>
;; Keywords: definition, MIME, multimedia, mail, news
;; This file is part of SEMI (Sample of Emacs MIME Implementation).
;;; Code:
-(require 'emu)
+(require 'poe)
(eval-when-compile (require 'cl))
(require 'custom)
-(defconst mime-user-interface-version '("SEMI" "Toyama" 1 8 0)
- "Implementation name, version name and numbers of MIME-kernel package.")
+(defconst mime-user-interface-product ["REMI" (1 14 1) "MushigawaĆ²sugi"]
+ "Product name, version number and code name of MIME-kernel package.")
(autoload 'mule-caesar-region "mule-caesar"
"Caesar rotation of current region." t)
(defsubst mime-add-button (from to function &optional data)
"Create a button between FROM and TO with callback FUNCTION and DATA."
- (let ((overlay (make-overlay from to)))
- (and mime-button-face
- (overlay-put overlay 'face mime-button-face))
- (and mime-button-mouse-face
- (overlay-put overlay 'mouse-face mime-button-mouse-face))
- (add-text-properties from to (list 'mime-button-callback function))
- (and data
- (add-text-properties from to (list 'mime-button-data data)))
- ))
+ (and mime-button-face
+ (put-text-property from to 'face mime-button-face))
+ (and mime-button-mouse-face
+ (put-text-property from to 'mouse-face mime-button-mouse-face))
+ (put-text-property from to 'mime-button-callback function)
+ (and data
+ (put-text-property from to 'mime-button-data data))
+ )
(defsubst mime-insert-button (string function &optional data)
"Insert STRING as button with callback FUNCTION and DATA."
;;; @ for URL
;;;
-(require 'browse-url)
-
(defcustom mime-browse-url-regexp
(concat "\\(http\\|ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\):"
"\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?"
:group 'mime
:type 'regexp)
-(defun mime-browse-url (&optional url)
- (if (fboundp browse-url-browser-function)
- (if url
- (funcall browse-url-browser-function url)
- (call-interactively browse-url-browser-function))
- (if (fboundp mime-button-mother-dispatcher)
- (call-interactively mime-button-mother-dispatcher)
- )))
+(defcustom mime-browse-url-function (function browse-url)
+ "*Function to browse URL."
+ :group 'mime
+ :type 'function)
-(defsubst mime-browse-add-url-buttons ()
+(defsubst mime-add-url-buttons ()
"Add URL-buttons for text body."
(goto-char (point-min))
(while (re-search-forward mime-browse-url-regexp nil t)
(let ((beg (match-beginning 0))
(end (match-end 0)))
- (mime-add-button beg end (function mime-browse-url)
+ (mime-add-button beg end mime-browse-url-function
(list (buffer-substring beg end))))))
-(defun mime-browse-add-url-buttons-maybe ()
- "Add URL-buttons if 'browse-url-browser-function is non-nil."
- (if browse-url-browser-function
- (mime-browse-add-url-buttons)
- ))
-
;;; @ menu
;;;
)
-;;; @ PGP
-;;;
-
-(defvar pgp-function-alist
- '(
- ;; for mime-pgp
- (verify mc-verify "mc-toplev")
- (decrypt mc-decrypt "mc-toplev")
- (fetch-key mc-pgp-fetch-key "mc-pgp")
- (snarf-keys mc-snarf-keys "mc-toplev")
- ;; for mime-edit
- (mime-sign mime-mc-pgp-sign-region "mime-mc")
- (traditional-sign mc-pgp-sign-region "mc-pgp")
- (encrypt mime-mc-pgp-encrypt-region "mime-mc")
- (insert-key mc-insert-public-key "mc-toplev")
- )
- "Alist of service names vs. corresponding functions and its filenames.
-Each element looks like (SERVICE FUNCTION FILE).
-
-SERVICE is a symbol of PGP processing. It allows `verify', `decrypt',
-`fetch-key', `snarf-keys', `mime-sign', `traditional-sign', `encrypt'
-or `insert-key'.
-
-Function is a symbol of function to do specified SERVICE.
-
-FILE is string of filename which has definition of corresponding
-FUNCTION.")
-
-(defmacro pgp-function (method)
- "Return function to do service METHOD."
- `(cadr (assq ,method (symbol-value 'pgp-function-alist))))
-
-(mapcar (function
- (lambda (method)
- (autoload (cadr method)(nth 2 method))
- ))
- pgp-function-alist)
-
-
;;; @ Other Utility
;;;