summaryrefslogtreecommitdiff
path: root/.emacs
AgeCommit message (Collapse)Author
2025-01-25Achieve XDG complianceKévin Le Gouguec
… sort of. Emacs apps will stuff all manner of transient state under user-emacs-directory by default, so full XDG compliance would probably involve customizing them all to instead use ~/.cache but 🤷
2025-01-22Ditch when-letKévin Le Gouguec
Obsoleted. While in there, rewrite to taste: - could just switch to when-let*, but I hear and-let* is more idiomatic for code that returns values; when(-let) OTOH denotes side-effects. - project-root (singular) has been available since 28, which is in Debian stable. Good enough. - I know about 𝓍-let*'s (VALUEFORM) shorthand now. - “(string-trim-right root "/")”? 🤭
2025-01-18Tell dired to use 'git mv' when appropriateKévin Le Gouguec
2024-12-23Set new completion knobKévin Le Gouguec
Probably handles 99% of the uses I've had for the substring style?
2024-07-07Use simpler method to get the number of processorsKévin Le Gouguec
Chance met reading '(elisp) Process Information'.
2024-07-06Adapt to which-key integration in core EmacsKévin Le Gouguec
The maintainers decided to disable Unicode symbols by default; re-enable them. Also fix the version check for Eglot and use-package.
2024-05-15Add & theme forgeKévin Le Gouguec
2024-03-24Refresh .emacs prologueKévin Le Gouguec
The stuff about package-initialize is flat out wrong: (a) package-initialize is _not_ called automatically at startup; (b) for all that, customizations seem none the worse for wear. '(elisp) Packaging Basics' suggests that Emacs does automatically call 'package-activate-all' (unless asked otherwise in the early init file) so it's really not clear what that business with package-initialize was about 🤷 Add some more up-to-date commentary regarding other topics.
2024-03-24Tweak commentaryKévin Le Gouguec
Not sure why I thought this cross-reference "format" was a good idea. Perhaps because it works even if 'calendar' is not loaded? OTOH C-x C-e vomits the docstring to the echo area, so meh.
2024-03-24Beef up program-running helpersKévin Le Gouguec
* .emacs (my/run-strip-newline): New escape hatch, to let my/run DTRT most of the time and spare most callers the cognitive load. (my/run): Heed it. Document. (my/kill-command): New helper; meant for programmatic use where arglists are manipulated as lists, and and no shell escaping is required. (my/kill-date, my/describe-revision): Use it. (my/kill-shell): Document, to disambiguate with my/kill-command.
2024-03-24Add command to kill the current dateKévin Le Gouguec
Comes up often enough, e.g. to add a stamp to a filename; probably was the original motivation for my/kill-shell. Gave a honest attempt at using a transient for this, but got bogged down second-guessing whether I should define my arguments as shorthands inside my transient-define-prefix form, or as dedicated transient-define-argument forms; gave up while trying to figure out whether the shorthand form could use transient-read-date.
2024-03-17Double-down on macros to reduce customization boilerplateKévin Le Gouguec
2024-03-17Fix broken macroKévin Le Gouguec
IIUC the previous version ran customizations immediately during expansion (ultimately expanding to the last customize-set-variable value), instead of generating forms that would run those customizations at appropriate times. Guess I never run Emacs <29 😐
2024-03-17Add helper to guess the correct fill-column for commit messagesKévin Le Gouguec
Also move more customizations to use-package forms.
2024-03-13Eliminate stressorKévin Le Gouguec
Been using that for literal years at $DAYJOB; no idea why it's taken me this long to port to my personal config.
2024-03-02Add helper to run Emacs testcaseKévin Le Gouguec
It's probably more idiomatic to run a testcase you are developing in your own session, using 'M-x ert' commands? I figure starting a fresh Emacs cannot hurt.
2024-02-11Wrestle in the mud with ERCKévin Le Gouguec
Unhappy with those timestamps, but somewhat less unhappy than when I started. Also * remove erc-fill-wrap: as mentioned in the comments, it causes intempestive recentering; * remove erc-notifications-mode; redundant with 'notifications' in erc-modules.
2024-01-08Make Gnus leverage visual-line-modeKévin Le Gouguec
Set shr-fill-text to nil; this automatically causes eww to enable visual-line-mode. For Gnus, the dance is a bit more involved. Not 100% happy with where I landed, but at least I gave myself an escape hatch by rebinding C-c d v in summary buffers. Also, * lift size restriction when fontifying citations: it mostly only ever causes fontification failures when people review big patches, * tweak header order slightly, * align shr heading faces with eighters-title-* faces.
2024-01-01Prevent percent characters from messing up my/kill commandsKévin Le Gouguec
2023-11-26Keep chipping away at custom-set-variablesKévin Le Gouguec
And finally get around to setting calendar-intermonth-text. Re-implement the docstring's example using functions I actually understand.
2023-10-29Stir HTML-yanking function a bitKévin Le Gouguec
2023-10-08Move generic-x configuration to use-packageKévin Le Gouguec
That package is unusual in that it requires… requiring it, in order to activate its settings. So it's a good candidate for use-package's :demand t. It's also a good candidate because something changed in Emacs's Lisp pretty-printing code, and now customizing anything changes how this variable is serialized, generating a spurious diff. Can't wait to have completely moved away from that auto-generated form.
2023-08-20Cleanup project-related commandsKévin Le Gouguec
* Remove provisions for Emacs<28. * Move Magit command to my/magit-map.
2023-07-30Add command to toggle between author/commit datesKévin Le Gouguec
2023-07-30Chip away at Custom fileKévin Le Gouguec
Move Python settings to use-package. Tweak a couple of knobs while in there.
2023-06-21Set a couple of Org ergonomics optionsKévin Le Gouguec
* "Extra keys" are advertised for non-graphical configurations; as it happens, they are also useful to provide substitutes for bindings based on arrow keys. * Speed commands are nice. Might tweak the predicate some day, but the default is already useful.
2023-06-21Switch to default completion UIKévin Le Gouguec
Mostly to avoid icomplete jank (bug#40152). Inspired by: <https://www.scss.tcd.ie/~sulimanm/posts/default-emacs-completion.html> Rationale for the customizations: C-M- chord for navigation Because I found myself missing C-n/C-p in a couple of situations. auto-help 'visible The feedback is not as immediate as icomplete, but it's good enough. Tried 'always, but there's a sit-for somewhere that causes a weird pause if you happen to RET before bringing up completions. auto-select 'second-tab M-v? M-g M-c?? show-help nil "Click on a selection to select it" 😏 format 'one-column Where have you been all my life. max-height 10 More often than not I'm typing something inspired by the content from another buffer, so limit how much context *Completions* can hide. auto-choose icomplete never clobbered the minibuffer until I asked it to (with e.g. C-M-i). Since C-u M-RET is a thing, keep candidates off the minibuffer unless I pull them in, in case I change my mind and start typing something entirely different from the currently highlighted candidate.
2023-06-04Convert diff-hl tweaks to use-packageKévin Le Gouguec
Puzzled by this problem I have with :hook. "(use-package) Hooks" suggests that if package X defines function X-foo to be used by package Y in Y-bar-hook, then the idiomatic thing to do is… (use-package X :hook ((Y-bar . X-foo))) … but empirically, if Y.el contains… (defcustom Y-bar-hook '(Y-quux Y-corge)) (add-hook 'Y-bar-hook #'Y-grault) … then Y-bar-hook will be set to '(X-foo Y-grault): it will be missing the functions added in the defcustom form. Since add-hook does this: (or (boundp hook) (set hook nil)) I am assuming that the problem happens when use-package runs X's :hook additions before Y is loaded. No idea (a) if I can reproduce from -Q (b) if this is a SNAFU from setting always-defer (c) if this could be solved by sprinkling :after or :requires.
2023-06-04Add command to show --help for CLI commandsKévin Le Gouguec
2023-05-18Use default ElDoc echo area settingsKévin Le Gouguec
Recent ElDoc & Eglot developments have made the defaults much more tolerable (the echo area height does not oscillate as much) & useful (linter warnings are no longer preempted by symbol documentation).
2023-04-19Show gravatars in Magit buffersKévin Le Gouguec
'cause why not.
2023-04-19Tweak new ERC 5.6 knobsKévin Le Gouguec
2023-03-05Commit a bunch of .emacs stuffKévin Le Gouguec
* ponder magical "kill context so I can paste it into another app" commands, * remove obsolete Magit variables, * make org-goto use the "path completion" UI, * ponder better buffer names for some buffers.
2023-02-12Adjust shell-mode-hookKévin Le Gouguec
Leave font-lock faces alone; just unset shell-font-lock-keywords.
2023-01-15Port more settings to use-packageKévin Le Gouguec
2023-01-12Remove leftover from 2022-12-30 "Tweak ERC settings" (19d34b7)Kévin Le Gouguec
2023-01-12Move show-paren settings to use-packageKévin Le Gouguec
show-paren-mode is not needed for Emacs≥28, but I still have stuff in these dotfiles that purport to support older versions.
2023-01-11Add a couple of handy commands to C-c d mapKévin Le Gouguec
They've been sitting here unstaged for, like, ever.
2023-01-09Switch to personal themeKévin Le Gouguec
2023-01-03Thoroughly adapt to Modus v4Kévin Le Gouguec
😵‍💫 Trying to get back the sense of sharp contrast I had before. Snippets from *scratch* in case I need to recompute some of these: (defun my/color-hsl-to-rgbhex (h s l) (apply 'color-rgb-to-hex `(,@(color-hsl-to-rgb h s l) 2))) (defun my/color-hs1-l2 (c1 c2) (pcase-let ((`(,h1 ,s1 _) (apply 'color-rgb-to-hsl (color-name-to-rgb c1))) (`(_ _ ,l2) (apply 'color-rgb-to-hsl (color-name-to-rgb c2)))) (message "hue %.3f with s %.3f l %.3f" h1 s1 l2) (apply 'color-rgb-to-hex `(,@(color-hsl-to-rgb h1 s1 l2) 2)))) (defun my/modus-rgb (key palette) (let ((value (car (alist-get key palette)))) (if (stringp value) value (car (alist-get value palette))))) (list-colors-display (list (my/modus-rgb 'bg-completion modus-vivendi-palette) (my/color-hs1-l2 (my/modus-rgb 'bg-completion modus-vivendi-palette) "#303030") (my/color-hs1-l2 (my/modus-rgb 'bg-completion modus-vivendi-palette) "#202020"))) (pcase-dolist (`(,sym ,val) modus-vivendi-palette) (when-let ((color (and (string-match "bg-\\(.*\\)-subtle" (symbol-name sym)) (match-string 1 (symbol-name sym)))) (darker (color-darken-name val 40.0))) (message "%s (%s): %.2f" color val (modus-themes-contrast val (car (alist-get (intern color) modus-vivendi-palette)))) (message "%s (%s): %.2f" color darker (modus-themes-contrast darker (car (alist-get (intern color) modus-vivendi-palette)))))) (dolist (diffkind '(removed changed)) (dolist (suffix '("" "-faint" "-refine")) (insert (format "(bg-%s%s \"%s\")\n" )))) (list-colors-display (seq-map (pcase-lambda (`(,h ,l)) (apply 'color-rgb-to-hex `(,@(color-hsl-to-rgb h 1.0 l) 2))) '((0.00 0.04) (0.00 0.08) (0.00 0.16) (0.59 0.04) (0.59 0.08) (0.59 0.16) (0.12 0.04) (0.12 0.08) (0.12 0.16))))
2023-01-01Tentatively adapt to Modus 4Kévin Le Gouguec
FTR, things that I expect to need further tweaks and/or discussions with Prot: (a) no "version" command, so it's kind of hard to guess what we are working with programmatically, (b) preset palettes overrides are unavailable before loading the themes, and we can't require 'modus-themes either; maybe the manual should point out that users who want to use those presets should (1) do that in :config (2) load the theme twice? (c) lots of backgrounds look very light/saturated to me even in the "faint preset": e.g. diff backgrounds, selected completion, region, eldoc current argument.
2022-12-30Port sneaky isearch setting to use-packageKévin Le Gouguec
2022-12-30Tweak some input sequences for math symbolsKévin Le Gouguec
Try as I might, I can't get my fingers to reach for underscores when my brain is thinking of *equality signs.
2022-12-30Defer all package loadsKévin Le Gouguec
I don't use any of the auto-deferring keywords; setting this shaves a bit off my startup time (5s ↘ 3.2s).
2022-12-30Revert "Defer some package loads"Kévin Le Gouguec
This reverts commit d3e251ac8ac4ee953fe24234b4ff4755a185b494. Will customize use-package-always-defer instead.
2022-12-30Defer some package loadsKévin Le Gouguec
2022-12-30Tweak .emacs commentsKévin Le Gouguec
2022-12-30Tweak ERC settingsKévin Le Gouguec
2022-12-30Make setopt handle multiple variable/value pairsKévin Le Gouguec
Also move it up, closer to Custom-related stuff.
2022-12-27Port package configuration to use-packageKévin Le Gouguec
Also update package list: - account eglot and use-package being built-in - add a couple of packages for Emacs development (elisp-benchmarks, gnus-mock) - remove paradox (most features now built into vanilla package.el)