little improvements
This commit is contained in:
parent
a295279bac
commit
65a2e95c54
1 changed files with 101 additions and 14 deletions
107
ReadMe.org
107
ReadMe.org
|
@ -196,6 +196,7 @@ We sometimes need a little help to figure out keybindings, using ~which-key~ for
|
||||||
:demand t
|
:demand t
|
||||||
:config
|
:config
|
||||||
(setq help-window-select t)
|
(setq help-window-select t)
|
||||||
|
(setq dired-kill-when-opening-new-dired-buffer t)
|
||||||
(setq eval-expression-print-length nil)
|
(setq eval-expression-print-length nil)
|
||||||
(setq kill-do-not-save-duplicates t))
|
(setq kill-do-not-save-duplicates t))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
@ -582,7 +583,12 @@ Setup contextual information on minibuffer options.
|
||||||
:config
|
:config
|
||||||
(setq corfu-auto t)
|
(setq corfu-auto t)
|
||||||
:init
|
:init
|
||||||
(global-corfu-mode))
|
(global-corfu-mode)
|
||||||
|
(corfu-popupinfo-mode)
|
||||||
|
(corfu-history-mode)
|
||||||
|
:config
|
||||||
|
(setq corfu-popupinfo-delay '(0.2 . 0.1))
|
||||||
|
(setq corfu-popupinfo-hide nil))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
~Cape~ is a completion provider for ~corfu~. I mostly use it to complete filenames, mostly.
|
~Cape~ is a completion provider for ~corfu~. I mostly use it to complete filenames, mostly.
|
||||||
|
@ -952,8 +958,10 @@ I have a little integration to remove empty lookbooks from my tasks.
|
||||||
Whenever I mark a tasks as done, it gets archived in my daily note.
|
Whenever I mark a tasks as done, it gets archived in my daily note.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
(use-package emacs
|
(use-package org-archive
|
||||||
:ensure nil
|
:ensure nil
|
||||||
|
:after denote-org
|
||||||
|
:after org
|
||||||
:config
|
:config
|
||||||
(setq org-archive-file-header-format nil)
|
(setq org-archive-file-header-format nil)
|
||||||
(setq org-archive-default-command #'org-archive-subtree-hierarchically)
|
(setq org-archive-default-command #'org-archive-subtree-hierarchically)
|
||||||
|
@ -1022,13 +1030,14 @@ Whenever I mark a tasks as done, it gets archived in my daily note.
|
||||||
|
|
||||||
(luj/archive-to-location (concat today-file "::* Tasks done")))))
|
(luj/archive-to-location (concat today-file "::* Tasks done")))))
|
||||||
|
|
||||||
(add-to-list 'org-after-todo-state-change-hook
|
(add-hook 'org-after-todo-state-change-hook
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(when (member org-state '("DONE" "CANCELLED" "READ"))
|
(when (member org-state '("DONE" "CANCELLED" "READ"))
|
||||||
(luj/org-roam-archive-todo-to-today))))
|
(luj/org-roam-archive-todo-to-today))))
|
||||||
|
|
||||||
(setq org-log-done 'time))
|
(setq org-log-done 'time))
|
||||||
|
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
@ -1120,8 +1129,8 @@ I use ~notmuch~ to index and search through my large mail inboxes.
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
(use-package notmuch
|
(use-package notmuch
|
||||||
:ensure t
|
:ensure t
|
||||||
:defer t
|
:init
|
||||||
:config
|
|
||||||
(setq notmuch-search-oldest-first nil)
|
(setq notmuch-search-oldest-first nil)
|
||||||
(setq notmuch-show-logo nil
|
(setq notmuch-show-logo nil
|
||||||
notmuch-column-control 1.0
|
notmuch-column-control 1.0
|
||||||
|
@ -1206,6 +1215,76 @@ I use ~notmuch~ to index and search through my large mail inboxes.
|
||||||
("julien.malka@telecom-paris.fr" . "telecom/Sent")))
|
("julien.malka@telecom-paris.fr" . "telecom/Sent")))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
I want the number of unread messages in my ~notmuch-hello~ buffer.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp :tangle init.el
|
||||||
|
(defun luj/notmuch-hello-insert-buttons (searches)
|
||||||
|
"Insert buttons for SEARCHES.
|
||||||
|
|
||||||
|
SEARCHES must be a list of plists each of which should contain at
|
||||||
|
least the properties :name NAME :query QUERY and :count COUNT,
|
||||||
|
where QUERY is the query to start when the button for the
|
||||||
|
corresponding entry is activated, and COUNT should be the number
|
||||||
|
of messages matching the query. Such a plist can be computed
|
||||||
|
with `notmuch-hello-query-counts'."
|
||||||
|
(let* ((widest (notmuch-hello-longest-label searches))
|
||||||
|
(tags-and-width (notmuch-hello-tags-per-line widest))
|
||||||
|
(tags-per-line (car tags-and-width))
|
||||||
|
(column-width (cdr tags-and-width))
|
||||||
|
(column-indent 0)
|
||||||
|
(count 0)
|
||||||
|
(reordered-list (notmuch-hello-reflect searches tags-per-line))
|
||||||
|
;; Hack the display of the buttons used.
|
||||||
|
(widget-push-button-prefix "")
|
||||||
|
(widget-push-button-suffix ""))
|
||||||
|
;; dme: It feels as though there should be a better way to
|
||||||
|
;; implement this loop than using an incrementing counter.
|
||||||
|
(mapc (lambda (elem)
|
||||||
|
;; (not elem) indicates an empty slot in the matrix.
|
||||||
|
(when elem
|
||||||
|
(when (> column-indent 0)
|
||||||
|
(widget-insert (make-string column-indent ? )))
|
||||||
|
(let* ((name (plist-get elem :name))
|
||||||
|
(query (plist-get elem :query))
|
||||||
|
(query-unread (concat query " and tag:unread"))
|
||||||
|
(count-unread (string-to-number (notmuch-saved-search-count query-unread)))
|
||||||
|
(oldest-first (cl-case (plist-get elem :sort-order)
|
||||||
|
(newest-first nil)
|
||||||
|
(oldest-first t)
|
||||||
|
(otherwise notmuch-search-oldest-first)))
|
||||||
|
(exclude (cl-case (plist-get elem :excluded)
|
||||||
|
(hide t)
|
||||||
|
(show nil)
|
||||||
|
(otherwise notmuch-search-hide-excluded)))
|
||||||
|
(search-type (plist-get elem :search-type))
|
||||||
|
(msg-count (plist-get elem :count)))
|
||||||
|
(widget-insert (format "%8s(%2s) "
|
||||||
|
(notmuch-hello-nice-number msg-count)
|
||||||
|
(if (>= count-unread 100)
|
||||||
|
"xx"
|
||||||
|
(notmuch-hello-nice-number count-unread))))
|
||||||
|
(widget-create 'push-button
|
||||||
|
:notify #'notmuch-hello-widget-search
|
||||||
|
:notmuch-search-terms query
|
||||||
|
:notmuch-search-oldest-first oldest-first
|
||||||
|
:notmuch-search-type search-type
|
||||||
|
:notmuch-search-hide-excluded exclude
|
||||||
|
name)
|
||||||
|
(setq column-indent
|
||||||
|
(1+ (max 0 (- column-width (length name)))))))
|
||||||
|
(cl-incf count)
|
||||||
|
(when (eq (% count tags-per-line) 0)
|
||||||
|
(setq column-indent 0)
|
||||||
|
(widget-insert "\n")))
|
||||||
|
reordered-list)
|
||||||
|
;; If the last line was not full (and hence did not include a
|
||||||
|
;; carriage return), insert one now.
|
||||||
|
(unless (eq (% count tags-per-line) 0)
|
||||||
|
(widget-insert "\n"))))
|
||||||
|
(advice-add 'notmuch-hello-insert-buttons :override #'luj/notmuch-hello-insert-buttons)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* Programming
|
* Programming
|
||||||
|
|
||||||
|
@ -1358,11 +1437,7 @@ The compilation buffer is very useful to launch ephemeral processes.
|
||||||
~eglot~ is the builtin LSP client inside ~emacs~. It works well, but I add some customization to make it faster.
|
~eglot~ is the builtin LSP client inside ~emacs~. It works well, but I add some customization to make it faster.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
(use-package eglot
|
(use-package eglot)
|
||||||
:ensure nil
|
|
||||||
:config
|
|
||||||
(fset #'jsonrpc--log-event #'ignore)
|
|
||||||
(setq eglot-events-buffer-size 0))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Including using ~eglot-booster~, that bufferize the LSP output instead of ~emacs~ and parses the ~json~.
|
Including using ~eglot-booster~, that bufferize the LSP output instead of ~emacs~ and parses the ~json~.
|
||||||
|
@ -1374,6 +1449,18 @@ Including using ~eglot-booster~, that bufferize the LSP output instead of ~emacs
|
||||||
:config (eglot-booster-mode))
|
:config (eglot-booster-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
I don't like how I must open another buffer to get documentation, so let's go with ~eldoc-box~
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
|
(use-package eldoc-box
|
||||||
|
:ensure t
|
||||||
|
:config
|
||||||
|
(eldoc-box-hover-at-point-mode)
|
||||||
|
(add-hook 'eglot-managed-mode-hook #'eldoc-box-hover-mode t)
|
||||||
|
)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
** Programming modes
|
** Programming modes
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue