Compare commits

...

2 commits

Author SHA1 Message Date
Benson Chu
621ef834f0 NEW ORG CAPTURE BEHAVIOR 2022-12-31 17:16:08 -06:00
Benson Chu
5b3e9af2f9 Move stuff around 2022-12-31 17:15:49 -06:00
4 changed files with 75 additions and 9 deletions

View file

@ -73,6 +73,22 @@
(slot . 6)
(window-width . 80)))
(defun my/is-org-capture-buffer (buffer &optional _rest)
(with-current-buffer buffer
(and (eq major-mode 'org-mode)
org-capture-mode)))
(add-to-list 'display-buffer-alist
`(my/is-org-capture-buffer
display-buffer-in-side-window
(side . right)
(select . t)
(slot . 7)
(window-width . 80)
(window-parameters
. ((no-delete-other-windows . t)
(dedicated . t)))))
;; (defun my/is-org-capture-buffer (buffer &optional _rest)
;; (with-current-buffer buffer
;; org-capture-mode))

View file

@ -659,15 +659,7 @@
:init
(setq org-roam-v2-ack t)
:config
(require 'my-org-roam-logger)
(org-roam-setup)
(setq org-roam-capture-templates
'(("d" "default" plain "%?" :target
(file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
:unnarrowed t)
("t" "tech tips" plain "%?" :target
(file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n#+filetags: techtips\n")
:unnarrowed t)))
(setq org-roam-dailies-directory "daily/")
(setq org-roam-dailies-capture-templates
'(("d" "Journal" entry "* %<%H:%M> %?"
@ -679,7 +671,16 @@
;; :target (file+head+olp "%<%Y-%m-%d>.org"
;; "#+title: %<%Y-%m-%d>\n#+filetags: %<:%Y:%B:>\n"
;; ("Most Important Thing(s)")))
)))
))
(require 'my-org-roam-logger)
(setq org-roam-capture-templates
'(("d" "default" plain "%?" :target
(file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
:unnarrowed t)
("t" "tech tips" plain "%?" :target
(file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n#+filetags: techtips\n")
:unnarrowed t))))
;; (require 'org-roam-protocol)
#+end_src

View file

@ -0,0 +1,47 @@
;;; my-org-capture-shouldnt-mess-windows.el --- -*- lexical-binding: t -*-
;; Copyright (C) 2022 Benson Chu
;; Author: Benson Chu <bensonchu457@gmail.com>
;; Created: [2022-12-31 17:03]
;; This file is not part of GNU Emacs
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;; Code:
(defun my/org-capture-shouldnt-mess-windows (fun &rest args)
(let ((buffer
(save-window-excursion
(apply fun args)
(current-buffer))))
(pop-to-buffer buffer)))
(advice-add #'org-capture
:around
#'my/org-capture-shouldnt-mess-windows)
(defun my/org-capture-finalize-shouldnt-mess-windows (fun &rest args)
(save-window-excursion
(apply fun args)))
(advice-add #'org-capture-finalize
:around
#'my/org-capture-finalize-shouldnt-mess-windows)
(provide 'my-org-capture-shouldnt-mess-windows)
;;; my-org-capture-shouldnt-mess-windows.el ends here

View file

@ -38,6 +38,8 @@
(require 'my-org-capture-templates)
(require 'org-other-additions)
(require 'my-org-capture-shouldnt-mess-windows)
(require 'self-chat-mode)
(provide 'my-org)