Files
@ 7ddca4d8f018
Branch filter:
Location: workgroups2/src/workgroups-commands-minibuffer.el - annotation
7ddca4d8f018
2.4 KiB
text/x-elisp
fixed typo
088605c05794 088605c05794 088605c05794 443938b472d4 c9e1713b76a2 c9e1713b76a2 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 c9e1713b76a2 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 c9e1713b76a2 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 443938b472d4 c9e1713b76a2 443938b472d4 443938b472d4 443938b472d4 088605c05794 | ;;; wg-commands-minibuffer --- minibuffer commands
;;; Commentary:
;;; Code:
(require 'workgroups-compat)
(defun wg-next-buffer-list-filter ()
"Trigger a switch to the next buffer-list-filter."
(interactive)
(throw 'wg-action (list 'next (minibuffer-contents))))
(defun wg-previous-buffer-list-filter ()
"Trigger a switch to the previous buffer-list-filter."
(interactive)
(throw 'wg-action (list 'prev (minibuffer-contents))))
(defun wg-backward-char-or-next-buffer-list-filter ()
"Call `backward-char' unless `point' is right after the prompt,
in which case call `wg-next-buffer-list-filter'."
(interactive)
(if (> (point) (minibuffer-prompt-end)) (backward-char)
(wg-next-buffer-list-filter)))
(defun wg-backward-char-or-previous-buffer-list-filter (&optional num)
"Call `backward-char' unless `point' is right after the prompt,
in which case call `wg-previous-buffer-list-filter'."
(interactive)
(if (> (point) (minibuffer-prompt-end)) (backward-char)
(wg-previous-buffer-list-filter)))
(defun wg-dissociate-first-match ()
"Dissociate the first match from current workgroup."
(interactive)
(wg-when-let
((mode (wg-read-buffer-mode))
(buffer (wg-current-match mode))
(pos (wg-position buffer (wg-filtered-buffer-list t) :test 'equal)))
(wg-workgroup-dissociate-bufobj (wg-current-workgroup) buffer)
(wg-set-current-matches
(wg-rotate-list (wg-filtered-buffer-list t) pos) mode)))
(defun wg-associate-first-match ()
"Associate the first match with or update it in the current workgroup."
(interactive)
(wg-when-let
((mode (wg-read-buffer-mode))
(buffer (wg-current-match mode))
(pos (wg-position buffer (wg-filtered-buffer-list t) :test 'equal)))
(wg-workgroup-associate-bufobj (wg-current-workgroup) buffer)
(wg-set-current-matches
(wg-rotate-list (wg-filtered-buffer-list t) pos) mode)))
(defun wg-minibuffer-mode-dissociate-weakly-associated-buffers ()
"Dissociate weakly associated buffers and update the current matches."
(interactive)
(wg-workgroup-dissociate-weakly-associated-buffers (wg-current-workgroup))
(wg-set-current-matches
(let ((remaining (wg-filtered-buffer-list t)))
(wg-remove-if-not (lambda (match) (member match remaining))
(wg-current-matches)))))
(provide 'workgroups-commands-minibuffer)
;;; workgroups-commands-minibuffer.el ends here
|