Disable buffer switch preview on WM mode
This commit is contained in:
parent
7b53b776ad
commit
26c1a6074d
|
@ -150,6 +150,11 @@ match all of the components in any order."
|
||||||
(advice-add #'register-preview :override #'consult-register-window)
|
(advice-add #'register-preview :override #'consult-register-window)
|
||||||
|
|
||||||
:config
|
:config
|
||||||
|
(when-wm
|
||||||
|
(consult-customize
|
||||||
|
;; Set preview for `consult-buffer' to key `M-.'
|
||||||
|
consult-buffer :preview-key nil))
|
||||||
|
|
||||||
;; For some reason `consult's autoloads do not work
|
;; For some reason `consult's autoloads do not work
|
||||||
(require 'consult-xref)
|
(require 'consult-xref)
|
||||||
;; Use Consult to select xref locations with preview
|
;; Use Consult to select xref locations with preview
|
||||||
|
|
|
@ -97,29 +97,6 @@ with is the buffer."
|
||||||
,@form))
|
,@form))
|
||||||
|
|
||||||
|
|
||||||
;; TODO: A good candidate for an inline function
|
|
||||||
(defun find-value-for (lst key)
|
|
||||||
"Return the value of the given KEY in the given LST.
|
|
||||||
For example for a list like (list :x 4 :y 5) we can find the value of
|
|
||||||
`:x' by doing `(get-value-for lst :x)'."
|
|
||||||
(let ((pairs (seq-partition lst 2)))
|
|
||||||
(let ((pair (assq key pairs)))
|
|
||||||
(when pair
|
|
||||||
(cadr pair)))))
|
|
||||||
|
|
||||||
|
|
||||||
(defun comp (&rest fns)
|
|
||||||
"Compose the given list of FNS into one function that accepts multiple values.
|
|
||||||
For example:
|
|
||||||
(funcall (compose (lambda (x) (+ 1 x)) (lambda (x) (* x s))) 5)
|
|
||||||
or
|
|
||||||
(funcall (compose #'some-fn #'message) some-value)"
|
|
||||||
(lambda (&rest values)
|
|
||||||
(cl-reduce 'funcall (butlast fns)
|
|
||||||
:from-end t
|
|
||||||
:initial-value (apply (car (last fns)) values))))
|
|
||||||
|
|
||||||
|
|
||||||
(defun path-join (&rest paths)
|
(defun path-join (&rest paths)
|
||||||
"Join the given PATHS."
|
"Join the given PATHS."
|
||||||
(apply #'concat
|
(apply #'concat
|
||||||
|
@ -157,20 +134,6 @@ last item in second form, etc."
|
||||||
(:else `(->> (->> ,x ,form) ,@more))))
|
(:else `(->> (->> ,x ,form) ,@more))))
|
||||||
|
|
||||||
|
|
||||||
(defun load-user-config (file)
|
|
||||||
"Load the given FILE as user config file."
|
|
||||||
(if (file-exists-p file)
|
|
||||||
(load-file file)))
|
|
||||||
|
|
||||||
|
|
||||||
(defmacro autoload-cube (fn file docstring &optional interactive)
|
|
||||||
"A wrapper for autloading FN at FILE with the given DOCSTRING.
|
|
||||||
This macro looks inside of the cubes directories. If the INTERACTIVE param
|
|
||||||
is non-nil value it means that the function can be called interactively."
|
|
||||||
`(autoload ,fn (expand-file-name (format "lisp/fg42/cubes/%s" ,file) fg42-home)
|
|
||||||
,docstring ,interactive))
|
|
||||||
|
|
||||||
|
|
||||||
(defmacro when-wm (&rest body)
|
(defmacro when-wm (&rest body)
|
||||||
"Run the BODY only if in wm mode."
|
"Run the BODY only if in wm mode."
|
||||||
(if (string= (getenv "FG42_WM") "true")
|
(if (string= (getenv "FG42_WM") "true")
|
||||||
|
@ -184,18 +147,6 @@ is non-nil value it means that the function can be called interactively."
|
||||||
nil))
|
nil))
|
||||||
|
|
||||||
|
|
||||||
(defmacro fg42/log (tag args)
|
|
||||||
"If the debug is enabled log the give ARGS."
|
|
||||||
(if fg42/debug-p
|
|
||||||
`(message "[%s]: %s" ,tag (apply #'format ,args))
|
|
||||||
nil))
|
|
||||||
|
|
||||||
|
|
||||||
(defmacro fg42/info (&rest args)
|
|
||||||
"If the debug is enabled log the give ARGS."
|
|
||||||
(fg42/log "INFO" args))
|
|
||||||
|
|
||||||
|
|
||||||
(defun get-base16-color-or (color-name default)
|
(defun get-base16-color-or (color-name default)
|
||||||
"Return the color for COLOR-NAME if a base16 theme is loade otherwise DEFAULT."
|
"Return the color for COLOR-NAME if a base16 theme is loade otherwise DEFAULT."
|
||||||
(let* ((theme (car custom-enabled-themes))
|
(let* ((theme (car custom-enabled-themes))
|
||||||
|
|
Loading…
Reference in New Issue