RE:simple-hatena-mode で編集中のエントリをブラウザで表示する
simple-hatena-mode で編集中のエントリをブラウザで表示する - 理系学生日記
グループに対応していなかったので,グループ日記を書いてるときもきちんと開けるのを書いてみた.
あと,syou6162/local_hatena_search · GitHubのローカルで動かすはてダにも対応
(defun simple-hatena-browse-current-buffer (&optional arg) (interactive "P") (let ((regex ;ref: simple-hatena-mode.el "/\\([^/]+\\)/\\(diary\\|group\\)/\\([^/]+\\)?/?\\([0-9][0-9][0-9][0-9]\\)-\\([01][0-9]\\)-\\([0-3][0-9]\\)\.txt")) (if (string-match regex buffer-file-name) (let* ((file (buffer-file-name)) (hatena-id (match-string 1 file)) (root-url (if (consp arg) "http://localhost:4567/" (if (string= (match-string 2 file) "diary") (concat "http://d.hatena.ne.jp/" hatena-id "/") (format "http://%s.g.hatena.ne.jp/%s/" (match-string 3 file) hatena-id))) ) (url (concat root-url (match-string 4 file) (match-string 5 file) (match-string 6 file)))) (browse-url url))))) (define-key simple-hatena-mode-map (kbd "C-c C-v") 'simple-hatena-browse-current-buffer)
C-u C-c C-vならローカルを,C-c C-vならはて(ダ|グ)を見にいく.
Seeking for my unique color.経由で知った.
syou6162/local_hatena_search · GitHubが便利.id:syou6162++++