org-modeの M-return 押下時の挙動が気持ち悪かったので
先日 org-modeを最新の安定版(8.2.2)にしたところ、下記、リンクの方と同じ現象に戸惑いました。
[O] possible org-insert-heading bug?
M-return して開いちゃやーよのところが開いてしまいます。
ということで以下のコードをinit.elに追加しました。
これで一安心。
;; カーソル位置のステータスを取得する関数 ;; 返り値 :item, :headline, :headline-stars (defun org-position-status(context-list) (if (not (cdr context-list)) ;; context-list の末尾に到達 (caar context-list) (org-position-status (cdr context-list)))) (add-hook 'org-mode-hook (lambda () (local-set-key (kbd "<M-return>") (lambda () (interactive) (if (not (eq (org-position-status (org-context)) :item)) (progn (org-insert-heading-after-current) (insert (format "%s" "TODO [/] "))) (org-insert-heading))))))