This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(cl-defun treemacs--find-keybind (func &optional (pad 8)) | |
"Find the keybind for FUNC in treemacs. | |
Return of cons of the key formatted for inclusion in the hydra string, including | |
a minimum width for alignment, and the key itself for the hydra heads. | |
Prefer evil keybinds, otherwise pick the first result." | |
(-if-let (keys (where-is-internal func)) | |
(let ((key | |
(key-description | |
(-if-let (evil-keys (--first (eq 'treemacs-state (aref it 0)) keys)) | |
(--map (aref evil-keys it) (number-sequence 1 (- (length evil-keys) 1))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun treemacs--get-buffer-groups () | |
"Get the list of buffers, grouped by their major mode." | |
(->> (buffer-list) | |
(--reject (eq ?\ (aref (buffer-name it) 0))) | |
(--group-by (buffer-local-value 'major-mode it)))) | |
(defun treemacs--visit-buffer (_) | |
"Switch to buffer saved in node at point." | |
(let* ((btn (treemacs-current-button)) | |
(buf (button-get btn :buffer))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "mod-test" | |
version = "0.1.0" | |
[lib] | |
crate-type = ["cdylib"] | |
[dependencies] | |
libc = "0.2" | |
emacs = "0.5.1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; treelib.el --- TODO -*- lexical-binding: t -*- | |
;;; Commentary: | |
;;; Code: | |
(defsubst treelib-current-button () | |
"Get the button in the current line, if any." | |
(if (get-text-property (point-at-bol) 'button) | |
(button-at (point-at-bol)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; -*- lexical-binding: t -*- | |
(require 'dash) | |
(require 's) | |
(require 'company) | |
(defun rofi-filter (proc msg) | |
(backward-delete-char (length company-prefix)) | |
(insert (s-trim msg))) |