(progn (global-set-key "\C-j" 'sato-execute-hyperlink-in-this-line) (defun sato-execute-hyperlink-in-this-line () "" (interactive) (let* ( ;; (a17 (progn (find-file "test") (goto-char 1))) (a1 (sato-get-hyperlink-in-this-line)) (a6 (buffer-name)) (a2 (replace-in-string a1 "/" "\\")) (a3 (concat "start " a2)) (a19 ;; dir_name "c:/tmp/") (a10 (if (file-exists-p a19) nil (make-directory a19 t))) (a12 (make-temp-name "")) (a18 (concat a12 ".bat")) (a9 (list a3) ;; command_list ) (a8 (concat a19 a18)) (a11 (progn (find-file a8) (mapcar '(lambda (a) (insert a "\n")) a9) (basic-save-buffer) (kill-buffer (current-buffer)) )) (a13 (generate-new-buffer (concat "*command_" a12 "*"))) (a15 (switch-to-buffer a6)) (a22 (progn (call-process a8) (delete-file a8) )) ) ;; ) ) (defun sato-get-hyperlink-in-this-line () "" (interactive) (let* ( ;; (a4 (progn (find-file "test") (goto-line 1))) (a136 (point)) (a1 (progn (end-of-line) (point))) (a138 (beginning-of-line)) (a23 (re-search-forward "\\(\\(http\\|ftp\\|https\\)://[^ \n}]*\\)" a1 t)) (a24 (if a23 (match-string 1) (let* ( (a138 (beginning-of-line)) (a5 (re-search-forward "[{]" a1 t)) (a6 (if (not a5) (error "There is no hyperlink in this line."))) (a7 (progn (goto-char a1) (re-search-backward "[{]" nil t))) (a8 (re-search-forward "[}]" nil t)) (a9 (if (not (and a7 a8)) (error "No hyperlink exists in this line.") )) (a44 (+ 1 a7)) (a46 (- a8 1)) (a10 (buffer-substring a44 a46)) (a11 (replace-in-string a10 "\\([ ]\\|\n\\)" "")) ) ;; a11 ) )) (a140 (goto-char a136)) ) ;; a24 )) (defun replace-in-string (str regexp newtext) "2012/01/16" (interactive) (let* ( (a1 str ;; a10 ;; "a b" ;; "a b" ;;"abyoabc" ) (a2 regexp ;; "\\([ ]\\|\n\\)" ;;"ab" ) (a3 newtext ;; "" ;; "cd" ;;"d" ) (a4 0) (a5 a1) (a12) (a15 (list)) (a18 (length a3)) ) ;; (while (string-match a2 a5 a4) (let* ( (a11 (match-beginning 0)) (a13 (match-end 0)) (a8 (setq a4 (+ a11 a18))) (a14 ( concat ;;list (substring a5 0 a11) a3 (substring a5 a13) )) ) ;; (setq a5 a14) ) ) a5 ) ) )