mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-23 11:30:23 +10:00
Updating Doom Emacs.
This commit is contained in:
@@ -6,33 +6,35 @@
|
||||
(defvar company-pcomplete-available 'unknown)
|
||||
|
||||
(defun company-pcomplete--prefix ()
|
||||
(let* ((pcomplete-stub)
|
||||
pcomplete-seen
|
||||
pcomplete-norm-func
|
||||
pcomplete-args
|
||||
pcomplete-last pcomplete-index
|
||||
(pcomplete-autolist pcomplete-autolist)
|
||||
(pcomplete-suffix-list pcomplete-suffix-list))
|
||||
(pcomplete-completions)
|
||||
(buffer-substring (pcomplete-begin) (point))))
|
||||
(with-no-warnings
|
||||
(let* ((pcomplete-stub)
|
||||
pcomplete-seen
|
||||
pcomplete-norm-func
|
||||
pcomplete-args
|
||||
pcomplete-last pcomplete-index
|
||||
(pcomplete-autolist pcomplete-autolist)
|
||||
(pcomplete-suffix-list pcomplete-suffix-list))
|
||||
(pcomplete-completions)
|
||||
(buffer-substring (pcomplete-begin) (point)))))
|
||||
|
||||
(defun company-pcomplete--candidates ()
|
||||
(let* ((pcomplete-stub)
|
||||
(pcomplete-show-list t)
|
||||
pcomplete-seen pcomplete-norm-func
|
||||
pcomplete-args pcomplete-last pcomplete-index
|
||||
(pcomplete-autolist pcomplete-autolist)
|
||||
(pcomplete-suffix-list pcomplete-suffix-list)
|
||||
(candidates (pcomplete-completions))
|
||||
(prefix (buffer-substring (pcomplete-begin) (point)))
|
||||
;; Collect all possible completions for the current stub
|
||||
(cnds (all-completions pcomplete-stub candidates))
|
||||
(bnds (completion-boundaries pcomplete-stub candidates nil ""))
|
||||
(skip (- (length pcomplete-stub) (car bnds))))
|
||||
;; Replace the stub at the beginning of each candidate by the prefix
|
||||
(mapcar (lambda (cand)
|
||||
(concat prefix (substring cand skip)))
|
||||
cnds)))
|
||||
(with-no-warnings
|
||||
(let* ((pcomplete-stub)
|
||||
(pcomplete-show-list t)
|
||||
pcomplete-seen pcomplete-norm-func
|
||||
pcomplete-args pcomplete-last pcomplete-index
|
||||
(pcomplete-autolist pcomplete-autolist)
|
||||
(pcomplete-suffix-list pcomplete-suffix-list)
|
||||
(candidates (pcomplete-completions))
|
||||
(prefix (buffer-substring (pcomplete-begin) (point)))
|
||||
;; Collect all possible completions for the current stub
|
||||
(cnds (all-completions pcomplete-stub candidates))
|
||||
(bnds (completion-boundaries pcomplete-stub candidates nil ""))
|
||||
(skip (- (length pcomplete-stub) (car bnds))))
|
||||
;; Replace the stub at the beginning of each candidate by the prefix
|
||||
(mapcar (lambda (cand)
|
||||
(concat prefix (substring cand skip)))
|
||||
cnds))))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-pcomplete-available ()
|
||||
|
||||
@@ -21,13 +21,15 @@
|
||||
t))
|
||||
|
||||
(defun +eshell--bury-buffer (&optional dedicated-p)
|
||||
(unless (switch-to-prev-buffer nil 'bury)
|
||||
(switch-to-buffer (doom-fallback-buffer)))
|
||||
(when (eq major-mode 'eshell-mode)
|
||||
(switch-to-buffer (doom-fallback-buffer)))
|
||||
(when +eshell-enable-new-shell-on-split
|
||||
(when-let (win (get-buffer-window (+eshell/here)))
|
||||
(set-window-dedicated-p win dedicated-p))))
|
||||
(let ((directory default-directory))
|
||||
(unless (switch-to-prev-buffer nil 'bury)
|
||||
(switch-to-buffer (doom-fallback-buffer)))
|
||||
(when (eq major-mode 'eshell-mode)
|
||||
(switch-to-buffer (doom-fallback-buffer)))
|
||||
(when +eshell-enable-new-shell-on-split
|
||||
(let ((default-directory directory))
|
||||
(when-let (win (get-buffer-window (+eshell/here t)))
|
||||
(set-window-dedicated-p win dedicated-p))))))
|
||||
|
||||
(defun +eshell--setup-window (window &optional flag)
|
||||
(when (window-live-p window)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"TODO"
|
||||
(interactive "<fsh><!>")
|
||||
(let ((buffer (+eshell-last-buffer))
|
||||
(command (+evil-resolve-vim-path-a command)))
|
||||
(command (+evil-replace-filename-modifiers-a command)))
|
||||
(cond (buffer
|
||||
(select-window (get-buffer-window buffer))
|
||||
(+eshell-run-command command buffer))
|
||||
|
||||
@@ -12,11 +12,16 @@
|
||||
|
||||
|
||||
(defun +eshell--current-git-branch ()
|
||||
;; TODO Refactor me
|
||||
(cl-destructuring-bind (status . output)
|
||||
(doom-call-process "git" "name-rev" "--name-only" "HEAD")
|
||||
(doom-call-process "git" "symbolic-ref" "-q" "--short" "HEAD")
|
||||
(if (equal status 0)
|
||||
(format " [%s]" output)
|
||||
"")))
|
||||
(cl-destructuring-bind (status . output)
|
||||
(doom-call-process "git" "describe" "--all" "--always" "HEAD")
|
||||
(if (equal status 0)
|
||||
(format " [%s]" output)
|
||||
"")))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +eshell-default-prompt-fn ()
|
||||
|
||||
Reference in New Issue
Block a user