Compare commits

...

11 commits

10 changed files with 98 additions and 19 deletions

View file

@ -1,7 +1,7 @@
* buffer-window management
#+begin_src emacs-lisp
(setq split-width-threshold 160)
(setq split-height-threshold 80)
(setq split-width-threshold 120)
(setq split-height-threshold 4)
(defun switch-to-buffer-force-same-window (buffer)
(interactive

View file

@ -468,3 +468,7 @@
:config
(direnv-mode))
#+end_src
* ledger
#+begin_src emacs-lisp
(require 'my-ledger)
#+end_src

View file

@ -57,7 +57,8 @@
(advice-add #'doom-modeline-project-p
:around
#'my/dont-check-project-samba)
)
(require 'erc-doom-modeline-hack))
;; Modeline display useful information
(setq global-mode-string '(" "))

View file

@ -931,9 +931,6 @@
(setq vterm-kill-buffer-on-exit t)))
#+end_src
** wgrep
#+begin_src emacs-lisp
#+end_src
** Query replace rx
#+begin_src emacs-lisp
(defun my/query-replace-rx (&rest _)
@ -979,7 +976,7 @@
:hook ((prog-mode . olivetti-mode)
(org-mode . olivetti-mode)
(dired-mode . olivetti-mode)
(org-agenda . olivetti-mode)
(org-agenda-mode . olivetti-mode)
(Info-mode . olivetti-mode)
(message-mode . olivetti-mode)
(markdown-mode . olivetti-mode))
@ -991,6 +988,14 @@
:before
'olivetti-reset-all-windows)
(advice-add 'olivetti-reset-window
:after
(lambda (window)
(set-window-parameter
window
'min-margins
(cons 0 0))))
(setq-default olivetti-body-width 140)
(with-eval-after-load 'mu4e

2
elpa

@ -1 +1 @@
Subproject commit 77e6fdb80d19f27850efd0d7ca20e2166fd6ff57
Subproject commit 6df853a359ff19a0a8fa40cc1dd52c0768a49129

View file

@ -1,11 +1,11 @@
(setq package-list '(org use-package quelpa quelpa-use-package))
;; list the repositories containing them
(setq package-archives '(("melpa" . "http://melpa.org/packages/")
;; ("org" . "https://orgmode.org/elpa/")
;; ("org" . "https://orgmode.org/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("nongnu" . "https://elpa.nongnu.org/nongnu/")
("elpa" . "http://tromey.com/elpa/")
;;("marmalade" . "http://marmalade-repo.org/packages/")
;; ("elpa" . "http://tromey.com/elpa/")
;; ("marmalade" . "http://marmalade-repo.org/packages/")
))
;; activate all the packages (in particular autoloads)

View file

@ -0,0 +1,55 @@
;;; erc-doom-modeline-hack.el --- -*- lexical-binding: t -*-
;; Copyright (C) 2025 Benson Chu
;; Author: Benson Chu <bensonchu457@gmail.com>
;; Created: [2025-09-01 10:50]
;; This file is not part of GNU Emacs
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;; Code:
(defun my/string-pixel-width (string)
"Return the width of STRING in pixels.
If you call this function to measure pixel width of a string
with embedded newlines, it returns the width of the widest
substring that does not include newlines."
(declare (important-return-value t))
(if (zerop (length string))
0
;; Keeping a work buffer around is more efficient than creating a
;; new temporary buffer.
(let ((inhibit-read-only t))
(with-current-buffer (get-buffer-create " *string-pixel-width*")
;; If `display-line-numbers' is enabled in internal buffers
;; (e.g. globally), it breaks width calculation (bug#59311)
(setq-local display-line-numbers nil)
(delete-region (point-min) (point-max))
;; Disable line-prefix and wrap-prefix, for the same reason.
(setq line-prefix nil
wrap-prefix nil)
(insert (propertize string 'line-prefix nil 'wrap-prefix nil))
(car (buffer-text-pixel-size nil nil t))))))
(advice-add #'string-pixel-width
:override
#'my/string-pixel-width)
(provide 'erc-doom-modeline-hack)
;;; erc-doom-modeline-hack.el ends here

View file

@ -42,19 +42,26 @@
(file-name-sans-extension)))
(file-name-directory fname)))
(defun ll/dump-extract-command (fname)
(defun ll/dump-extract-command-flags (fname)
(with-current-buffer (find-file-noselect fname)
(save-excursion
(goto-char (point-min))
(re-search-forward "^[^#]")
(kill-ring-save (point-at-bol) (point-at-eol))
(current-kill 0))))
(re-search-forward
(rx line-start (not "#")
(group "\"" (+? nonl) "\"")
(group (+ nonl))
line-end))
(match-string 2))))
(defun ll/act-on-llvm-dump-file (fname)
(let* ((action (aml/read-action-map ll/dump-file-action-map))
(command (ll/dump-extract-command (ll/dump-to-sh-file fname))))
(command-flags (ll/dump-extract-command-flags (ll/dump-to-sh-file fname)))
(clang (lls/prompt-tool "clang$")))
(compilation-start
(concat command " -S -o -")
(concat
(when (y-or-n-p "Would you like to `rr record`? ")
"rr record ")
clang command-flags " -S -o -")
'asm-mode
`(lambda (_)
,(format "*%s*" fname)))))

View file

@ -59,10 +59,9 @@
(defun my/org-capture-finalize-shouldnt-mess-windows (orig &rest args)
(cl-letf* ((orig-set-window-configuration (symbol-function 'set-window-configuration))
((symbol-function 'set-window-configuration)
#'(lambda (&rest args)
(unless (equal (car args) (org-capture-get :return-to-wconf 'local))
(unless (equal (car args) (org-capture-get :return-to-wconf))
(apply orig-set-window-configuration args)))))
(apply orig args)))

View file

@ -37,6 +37,14 @@
(require 'bisect-mode)
(require 'deadgrep-rejump-mode)
(use-package editorconfig
:config
(editorconfig-mode 1)
(advice-add #'editorconfig-set-trailing-ws
:override
#'ignore))
(put 'magit-log-mode 'magit-log-default-arguments
'("--graph" "-n64" "--decorate"))