• R/O
  • SSH
  • HTTPS

predoc: コミット


コミットメタ情報

リビジョン132 (tree)
日時2007-09-16 11:58:36
作者kiyoka

ログメッセージ

(メッセージはありません)

変更サマリ

差分

--- predoc/trunk/src/predoc-mode.el (revision 131)
+++ predoc/trunk/src/predoc-mode.el (revision 132)
@@ -31,6 +31,7 @@
3131 ;; [0.9.4]
3232 ;; 1. Fixed some bugs.
3333 ;; 2. Added predoc-open-alink() function ( and bind to C-m key )
34+;; 3. Supported "http://host/path/of/contents... " string convert into `a' tag. ( necessary to install emacs-w3m )
3435 ;;
3536 ;; [0.9.3]
3637 ;; 1. Added costomize variable `predoc-curl-program'
@@ -404,9 +405,10 @@
404405 predoc-image-prefix-list
405406 "\\|")
406407 "\\)"))
408+ (_url-pattern
409+ "\\(http://[^\t ]+\\|.+html?\\)")
407410 (_url_file-pattern
408411 "\\(http://[^\t ]+\\|.+html?\\)[\t ]+\\([^\t ]+\\)"))
409-
410412 (let ((cur (point))
411413 (str (buffer-substring-no-properties (point) (point-at-eol))))
412414 (cond
@@ -466,7 +468,17 @@
466468 (delete-region (match-beginning 1) (match-end 2))
467469 (goto-char (match-beginning 1))
468470 (insert (format "<a href=\"%s\" />%s</a>" url str))))
469- ;; No match
471+ ;; http://host/path/of/contents...
472+ ((string-match (concat "^" _url-pattern) str)
473+ (re-search-forward _url-pattern (point-at-eol) t)
474+ (if (boundp 'w3m-version)
475+ (let* ((url (match-string 1))
476+ (title (or (w3m-arrived-title url)
477+ "NoTitle")))
478+ (delete-region (match-beginning 1) (match-end 1))
479+ (goto-char (match-beginning 1))
480+ (insert (format "<a href=\"%s\" />%s</a>" url title)))
481+ (message "Predoc: Please install emacs-w3m.")))
470482 (t
471483 (message "Predoc: <a> link format is URL_or_FILENAME STRING' . "))))))
472484
@@ -518,4 +530,4 @@
518530 (add-hook 'sgml-mode-hook 'predoc-mode-hookfunc)
519531
520532 (provide 'predoc)
521-;; predoc.el ends here
533+;; predoc-mode.el ends here
旧リポジトリブラウザで表示