yanbe.diff このページをアンテナに追加 RSSフィード

2008-11-21

emacs-w3mで最近開いたURLをanything.elから開く設定

07:21 |  emacs-w3mで最近開いたURLをanything.elから開く設定 - yanbe.diff を含むブックマーク はてなブックマーク -  emacs-w3mで最近開いたURLをanything.elから開く設定 - yanbe.diff  emacs-w3mで最近開いたURLをanything.elから開く設定 - yanbe.diff のブックマークコメント

;;;; Arrived URL history in DataBase
(require 'w3m)

(defun anything-c-source-arrived-url-get-candidates ()
  (let (titles)
    (loop for record in
          (w3m-load-list (expand-file-name ".arrived" w3m-profile-directory))
          do (if (or (string-match anything-pattern (car record))
                     (string-match anything-pattern (or (car (cdr record)) "")))
                 (push (or (car (cdr record)) (car record)) titles))
          finally (return titles))))

(defun anything-c-match-on-arrived-url-history (candidate) t)

(defvar anything-c-source-arrived-url-history
  '((name . "Arrived URL history in DataBase")
    (candidates . (lambda () (anything-c-source-arrived-url-get-candidates)))
    (match . (anything-c-match-on-arrived-url-history))
    (action . (("Goto URL" . (lambda (candidate)
       (if (string-match "http://" candidate)
           (w3m-browse-url candidate)
         (let (urls)
           (loop for record in
             (w3m-load-list (expand-file-name ".arrived" w3m-profile-directory))
             do (if (string-equal candidate (car (cdr record)))
                    (push (car record) urls))
             finally (w3m-browse-url (car urls)))))))))
    (requires-pattern . 3)
    (delayed)
    (volatile)
    ))

上記のコードをanything-config.elに追加した後,

(add-to-list 'anything-sources 'anything-c-source-arrived-url-history)

などとする.

これにより,anything.elで「w3m-emacsで最近訪問したページのURLまたはタイトルの一部」を検索して開くことが出来るようになる.

BobilusBobilus2012/02/23 10:52Imrepsisve brain power at work! Great answer!

okrziekedlokrziekedl2012/02/23 22:13kxJPQp <a href="http://digmlfgvvyuk.com/">digmlfgvvyuk</a>

uowblbduowblbd2012/02/25 22:30TBwdS5 , [url=http://fbbimndvqtoj.com/]fbbimndvqtoj[/url], [link=http://ekhrwtdoafqy.com/]ekhrwtdoafqy[/link], http://nitztfxthurk.com/

vaxenujldzcvaxenujldzc2012/02/29 23:12TniPoB <a href="http://yxmjbjqxkrgl.com/">yxmjbjqxkrgl</a>

ehpdafboehpdafbo2012/03/13 15:08vZJ8Y3 , [url=http://iayvkwvojbwj.com/]iayvkwvojbwj[/url], [link=http://kxfejwxbhrzv.com/]kxfejwxbhrzv[/link], http://lvjdfdnbcrer.com/

トラックバック - http://subtech.g.hatena.ne.jp/y_yanbe/20081121