Remove obsolete shell popup shortcut
Using `project-shell` as a replacement.
This commit is contained in:
parent
072fd2887b
commit
92ff95b2e6
1
init.el
1
init.el
@ -458,7 +458,6 @@ split horizontally again, but this extra work should not matter much."
|
|||||||
|
|
||||||
(use-package db-utils
|
(use-package db-utils
|
||||||
:commands (endless/fill-or-unfill
|
:commands (endless/fill-or-unfill
|
||||||
db/run-or-hide-shell
|
|
||||||
db/gnus
|
db/gnus
|
||||||
db/org-agenda
|
db/org-agenda
|
||||||
db/scratch
|
db/scratch
|
||||||
|
|||||||
@ -90,42 +90,6 @@ If already in *ansi-term* buffer, bury it."
|
|||||||
(user-error "Cannot open default refile file: file «%s» does not exist" db/org-default-refile-file))
|
(user-error "Cannot open default refile file: file «%s» does not exist" db/org-default-refile-file))
|
||||||
(find-file db/org-default-refile-file))
|
(find-file db/org-default-refile-file))
|
||||||
|
|
||||||
(defun db/run-or-hide-shell (arg)
|
|
||||||
"Opens a shell buffer in new window if not already in one.
|
|
||||||
|
|
||||||
Otherwise, closes the current shell window.
|
|
||||||
|
|
||||||
The buffer's name has to start with “*shell-side*” to be recognized by
|
|
||||||
this function. Otherwise the current buffer is not treated as a shell
|
|
||||||
buffer.
|
|
||||||
|
|
||||||
With ARG, switch to `default-directory' of the current buffer first."
|
|
||||||
(interactive "P")
|
|
||||||
(cl-flet ((change-to-shell ()
|
|
||||||
(if-let ((shell-window (cl-find-if (lambda (window)
|
|
||||||
(with-current-buffer (window-buffer window)
|
|
||||||
(and (derived-mode-p 'shell-mode)
|
|
||||||
(string-match-p "^\\*shell-side\\*" (buffer-name)))))
|
|
||||||
(window-list-1))))
|
|
||||||
(select-window shell-window)
|
|
||||||
(--if-let (display-buffer (shell (get-buffer-create "*shell-side*")))
|
|
||||||
(select-window it)
|
|
||||||
(error "Could not start shell (`display-buffer' returned nil)")))))
|
|
||||||
(if (not arg)
|
|
||||||
;; toggle shell window
|
|
||||||
(if (and (derived-mode-p 'shell-mode)
|
|
||||||
(string-match-p "^\\*shell-side\\*" (buffer-name)))
|
|
||||||
(bury-buffer)
|
|
||||||
(change-to-shell))
|
|
||||||
|
|
||||||
;; unconditionally go to shell, and also change to cwd
|
|
||||||
(let ((current-dir (expand-file-name default-directory)))
|
|
||||||
(change-to-shell)
|
|
||||||
(end-of-line)
|
|
||||||
(comint-kill-input)
|
|
||||||
(insert (format "cd '%s'" current-dir))
|
|
||||||
(comint-send-input)))))
|
|
||||||
|
|
||||||
(defun db/ement-connect ()
|
(defun db/ement-connect ()
|
||||||
"Connect to my matrix account."
|
"Connect to my matrix account."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user