Fix obsolete (when|if)-let messages in Emacs 26
This commit is contained in:
parent
e168118243
commit
76a4ae459d
40 changed files with 110 additions and 103 deletions
|
@ -53,7 +53,7 @@ Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/"
|
||||||
|
|
||||||
If no project is active, return all buffers."
|
If no project is active, return all buffers."
|
||||||
(let ((buffers (doom-buffer-list)))
|
(let ((buffers (doom-buffer-list)))
|
||||||
(if-let (project-root (if (doom-project-p) (doom-project-root)))
|
(if-let* ((project-root (if (doom-project-p) (doom-project-root))))
|
||||||
(cl-loop for buf in buffers
|
(cl-loop for buf in buffers
|
||||||
if (projectile-project-buffer-p buf project-root)
|
if (projectile-project-buffer-p buf project-root)
|
||||||
collect buf)
|
collect buf)
|
||||||
|
@ -148,7 +148,7 @@ real buffer is:
|
||||||
c) is not a special buffer (its name isn't something like *Help*)
|
c) is not a special buffer (its name isn't something like *Help*)
|
||||||
|
|
||||||
If BUFFER-OR-NAME is omitted or nil, the current buffer is tested."
|
If BUFFER-OR-NAME is omitted or nil, the current buffer is tested."
|
||||||
(when-let (buf (ignore-errors (window-normalize-buffer buffer-or-name)))
|
(when-let* ((buf (ignore-errors (window-normalize-buffer buffer-or-name))))
|
||||||
(or (buffer-local-value 'doom-real-buffer-p buf)
|
(or (buffer-local-value 'doom-real-buffer-p buf)
|
||||||
(run-hook-with-args-until-success 'doom-real-buffer-functions buf)
|
(run-hook-with-args-until-success 'doom-real-buffer-functions buf)
|
||||||
(not (or (doom-popup-p buf)
|
(not (or (doom-popup-p buf)
|
||||||
|
|
|
@ -60,14 +60,14 @@ selection of all minor-modes, active or not."
|
||||||
(interactive)
|
(interactive)
|
||||||
(unless (string-match-p "\\_<GNUTLS\\_>" system-configuration-features)
|
(unless (string-match-p "\\_<GNUTLS\\_>" system-configuration-features)
|
||||||
(warn "gnutls support isn't built into Emacs, there may be problems"))
|
(warn "gnutls support isn't built into Emacs, there may be problems"))
|
||||||
(if-let (bad-hosts
|
(if-let* ((bad-hosts
|
||||||
(cl-loop for bad
|
(cl-loop for bad
|
||||||
in '("https://wrong.host.badssl.com/"
|
in '("https://wrong.host.badssl.com/"
|
||||||
"https://self-signed.badssl.com/")
|
"https://self-signed.badssl.com/")
|
||||||
if (condition-case _e
|
if (condition-case _e
|
||||||
(url-retrieve bad (lambda (_retrieved) t))
|
(url-retrieve bad (lambda (_retrieved) t))
|
||||||
(error nil))
|
(error nil))
|
||||||
collect bad))
|
collect bad)))
|
||||||
(error (format "tls seems to be misconfigured (it got %s)."
|
(error (format "tls seems to be misconfigured (it got %s)."
|
||||||
bad-hosts))
|
bad-hosts))
|
||||||
(url-retrieve "https://badssl.com"
|
(url-retrieve "https://badssl.com"
|
||||||
|
|
|
@ -12,7 +12,7 @@ PROMPT (a string) and COMMAND (a list of command plists; see `def-menu!').")
|
||||||
(completing-read prompt (mapcar #'car commands)))
|
(completing-read prompt (mapcar #'car commands)))
|
||||||
|
|
||||||
(defun doom--menu-read (prompt commands)
|
(defun doom--menu-read (prompt commands)
|
||||||
(if-let (choice (funcall doom-menu-display-fn prompt commands))
|
(if-let* ((choice (funcall doom-menu-display-fn prompt commands)))
|
||||||
(cdr (assoc choice commands))
|
(cdr (assoc choice commands))
|
||||||
(user-error "Aborted")))
|
(user-error "Aborted")))
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ list, whose car is NAME, and cdr the current version list and latest version
|
||||||
list of the package."
|
list of the package."
|
||||||
(cl-assert (symbolp name) t)
|
(cl-assert (symbolp name) t)
|
||||||
(doom-initialize-packages)
|
(doom-initialize-packages)
|
||||||
(when-let (desc (cadr (assq name package-alist)))
|
(when-let* ((desc (cadr (assq name package-alist))))
|
||||||
(let* ((old-version (package-desc-version desc))
|
(let* ((old-version (package-desc-version desc))
|
||||||
(new-version
|
(new-version
|
||||||
(pcase (doom-package-backend name)
|
(pcase (doom-package-backend name)
|
||||||
|
@ -57,7 +57,7 @@ list of the package."
|
||||||
(dir (expand-file-name (symbol-name name) quelpa-build-dir))
|
(dir (expand-file-name (symbol-name name) quelpa-build-dir))
|
||||||
(inhibit-message (not doom-debug-mode))
|
(inhibit-message (not doom-debug-mode))
|
||||||
(quelpa-upgrade-p t))
|
(quelpa-upgrade-p t))
|
||||||
(if-let (ver (quelpa-checkout recipe dir))
|
(if-let* ((ver (quelpa-checkout recipe dir)))
|
||||||
(version-to-list ver)
|
(version-to-list ver)
|
||||||
old-version)))
|
old-version)))
|
||||||
('elpa
|
('elpa
|
||||||
|
@ -115,7 +115,7 @@ If INSTALLED-ONLY-P, only return packages that are installed."
|
||||||
(defun doom-get-depending-on (name)
|
(defun doom-get-depending-on (name)
|
||||||
"Return a list of packages that depend on the package named NAME."
|
"Return a list of packages that depend on the package named NAME."
|
||||||
(doom-initialize)
|
(doom-initialize)
|
||||||
(when-let (desc (cadr (assq name package-alist)))
|
(when-let* ((desc (cadr (assq name package-alist))))
|
||||||
(mapcar #'package-desc-name (package--used-elsewhere-p desc nil t))))
|
(mapcar #'package-desc-name (package--used-elsewhere-p desc nil t))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
@ -291,7 +291,7 @@ package.el as appropriate."
|
||||||
(package-compute-transaction () (list (list archive))))))
|
(package-compute-transaction () (list (list archive))))))
|
||||||
(package-download-transaction packages))))
|
(package-download-transaction packages))))
|
||||||
(unless (doom-package-outdated-p name)
|
(unless (doom-package-outdated-p name)
|
||||||
(when-let (old-dir (package-desc-dir desc))
|
(when-let* ((old-dir (package-desc-dir desc)))
|
||||||
(when (file-directory-p old-dir)
|
(when (file-directory-p old-dir)
|
||||||
(delete-directory old-dir t)))
|
(delete-directory old-dir t)))
|
||||||
t))))
|
t))))
|
||||||
|
@ -498,7 +498,7 @@ calls."
|
||||||
(user-error "All packages are up to date"))))
|
(user-error "All packages are up to date"))))
|
||||||
(list (cdr (assq (car (assoc package package-alist)) packages)))))
|
(list (cdr (assq (car (assoc package package-alist)) packages)))))
|
||||||
(cl-destructuring-bind (package old-version new-version) pkg
|
(cl-destructuring-bind (package old-version new-version) pkg
|
||||||
(if-let (desc (doom-package-outdated-p package))
|
(if-let* ((desc (doom-package-outdated-p package)))
|
||||||
(let ((old-v-str (package-version-join old-version))
|
(let ((old-v-str (package-version-join old-version))
|
||||||
(new-v-str (package-version-join new-version)))
|
(new-v-str (package-version-join new-version)))
|
||||||
(if (y-or-n-p (format "%s will be updated from %s to %s. Update?"
|
(if (y-or-n-p (format "%s will be updated from %s to %s. Update?"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
(defun doom-popup-p (&optional target)
|
(defun doom-popup-p (&optional target)
|
||||||
"Return t if TARGET (a window or buffer) is a popup. Uses current window if
|
"Return t if TARGET (a window or buffer) is a popup. Uses current window if
|
||||||
omitted."
|
omitted."
|
||||||
(when-let (target (or target (selected-window)))
|
(when-let* ((target (or target (selected-window))))
|
||||||
(cond ((bufferp target)
|
(cond ((bufferp target)
|
||||||
(and (buffer-live-p target)
|
(and (buffer-live-p target)
|
||||||
(buffer-local-value 'doom-popup-mode target)))
|
(buffer-local-value 'doom-popup-mode target)))
|
||||||
|
@ -31,7 +31,7 @@ this popup, just the specified properties. Returns the new popup window."
|
||||||
(defun doom-popup-switch-to-buffer (buffer)
|
(defun doom-popup-switch-to-buffer (buffer)
|
||||||
"Switch the current (or closest) pop-up window to BUFFER."
|
"Switch the current (or closest) pop-up window to BUFFER."
|
||||||
(unless (doom-popup-p)
|
(unless (doom-popup-p)
|
||||||
(if-let (popups (doom-popup-windows))
|
(if-let* ((popups (doom-popup-windows)))
|
||||||
(select-window (car popups))
|
(select-window (car popups))
|
||||||
(error "No popups to switch to")))
|
(error "No popups to switch to")))
|
||||||
(set-window-dedicated-p nil nil)
|
(set-window-dedicated-p nil nil)
|
||||||
|
@ -113,7 +113,7 @@ window parameter."
|
||||||
((or 'above 'below) (window-height window))))
|
((or 'above 'below) (window-height window))))
|
||||||
|
|
||||||
(defun doom--popup-data (window)
|
(defun doom--popup-data (window)
|
||||||
(when-let (buffer (window-buffer window))
|
(when-let* ((buffer (window-buffer window)))
|
||||||
`(,(buffer-name buffer)
|
`(,(buffer-name buffer)
|
||||||
:file ,(buffer-file-name buffer)
|
:file ,(buffer-file-name buffer)
|
||||||
:rules ,(window-parameter window 'popup)
|
:rules ,(window-parameter window 'popup)
|
||||||
|
@ -167,7 +167,7 @@ Returns t if popups were restored, nil otherwise."
|
||||||
(size (plist-get (cdr spec) :size)))
|
(size (plist-get (cdr spec) :size)))
|
||||||
(when (and (not buffer) file)
|
(when (and (not buffer) file)
|
||||||
(setq buffer
|
(setq buffer
|
||||||
(if-let (buf (get-file-buffer file))
|
(if-let* ((buf (get-file-buffer file)))
|
||||||
(clone-indirect-buffer (buffer-name buf) nil t)
|
(clone-indirect-buffer (buffer-name buf) nil t)
|
||||||
(find-file-noselect file t))))
|
(find-file-noselect file t))))
|
||||||
(when size
|
(when size
|
||||||
|
@ -212,7 +212,7 @@ If FORCE-P is non-nil (or this function is called interactively), ignore popups'
|
||||||
:autoclose property. This command will never close :static popups."
|
:autoclose property. This command will never close :static popups."
|
||||||
(interactive
|
(interactive
|
||||||
(list (called-interactively-p 'interactive)))
|
(list (called-interactively-p 'interactive)))
|
||||||
(when-let (popups (doom-popup-windows t))
|
(when-let* ((popups (doom-popup-windows t)))
|
||||||
(let (success doom-popup-remember-history)
|
(let (success doom-popup-remember-history)
|
||||||
(setq doom-popup-history (delq nil (mapcar #'doom--popup-data popups)))
|
(setq doom-popup-history (delq nil (mapcar #'doom--popup-data popups)))
|
||||||
(dolist (window popups success)
|
(dolist (window popups success)
|
||||||
|
@ -225,7 +225,7 @@ If FORCE-P is non-nil (or this function is called interactively), ignore popups'
|
||||||
"Like `doom/popup-close-all', but kill *all* popups, including :static ones,
|
"Like `doom/popup-close-all', but kill *all* popups, including :static ones,
|
||||||
without leaving any trace behind (muahaha)."
|
without leaving any trace behind (muahaha)."
|
||||||
(interactive)
|
(interactive)
|
||||||
(when-let (popups (doom-popup-windows))
|
(when-let* ((popups (doom-popup-windows)))
|
||||||
(let (doom-popup-remember-history)
|
(let (doom-popup-remember-history)
|
||||||
(setq doom-popup-history nil)
|
(setq doom-popup-history nil)
|
||||||
(mapc #'delete-window popups))))
|
(mapc #'delete-window popups))))
|
||||||
|
@ -251,7 +251,7 @@ without leaving any trace behind (muahaha)."
|
||||||
(defun doom/popup-toggle-messages ()
|
(defun doom/popup-toggle-messages ()
|
||||||
"Toggle *Messages* buffer."
|
"Toggle *Messages* buffer."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if-let (win (get-buffer-window "*Messages*"))
|
(if-let* ((win (get-buffer-window "*Messages*")))
|
||||||
(doom/popup-close win)
|
(doom/popup-close win)
|
||||||
(doom-popup-buffer (get-buffer "*Messages*"))))
|
(doom-popup-buffer (get-buffer "*Messages*"))))
|
||||||
|
|
||||||
|
@ -259,10 +259,10 @@ without leaving any trace behind (muahaha)."
|
||||||
(defun doom/other-popup (count)
|
(defun doom/other-popup (count)
|
||||||
"Cycle through popup windows. Like `other-window', but for popups."
|
"Cycle through popup windows. Like `other-window', but for popups."
|
||||||
(interactive "p")
|
(interactive "p")
|
||||||
(if-let (popups (if (doom-popup-p)
|
(if-let* ((popups (if (doom-popup-p)
|
||||||
(cdr (memq (selected-window) doom-popup-windows))
|
(cdr (memq (selected-window) doom-popup-windows))
|
||||||
(setq doom-popup-other-window (selected-window))
|
(setq doom-popup-other-window (selected-window))
|
||||||
doom-popup-windows))
|
doom-popup-windows)))
|
||||||
(ignore-errors (select-window (nth (mod (1- count) (length popups)) popups)))
|
(ignore-errors (select-window (nth (mod (1- count) (length popups)) popups)))
|
||||||
(unless (eq (selected-window) doom-popup-other-window)
|
(unless (eq (selected-window) doom-popup-other-window)
|
||||||
(when doom-popup-other-window
|
(when doom-popup-other-window
|
||||||
|
@ -419,6 +419,6 @@ properties."
|
||||||
(with-selected-window window
|
(with-selected-window window
|
||||||
(doom-popup-mode -1)
|
(doom-popup-mode -1)
|
||||||
(when autokill-p
|
(when autokill-p
|
||||||
(when-let (process (get-buffer-process (current-buffer)))
|
(when-let* ((process (get-buffer-process (current-buffer))))
|
||||||
(set-process-query-on-exit-flag process nil))
|
(set-process-query-on-exit-flag process nil))
|
||||||
(kill-buffer (current-buffer)))))))
|
(kill-buffer (current-buffer)))))))
|
||||||
|
|
|
@ -269,7 +269,7 @@ Example
|
||||||
(dolist (keymap doom--keymaps)
|
(dolist (keymap doom--keymaps)
|
||||||
(when (memq 'global states)
|
(when (memq 'global states)
|
||||||
(push `(define-key ,keymap ,key ,def) forms))
|
(push `(define-key ,keymap ,key ,def) forms))
|
||||||
(when-let (states (delq 'global states))
|
(when-let* ((states (delq 'global states)))
|
||||||
(push `(,(if doom--defer 'evil-define-key 'evil-define-key*)
|
(push `(,(if doom--defer 'evil-define-key 'evil-define-key*)
|
||||||
',states ,keymap ,key ,def)
|
',states ,keymap ,key ,def)
|
||||||
forms))))
|
forms))))
|
||||||
|
|
|
@ -6,6 +6,12 @@
|
||||||
(load "persistent-soft-autoloads" nil t)
|
(load "persistent-soft-autoloads" nil t)
|
||||||
(dolist (sym '(json-read json-read-file json-read-from-string json-encode))
|
(dolist (sym '(json-read json-read-file json-read-from-string json-encode))
|
||||||
(autoload sym "json"))
|
(autoload sym "json"))
|
||||||
|
(eval-and-compile
|
||||||
|
(when (version< emacs-version "26")
|
||||||
|
(with-no-warnings
|
||||||
|
(defalias 'if-let* #'if-let)
|
||||||
|
(defalias 'when-let* #'when-let))))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Helpers
|
;; Helpers
|
||||||
|
@ -96,7 +102,7 @@ See http://vimdoc.sourceforge.net/htmldoc/cmdline.html#filename-modifiers."
|
||||||
(file-relative-name parent)))))
|
(file-relative-name parent)))))
|
||||||
("s"
|
("s"
|
||||||
(if (featurep 'evil)
|
(if (featurep 'evil)
|
||||||
(when-let (args (evil-delimited-arguments (substring flag 1) 2))
|
(when-let* ((args (evil-delimited-arguments (substring flag 1) 2)))
|
||||||
(let ((pattern (evil-transform-vim-style-regexp (car args)))
|
(let ((pattern (evil-transform-vim-style-regexp (car args)))
|
||||||
(replace (cadr args)))
|
(replace (cadr args)))
|
||||||
(replace-regexp-in-string
|
(replace-regexp-in-string
|
||||||
|
|
|
@ -247,9 +247,10 @@ This aggressively reloads core autoload files."
|
||||||
|
|
||||||
(defun doom-module-from-path (path)
|
(defun doom-module-from-path (path)
|
||||||
"Get module cons cell (MODULE . SUBMODULE) for PATH, if possible."
|
"Get module cons cell (MODULE . SUBMODULE) for PATH, if possible."
|
||||||
(when (string-match (concat doom-modules-dir "\\([^/]+\\)/\\([^/]+\\)/") path)
|
(when-let* ((path (file-relative-name (file-truename path) (file-truename doom-modules-dir))))
|
||||||
(cons (intern (concat ":" (match-string 1 path)))
|
(let ((segments (split-string path "/")))
|
||||||
(intern (match-string 2 path)))))
|
(cons (intern (concat ":" (car segments)))
|
||||||
|
(intern (cadr segments))))))
|
||||||
|
|
||||||
(defun doom-module-paths (&optional append-file)
|
(defun doom-module-paths (&optional append-file)
|
||||||
"Returns a list of absolute file paths to activated modules, with APPEND-FILE
|
"Returns a list of absolute file paths to activated modules, with APPEND-FILE
|
||||||
|
@ -463,7 +464,7 @@ Accepts the following properties:
|
||||||
(when pkg-pin
|
(when pkg-pin
|
||||||
(plist-put plist :pin nil)))
|
(plist-put plist :pin nil)))
|
||||||
(dolist (prop '(:ignore :freeze))
|
(dolist (prop '(:ignore :freeze))
|
||||||
(when-let (val (plist-get plist prop))
|
(when-let* ((val (plist-get plist prop)))
|
||||||
(plist-put plist prop (eval val))))
|
(plist-put plist prop (eval val))))
|
||||||
`(progn
|
`(progn
|
||||||
(when ,(and pkg-pin t)
|
(when ,(and pkg-pin t)
|
||||||
|
|
|
@ -414,7 +414,7 @@ that `doom*popup-save' won't break it."
|
||||||
(defun doom*persp-mode-restore-popups (&rest _)
|
(defun doom*persp-mode-restore-popups (&rest _)
|
||||||
"Restore popup windows when loading a perspective from file."
|
"Restore popup windows when loading a perspective from file."
|
||||||
(dolist (window (window-list))
|
(dolist (window (window-list))
|
||||||
(when-let (plist (doom-popup-properties window))
|
(when-let* ((plist (doom-popup-properties window)))
|
||||||
(with-selected-window window
|
(with-selected-window window
|
||||||
(unless doom-popup-mode
|
(unless doom-popup-mode
|
||||||
(setq-local doom-popup-rules plist)
|
(setq-local doom-popup-rules plist)
|
||||||
|
|
|
@ -147,7 +147,7 @@ local value, whether or not it's permanent-local. Therefore, we cycle
|
||||||
;; like diminish, but for major-modes. [pedantry intensifies]
|
;; like diminish, but for major-modes. [pedantry intensifies]
|
||||||
(defun doom|set-mode-name ()
|
(defun doom|set-mode-name ()
|
||||||
"Set the major mode's `mode-name', as dictated by `doom-major-mode-names'."
|
"Set the major mode's `mode-name', as dictated by `doom-major-mode-names'."
|
||||||
(when-let (name (cdr (assq major-mode doom-major-mode-names)))
|
(when-let* ((name (cdr (assq major-mode doom-major-mode-names))))
|
||||||
(setq mode-name
|
(setq mode-name
|
||||||
(cond ((functionp name) (funcall name))
|
(cond ((functionp name) (funcall name))
|
||||||
((stringp name) name)
|
((stringp name) name)
|
||||||
|
@ -475,7 +475,7 @@ error if it doesn't exist."
|
||||||
(defun doom-set-modeline (key &optional default)
|
(defun doom-set-modeline (key &optional default)
|
||||||
"Set the modeline format. Does nothing if the modeline KEY doesn't exist. If
|
"Set the modeline format. Does nothing if the modeline KEY doesn't exist. If
|
||||||
DEFAULT is non-nil, set the default mode-line for all buffers."
|
DEFAULT is non-nil, set the default mode-line for all buffers."
|
||||||
(when-let (modeline (doom-modeline key))
|
(when-let* ((modeline (doom-modeline key)))
|
||||||
(setf (if default
|
(setf (if default
|
||||||
(default-value 'mode-line-format)
|
(default-value 'mode-line-format)
|
||||||
(buffer-local-value 'mode-line-format (current-buffer)))
|
(buffer-local-value 'mode-line-format (current-buffer)))
|
||||||
|
|
|
@ -31,7 +31,7 @@ DEFAULT-P is a boolean. If non-nil, it marks that email account as the
|
||||||
default/fallback account."
|
default/fallback account."
|
||||||
`(after! mu4e
|
`(after! mu4e
|
||||||
(let ((account-vars ,letvars))
|
(let ((account-vars ,letvars))
|
||||||
(when-let (address (cdr (assq 'user-mail-address account-vars)))
|
(when-let* ((address (cdr (assq 'user-mail-address account-vars))))
|
||||||
(cl-pushnew address mu4e-user-mail-address-list :test #'equal))
|
(cl-pushnew address mu4e-user-mail-address-list :test #'equal))
|
||||||
(let ((context (make-mu4e-context
|
(let ((context (make-mu4e-context
|
||||||
:name ,label
|
:name ,label
|
||||||
|
|
|
@ -88,7 +88,7 @@ playback.")
|
||||||
|
|
||||||
(defun +irc*circe-truncate-nicks ()
|
(defun +irc*circe-truncate-nicks ()
|
||||||
"Truncate long nicknames in chat output non-destructively."
|
"Truncate long nicknames in chat output non-destructively."
|
||||||
(when-let (beg (text-property-any (point-min) (point-max) 'lui-format-argument 'nick))
|
(when-let* ((beg (text-property-any (point-min) (point-max) 'lui-format-argument 'nick)))
|
||||||
(goto-char beg)
|
(goto-char beg)
|
||||||
(let ((end (next-single-property-change beg 'lui-format-argument))
|
(let ((end (next-single-property-change beg 'lui-format-argument))
|
||||||
(nick (plist-get (plist-get (text-properties-at beg) 'lui-keywords)
|
(nick (plist-get (plist-get (text-properties-at beg) 'lui-keywords)
|
||||||
|
|
|
@ -261,7 +261,7 @@ __DATA__
|
||||||
(overlay-put ov 'category '+regex))
|
(overlay-put ov 'category '+regex))
|
||||||
(cl-incf i)
|
(cl-incf i)
|
||||||
(dotimes (i 10)
|
(dotimes (i 10)
|
||||||
(when-let (text (match-string i))
|
(when-let* ((text (match-string i)))
|
||||||
(save-match-data
|
(save-match-data
|
||||||
(with-current-buffer +regex--groups-buffer
|
(with-current-buffer +regex--groups-buffer
|
||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
(interactive)
|
(interactive)
|
||||||
(doom-kill-matching-buffers "^\\*elfeed")
|
(doom-kill-matching-buffers "^\\*elfeed")
|
||||||
(dolist (file +rss-elfeed-files)
|
(dolist (file +rss-elfeed-files)
|
||||||
(when-let (buf (get-file-buffer (expand-file-name file +rss-org-dir)))
|
(when-let* ((buf (get-file-buffer (expand-file-name file +rss-org-dir))))
|
||||||
(kill-buffer buf))))
|
(kill-buffer buf))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
|
@ -73,9 +73,9 @@ If ARG (universal argument), open selection in other-window."
|
||||||
(task-tags (mapcar #'car +ivy-task-tags))
|
(task-tags (mapcar #'car +ivy-task-tags))
|
||||||
(cmd
|
(cmd
|
||||||
(format "%s -H -S --no-heading -- %s %s"
|
(format "%s -H -S --no-heading -- %s %s"
|
||||||
(or (when-let (bin (executable-find "rg"))
|
(or (when-let* ((bin (executable-find "rg")))
|
||||||
(concat bin " --line-number"))
|
(concat bin " --line-number"))
|
||||||
(when-let (bin (executable-find "ag"))
|
(when-let* ((bin (executable-find "ag")))
|
||||||
(concat bin " --numbers"))
|
(concat bin " --numbers"))
|
||||||
(error "ripgrep & the_silver_searcher are unavailable"))
|
(error "ripgrep & the_silver_searcher are unavailable"))
|
||||||
(shell-quote-argument
|
(shell-quote-argument
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
"Evaluate a region between BEG and END and display the output."
|
"Evaluate a region between BEG and END and display the output."
|
||||||
(interactive "r")
|
(interactive "r")
|
||||||
(let ((load-file-name buffer-file-name))
|
(let ((load-file-name buffer-file-name))
|
||||||
(if-let (runner (cdr (assq major-mode +eval-runners)))
|
(if-let* ((runner (cdr (assq major-mode +eval-runners))))
|
||||||
(funcall runner beg end)
|
(funcall runner beg end)
|
||||||
(quickrun-region beg end))))
|
(quickrun-region beg end))))
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
(or (eq (current-buffer) +eval-repl-buffer)
|
(or (eq (current-buffer) +eval-repl-buffer)
|
||||||
(progn
|
(progn
|
||||||
(if (and +eval-repl-buffer (buffer-live-p +eval-repl-buffer))
|
(if (and +eval-repl-buffer (buffer-live-p +eval-repl-buffer))
|
||||||
(if-let (win (get-buffer-window +eval-repl-buffer))
|
(if-let* ((win (get-buffer-window +eval-repl-buffer)))
|
||||||
(select-window win)
|
(select-window win)
|
||||||
(doom-popup-buffer +eval-repl-buffer))
|
(doom-popup-buffer +eval-repl-buffer))
|
||||||
(when command
|
(when command
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
"Opens (or reopens) the REPL associated with the current major-mode and place
|
"Opens (or reopens) the REPL associated with the current major-mode and place
|
||||||
the cursor at the prompt."
|
the cursor at the prompt."
|
||||||
(interactive)
|
(interactive)
|
||||||
(when-let (command (cdr (assq major-mode +eval-repls)))
|
(when-let* ((command (cdr (assq major-mode +eval-repls))))
|
||||||
(when (+eval--ensure-in-repl-buffer command)
|
(when (+eval--ensure-in-repl-buffer command)
|
||||||
(when (bound-and-true-p evil-mode)
|
(when (bound-and-true-p evil-mode)
|
||||||
(call-interactively #'evil-append-line))
|
(call-interactively #'evil-append-line))
|
||||||
|
|
|
@ -74,7 +74,7 @@ function that creates and returns the REPL buffer."
|
||||||
|
|
||||||
(defun +eval*quickrun-auto-close (&rest _)
|
(defun +eval*quickrun-auto-close (&rest _)
|
||||||
"Allows us to silently re-run quickrun from within the quickrun buffer."
|
"Allows us to silently re-run quickrun from within the quickrun buffer."
|
||||||
(when-let (win (get-buffer-window quickrun--buffer-name))
|
(when-let* ((win (get-buffer-window quickrun--buffer-name)))
|
||||||
(let ((inhibit-message t))
|
(let ((inhibit-message t))
|
||||||
(quickrun--kill-running-process)
|
(quickrun--kill-running-process)
|
||||||
(message ""))
|
(message ""))
|
||||||
|
|
|
@ -77,7 +77,7 @@ overwrite the destination file if it exists, without confirmation."
|
||||||
(pcase (catch 'status
|
(pcase (catch 'status
|
||||||
(let ((old-path (buffer-file-name))
|
(let ((old-path (buffer-file-name))
|
||||||
(new-path (expand-file-name new-path)))
|
(new-path (expand-file-name new-path)))
|
||||||
(when-let (dest (+evil--copy-file old-path new-path force-p))
|
(when-let* ((dest (+evil--copy-file old-path new-path force-p)))
|
||||||
(delete-file old-path)
|
(delete-file old-path)
|
||||||
(kill-this-buffer)
|
(kill-this-buffer)
|
||||||
(find-file new-path)
|
(find-file new-path)
|
||||||
|
@ -95,7 +95,7 @@ overwrite the destination file if it exists, without confirmation."
|
||||||
:repeat nil
|
:repeat nil
|
||||||
(interactive "<f><!>")
|
(interactive "<f><!>")
|
||||||
(pcase (catch 'status
|
(pcase (catch 'status
|
||||||
(when-let (dest (+evil--copy-file (buffer-file-name) new-path force-p))
|
(when-let* ((dest (+evil--copy-file (buffer-file-name) new-path force-p)))
|
||||||
(message "File successfully copied to %s" dest)))
|
(message "File successfully copied to %s" dest)))
|
||||||
('overwrite-self (error "Cannot overwrite self"))
|
('overwrite-self (error "Cannot overwrite self"))
|
||||||
('aborted (message "Aborted"))
|
('aborted (message "Aborted"))
|
||||||
|
|
|
@ -180,11 +180,11 @@ across windows."
|
||||||
(evil-embrace-enable-evil-surround-integration)
|
(evil-embrace-enable-evil-surround-integration)
|
||||||
|
|
||||||
(defun +evil--embrace-get-pair (char)
|
(defun +evil--embrace-get-pair (char)
|
||||||
(if-let (pair (cdr-safe (assoc (string-to-char char) evil-surround-pairs-alist)))
|
(if-let* ((pair (cdr-safe (assoc (string-to-char char) evil-surround-pairs-alist))))
|
||||||
pair
|
pair
|
||||||
(if-let (pair (assoc-default char embrace--pairs-list))
|
(if-let* ((pair (assoc-default char embrace--pairs-list)))
|
||||||
(if-let (real-pair (and (functionp (embrace-pair-struct-read-function pair))
|
(if-let* ((real-pair (and (functionp (embrace-pair-struct-read-function pair))
|
||||||
(funcall (embrace-pair-struct-read-function pair))))
|
(funcall (embrace-pair-struct-read-function pair)))))
|
||||||
real-pair
|
real-pair
|
||||||
(cons (embrace-pair-struct-left pair) (embrace-pair-struct-right pair)))
|
(cons (embrace-pair-struct-left pair) (embrace-pair-struct-right pair)))
|
||||||
(cons char char))))
|
(cons char char))))
|
||||||
|
|
|
@ -70,8 +70,8 @@ properties:
|
||||||
(defun +jump|init ()
|
(defun +jump|init ()
|
||||||
"Initialize `+jump-current-functions', used by `+jump/definition',
|
"Initialize `+jump-current-functions', used by `+jump/definition',
|
||||||
`+jump/references' and `+jump/documentation'."
|
`+jump/references' and `+jump/documentation'."
|
||||||
(when-let (plist (cdr (assq major-mode +jump-function-alist)))
|
(when-let* ((plist (cdr (assq major-mode +jump-function-alist))))
|
||||||
(when-let (backend (plist-get plist :xref-backend))
|
(when-let* ((backend (plist-get plist :xref-backend)))
|
||||||
(make-variable-buffer-local 'xref-backend-functions)
|
(make-variable-buffer-local 'xref-backend-functions)
|
||||||
(cl-pushnew backend xref-backend-functions :test #'eq))
|
(cl-pushnew backend xref-backend-functions :test #'eq))
|
||||||
(setq-local +jump-current-functions plist)))
|
(setq-local +jump-current-functions plist)))
|
||||||
|
|
|
@ -11,7 +11,7 @@ and switches to insert mode if there are editable fields."
|
||||||
(cl-letf (((symbol-function 'region-beginning) (lambda () evil-visual-beginning))
|
(cl-letf (((symbol-function 'region-beginning) (lambda () evil-visual-beginning))
|
||||||
((symbol-function 'region-end) (lambda () evil-visual-end)))
|
((symbol-function 'region-end) (lambda () evil-visual-end)))
|
||||||
(yas-insert-snippet))
|
(yas-insert-snippet))
|
||||||
(when-let (snippet (car-safe (yas-active-snippets)))
|
(when-let* ((snippet (car-safe (yas-active-snippets))))
|
||||||
(let ((fields (yas--snippet-fields snippet)))
|
(let ((fields (yas--snippet-fields snippet)))
|
||||||
(evil-insert-state +1)
|
(evil-insert-state +1)
|
||||||
(unless fields (evil-change-state 'normal)))))
|
(unless fields (evil-change-state 'normal)))))
|
||||||
|
|
|
@ -27,7 +27,7 @@ repository root."
|
||||||
(defun +vcs/git-browse-issues ()
|
(defun +vcs/git-browse-issues ()
|
||||||
"Open the github issues page for current repo."
|
"Open the github issues page for current repo."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if-let (root (+vcs-root))
|
(if-let* ((root (+vcs-root)))
|
||||||
(browse-url (concat root "/issues"))
|
(browse-url (concat root "/issues"))
|
||||||
(user-error "No git root found!")))
|
(user-error "No git root found!")))
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +workspace-get (name &optional noerror)
|
(defun +workspace-get (name &optional noerror)
|
||||||
"Returns a workspace (perspective hash table) named NAME."
|
"Returns a workspace (perspective hash table) named NAME."
|
||||||
(when-let (persp (persp-get-by-name name))
|
(when-let* ((persp (persp-get-by-name name)))
|
||||||
(cond ((+workspace-p persp) persp)
|
(cond ((+workspace-p persp) persp)
|
||||||
((not noerror) (error "'%s' is an invalid workspace" name)))))
|
((not noerror) (error "'%s' is an invalid workspace" name)))))
|
||||||
|
|
||||||
|
|
|
@ -35,9 +35,9 @@ compilation database is present in the project.")
|
||||||
(or (file-exists-p (expand-file-name
|
(or (file-exists-p (expand-file-name
|
||||||
(concat (file-name-sans-extension buffer-file-name)
|
(concat (file-name-sans-extension buffer-file-name)
|
||||||
".cpp")))
|
".cpp")))
|
||||||
(when-let (file (car-safe (projectile-get-other-files
|
(when-let* ((file (car-safe (projectile-get-other-files
|
||||||
buffer-file-name
|
buffer-file-name
|
||||||
(projectile-current-project-files))))
|
(projectile-current-project-files)))))
|
||||||
(equal (file-name-extension file) "cpp")))))
|
(equal (file-name-extension file) "cpp")))))
|
||||||
|
|
||||||
(defun +cc-objc-header-file-p ()
|
(defun +cc-objc-header-file-p ()
|
||||||
|
|
|
@ -10,14 +10,14 @@ ignore the cache."
|
||||||
(or (and (not refresh-p)
|
(or (and (not refresh-p)
|
||||||
(gethash project-root +javascript-npm-conf))
|
(gethash project-root +javascript-npm-conf))
|
||||||
(let ((package-file (expand-file-name "package.json" project-root)))
|
(let ((package-file (expand-file-name "package.json" project-root)))
|
||||||
(when-let (json (and (file-exists-p package-file)
|
(when-let* ((json (and (file-exists-p package-file)
|
||||||
(json-read-file package-file)))
|
(json-read-file package-file))))
|
||||||
(puthash project-root json +javascript-npm-conf))))))
|
(puthash project-root json +javascript-npm-conf))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +javascript-npm-dep-p (packages &optional project-root refresh-p)
|
(defun +javascript-npm-dep-p (packages &optional project-root refresh-p)
|
||||||
(when-let (data (and (bound-and-true-p +javascript-npm-mode)
|
(when-let* ((data (and (bound-and-true-p +javascript-npm-mode)
|
||||||
(+javascript-npm-conf project-root refresh-p)))
|
(+javascript-npm-conf project-root refresh-p))))
|
||||||
(let ((deps (append (cdr (assq 'dependencies data))
|
(let ((deps (append (cdr (assq 'dependencies data))
|
||||||
(cdr (assq 'devDependencies data)))))
|
(cdr (assq 'devDependencies data)))))
|
||||||
(cond ((listp packages)
|
(cond ((listp packages)
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
(defun +javascript|init-flycheck-eslint ()
|
(defun +javascript|init-flycheck-eslint ()
|
||||||
"Favor local eslint over global installs and configure flycheck for eslint."
|
"Favor local eslint over global installs and configure flycheck for eslint."
|
||||||
(when (derived-mode-p 'js-mode)
|
(when (derived-mode-p 'js-mode)
|
||||||
(when-let ((exec-path (list (doom-project-expand "node_modules/.bin")))
|
(when-let* (((exec-path (list (doom-project-expand "node_modules/.bin")))
|
||||||
(eslint (executable-find "eslint")))
|
(eslint (executable-find "eslint"))))
|
||||||
(setq-local flycheck-javascript-eslint-executable eslint))
|
(setq-local flycheck-javascript-eslint-executable eslint))
|
||||||
(when (flycheck-find-checker-executable 'javascript-eslint)
|
(when (flycheck-find-checker-executable 'javascript-eslint)
|
||||||
;; Flycheck has it's own trailing command and semicolon warning that was
|
;; Flycheck has it's own trailing command and semicolon warning that was
|
||||||
|
|
|
@ -35,8 +35,8 @@
|
||||||
;; (goto-char (point-min))
|
;; (goto-char (point-min))
|
||||||
;; (while (progn (org-next-link) (not org-link-search-failed))
|
;; (while (progn (org-next-link) (not org-link-search-failed))
|
||||||
;; (setq element (org-element-context))
|
;; (setq element (org-element-context))
|
||||||
;; (when-let (file (and (eq (org-element-type element) 'link)
|
;; (when-let* (file (and (eq (org-element-type element) 'link)
|
||||||
;; (expand-file-name (org-element-property :path element))))
|
;; (expand-file-name (org-element-property :path element))))
|
||||||
;; (when (and (string= (org-element-property :type element) "file")
|
;; (when (and (string= (org-element-property :type element) "file")
|
||||||
;; (string= (concat (file-name-base (directory-file-name (file-name-directory file))) "/")
|
;; (string= (concat (file-name-base (directory-file-name (file-name-directory file))) "/")
|
||||||
;; org-attach-directory)
|
;; org-attach-directory)
|
||||||
|
|
|
@ -18,12 +18,12 @@
|
||||||
Uses the capture template specified by KEY. Otherwise, prompts you for one."
|
Uses the capture template specified by KEY. Otherwise, prompts you for one."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((key (or key "n")))
|
(let ((key (or key "n")))
|
||||||
(if-let (string (cond ((not (equal string ""))
|
(if-let* ((string (cond ((not (equal string ""))
|
||||||
string)
|
string)
|
||||||
((region-active-p)
|
((region-active-p)
|
||||||
(buffer-substring-no-properties
|
(buffer-substring-no-properties
|
||||||
(region-beginning)
|
(region-beginning)
|
||||||
(region-end)))))
|
(region-end))))))
|
||||||
(org-capture-string string key)
|
(org-capture-string string key)
|
||||||
(org-capture nil key))))
|
(org-capture nil key))))
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"The directory where org files are kept.")
|
"The directory where org files are kept.")
|
||||||
|
|
||||||
;; Ensure ELPA org is prioritized above built-in org.
|
;; Ensure ELPA org is prioritized above built-in org.
|
||||||
(when-let (path (locate-library "org" nil doom--package-load-path))
|
(when-let* ((path (locate-library "org" nil doom--package-load-path)))
|
||||||
(setq load-path (delete path load-path))
|
(setq load-path (delete path load-path))
|
||||||
(push (file-name-directory path) load-path))
|
(push (file-name-directory path) load-path))
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,6 @@ ignore the cache."
|
||||||
(let ((project-root (or project-root (doom-project-root))))
|
(let ((project-root (or project-root (doom-project-root))))
|
||||||
(or (and (not refresh-p) (gethash project-root +php-composer-conf))
|
(or (and (not refresh-p) (gethash project-root +php-composer-conf))
|
||||||
(let ((package-file (expand-file-name "composer.json" project-root)))
|
(let ((package-file (expand-file-name "composer.json" project-root)))
|
||||||
(when-let (data (and (file-exists-p package-file)
|
(when-let* ((data (and (file-exists-p package-file)
|
||||||
(json-read-file package-file)))
|
(json-read-file package-file))))
|
||||||
(puthash project-root data +php-composer-conf))))))
|
(puthash project-root data +php-composer-conf))))))
|
||||||
|
|
|
@ -55,7 +55,7 @@ is loaded.")
|
||||||
(defun +python|detect-pyenv-version ()
|
(defun +python|detect-pyenv-version ()
|
||||||
"Detect the pyenv version for the current project and set the relevant
|
"Detect the pyenv version for the current project and set the relevant
|
||||||
environment variables."
|
environment variables."
|
||||||
(when-let (version-str (shell-command-to-string "python --version 2>&1 | cut -d' ' -f2"))
|
(when-let* ((version-str (shell-command-to-string "python --version 2>&1 | cut -d' ' -f2")))
|
||||||
(setq version-str (string-trim version-str)
|
(setq version-str (string-trim version-str)
|
||||||
+python-current-version version-str)
|
+python-current-version version-str)
|
||||||
(let ((pyenv-current-path (concat +python-pyenv-root "/versions/" version-str)))
|
(let ((pyenv-current-path (concat +python-pyenv-root "/versions/" version-str)))
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
(defun +ruby|detect-rbenv-version ()
|
(defun +ruby|detect-rbenv-version ()
|
||||||
"Detect the rbenv version for the current project and set the relevant
|
"Detect the rbenv version for the current project and set the relevant
|
||||||
environment variables."
|
environment variables."
|
||||||
(when-let (version-str (shell-command-to-string "ruby --version 2>&1 | cut -d' ' -f2"))
|
(when-let* ((version-str (shell-command-to-string "ruby --version 2>&1 | cut -d' ' -f2")))
|
||||||
(setq version-str (string-trim version-str)
|
(setq version-str (string-trim version-str)
|
||||||
+ruby-current-version version-str)
|
+ruby-current-version version-str)
|
||||||
(when (member version-str +ruby-rbenv-versions)
|
(when (member version-str +ruby-rbenv-versions)
|
||||||
|
|
|
@ -12,7 +12,7 @@ private/hlissner/snippets."
|
||||||
(defun +hlissner/yank-buffer-filename ()
|
(defun +hlissner/yank-buffer-filename ()
|
||||||
"Copy the current buffer's path to the kill ring."
|
"Copy the current buffer's path to the kill ring."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if-let (filename (or buffer-file-name (bound-and-true-p list-buffers-directory)))
|
(if-let* ((filename (or buffer-file-name (bound-and-true-p list-buffers-directory))))
|
||||||
(message (kill-new (abbreviate-file-name filename)))
|
(message (kill-new (abbreviate-file-name filename)))
|
||||||
(error "Couldn't find filename in current buffer")))
|
(error "Couldn't find filename in current buffer")))
|
||||||
|
|
||||||
|
|
|
@ -41,8 +41,8 @@ module to be loaded."
|
||||||
(user-error ":feature workspaces is required, but disabled"))
|
(user-error ":feature workspaces is required, but disabled"))
|
||||||
(unless (+workspace-get "eshell" t)
|
(unless (+workspace-get "eshell" t)
|
||||||
(+workspace/new "eshell"))
|
(+workspace/new "eshell"))
|
||||||
(if-let (buf (cl-find-if (lambda (it) (string-match-p "^\\*doom:eshell" (buffer-name (window-buffer it))))
|
(if-let* ((buf (cl-find-if (lambda (it) (string-match-p "^\\*doom:eshell" (buffer-name (window-buffer it))))
|
||||||
(doom-visible-windows)))
|
(doom-visible-windows))))
|
||||||
(select-window (get-buffer-window buf))
|
(select-window (get-buffer-window buf))
|
||||||
(+eshell/open))
|
(+eshell/open))
|
||||||
(doom/workspace-display)
|
(doom/workspace-display)
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
(defun +gist/open-current ()
|
(defun +gist/open-current ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(gist-fetch-current)
|
(gist-fetch-current)
|
||||||
(when-let (win (get-buffer-window "*github:gists*"))
|
(when-let* ((win (get-buffer-window "*github:gists*")))
|
||||||
(doom/popup-close win)))
|
(doom/popup-close win)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
(defun +neotree/collapse-or-up ()
|
(defun +neotree/collapse-or-up ()
|
||||||
"Collapse an expanded directory node or go to the parent node."
|
"Collapse an expanded directory node or go to the parent node."
|
||||||
(interactive)
|
(interactive)
|
||||||
(when-let (node (neo-buffer--get-filename-current-line))
|
(when-let* ((node (neo-buffer--get-filename-current-line)))
|
||||||
(if (file-directory-p node)
|
(if (file-directory-p node)
|
||||||
(if (neo-buffer--expanded-node-p node)
|
(if (neo-buffer--expanded-node-p node)
|
||||||
(+neotree/collapse)
|
(+neotree/collapse)
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
(defun +neotree/collapse ()
|
(defun +neotree/collapse ()
|
||||||
"Collapse a neotree node."
|
"Collapse a neotree node."
|
||||||
(interactive)
|
(interactive)
|
||||||
(when-let (node (neo-buffer--get-filename-current-line))
|
(when-let* ((node (neo-buffer--get-filename-current-line)))
|
||||||
(when (file-directory-p node)
|
(when (file-directory-p node)
|
||||||
(neo-buffer--set-expand node nil)
|
(neo-buffer--set-expand node nil)
|
||||||
(neo-buffer--refresh t))
|
(neo-buffer--refresh t))
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
(defun +neotree/expand-or-open ()
|
(defun +neotree/expand-or-open ()
|
||||||
"Expand or open a neotree node."
|
"Expand or open a neotree node."
|
||||||
(interactive)
|
(interactive)
|
||||||
(when-let (node (neo-buffer--get-filename-current-line))
|
(when-let* ((node (neo-buffer--get-filename-current-line)))
|
||||||
(cond ((file-directory-p node)
|
(cond ((file-directory-p node)
|
||||||
(neo-buffer--set-expand node t)
|
(neo-buffer--set-expand node t)
|
||||||
(neo-buffer--refresh t)
|
(neo-buffer--refresh t)
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +pass-get-field (entry fields)
|
(defun +pass-get-field (entry fields)
|
||||||
(unless noninteractive
|
(unless noninteractive
|
||||||
(if-let (data (if (listp entry) entry (auth-pass-parse-entry entry)))
|
(if-let* ((data (if (listp entry) entry (auth-pass-parse-entry entry))))
|
||||||
(cl-loop for key in (doom-enlist fields)
|
(cl-loop for key in (doom-enlist fields)
|
||||||
when (assoc key data)
|
when (assoc key data)
|
||||||
return (cdr it))
|
return (cdr it))
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
(+pass-get-field entry 'secret))
|
(+pass-get-field entry 'secret))
|
||||||
|
|
||||||
(defun +pass-ivy-action--open-url (entry)
|
(defun +pass-ivy-action--open-url (entry)
|
||||||
(if-let (url (+pass-get-field entry +pass-url-fields))
|
(if-let* ((url (+pass-get-field entry +pass-url-fields)))
|
||||||
(and (or (string-match-p "https?://" url)
|
(and (or (string-match-p "https?://" url)
|
||||||
(error "Field for %s doesn't look like an url" item))
|
(error "Field for %s doesn't look like an url" item))
|
||||||
(browse-url url))
|
(browse-url url))
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
(error "Couldn't find entry: %s" item))))
|
(error "Couldn't find entry: %s" item))))
|
||||||
|
|
||||||
(defun +pass-ivy-action--copy-username (entry)
|
(defun +pass-ivy-action--copy-username (entry)
|
||||||
(if-let (user (+pass-get-field entry +pass-user-fields))
|
(if-let* ((user (+pass-get-field entry +pass-user-fields)))
|
||||||
(progn (password-store-clear)
|
(progn (password-store-clear)
|
||||||
(message "Copied username to the kill ring.")
|
(message "Copied username to the kill ring.")
|
||||||
(kill-new user))
|
(kill-new user))
|
||||||
|
|
|
@ -108,11 +108,11 @@ but do not execute them."
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +tmux-list-windows (&optional session)
|
(defun +tmux-list-windows (&optional session)
|
||||||
(if-let (lines
|
(if-let* ((lines
|
||||||
(+tmux (format "list-windows %s -F '#{window_id};#{session_id};#{window_active};#{window_name};#{window_activity_flag}'"
|
(+tmux (format "list-windows %s -F '#{window_id};#{session_id};#{window_active};#{window_name};#{window_activity_flag}'"
|
||||||
(if session
|
(if session
|
||||||
(concat "-t " (car session))
|
(concat "-t " (car session))
|
||||||
"-a"))))
|
"-a")))))
|
||||||
(cl-loop for line in (string-split lines "\n" t)
|
(cl-loop for line in (string-split lines "\n" t)
|
||||||
collect (let ((window (string-split line ";")))
|
collect (let ((window (string-split line ";")))
|
||||||
(list (nth 0 window)
|
(list (nth 0 window)
|
||||||
|
@ -124,13 +124,13 @@ but do not execute them."
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +tmux-list-panes (&optional sess-or-win)
|
(defun +tmux-list-panes (&optional sess-or-win)
|
||||||
(if-let (lines
|
(if-let* ((lines
|
||||||
(+tmux (format "list-panes %s -F '#{pane_id};#{window_id};#{session_id};#{pane_active};#{pane_title};#{pane_current_path}'"
|
(+tmux (format "list-panes %s -F '#{pane_id};#{window_id};#{session_id};#{pane_active};#{pane_title};#{pane_current_path}'"
|
||||||
(if sess-or-win
|
(if sess-or-win
|
||||||
(concat (if (string-prefix-p "$" (car sess-or-win)) "-s ")
|
(concat (if (string-prefix-p "$" (car sess-or-win)) "-s ")
|
||||||
"-t "
|
"-t "
|
||||||
(car sess-or-win))
|
(car sess-or-win))
|
||||||
"-a"))))
|
"-a")))))
|
||||||
(cl-loop for line in (string-split lines "\n" t)
|
(cl-loop for line in (string-split lines "\n" t)
|
||||||
collect (let ((pane (split-string line ";")))
|
collect (let ((pane (split-string line ";")))
|
||||||
(list (nth 0 pane)
|
(list (nth 0 pane)
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
(defvar +doom-modeline-current-window (frame-selected-window))
|
(defvar +doom-modeline-current-window (frame-selected-window))
|
||||||
(defun +doom-modeline|set-selected-window (&rest _)
|
(defun +doom-modeline|set-selected-window (&rest _)
|
||||||
"Sets `+doom-modeline-current-window' appropriately"
|
"Sets `+doom-modeline-current-window' appropriately"
|
||||||
(when-let (win (frame-selected-window))
|
(when-let* ((win (frame-selected-window)))
|
||||||
(unless (minibuffer-window-active-p win)
|
(unless (minibuffer-window-active-p win)
|
||||||
(setq +doom-modeline-current-window win))))
|
(setq +doom-modeline-current-window win))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue