diff options
author | Case Duckworth | 2022-01-13 18:01:12 -0600 |
---|---|---|
committer | Case Duckworth | 2022-01-13 18:01:12 -0600 |
commit | e037d2fb71b533b506469d78a58ff351194d6e36 (patch) | |
tree | 4faccc056f6b2d2d715944d80f6fe98d44c6f732 /lisp | |
parent | Add remember.el (WIP) (diff) | |
download | emacs-e037d2fb71b533b506469d78a58ff351194d6e36.tar.gz emacs-e037d2fb71b533b506469d78a58ff351194d6e36.zip |
Whatever
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/+tab-bar.el | 8 | ||||
-rw-r--r-- | lisp/remember.el | 19 |
2 files changed, 24 insertions, 3 deletions
diff --git a/lisp/+tab-bar.el b/lisp/+tab-bar.el index 1dc1f68..1ee7606 100644 --- a/lisp/+tab-bar.el +++ b/lisp/+tab-bar.el | |||
@@ -21,6 +21,14 @@ | |||
21 | (defvar +tab-bar-show-original nil | 21 | (defvar +tab-bar-show-original nil |
22 | "Original value of `tab-bar-show'.") | 22 | "Original value of `tab-bar-show'.") |
23 | 23 | ||
24 | (defun +tab-bar-basename () | ||
25 | "Generate the tab name from the basename of the buffer of the | ||
26 | selected window." | ||
27 | (let* ((tab-file-name (buffer-file-name (window-buffer (minibuffer-selected-window))))) | ||
28 | (if tab-file-name | ||
29 | (file-name-nondirectory tab-file-name) | ||
30 | (+tab-bar-tab-name-truncated-left)))) | ||
31 | |||
24 | (defun +tab-bar-tab-name-truncated-left () | 32 | (defun +tab-bar-tab-name-truncated-left () |
25 | "Generate the tab name from the buffer of the selected window. | 33 | "Generate the tab name from the buffer of the selected window. |
26 | This is just like `tab-bar-tab-name-truncated', but truncates the | 34 | This is just like `tab-bar-tab-name-truncated', but truncates the |
diff --git a/lisp/remember.el b/lisp/remember.el index 39476d1..a759419 100644 --- a/lisp/remember.el +++ b/lisp/remember.el | |||
@@ -1,4 +1,17 @@ | |||
1 | ;; ABANDON ALL HOPE YE WHO ENTER HERE | 1 | ;;; remember.el --- Remember variables and modes -*- lexical-binding: t; -*- |
2 | |||
3 | ;;; Code: | ||
4 | |||
5 | (defmacro remember-remember (alist) | ||
6 | (let* ((template (format "remember--%s-%%s" (gensym))) | ||
7 | (reset-fn (intern (format template "recall"))) | ||
8 | (things (cl-loop for (sym . newval) in alist | ||
9 | as rem = (intern (format template sym)) | ||
10 | |||
11 | ;; Collect original values | ||
12 | |||
13 | ))))) | ||
14 | |||
2 | 15 | ||
3 | (defmacro remember-set (&rest symbols) | 16 | (defmacro remember-set (&rest symbols) |
4 | "Setup a closure remembering symbols to apply with | 17 | "Setup a closure remembering symbols to apply with |
@@ -6,7 +19,7 @@ | |||
6 | SYMBOLS is a plist: the properties are symbols or mode names, and | 19 | SYMBOLS is a plist: the properties are symbols or mode names, and |
7 | their values what to set after `remember-setup'." | 20 | their values what to set after `remember-setup'." |
8 | (let* ((template (format "remember--%s-%%s" (gensym))) | 21 | (let* ((template (format "remember--%s-%%s" (gensym))) |
9 | (reset-fn (intern (format template "reset" "fn"))) | 22 | (reset-fn (intern (format template "reset"))) |
10 | (list (cl-loop for sym in symbols by #'cddr | 23 | (list (cl-loop for sym in symbols by #'cddr |
11 | collect `(,(intern (format template sym)) | 24 | collect `(,(intern (format template sym)) |
12 | ,sym) | 25 | ,sym) |
@@ -39,5 +52,5 @@ their values what to set after `remember-setup'." | |||
39 | 52 | ||
40 | ;; test | 53 | ;; test |
41 | 54 | ||
42 | (setq fn (remember-set display-fill-column-indicator-mode disable)) | 55 | (set 'fn (remember-set display-fill-column-indicator-mode disable)) |
43 | (funcall fn) | 56 | (funcall fn) |