« ^ »

org-captureでhook実行時にカレントバッファがどのバッファなのかを確認する

所要時間: 約 1分

次のようなコードで確認した

(add-hook 'org-capture-prepare-finalize-hook
	  (lambda ()
	    (message (format "prepare: %s"
			     (buffer-name (current-buffer))))))
 
(add-hook 'org-capture-before-finalize-hook
	  (lambda ()
	    (message (format "before: %s"
			     (buffer-name (current-buffer))))))
 

(add-hook 'org-capture-after-finalize-hook
	  (lambda ()
	    (message (format "after: %s"
			     (buffer-name (current-buffer))))))

結果

prepare: CAPTURE-.notes
before: CAPTURE-.notes
Wrote /Users/sximada/.notes
after: current.org