Changeset 14729 for lang/gauche
- Timestamp:
- 06/28/08 01:23:18 (5 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/oldtype-mode.el
r13658 r14729 29 29 ;; 30 30 ;; ChangeLog: 31 ;; [0.0.6] 32 ;; 1. Improved URL to [URL|TITLE] conversion feature. ( C-c C-c key ) 33 ;; oldtype-mode.el fetches remote title page and insert TITLE. 34 ;; 31 35 ;; [0.0.5] 32 36 ;; 1. Fixed bug: [return] key breaks japanese input method UI. … … 599 603 (newline)))) 600 604 605 606 ;; 607 ;; [fetch command] 608 ;; w3m -no-graph -halfdump -o ext_halfdump=1 -o strict_iso2022=0 -o fix_width_conv=1 URL 609 ;; | awk '-F<' '/title_alt/ { print $2; }' | tail -1 | awk '-F"' '{ print $2; }' 610 ;; 611 (defun oldtype-fetch-html-title (url) 612 (cond 613 ((string-match "http://" url) 614 (with-temp-buffer 615 (shell-command 616 (concat 617 (format "w3m -no-graph -halfdump -o ext_halfdump=1 -o strict_iso2022=0 -o fix_width_conv=1 \'%s\' |" url) 618 "awk \'-F\<\' \'/title_alt/ { print $2; }\' |" 619 "tail -1 |" 620 "awk \'-F\"\' \'{ print $2; }\'") 621 (current-buffer)) 622 (replace-string "[" "<" nil (point-min) (point-max)) 623 (replace-string "]" ">" nil (point-min) (point-max)) 624 (buffer-substring-no-properties (point-min) (point-max)))) 625 (t 626 "No Title"))) 627 628 601 629 (defun oldtype-mode-hookfunc () 602 630 … … 649 677 (insert "##(")) 650 678 (insert str) 651 (insert end)679 xo (insert end) 652 680 (goto-char pos)))) 653 681 ((equal ?< (char-after (point))) … … 673 701 (let* ((asin (match-string 2)) 674 702 (url (match-string 0)) 675 (title (if (boundp 'w3m-version) 676 (or (w3m-arrived-title url) 677 "NoTitle") 678 "NoTitle"))) 679 (delete-region (match-beginning 1) (match-end 3)) 680 (goto-char (match-beginning 1)) 703 (s (match-beginning 1)) 704 (e (match-end 3)) 705 (title (oldtype-fetch-html-title url))) 706 (delete-region s e) 707 (goto-char s) 681 708 (insert (format "##(amazon %s) %s" asin title)))) 682 709 ;; http://www.youtube.com/watch ... youtube-command … … 685 712 (let* ((video (match-string 2)) 686 713 (url (match-string 0)) 687 (title (if (boundp 'w3m-version) 688 (or (w3m-arrived-title url) 689 "NoTitle") 690 "NoTitle"))) 691 (delete-region (match-beginning 1) (match-end 3)) 692 (goto-char (match-beginning 1)) 714 (s (match-beginning 1)) 715 (e (match-end 3)) 716 (title (oldtype-fetch-html-title url))) 717 (delete-region s e) 718 (goto-char s) 693 719 (insert (format "##(youtube %s) %s" video title)))) 694 720 ;; http://host/path/of/contents... anchor-keyword 695 721 ((string-match (concat "^" _url_file-pattern) str) 696 722 (re-search-forward _url_file-pattern (point-at-eol) t) 697 (if (boundp 'w3m-version) 698 (let* ((url (match-string 1)) 699 (title (or (w3m-arrived-title url) 700 "NoTitle"))) 701 (delete-region (match-beginning 1) (match-end 1)) 702 (goto-char (match-beginning 1)) 703 (insert (format "[[%s|%s]]" url title))) 704 (message "OldType: Please install emacs-w3m."))) 723 (let* ((url (match-string 1)) 724 (s (match-beginning 1)) 725 (e (match-end 1)) 726 (title (oldtype-fetch-html-title url))) 727 (delete-region s e) 728 (goto-char s) 729 (insert (format "[[%s|%s]]" url title)))) 705 730 (t 706 731 (message "OldType: Please move cursor to [[URL|Name]] or [[WikiName]] *.png or ##(... ) keywword.' "))))))
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)