Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.elc
2 changes: 1 addition & 1 deletion config.el
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ Spacemacs use spacemacs-.*-mode-map, we here use original mode map."
"ESC" nil
"M-s" nil
)
(compleseus/init-consult-yasnippet )()
(compleseus/init-consult-yasnippet)
(compleseus/init-embark)
(compleseus/init-embark-consult)
(compleseus/init-orderless)
Expand Down
36 changes: 16 additions & 20 deletions core/core-dotspacemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -748,33 +748,29 @@ Informs users of error and prompts for default editing style for use during
error recovery."
(load (concat dotspacemacs-template-directory
".spacemacs.template"))
(defadvice dotspacemacs/layers
(after error-recover-preserve-packages activate)
(progn
(setq-default dotspacemacs-install-packages 'used-but-keep-unused)
(ad-disable-advice 'dotspacemacs/layers 'after
'error-recover-preserve-packages)
(ad-activate 'dotspacemacs/layers)))
(defadvice dotspacemacs/init
(after error-recover-prompt-for-style activate)
(progn
(setq-default dotspacemacs-editing-style
(intern
(ido-completing-read
(format
(concat
"Spacemacs encountered an error while "
"loading your `%s' file.\n"
(advice-add 'dotspacemacs/layers :after
(lambda (&rest _args)
(setq-default dotspacemacs-install-packages 'used-but-keep-unused)
(advice-remove 'dotspacemacs/layers
'error-recover-preserve-packages)))
(advice-add 'dotspacemacs/init :after
(lambda (&rest _args)
(setq-default dotspacemacs-editing-style
(intern
(ido-completing-read
(format
(concat
"Spacemacs encountered an error while "
"loading your `%s' file.\n"
"Pick your editing style for recovery "
"(use left and right arrows): ")
dotspacemacs-filepath)
'(("vim" vim)
("emacs" emacs)
("hybrid" hybrid))
nil t nil nil 'vim)))
(ad-disable-advice 'dotspacemacs/init 'after
'error-recover-prompt-for-style)
(ad-activate 'dotspacemacs/init))))
(advice-remove 'dotspacemacs/init
'error-recover-prompt-for-style))))

(defun dotspacemacs//test-dotspacemacs/layers ()
"Tests for `dotspacemacs/layers'"
Expand Down
4 changes: 2 additions & 2 deletions layer/shell/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"Open the default shell in a popup."
(interactive)
(let ((shell (cl-case shell-default-shell
('multi-term 'multiterm)
('shell 'inferior-shell)
(multi-term 'multiterm)
(shell 'inferior-shell)
(t shell-default-shell))))
(call-interactively (intern (format "spacemacs/shell-pop-%S" shell)))))

Expand Down
10 changes: 5 additions & 5 deletions layer/spacemacs-defaults/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -756,11 +756,11 @@ then apply that major mode to the new buffer."
(interactive)
(let ((newbuf (generate-new-buffer "untitled")))
(cl-case split
('left (split-window-horizontally))
('below (spacemacs/split-window-vertically-and-switch))
('above (split-window-vertically))
('right (spacemacs/split-window-horizontally-and-switch))
('frame (select-frame (make-frame))))
(left (split-window-horizontally))
(below (spacemacs/split-window-vertically-and-switch))
(above (split-window-vertically))
(right (spacemacs/split-window-horizontally-and-switch))
(frame (select-frame (make-frame))))
;; Prompt to save on `save-some-buffers' with positive PRED
(with-current-buffer newbuf
(setq-local buffer-offer-save t)
Expand Down
21 changes: 12 additions & 9 deletions layer/spacemacs-editing/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@
(require 'evil-iedit-state) ;; for "e" key
;; add search capability to expand-region
(when (featurep 'helm-ag)
(defadvice er/prepare-for-more-expansions-internal
(around helm-ag/prepare-for-more-expansions-internal activate)
ad-do-it
(let ((new-msg (concat (car ad-return-value)
", / to search in project, "
"f to search in files, "
"b to search in opened buffers"))
(new-bindings (cdr ad-return-value)))
(defun spacemacs//er-prepare-more-expansions-advice (orig-func &rest args)
"Add helm-ag search capabilities to expand-region."
(let* ((result (apply orig-func args))
(new-msg (concat (car result)
", / to search in project, "
"f to search in files, "
"b to search in opened buffers"))
(new-bindings (cdr result)))
(cl-pushnew
'("/" (lambda ()
(call-interactively
Expand All @@ -139,7 +139,10 @@
(call-interactively
'spacemacs/helm-buffers-smart-do-search-region-or-symbol)))
new-bindings)
(setq ad-return-value (cons new-msg new-bindings)))))
(cons new-msg new-bindings)))
(advice-add 'er/prepare-for-more-expansions-internal
:around
#'spacemacs//er-prepare-more-expansions-advice))
(setq expand-region-contract-fast-key "V"
expand-region-reset-fast-key "r"))))

Expand Down
32 changes: 17 additions & 15 deletions layer/spacemacs-layouts/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -747,25 +747,27 @@ graphical frames, and one set for terminal frames."
(--zip-with (set-persp-parameter it other persp)
param-names workspace-params)))

(defun spacemacs/load-eyebrowse-for-perspective (type &optional frame)
(defun spacemacs/load-eyebrowse-for-perspective (&rest args)
"Load an eyebrowse workspace according to a perspective's parameters.
FRAME's perspective is the perspective that is considered, defaulting to
the current frame's perspective.
If the perspective doesn't have a workspace, create one."
(when (eq type 'frame)
(let* ((workspace-params (spacemacs//get-persp-workspace (get-frame-persp frame) frame))
(window-configs (nth 0 workspace-params))
(current-slot (nth 1 workspace-params))
(last-slot (nth 2 workspace-params)))
(if window-configs
(progn
(eyebrowse--set 'window-configs window-configs frame)
(eyebrowse--set 'current-slot current-slot frame)
(eyebrowse--set 'last-slot last-slot frame)
(eyebrowse--load-window-config current-slot))
(eyebrowse--set 'window-configs nil frame)
(eyebrowse-init frame)
(spacemacs/save-eyebrowse-for-perspective frame)))))
(let ((type (if args (car args) 'frame))
(frame (if (> (length args) 1) (cadr args) nil)))
(when (eq type 'frame)
(let* ((workspace-params (spacemacs//get-persp-workspace (get-frame-persp frame) frame))
(window-configs (nth 0 workspace-params))
(current-slot (nth 1 workspace-params))
(last-slot (nth 2 workspace-params)))
(if window-configs
(progn
(eyebrowse--set 'window-configs window-configs frame)
(eyebrowse--set 'current-slot current-slot frame)
(eyebrowse--set 'last-slot last-slot frame)
(eyebrowse--load-window-config current-slot))
(eyebrowse--set 'window-configs nil frame)
(eyebrowse-init frame)
(spacemacs/save-eyebrowse-for-perspective frame))))))

(defun spacemacs/load-eyebrowse-after-loading-layout (_state-file _phash persp-names)
"Bridge between `persp-after-load-state-functions' and
Expand Down
5 changes: 3 additions & 2 deletions layer/spacemacs-layouts/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,9 @@
:config
(progn
;; (spacemacs|hide-lighter persp-mode)
(defadvice persp-activate (before spacemacs//save-toggle-layout activate)
(setq spacemacs--last-selected-layout persp-last-persp-name))
(advice-add 'persp-activate :before
(lambda (&rest _args)
(setq spacemacs--last-selected-layout persp-last-persp-name)))
(add-hook 'persp-mode-hook 'spacemacs//layout-autosave)
(advice-add 'persp-load-state-from-file
:before 'spacemacs//layout-wait-for-modeline)
Expand Down
27 changes: 14 additions & 13 deletions layer/spacemacs-navigation/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,12 @@
ahs-back-to-start
ahs-change-range))
(let* ((advice (intern (format "spacemacs/%s" (symbol-name sym)))))
(eval `(defadvice ,sym (around ,advice activate)
(spacemacs/ahs-highlight-now-wrapper)
ad-do-it
(spacemacs/ahs-highlight-now-wrapper)
(setq spacemacs-last-ahs-highlight-p (ahs-highlight-p))))))
(advice-add sym :around
(lambda (orig-fun &rest args)
(spacemacs/ahs-highlight-now-wrapper)
(apply orig-fun args)
(spacemacs/ahs-highlight-now-wrapper)
(setq spacemacs-last-ahs-highlight-p (ahs-highlight-p))))))

;; transient state
(spacemacs|define-transient-state symbol-highlight
Expand Down Expand Up @@ -201,14 +202,14 @@
(progn
;; fixed a weird issue where toggling display does not
;; swtich to text mode
(defadvice doc-view-toggle-display
(around spacemacs/doc-view-toggle-display activate)
(if (eq major-mode 'doc-view-mode)
(progn
ad-do-it
(text-mode)
(doc-view-minor-mode))
ad-do-it)))))
(advice-add 'doc-view-toggle-display :around
(lambda (orig-fun &rest args)
(if (eq major-mode 'doc-view-mode)
(progn
(apply orig-fun args)
(text-mode)
(doc-view-minor-mode))
(apply orig-fun args)))))))

(defun spacemacs-navigation/init-golden-ratio ()
(use-package golden-ratio
Expand Down