(call-interactively cmd)
(user-error "%s is undefined" (key-description key)))))
+(defun project--other-place-prefix (place &optional extra-keymap)
+ (cl-assert (member place '(window frame tab)))
+ (prefix-command-preserve-state)
+ (let ((inhibit-message t)) (funcall (intern (format "other-%s-prefix" place))))
+ (message "Display next project command buffer in a new %s..." place)
+ ;; Should return exitfun from set-transient-map
+ (set-transient-map (if extra-keymap
+ (make-composed-keymap project-prefix-map
+ extra-keymap)
+ project-prefix-map)))
+
;;;###autoload
(defun project-other-window-command ()
"Run project command, displaying resultant buffer in another window.
\\{project-prefix-map}
\\{project-other-window-map}"
(interactive)
- (project--other-place-command '((display-buffer-pop-up-window)
- (inhibit-same-window . t))
- project-other-window-map))
+ (if (< emacs-major-version 30)
+ (project--other-place-command '((display-buffer-pop-up-window)
+ (inhibit-same-window . t))
+ project-other-window-map)
+ (project--other-place-prefix 'window project-other-window-map)))
;;;###autoload (define-key ctl-x-4-map "p" #'project-other-window-command)
\\{project-prefix-map}
\\{project-other-frame-map}"
(interactive)
- (project--other-place-command '((display-buffer-pop-up-frame))
- project-other-frame-map))
+ (if (< emacs-major-version 30)
+ (project--other-place-command '((display-buffer-pop-up-frame))
+ project-other-frame-map)
+ (project--other-place-prefix 'frame project-other-frame-map)))
;;;###autoload (define-key ctl-x-5-map "p" #'project-other-frame-command)
\\{project-prefix-map}"
(interactive)
- (project--other-place-command '((display-buffer-in-new-tab))))
+ (if (< emacs-major-version 30)
+ (project--other-place-command '((display-buffer-in-new-tab)))
+ (project--other-place-prefix 'tab)))
;;;###autoload
(when (bound-and-true-p tab-prefix-map)