(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
(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."
(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
("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)))
(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."