Created
June 30, 2010 11:26
-
-
Save mori-dev/458545 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; iphoneを持っていないので未検証 | |
;; 「[Create new note] で新しいメモを作成&保存した場合は以下のような表示になり、 | |
;; やはり同期を行うまではローカルにのみ存在するメモとなります。」の対処例 | |
;; C-x C-s(save-buffer)でセーブする前に[Sync with server] する例 | |
(defadvice save-buffer (before my-save-buffer activate) | |
(when (equal (buffer-name) "*Simplenote*") | |
(simplenote-sync-notes) | |
(simplenote-browser-refresh)) | |
;; (when (equal (buffer-name) " *hoge*") | |
;; ...) | |
) | |
;; 概略このようなかんじで、save-buffer のbeforeアドバイスとして、 | |
;; それぞれの処理のためのバッファ名でチェックしたうえで、行ないたい処理を書くといいはずだとおもいます。 | |
;; 「それぞれの処理のためのバッファ名」とは、"*Simplenote*"や" *simplenote-temp*"をさします。 | |
;; 追記 | |
;; アドバイスより before-save-hook のほうが素直かもしれません | |
(add-hook 'before-save-hook | |
(lambda() | |
(when (equal (buffer-name) "*Simplenote*") | |
(simplenote-sync-notes) | |
(simplenote-browser-refresh)) | |
;; (when (equal (buffer-name) " *hoge*") | |
;; ...) | |
)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment