Helm/EXWM: Use consistent naming

master
Pierre Neidhardt 2017-11-02 10:28:34 +01:00
parent 348be638fd
commit 9ad4f9e26c
1 changed files with 16 additions and 14 deletions

View File

@ -9,9 +9,14 @@
(kill-buffer b) (kill-buffer b)
(message "helm-exwm: Killed."))))) (message "helm-exwm: Killed.")))))
;; TODO: Post on EXWM's wiki once all TODOs are fixed. ;; TODO: Publish on MELPA.
;; Publish on MELPA? Maybe with generic code for EXWM buffers with column ;; TODO: Post on EXWM's wiki once on MELPA.
;; containing the class name, and and emacs-buffers helm source too.
;; TODO: Maybe generic code for EXWM buffers with column
;; containing the class name.
;; TODO: Write a emacs-buffers helm source to filter out EXWM buffers from buffer list.
;; Write an all-exwm buffer source.
;; TODO: s-w s-w loses focus. ;; TODO: s-w s-w loses focus.
;; We don't get the expected error: ;; We don't get the expected error:
@ -69,8 +74,8 @@
(setcdr (last bufs) (list (pop bufs)))) (setcdr (last bufs) (list (pop bufs))))
bufs)) bufs))
(defun helm-exwm-windows (class) (defun helm-exwm-buffers (class)
"Preconfigured `helm' to list EXWM windows belonging to CLASS." "Preconfigured `helm' to list EXWM buffers belonging to CLASS."
(helm :sources (helm :sources
(helm-build-sync-source "EXWM buffers" (helm-build-sync-source "EXWM buffers"
:candidates (helm-exwm-candidates class) :candidates (helm-exwm-candidates class)
@ -84,9 +89,6 @@
:keymap helm-exwm-map) :keymap helm-exwm-map)
:buffer "*helm-exwm*")) :buffer "*helm-exwm*"))
;; (add-to-list 'helm-source-names-using-follow "helm-exwm"))
;; (setq helm-source-names-using-follow nil)
(defun helm-exwm-switch (class &optional program other-window) (defun helm-exwm-switch (class &optional program other-window)
"Switch to some EXWM windows belonging to CLASS. "Switch to some EXWM windows belonging to CLASS.
@ -100,8 +102,8 @@ With prefix argument or if OTHER-WINDOW is non-nil, open in other window."
other-window (or other-window current-prefix-arg)) other-window (or other-window current-prefix-arg))
(if (and (eq major-mode 'exwm-mode) (if (and (eq major-mode 'exwm-mode)
(string= (downcase exwm-class-name) class)) (string= (downcase exwm-class-name) class))
(if (fboundp 'helm-exwm-windows) (if (fboundp 'helm-exwm-buffers)
(helm-exwm-windows class) (helm-exwm-buffers class)
(when other-window (other-window 1)) (when other-window (other-window 1))
(start-process-shell-command program nil program)) (start-process-shell-command program nil program))
(let ((last (buffer-list))) (let ((last (buffer-list)))
@ -129,10 +131,10 @@ See `helm-exwm-start'."
(interactive) (interactive)
(helm-exwm-switch (file-name-nondirectory browse-url-generic-program) browse-url-generic-program t)) (helm-exwm-switch (file-name-nondirectory browse-url-generic-program) browse-url-generic-program t))
(exwm-input-set-key (kbd "s-w") #'helm-exwm-start-browser) (exwm-input-set-key (kbd "s-w") #'helm-exwm-switch-browser)
(exwm-input-set-key (kbd "s-W") #'helm-exwm-start-browser-other-window) (exwm-input-set-key (kbd "s-W") #'helm-exwm-switch-browser-other-window)
;; (defun helm-exwm-browser-candidates () ;; (add-to-list 'helm-source-names-using-follow "helm-exwm"))
;; (helm-exwm-generic-candidates (file-name-nondirectory browse-url-generic-program))) ;; (setq helm-source-names-using-follow nil)
(provide 'package-helm-exwm) (provide 'package-helm-exwm)