Changeset 7870 for lang/gauche/oldtype

Show
Ignore:
Timestamp:
03/13/08 00:38:51 (5 years ago)
Author:
kiyoka
Message:
 
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/oldtype-mode.el

    r7811 r7870  
    55;;   Copyright (C) 2007 Kiyoka Nishiyama 
    66;; 
    7 ;;     $Id: oldtype-mode.el 289 2008-03-01 01:50:33Z kiyoka $ 
     7;;     $Id: oldtype-mode.el 242 2008-02-02 09:58:22Z kiyoka $ 
    88;; 
    99;; This file is part of oldtype-mode 
     
    2929;; 
    3030;; ChangeLog: 
     31;;   [0.0.4] 
     32;;     1. Added image displaying feature for ##(amazon ASIN) command. 
     33;; 
    3134;;   [0.0.3] 
    32 ;;     1. Added ##(amazon ASIN) command. 
     35;;     1. Supported URL to ##(amazon ASIN) command conversion feature.  ( C-c C-c key ) 
    3336;; 
    3437;;   [0.0.2] 
    3538;;     1. Added ##(todo),##(undo) command. 
    3639;;     2. Added oldtype-openfile( wikiname ) function. 
    37  
     40;;  
    3841;;   [0.0.1] 
    3942;;     1. first release 
    4043;; 
    4144;; 
    42 (defconst oldtype-version "0.0.3") 
     45(defconst oldtype-version "0.0.4") 
    4346 
    4447(defconst oldtype-wikiname-face 'oldtype-wikiname-face) 
     
    305308;; 
    306309(defun oldtype-install-fontification () 
     310  ;; 
     311  ;; "4873113482" 
     312  ;;   => "http://images.amazon.com/images/P/4873113482.09.MZZZZZZZ_.jpg" 
     313  ;; 
     314  ;; test pattern: 
     315  ;;   (amazon-asincode-to-url "4873113482") 
     316  ;; 
     317  (defun amazon-asincode-to-url (asincode) 
     318    (format "http://images.amazon.com/images/P/%s.09.MZZZZZZZ_.jpg" asincode)) 
     319 
    307320  (defun code-linep (pos) 
    308321    (save-excursion 
     
    329342        (_image-pattern 
    330343         "\\(##[(]img[ ]+\\)\\([^)]+\\)\\([)]\\)") 
     344        (_amazon-pattern 
     345         "\\(##[(]amazon[ ]+\\)\\([^)]+\\)\\([)]\\)") 
    331346        (_simple-command-pattern 
    332347         "\\(##[(]\\(todo\\|done\\)[)]\\)")) 
     
    360375                                            `( 
    361376                                              (src . ,image-url))))) 
     377             t) 
     378 
     379            ;; ##(amazon asincode) 
     380            (,_amazon-pattern 
     381             2 
     382             (when (not (code-linep (match-beginning 2))) 
     383               (let* ((beg       (match-beginning 1)) 
     384                      (asincode  (match-string-no-properties 2)) 
     385                      (end       (match-end 3))) 
     386                 (compose-region beg 
     387                                 end 
     388                                 oldtype-image-icon-string) 
     389                 (oldtype-remove-image beg 
     390                                       end) 
     391                 (oldtype-insert-image-file beg 
     392                                            end 
     393                                            `( 
     394                                              (src . ,(amazon-asincode-to-url asincode)))))) 
    362395             t) 
    363396