2024-10-01 (Tue)
- 職場健康診断なので朝食を取らずに出かける。
- 妻はボランティア活動で上野へ。
- 天気予報は雨だが、降ってないので最寄り駅まで歩く。霧雨のような雨が途中で少し降った。
- 朝食と昼食用に、サミットで、サンドイッチと三色マグロ丼を買う。
- 健康診断は30分くらいで終了。
- 早めに帰宅。
- 夕方ジム。あまり無理をしない。
- 夕食は黒酢の酢豚。
notmuchの整備はほぼ終了。 mbsync でメールを取ってきて、 notmuch new でインデックスを付け、受信箱を表示するという手順を毎回やるのは面倒なので、そこを自動化する関数を書く。
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; my_fetch_and_show_mail ;; (defun my_fetch_and_show_mail () "execute mbsync -a, notmuch new, and show unread messages in notmuch" (interactive) (shell-command-to-string "mbsync -a") ;メールを取ってきて (shell-command-to-string "notmuch new") ;tagを付けて ;; (message "%s" (shell-command-to-string "notmuch count tag:unread")) ;未読数をミニバッファに表示 (notmuch-search "tag:unread") ;未読メールを表示する )
emacsが起動したら、org-agendaとnotmuchとeshellが三つのタブで開いていて欲しい。ちょっと調べたら、簡単にできることがわかった。こんな感じで、開くタブで実行するコマンドを指定してから、 tab-new でタブを開いていくだけ。emacs27.1から実装されているらしい。しかしもう少しスマートにできないものか。
(setq tab-bar-new-tab-choice 'eshell) (tab-new) (setq tab-bar-new-tab-choice 'notmuch) (tab-new) (setq tab-bar-new-tab-choice 'org-agenda-list) (tab-new) (setq tab-bar-new-tab-choice "*scratch*") ;手動で新しいタブを開くときは*scratch*を開く
emacsのtab-modeの整備。ポイントはキー操作か。今のところの割り当て。コマンドキー+矢印キーで、タブの移動と開閉ができるようにした。あと、コマンドキー+リターンキーで、開いているタブのリストを表示して選択できる。
("s-<right>" . tab-next) ("s-<left>" . tab-previous) ("s-<up>" . tab-new) ("s-<down>" . tab-close) ("s-b" . switch-to-buffer-other-tab) ("s-n" . tab-new) ("s-o" . tab-next) ("s-w" . tab-close) ("s-<return>" . tab-switch)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; my/mailcheck.el ;; (defun my/mailcheck () "show unread mails if any" (interactive) (shell-command-to-string "mbsync sakura") (shell-command-to-string "notmuch new") (setq mails (substring (shell-command-to-string "notmuch count tag:unread") 0 -1)) (if (equal "0" mails) (message "No mail") (notmuch-search "tag:unread") (message "%s unread" mails) ) )
:unfixed: というタグを付けて予定を記録する。通常のagenda-viewの下に、unfixed todoを表示するように、org-agenda-custom-commandsをセット。
(setq org-agenda-custom-commands '(("A" "my Agenda view" ((agenda "") (tags "unfixed")))))
このcustom-commandをinit.elから呼び出すには、以下のようにする。
(org-agenda nil "A")