Changeset 24543 for lang/elisp

Show
Ignore:
Timestamp:
11/21/08 11:01:08 (6 years ago)
Author:
kentaro
Message:

id:hayamiz++ にいろいろ改良してもらったよ! http://d.hatena.ne.jp/hayamiz/20081121/1227228535

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/elisp/outputz/outputz.el

    r24503 r24543  
    4141(defvar outputz-key nil) 
    4242(defvar outputz-url nil) 
    43 (defvar outputz-modes 
     43(defcustom outputz-modes 
    4444  '(emacs-lisp-mode lisp-interaction-mode 
    4545    c-mode c++-mode java-mode 
     
    4848    makefile-mode sh-mode fortran-mode f90-mode ada-mode 
    4949    xml-mode sgml-mode 
    50     text-mode simple-hatena-mode)) 
     50    text-mode simple-hatena-mode) 
     51  "A list of major mode in which `outputz-mode' should be enabled." 
     52  :type '(list symbol)) 
    5153 
    5254(require 'url) 
     55 
     56(unless (fboundp 'mailcap-parse-mailcaps) 
     57  (block nil 
     58    (dolist (path load-path) 
     59      (when (or (file-exists-p (expand-file-name "mailcap.el" path)) 
     60                (file-exists-p (expand-file-name "mailcap.elc" path))) 
     61        (load (expand-file-name "mailcap" path))) 
     62      (when (fboundp 'mailcap-parse-mailcaps) 
     63        (return))))) 
     64 
    5365(require 'easy-mmode) 
    5466 
     
    7082      outputz-mode outputz-mode-maybe)) 
    7183 
     84(add-hook 'find-file-hook 
     85          (lambda () 
     86            (when outputz-mode 
     87              (setq outputz-count 
     88                    (max 0 (- (point-max) (point-min))))))) 
     89 
    7290(add-hook 'after-save-hook 'outputz) 
    7391 
     
    7997                 (> current-count outputz-count)) 
    8098        (outputz-post (- current-count outputz-count)) 
    81         (setq outputz-count current-count))))) 
     99        ) 
     100      (setq outputz-count current-count)))) 
    82101 
    83102(defun outputz-post (count)