]> git.earman.xyz Git - emacsinit.git/commitdiff
Make running fn in new frame a macro, new org bind
authorrearman <rearman@r717.net>
Thu, 2 Oct 2025 14:41:43 +0000 (10:41 -0400)
committerrearman <rearman@r717.net>
Thu, 2 Oct 2025 14:41:43 +0000 (10:41 -0400)
Plain org agenda in new frame now on "S-<f6>".  New macro
're/open-with-new-frame' to make those bindings easier.

re/re-editing-defuns.el
re/re-howm-defuns.el
re/re-org-defuns.el
re/re-packages.el
re/re-repl-defuns.el

index 9aafac9ef16c3080c67ec42838cfa5de71ce3ade..3c77d5149c4d1da98c27d0aa294e6d1d47ca2180 100644 (file)
@@ -184,5 +184,11 @@ Start from bottom if given a negative line number."
        (forward-line (1- line-number))))
     (buffer-substring-no-properties (line-beginning-position) (line-end-position))))
 
+(defmacro re/open-with-new-frame (frname function)
+  "Run the function in its own named frame."
+  `(progn
+     (select-frame (make-frame '((name . ,(eval frname)))))
+     (call-interactively ,function)))
+
 (provide 're-editing-defuns)
 ;;; re-editing-defuns.el ends here
index 852ec501680f94bdb55c9c08f75f139dc6f0b24c..1126a4affb830adca1e014f13bbc21d0864a0bfd 100644 (file)
@@ -6,8 +6,7 @@
 (defun re/howm-menu-new-frame (&optional arg)
   "Show the howm menu in a new frame"
   (interactive "P")
-  (select-frame (make-frame '((name . "HOWM"))))
-  (funcall #'howm-menu))
+  (re/open-with-new-frame "HOWM" #'howm-menu))
 
 (defun re/howm-create-keyword ()
   "Reads a keyword from the minibuffer and appends it to the keywords file."
index 1fe9c92156d459cf58aeeda5fd0887a6721806d9..12e49c600ac4973e20efdb886d4a02c530955d0d 100644 (file)
   (interactive "P")
   (org-agenda arg "a"))
 
+(defun re/org-agenda-new-frame (&optional arg)
+  "Show the main agenda in a new frame"
+  (interactive "P")
+  (re/open-with-new-frame "ORG" #'re/org-show-agenda))
+
 (defun re/org-agenda-custom-new-frame (&optional arg)
   "Show my custom agenda in a new frame"
   (interactive "P")
-  (select-frame (make-frame '((name . "ORG"))))
-  (funcall #'re/org-agenda-show-custom))
+  (re/open-with-new-frame "ORG" #'re/org-agenda-show-custom))
 
 (defun re/org-auto-generate-ids-in-file ()
   "Add ID properties to all headlines in the current
index 08d8af9d12908160445ad39c9b08096cd397c817..62b340b58d18bffda676540827b7d390ae01a765 100644 (file)
    ("C-c c" . org-capture)
    ("C-c b" . org-switchb)
    ("<f6>" . re/org-show-agenda)
+   ("S-<f6>" . re/org-agenda-new-frame)
    ("<f8>" . re/org-agenda-show-custom)
    ("S-<f8>" . re/org-agenda-custom-new-frame)
    :map
   (add-hook 'after-save-hook 'howm-mode-set-buffer-name)
   (add-hook 'howm-mode-hook 'howm-mode-set-buffer-name)
   :bind
-  (("S-<f6>" . howm-menu)
+  (
+   ;; ("S-<f6>" . howm-menu)
    ;; ("S-<f8>" . re/howm-menu-new-frame)
    :map howm-mode-map
    ("C-c , k" . re/howm-create-keyword)))
index b0462b2f485def8e1caae2934030bd859bab2794..df97458a028765b166d441c81484c10340209810 100644 (file)
@@ -59,8 +59,7 @@ Stolen from https://depp.brause.cc/dotemacs"
 (defun re/sly-repl-new-frame (&optional arg)
   "Start a SLY repl in a new frame."
   (interactive "P")
-  (select-frame (make-frame '((name . "SLY"))))
-  (call-interactively 'sly))
+  (re/open-with-new-frame "SLY" #'sly))
 
 (defun re/sly-quit-current-lisp ()
   "Quit the current lisp repl connection without prompting."