Merge branch 'develop' into eshell-improvements

This commit is contained in:
Steven vanZyl 2020-05-13 09:17:10 -04:00 committed by GitHub
commit c881f98960
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
75 changed files with 1118 additions and 535 deletions

View file

@ -23,7 +23,7 @@
- [Install](#install)
- [Roadmap](#roadmap)
- [Getting help](#getting-help)
- [Contributing](#contributing)
- [Contribute](#contribute)
# Introduction

View file

@ -23,23 +23,21 @@ the first, fresh scratch buffer you create. This accepts:
(defvar doom-scratch-current-project nil
"The name of the project associated with the current scratch buffer.")
(put 'doom-scratch-current-project 'permanent-local t)
(defvar doom-scratch-buffer-hook ()
"The hooks to run after a scratch buffer is created.")
(defun doom--load-persistent-scratch-buffer (name)
(defun doom--load-persistent-scratch-buffer (project-name)
(setq-local doom-scratch-current-project
(or name
(or project-name
doom-scratch-default-file))
(let ((smart-scratch-file
(expand-file-name (concat doom-scratch-current-project ".el")
doom-scratch-dir))
(scratch-file
(expand-file-name doom-scratch-current-project
doom-scratch-dir)))
(make-directory doom-scratch-dir t)
(cond ((file-readable-p smart-scratch-file)
(when (file-readable-p smart-scratch-file)
(message "Reading %s" smart-scratch-file)
(cl-destructuring-bind (content point mode)
(with-temp-buffer
@ -49,15 +47,7 @@ the first, fresh scratch buffer you create. This accepts:
(funcall mode)
(insert content)
(goto-char point)
t))
((file-readable-p scratch-file) ; DEPRECATED
(when (file-readable-p scratch-file)
(let ((pt (point)))
(erase-buffer)
(insert-file-contents scratch-file)
(set-auto-mode)
(goto-char pt))
t)))))
t))))
;;;###autoload
(defun doom-scratch-buffer (&optional dont-restore-p mode directory project-name)

View file

@ -30,6 +30,14 @@ and Emacs states, and for non-evil users.")
(setq mac-command-modifier 'super
mac-option-modifier 'meta))
;; HACK Emacs cannot distinguish C-i from TAB, which is disturbing. Instead,
;; let's at least make GUI Emacs aware of this distinction:
(define-key key-translation-map [?\C-i]
(λ! (if (and (not (cl-position 'tab (this-single-command-raw-keys)))
(not (cl-position 'kp-tab (this-single-command-raw-keys)))
(display-graphic-p))
[C-i] [?\C-i])))
;;
;;; Universal, non-nuclear escape

View file

@ -157,7 +157,7 @@ at the values with which this function was called."
A factory for quickly producing interaction commands, particularly for keybinds
or aliases."
(declare (doc-string 1) (pure t) (side-effect-free t))
`(lambda () (interactive) ,@body))
`(lambda (&rest _) (interactive) ,@body))
(defalias 'lambda! 'λ!)
(defun λ!! (command &optional arg)
@ -165,7 +165,7 @@ or aliases."
A factory for quickly producing interactive, prefixed commands for keybinds or
aliases."
(declare (doc-string 1) (pure t) (side-effect-free t))
(lambda () (interactive)
(lambda (&rest _) (interactive)
(let ((current-prefix-arg arg))
(call-interactively command))))
(defalias 'lambda!! 'λ!!)

View file

@ -254,6 +254,17 @@ This value is cached. If REFRESH-P, then don't use the cached value."
;; Macros are already fontified, no need for this
(font-lock-remove-keywords 'emacs-lisp-mode use-package-font-lock-keywords)
;; A common mistake for new users is that they inadvertantly try to install
;; their packages with package.el, by copying over old `use-package'
;; declarations with an :ensure t property. Doom doesn't use package.el, so
;; this will throw an error that will confuse beginners.
(setq use-package-ensure-function #'ignore)
;; ...On the other hand, if the user has loaded `package', then we should
;; assume they know what they're doing and restore the old behavior:
(add-transient-hook! 'package-initialize
(when (eq use-package-ensure-function #'ignore)
(setq use-package-ensure-function #'use-package-ensure-elpa)))
;; We define :minor and :magic-minor from the `auto-minor-mode' package here
;; so we don't have to load `auto-minor-mode' so early.
(dolist (keyword '(:minor :magic-minor))

View file

@ -291,7 +291,9 @@ users).")
;; Performance on Windows is considerably worse than elsewhere, especially if
;; WSL is involved. We'll need everything we can get.
(when IS-WINDOWS
(setq w32-get-true-file-attributes nil)) ; slightly faster IO
(setq w32-get-true-file-attributes nil ; slightly faster IO
w32-pipe-read-delay 0 ; faster ipc
w32-pipe-buffer-size (* 64 1024))) ; read more at a time (was 4K)
;; Remove command line options that aren't relevant to our current OS; means
;; slightly less to process at startup.
@ -305,13 +307,13 @@ users).")
;; Adopt a sneaky garbage collection strategy of waiting until idle time to
;; collect; staving off the collector while the user is working.
(when doom-interactive-mode
(setq gc-cons-percentage 0.6)
(setq gcmh-idle-delay 5
gcmh-high-cons-threshold 16777216 ; 16mb
gcmh-verbose doom-debug-mode
gc-cons-percentage 0.6)
(add-transient-hook! 'pre-command-hook (gcmh-mode +1))
(with-eval-after-load 'gcmh
(setq gcmh-idle-delay 10
gcmh-high-cons-threshold 16777216
gcmh-verbose doom-debug-mode ; 16mb
gc-cons-percentage 0.1)
(setq gc-cons-percentage 0.1)
(add-hook 'focus-out-hook #'gcmh-idle-garbage-collect)))
;; HACK `tty-run-terminal-initialization' is *tremendously* slow for some
@ -379,13 +381,16 @@ Set this to nil to disable incremental loading.")
(defvar doom-incremental-idle-timer 0.75
"How long (in idle seconds) in between incrementally loading packages.")
(defvar doom-incremental-load-immediately (daemonp)
"If non-nil, load all incrementally deferred packages immediately at startup.")
(defun doom-load-packages-incrementally (packages &optional now)
"Registers PACKAGES to be loaded incrementally.
If NOW is non-nil, load PACKAGES incrementally, in `doom-incremental-idle-timer'
intervals."
(if (not now)
(nconc doom-incremental-packages packages)
(appendq! doom-incremental-packages packages)
(while packages
(let ((req (pop packages)))
(unless (featurep req)
@ -415,7 +420,7 @@ intervals."
"Begin incrementally loading packages in `doom-incremental-packages'.
If this is a daemon session, load them all immediately instead."
(if (daemonp)
(if doom-incremental-load-immediately
(mapc #'require (cdr doom-incremental-packages))
(when (numberp doom-incremental-first-idle-timer)
(run-with-idle-timer doom-incremental-first-idle-timer

View file

@ -6,7 +6,7 @@
(package! gcmh :pin "b1bde5089169a74f62033d027e06e98cbeedd43f")
;; core-ui.el
(package! all-the-icons :pin "0b74fc361817e885580c3f3408079f949f5830e1")
(package! all-the-icons :pin "d6cb6d4a779eaa3570d8e451fd4d38b2b4554860")
(package! hide-mode-line :pin "88888825b5b27b300683e662fa3be88d954b1cea")
(package! highlight-numbers :pin "8b4744c7f46c72b1d3d599d4fb75ef8183dee307")
(package! rainbow-delimiters :pin "5125f4e47604ad36c3eb4706310fcafac729ca8c")
@ -14,8 +14,8 @@
;; core-editor.el
(package! better-jumper :pin "6d240032ca213ccb3347e25f26c29b6822bf03a7")
(package! dtrt-indent :pin "9163cd990fb1f43dafed3948c6e406c13a45a6be")
(package! helpful :pin "c54e9ddbd6a77858048c1a4c4b549de98af8f88e")
(package! dtrt-indent :pin "50c440c80e0d15303d8ab543bce4c56e9c2bf407")
(package! helpful :pin "c0662aa07266fe204f4e6d72ccaa6af089400556")
(when IS-MAC
(package! ns-auto-titlebar :pin "1efc30d38509647b417f05587fd7003457719256"))
(package! pcre2el :pin "0b5b2a2c173aab3fd14aac6cf5e90ad3bf58fa7d")
@ -38,7 +38,7 @@
:pin "01b39044b9b65fa4ea7d3166f8b1ffab6f740362"))
;; core-projects.el
(package! projectile :pin "5cd261dd75f4d711c0016617621349e2a98b43aa")
(package! projectile :pin "768f0570cad57b6885c4472df803906d097cbc1a")
;; core-keybinds.el
(package! general :pin "42e38034cd2305fa7432866323c923979d8f9b06")

View file

@ -546,7 +546,7 @@ These are side-by-side comparisons, showing how to bind keys with and without
(fullscreen . ,fullscreen))))))
(defun save-frame-dimensions ()
(doom-store-set 'last-frame-size
(doom-store-put 'last-frame-size
(list (frame-position)
(frame-width)
(frame-height)

View file

@ -16,6 +16,7 @@
- [[#what-is-the-meaning-behind-dooms-naming-convention-in-its-source-code][What is the meaning behind Doom's naming convention in its source code?]]
- [[#what-version-of-doom-am-i-running][What version of Doom am I running?]]
- [[#is-discord-the-only-option-for-interacting-with-your-community][Is Discord the only option for interacting with your community?]]
- [[#why-is-scrolling-slow-in-emacsdoom][Why is scrolling slow in Emacs/Doom?]]
- [[#configuration][Configuration]]
- [[#does-doom-respect-xdg-conventions][Does Doom respect XDG conventions]]
- [[#how-do-i-configure-doom-emacs][How do I configure Doom Emacs?]]
@ -64,32 +65,29 @@
- [[#an-upstream-package-was-broken-and-i-cant-update-it][An upstream package was broken and I can't update it]]
- [[#why-do-i-see-ugly-indentation-highlights-for-tabs][Why do I see ugly indentation highlights for tabs?]]
- [[#clipetty--emit-opening-output-file-permission-denied-devpts29-error]["clipetty--emit: Opening output file: Permission denied, /dev/pts/29" error]]
- [[#contributing][Contributing]]
* General
** Why is it called Doom?
It's an homage to idsoftware's classic game, whose open sourced code was
Henrik's (Doom's maintainer) first exposure to programming.
It's an homage to idsoftware's classic game, whose source code was Henrik's
(Doom's maintainer) first exposure to programming, back in the Cretaceous period
(1999).
And if you're obsessed enough with a text editor that you write a community
config for it, you're doomed from the start.
** Does Doom work on Windows?
Windows support is weak and generally lags behind Linux/MacOS support, so your
mileage will vary. However, some have reported success using Doom Emacs on
Windows (using WSL, WSL2 or scoop/chocolatey). You'll find install instructions
in the [[file:getting_started.org::On Windows][Getting Starting guide]].
Windows support is weaker and will lag behind Linux/MacOS support, but your
mileage will vary. Many have reported success using Doom Emacs on Windows (using
WSL, WSL2 or scoop/chocolatey). You'll find install instructions in the [[file:getting_started.org::On Windows][Getting
Starting guide]].
If you're a Windows user, help us improve our documentation!
** Is Doom only for vimmers?
No, but it is Doom's primary audience, because its maintainer is a
dyed-in-the-wool vimmer with almost two decades of vim muscle memory, and he
adopted Emacs in search of a better vim.
Although Doom is less polished without evil, its growing non-evil user base is
slowly improving the situation. We welcome suggestions and PRs to help
accommodate a non-evil workflow.
No, but its maintainer /is/ a dyed-in-the-wool vimmer with almost two decades of
vim muscle memory, so the non-vim experience will be less polished. Still, Doom
has a growing user base of non-vim users, who continue to improve the situation,
and we welcome suggestions and contributions!
If you'd still like a go at it, see the [[file:../modules/editor/evil/README.org::Removing evil-mode][removing evil-mode]] section in the
[[file:../modules/editor/evil/README.org][:editor evil]] module's documentation.
@ -144,15 +142,17 @@ Doom had +four+ *five* goals for its package management system:
superior fork, or aren't available in ELPA repos.
3. *Performance:* lazy-loading the package management system is a tremendous
boon to start up speed. Initializing package.el and straight (and/or checking
that your packages are installed) each time you start up is expensive.
that your packages are installed) or loading package autoloads files each
time you start up is expensive.
4. *Organization:* an Emacs configuration grows so quickly, in complexity and
size. A clear separation of concerns (configuration of packages from their
installation) is more organized.
5. *Reproducibility:* /This goal hasn't been implemented yet/, but all our work
up until now is aimed at this goal. Emacs is a tumultuous ecosystem; packages
break left and right, and we rely on hundreds of them. Eventually, we want
package versions to be locked to Doom's releases so that Doom installs are
reproducible.
installation) is easier to manage.
5. *Reproducibility:* Emacs is a tumultuous ecosystem; packages break left and
right, and we rely on hundreds of them. By pinning our packages we achieve a
degree of config reproducibility and significantly limit the damage upstream
changes can do. Better yet, we stave off having to deal with those issues
until we are ready to. Although technical limitations prevent us from
achieving true reproducibility, this is better than nothing.
** How does Doom start up so quickly?
Doom employs a number of techniques to cut down startup time. Here are its most
@ -199,50 +199,25 @@ helm and ivy). Here is how Doom does it:
(add-hook 'minibuffer-exit-hook #'doom-restore-garbage-collection-h)
#+END_SRC
Another alternative (which is [[https://github.com/hlissner/doom-emacs/blob/develop/core/core.el#L269-L274][what Doom uses]]) is to use the [[https://gitlab.com/koral/gcmh/][gcmh]] package to
stave off the GC until you are idle or unfocus the Emacs frame.
*** Unset ~file-name-handler-alist~ temporarily
Emacs consults this variable every time a file is read or library loaded, or
when certain functions in the file API are used (like ~expand-file-name~ or
~file-truename~).
Emacs does to check if a special handler is needed to read that file, but none
of them are (typically) necessary at startup, so we disable them (temporarily!):
#+BEGIN_SRC emacs-lisp
(defvar doom--file-name-handler-alist file-name-handler-alist)
(setq file-name-handler-alist nil)
;; ... your whole emacs config here ...
;; Then restore it later:
(setq file-name-handler-alist doom--file-name-handler-alist)
;; Alternatively, restore it even later:
(add-hook 'emacs-startup-hook
(lambda ()
(setq file-name-handler-alist doom--file-name-handler-alist)))
#+END_SRC
Don't forget to restore ~file-name-handler-alist~, otherwise TRAMP won't work
and compressed/encrypted files won't open.
Another alternative (which is [[https://github.com/hlissner/doom-emacs/blob/develop/core/core.el#L269-L274][what Doom uses]]) is the [[https://gitlab.com/koral/gcmh/][gcmh]] package; which staves
off the GC until you are idle. Doom also triggers GC when you unfocus the Emacs
frame.
*** Concatenate package autoloads
When you install a package, a PACKAGE-autoloads.el file is generated. This file
contains a map of autoloaded functions and snippets declared by the package.
They tell Emacs where to find them when they are eventually called. In your
conventional Emacs config, every one of these autoloads files are loaded
immediately at startup (when ~package-initialize~ is called).
maps autoloaded functions and snippets to their containing package so Emacs will
know where to find them when they are used. In your conventional Emacs config,
every one of these autoloads files are loaded immediately at startup (when
~package-initialize~ is called).
Since you'll commonly have hundreds of packages, loading hundreds of autoloads
file can hurt startup times, especially without an SSD. We get around this by
concatenating these files into one giant one when you run ~doom sync~.
Emacs 27+ introduces a ~package-quickstart~ command does this for you, and
=straight=, our package manager, does this for you too, but [[https://github.com/hlissner/doom-emacs/tree/develop/core/cli/autoloads.el][Doom Emacs has its
own specialized mechanism]] for this, topped off with a few Doom-specific
optimizations.
Emacs 27+ introduces a ~package-quickstart~ command that does this for you, and
=straight= (which powers our package manager) does this for you too, but [[https://github.com/hlissner/doom-emacs/tree/develop/core/cli/autoloads.el][Doom
Emacs has its own specialized mechanism]] for this, topped off with a few
Doom-specific optimizations.
*** Lazy load package management system(s)
Initializing package.el or straight.el at startup is expensive. We can save some
@ -437,8 +412,8 @@ summons to fight for custody of your kids.
Doom invests a lot of effort to improve runtime performance as well.
+ Doom's package manager (powered by straight.el) is declarative, non-rolling
release and (nominally) reproducible; which is unique on the Emacs distro
scene. Upstream issues won't surprise you as much, and you can roll back when
you don't have the time to deal with them.
scene. Don't let upstream issues surprise you. Roll back or re-pin packages
when you don't have the time to deal with issues.
+ It facilitates integration with the command line, which makes it easy to
integrate external tools with Emacs via the =bin/doom= script.
@ -453,24 +428,64 @@ can also be retrieved using ~M-x doom/version~ (bound to =SPC h d v= or =C-h d
v= by default) or ~bin/doom version~ on the command line.
** Is Discord the only option for interacting with your community?
Yes. I selected it for my personal convenience and have no plans to extend our
community to any other platform (like Matrix, IRC or Slack), or add bridges for
them. I already have my hands full managing the one.
Yes. Discord is already woven into my social and work life, and was selected to
maximize my availability to the community. I have no plans to extend it to other
platforms (like Matrix, IRC or Slack), or add bridges for them, even if they are
better suited to the task. I already have my hands full managing the one.
My being so active on our Discord is owed to that fact that my friends, family
and other communities were on Discord to begin with. My availability was the
most important factor in choosing a platform, even if there are other platforms
better suited to the task.
Email is a possible alternative, but it is constantly swamped; expect a long
Email is a possible alternative, but is constantly swamped; expect a long
turn-around time.
** Why is scrolling slow in Emacs/Doom?
This comes up often. The first thing folks fresh off the boat from other editors
will notice is that Emacs has a low threshold for performance issues. It doesn't
take much to get it to scroll like molasses.
Retina/4K/high res users have it especially hard. MacOS users too, where Emacs
seem even slower. Add to that files that are large (perhaps 1mb+) or have long
lines (200 characters+) and we've got ourselves a really poor experience. And
that's before we factor in plugins and poorly optimized major modes.
There is an unfortunate but necessary adjustment of expectations new users must
undergo, when they adopt Emacs. Doom has inherited this curse. It's raison
d'etre is to improve the situation, but I can only go so far. You /will/ find
cases where Emacs just scrolls slowly.
What can you do about it?
1. Disable some of Doom's slowest modules. The biggest offenders tend to be:
=:ui tabs=, =:ui indent-guides=, =:ui pretty-code=, and =:ui word-wrap=.
2. Turn off line numbers ~(setq display-line-numbers-type nil)~. It's known to
slow down scrolling, in particular.
3. Org users can turn off ~org-superstar-mode~: ~(remove-hook 'org-mode-hook
#'org-superstar-mode)~. It's an aesthetic plugin that offers fancier bullets.
Emacs seems to struggle to display those characters with some fonts.
Org uses can also turn off the rest of org's eye candy:
#+BEGIN_SRC elisp
(after! org
(setq org-fontify-quote-and-verse-blocks nil
org-fontify-whole-heading-line nil
org-hide-leading-stars nil
org-startup-indented nil))
#+END_SRC
4. Turn on =M-x so-long-minor-mode=. This is a minor mode that disables
non-essential functionality and can be used to temporarily view files that
would be too slow otherwise. =M-x so-long-mode= is its extreme version; it
turns off /everything/, including syntax highlighting.
5. Try replacing the =:ui modeline= module with =:ui (modeline +light)=. There
are aspects of the default modeline that can be unpredictably slow.
6. Don't mash =j= (or =C-n=) to scroll. Evil users can scroll long distances
with =C-d= and =C-u=, for instance, to avoid that slowness. Otherwise, use
search mechanisms to move around, like isearch (=C-s=) or evil-search (=/=).
* Configuration
** Does Doom respect XDG conventions
Yes. Your private config (normally in =~/.doom.d=) can be moved to
=~/.config/doom=.
And as of Emacs 27, Emacs will recognize =~/.config/emacs=.
And as of Emacs 27, you can move =~/.emacs.d= to =~/.config/emacs=.
** How do I configure Doom Emacs?
Canonically, your private config is kept in =~/.doom.d/= (or =~/.config/doom/=).
@ -840,14 +855,13 @@ Long answer: Features and performance appear to be the main talking points when
comparing the two, but as far as I'm concerned they are equal in both respects
(not all across the board, but on average).
Instead, what is important to me is maintainability. As someone who frequently
extends and debugs his editor (and maintains a community config), I frequently
run up against issues with ivy and helm, but spend disproportionally more time
doing so with helm than I do ivy, for little or no gain. Though both frameworks
are excellent, the difference in complexity is also reflected in their plugin
ecosystems; ivy plugins tend to be lighter, simpler, more consistent and
significantly easier to hack if I want to change something. Unless you like helm
/just/ the way it is out of the box, ivy is just the simpler choice.
Instead, maintainability is most important for someone that frequently tinkers
with their editor. When I have an issue, I spend a disproportionately more time
dealing helm than I do ivy, for little or no gain. Though both frameworks are
excellent, the difference in complexity is reflected in their plugin ecosystems;
ivy plugins tend to be lighter, simpler, more consistent and significantly
easier to hack if I want to change something. Unless you like helm /just/ the
way it is out of the box, ivy is just the simpler choice.
And since I dogfood it, Ivy's integration into Doom will always be a step or
three ahead of helm's.
@ -941,12 +955,13 @@ you have rambunctious colleagues peppering trailing whitespace into your
project, you need to have a talk (with wiffle bats, preferably) rather than play
a passive-aggressive game of whack-a-mole.
Here at Doom Inc we believe that operations that mutate entire files should not
be automated. Rather, they should be invoked deliberately, when and where it is
needed, by someone that is aware of the potential consequences. This is where
=ws-butler= comes in. It only cleans up whitespace /on the lines you've touched/
*and* it leaves behind virtual whitespace (which is never written to the file)
so your cursor doesn't get thrown around in all that cleanup work.
Here at Doom Inc we believe that operations that mutate entire files (or worse,
projects) should not be automated. Rather, they should be invoked deliberately,
only when and where it is needed, by someone that is aware of the consequences.
This is where =ws-butler= comes in. It only cleans up whitespace /on the lines
you've touched/ *and* it leaves behind virtual whitespace (which is never
written to the file) so your cursor doesn't get thrown around in all that
cleanup work.
In any case, if you had used =ws-butler= from the beginning, trailing whitespace
and newlines would never be a problem!
@ -1082,6 +1097,8 @@ Here are a few common causes for random crashes:
#+END_SRC
Or disable the =:ui doom-dashboard= & =:tools magit= modules (see [[https://github.com/hlissner/doom-emacs/issues/1170][#1170]]).
+ Ligatures and some fonts can cause Emacs to crash. You may want to try a
different font, or disable the =:ui pretty-code= module.
** Can't load my theme; ~unable to find theme file for X~ errors
This means Emacs can't find the X-theme.el file for the theme you want to load.
@ -1163,5 +1180,3 @@ There are a couple ways to address this:
** "clipetty--emit: Opening output file: Permission denied, /dev/pts/29" error
This applies to tmux users, in particular. See
https://github.com/spudlyo/clipetty/issues/15 for a solution.
* TODO Contributing

View file

@ -164,7 +164,7 @@ Small modules that give Emacs access to external tools & services.
+ [[file:../modules/tools/ein/README.org][ein]] - TODO
+ [[file:../modules/tools/eval/README.org][eval]] =+overlay= - REPL & code evaluation support for a variety of languages
+ gist - TODO
+ [[file:../modules/tools/lookup/README.org][lookup]] =+dictionary +docsets= - Universal jump-to & documentation lookup
+ [[file:../modules/tools/lookup/README.org][lookup]] =+dictionary +docsets +offline +xwidget= - Universal jump-to & documentation lookup
backend
+ [[file:../modules/tools/lsp/README.org][lsp]] =+peek= - TODO
+ macos - TODO

View file

@ -214,6 +214,7 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
;; Record in jumplist when opening files via counsel-{ag,rg,pt,git-grep}
(add-hook 'counsel-grep-post-action-hook #'better-jumper-set-jump)
(add-hook 'counsel-grep-post-action-hook #'recenter)
(ivy-add-actions
'counsel-rg ; also applies to `counsel-rg'
'(("O" +ivy-git-grep-other-window-action "open in other window")))

View file

@ -1,7 +1,7 @@
;; -*- no-byte-compile: t; -*-
;;; completion/ivy/packages.el
(package! swiper :pin "9e0803cdb5b47e4e1844e8281516b46589ef26c7")
(package! swiper :pin "84efa3a2cbb9c5b0bbcc8d2e90671434eed74f94")
(package! ivy)
(package! ivy-hydra)
(package! counsel)

View file

@ -202,7 +202,14 @@
:desc "Send to Launchbar" "l" #'+macos/send-to-launchbar
:desc "Send project to Launchbar" "L" #'+macos/send-project-to-launchbar)
(:when (featurep! :tools docker)
:desc "Docker" "D" #'docker))
:desc "Docker" "D" #'docker)
(:when (featurep! :email mu4e)
:desc "mu4e" "m" #'=mu4e)
(:when (featurep! :email notmuch)
:desc "notmuch" "m" #'=notmuch)
(:when (featurep! :email wanderlust)
:desc "wanderlust" "m" #'=wanderlust))
;;; <leader> p --- project
(:prefix ("p" . "project")

View file

@ -549,7 +549,13 @@
:desc "Send to Launchbar" "l" #'+macos/send-to-launchbar
:desc "Send project to Launchbar" "L" #'+macos/send-project-to-launchbar)
(:when (featurep! :tools docker)
:desc "Docker" "D" #'docker))
:desc "Docker" "D" #'docker)
(:when (featurep! :email mu4e)
:desc "mu4e" "m" #'=mu4e)
(:when (featurep! :email notmuch)
:desc "notmuch" "m" #'=notmuch)
(:when (featurep! :email wanderlust)
:desc "wanderlust" "m" #'=wanderlust))
;;; <leader> p --- project
(:prefix-map ("p" . "project")

View file

@ -36,17 +36,6 @@ If ARG (universal argument), runs `compile' from the current directory."
(with-current-buffer buffer
(funcall (default-value 'major-mode))))))
;;;###autoload
(defun +default/lsp-format-region-or-buffer ()
"Format the buffer (or selection) with LSP."
(interactive)
(unless (bound-and-true-p lsp-mode)
(user-error "Not in an LSP buffer"))
(call-interactively
(if (doom-region-active-p)
#'lsp-format-region
#'lsp-format-buffer)))
;;;###autoload
(defun +default/restart-server ()
"Restart the Emacs server."

View file

@ -28,13 +28,15 @@
(defun +default/browse-notes ()
"Browse files from `org-directory'."
(interactive)
(require 'org)
(unless (boundp 'org-directory)
(require 'org))
(doom-project-browse org-directory))
;;;###autoload
(defun +default/find-in-notes ()
"Find a file under `org-directory', recursively."
(interactive)
(require 'org)
(unless (boundp 'org-directory)
(require 'org))
(doom-project-find-file org-directory))
;;;###autoload

View file

@ -50,8 +50,8 @@ If `buffer-file-name' isn't set, uses `default-directory'."
(abbreviate-file-name path)
(file-name-nondirectory path)))))
(defun doom--backward-delete-whitespace-to-column ()
;;;###autoload
(defun doom/backward-delete-whitespace-to-column ()
"Delete back to the previous column of whitespace, or as much whitespace as
possible, or just one char if that's not possible."
(interactive)
@ -74,7 +74,7 @@ possible, or just one char if that's not possible."
;; point and bol.
((and (not indent-tabs-mode)
(not (bolp))
(not (sp-point-in-string))
(not (doom-point-in-string-p))
(save-excursion (>= (- (skip-chars-backward " \t")) tab-width)))
(let ((movement (% (current-column) tab-width)))
(when (= movement 0)
@ -97,7 +97,7 @@ possible, or just one char if that's not possible."
{
|
} => {|}
+ Otherwise, resort to `doom--backward-delete-whitespace-to-column'.
+ Otherwise, resort to `doom/backward-delete-whitespace-to-column'.
+ Resorts to `delete-char' if n > 1"
(interactive "p\nP")
(or (integerp n)
@ -120,12 +120,14 @@ possible, or just one char if that's not possible."
(save-excursion
(insert-char ?\s (- ocol (current-column)) nil))))
;;
((and (= n 1) (bound-and-true-p smartparens-mode))
(cond ((and (memq (char-before) (list ?\ ?\t))
((= n 1)
(cond ((or (not (featurep! +smartparens))
(not (bound-and-true-p smartparens-mode))
(and (memq (char-before) (list ?\ ?\t))
(save-excursion
(and (/= (skip-chars-backward " \t" (line-beginning-position)) 0)
(bolp))))
(doom--backward-delete-whitespace-to-column))
(bolp)))))
(doom/backward-delete-whitespace-to-column))
((let* ((pair (ignore-errors (sp-get-thing)))
(op (plist-get pair :op))
(cl (plist-get pair :cl))
@ -144,6 +146,6 @@ possible, or just one char if that's not possible."
(sp-insert-pair op)
t)
((run-hook-with-args-until-success 'doom-delete-backward-functions))
((doom--backward-delete-whitespace-to-column)))))))
((doom/backward-delete-whitespace-to-column)))))))
;; Otherwise, do simple deletion.
((delete-char (- n) killflag))))

View file

@ -204,36 +204,40 @@
;; This keybind allows * to skip over **.
(map! :map markdown-mode-map
:ig "*" (λ! (if (looking-at-p "\\*\\* *$")
(forward-char 2)
(call-interactively 'self-insert-command)))))
:ig "*" (general-predicate-dispatch nil
(looking-at-p "\\*\\* *")
(λ! (forward-char 2)))))))
;; Highjacks backspace to:
;; a) balance spaces inside brackets/parentheses ( | ) -> (|)
;; b) delete up to nearest column multiple of `tab-width' at a time
;; c) close empty multiline brace blocks in one step:
;; {
;; |
;; }
;; becomes {|}
;; d) refresh smartparens' :post-handlers, so SPC and RET expansions work
;; even after a backspace.
;; e) properly delete smartparen pairs when they are encountered, without
;; the need for strict mode.
;; f) do none of this when inside a string
(advice-add #'delete-backward-char :override #'+default--delete-backward-char-a))
;; HACK Makes `newline-and-indent' continue comments (and more reliably).
;; Consults `doom-point-in-comment-functions' to detect a commented
;; region and uses that mode's `comment-line-break-function' to continue
;; comments. If neither exists, it will fall back to the normal behavior
;; of `newline-and-indent'.
;;
;; We use an advice here instead of a remapping because many modes define
;; and remap to their own newline-and-indent commands, and tackling all
;; those cases was judged to be more work than dealing with the edge
;; cases on a case by case basis.
(defadvice! +default--newline-indent-and-continue-comments-a (&rest _)
;;
;;; Keybinding fixes
;; Highjacks backspace to delete up to nearest column multiple of `tab-width' at
;; a time. If you have smartparens enabled, it will also:
;; a) balance spaces inside brackets/parentheses ( | ) -> (|)
;; b) close empty multiline brace blocks in one step:
;; {
;; |
;; }
;; becomes {|}
;; c) refresh smartparens' :post-handlers, so SPC and RET expansions work even
;; after a backspace.
;; d) properly delete smartparen pairs when they are encountered, without the
;; need for strict mode.
;; e) do none of this when inside a string
(advice-add #'delete-backward-char :override #'+default--delete-backward-char-a)
;; HACK Makes `newline-and-indent' continue comments (and more reliably).
;; Consults `doom-point-in-comment-functions' to detect a commented region
;; and uses that mode's `comment-line-break-function' to continue comments.
;; If neither exists, it will fall back to the normal behavior of
;; `newline-and-indent'.
;;
;; We use an advice here instead of a remapping because many modes define
;; and remap to their own newline-and-indent commands, and tackling all
;; those cases was judged to be more work than dealing with the edge cases
;; on a case by case basis.
(defadvice! +default--newline-indent-and-continue-comments-a (&rest _)
"A replacement for `newline-and-indent'.
Continues comments if executed from a commented line. Consults
@ -244,11 +248,7 @@ Continues comments if executed from a commented line. Consults
(doom-point-in-comment-p)
(fboundp comment-line-break-function))
(funcall comment-line-break-function nil)
t)))
;;
;;; Keybinding fixes
t))
;; This section is dedicated to "fixing" certain keys so that they behave
;; sensibly (and consistently with similar contexts).

View file

@ -1,9 +0,0 @@
(defun yas-java-project-package ()
(or (and (eq major-mode 'java-mode)
(+java-current-package))
""))
(defun yas-java-class-name ()
(or (and (eq major-mode 'java-mode)
(+java-current-class))
""))

View file

@ -1,9 +1,9 @@
# -*- mode: snippet -*-
# name: Java file template
# --
package `(yas-java-project-package)`;
package `(+java-current-package)`;
public class `(yas-java-class-name)` $1
public class `(+java-current-class)` $1
{
$0
}

View file

@ -1,9 +1,9 @@
# -*- mode: snippet -*-
# name: Java MAIN file template
# --
package `(yas-java-project-package)`;
package `(+java-current-package)`;
public class `(yas-java-class-name)` $1
public class `(+java-current-class)` $1
{
public static void main(String[] args) {
$0

View file

@ -198,7 +198,14 @@ See `+format/buffer' for the interactive version of this function, and
;;; Commands
;;;###autoload
(defalias '+format/buffer #'format-all-buffer)
(defun +format/buffer ()
"Reformat the current buffer using LSP or `format-all-buffer'."
(interactive)
(call-interactively
(if (and (bound-and-true-p lsp-mode)
(lsp-feature? "textDocument/formatting"))
#'lsp-format-buffer
#'format-all-buffer)))
;;;###autoload
(defun +format/region (beg end)
@ -208,10 +215,13 @@ WARNING: this may not work everywhere. It will throw errors if the region
contains a syntax error in isolation. It is mostly useful for formatting
snippets or single lines."
(interactive "rP")
(if (and (bound-and-true-p lsp-mode)
(lsp-feature? "textDocument/rangeFormatting"))
#'lsp-format-region
(save-restriction
(narrow-to-region beg end)
(let ((+format-region-p t))
(+format/buffer))))
(+format/buffer)))))
;;;###autoload
(defun +format/region-or-buffer ()
@ -219,11 +229,9 @@ snippets or single lines."
is selected)."
(interactive)
(call-interactively
(if (bound-and-true-p lsp-mode)
#'+default/lsp-format-region-or-buffer
(if (use-region-p)
(if (doom-region-active-p)
#'+format/region
#'+format/buffer))))
#'+format/buffer)))
;;

View file

@ -91,7 +91,7 @@
(name formatter &key modes filter ok-statuses error-regexp)
"Define (or modify) a formatter named NAME.
Supported keywords: :modes :install :filter :ok-statuses :error-regexp
Supported keywords: :modes :filter :ok-statuses :error-regexp
NAME is a symbol that identifies this formatter.

View file

@ -12,10 +12,12 @@
- [[#prerequisites][Prerequisites]]
- [[#features][Features]]
- [[#configuration][Configuration]]
- [[#disabling-persistent-undo-history][Disabling persistent undo history]]
- [[#troubleshooting][Troubleshooting]]
* Description
This module augments Emacs' built-in undo system to be more intuitive.
This module augments Emacs' built-in undo system to be more intuitive and to
persist across Emacs sessions.
** Maintainers
This module has no dedicated maintainers.
@ -47,8 +49,20 @@ This module has no prereqisites.
* TODO Features
# An in-depth list of features, how to use them, and their dependencies.
* TODO Configuration
# How to configure this module, including common problems and how to address them.
* Configuration
** Disabling persistent undo history
+ If you are using =+tree=:
#+BEGIN_SRC elisp
(after! undo-tree
(setq undo-tree-auto-save-history nil))
#+END_SRC
+ If you aren't:
#+BEGIN_SRC elisp
(remove-hook 'undo-fu-mode-hook #'global-undo-fu-session-mode)
#+END_SRC
* TODO Troubleshooting
# Common issues and their solution, or places to look for help.

View file

@ -2,7 +2,7 @@
(use-package! undo-fu
:unless (featurep! +tree)
:after-call doom-switch-buffer after-find-file
:after-call doom-switch-buffer-hook after-find-file
:init
(after! undo-tree
(global-undo-tree-mode -1))

View file

@ -3,5 +3,5 @@
(if (featurep! +tree)
(package! undo-tree :pin "5b6df03781495d8a25695d846b0cce496d3d3058")
(package! undo-fu :pin "0ce9ac36144e80316fff50bfe1bc5dd7e5e7ded6")
(package! undo-fu-session :pin "b808ef0cdcdd2eef221c67eda567eed7fcb3d4af"))
(package! undo-fu :pin "2b1e53285a55ce50ca6fd60b050f2171e235d8f9")
(package! undo-fu-session :pin "0400f15f2a0cfcedb69c06c3ff62f3f8814b62fb"))

View file

@ -80,7 +80,7 @@ environment.systemPackages = with pkgs; [
];
#+END_SRC
[[https://github.com/Emiller88/dotfiles/blob/master/modules/shell/mail.nix][An example of setting up mbsync with home-manager]]
[[https://github.com/Emiller88/dotfiles/blob/5eaabedf1b141c80a8d32e1b496055231476f65e/modules/shell/mail.nix][An example of setting up mbsync and mu with home-manager]]
** openSUSE
Remove ~#~ in ~#sync_program=offlineimap~ to choose ~offlineimap~ instead of

View file

@ -0,0 +1,110 @@
#+TITLE: email/notmuch
#+DATE: May 5, 2019
#+SINCE: v2.0
#+STARTUP: inlineimages
* Table of Contents :TOC:
- [[#description][Description]]
- [[#module-flags][Module Flags]]
- [[#plugins][Plugins]]
- [[#prerequisites][Prerequisites]]
- [[#macos][MacOS]]
- [[#arch-linux][Arch Linux]]
- [[#nixos][NixOS]]
- [[#opensuse][openSUSE]]
- [[#debianubuntu][Debian/Ubuntu]]
- [[#features][Features]]
- [[#configuration][Configuration]]
- [[#gmailier][Gmailier]]
- [[#offlineimap][offlineimap]]
- [[#mbsync][mbsync]]
- [[#notmuch][notmuch]]
- [[#troubleshooting][Troubleshooting]]
* Description
This module makes Emacs an email client, using ~notmuch~.
** Module Flags
+ This module install no module flags.
** Plugins
+ [[https://notmuchmail.org/][notmuch]]
+ [[https://github.com/org-mime/org-mime][org-mime]]
* Prerequisites
This module requires:
+ Either ~gmailieer~ (default), ~mbsync~ or ~offlineimap~ (to sync mail with)
+ ~notmuch~, to index and tag your downloaded messages.
+ ~afew~, optionally to initially tag your downloaded messages.
** TODO MacOS
** TODO Arch Linux
** NixOS
#+BEGIN_SRC nix
environment.systemPackages = with pkgs; [
notmuch
# And one of the following
gmailieer
isync
offlineimap
];
#+END_SRC
[[https://github.com/Emiller88/dotfiles/blob/319841bd3b89e59b01d169137cceee3183aba4fc/modules/shell/mail.nix][An example of setting up mbsync and notmuch with home-manager]]
** TODO openSUSE
** TODO Debian/Ubuntu
* TODO Features
* Configuration
** TODO Gmailier
** offlineimap
This module uses =Gmailier= by default. To use =offlineimap=, change ~+notmuch-sync-backend~:
#+BEGIN_SRC emacs-lisp
(setq +notmuch-sync-backend 'offlineimap)
#+END_SRC
Next, you need to write a configuration file for =offlineimap=. Mine can be found
[[https://github.com/hlissner/dotfiles/tree/master/shell/mu][in my dotfiles repository]]. It is configured to download mail to ~\~/.mail~. I
use [[https://www.passwordstore.org/][unix pass]] to securely store my login credentials. You can find a *very*
detailed configuration [[https://github.com/OfflineIMAP/offlineimap/blob/master/offlineimap.conf][here]].
Next you can download your email with ~offlineimap -o~. This may take a while,
especially if you have thousands of mails.
You can now proceed with the [[*mu and mu4e][mu and mu4e]] section.
** mbsync
This module uses =Gmailier= by default. To use =mbsync=, change ~+notmuch-sync-backend~:
#+BEGIN_SRC emacs-lisp
(setq +notmuch-sync-backend 'mbsync)
#+END_SRC
The steps needed to set up =mu4e= with =mbsync= are very similar to the ones for
[[*offlineimap][offlineimap]].
Start with writing a ~\~/.mbsyncrc~. An example for GMAIL can be found on
[[http://pragmaticemacs.com/emacs/migrating-from-offlineimap-to-mbsync-for-mu4e/][pragmaticemacs.com]]. A non-GMAIL example is available as a gist [[https://gist.github.com/agraul/60977cc497c3aec44e10591f94f49ef0][here]]. The [[http://isync.sourceforge.net/mbsync.html][manual
page]] contains all needed information to set up your own.
Next you can download your email with ~mbsync --all~. This may take a while, but
should be quicker than =offlineimap= ;).
You can now proceed with the [[*mu and mu4e][mu and mu4e]] section.
** notmuch
You should have your email downloaded already. If you have not, you need to set
=Gmailier=, =offlineimap= or =mbsync= up before you proceed.
Before you can use =notmuch=, you need to index your email initially.
#+BEGIN_SRC sh
notmuch new
#+END_SRC
* Troubleshooting

View file

@ -1,9 +1,9 @@
;; -*- no-byte-compile: t; -*-
;;; lang/clojure/packages.el
(package! clojure-mode :pin "c970c4605c")
(package! cider :pin "d63e5652fd")
(package! clj-refactor :pin "8259791e05")
(package! clojure-mode :pin "da9f1ec717dac1194404b4a4562dba6bd9a4ee3a")
(package! cider :pin "3a59fe046c9884573512dff88d140d37c0be7b2c")
(package! clj-refactor :pin "8259791e054382457b87d1f78061b5e3ce948907")
(when (featurep! :checkers syntax)
(package! flycheck-clj-kondo :pin "5472c26ffd"))
(package! flycheck-clj-kondo :pin "5472c26ffdf754a0661357564874ffd4f8598805"))

View file

@ -76,12 +76,15 @@
(map! (:map sly-db-mode-map
:n "gr" #'sly-db-restart-frame)
(:map sly-inspector-mode-map
:n "gb" #'sly-inspector-pop
:n "gr" #'sly-inspector-reinspect
:n "gR" #'sly-inspector-fetch-all
:n "K" #'sly-inspector-describe-inspectee)
(:map sly-xref-mode-map
:n "gr" #'sly-recompile-xref
:n "gR" #'sly-recompile-all-xrefs)
(:map lisp-mode-map
:n "gb" #'sly-pop-find-definition-stack)
(:localleader
:map lisp-mode-map

View file

@ -16,10 +16,10 @@
* Description
This module provides support for [[https://elixir-lang.org/][Elixir programming language]] via [[https://github.com/tonini/alchemist.el][alchemist.el]]
or [[https://github.com/JakeBecker/elixir-ls/][elixir-ls]].
or [[https://github.com/elixir-lsp/elixir-ls/][elixir-ls]].
** Module flags
+ ~+lsp~ Enable LSP support. Requires [[https://github.com/JakeBecker/elixir-ls/][elixir-ls]].
+ ~+lsp~ Enable LSP support. Requires [[https://github.com/elixir-lsp/elixir-ls/][elixir-ls]].
** Plugins
+ [[https://github.com/elixir-editors/emacs-elixir][elixir-mode]]

View file

@ -67,6 +67,9 @@ library/userland functions"
(byte-compile #'+emacs-lisp-highlight-vars-and-faces)))
;;
;;; Handlers
(defun +emacs-lisp--module-at-point ()
(let ((origin (point)))
(save-excursion
@ -126,11 +129,52 @@ if it's callable, `apropos' otherwise."
(thing (helpful-symbol (intern thing)))
((call-interactively #'helpful-at-point))))
;; FIXME
;; (defun +emacs-lisp-lookup-file (thing)
;; (when-let (module (+emacs-lisp--module-at-point thing))
;; (doom/help-modules (car module) (cadr module) 'visit-dir)
;; t))
;;;###autoload
(defun +emacs-lisp-indent-function (indent-point state)
"A replacement for `lisp-indent-function'.
Indents plists more sensibly. Adapted from
https://emacs.stackexchange.com/questions/10230/how-to-indent-keywords-aligned"
(let ((normal-indent (current-column))
(orig-point (point))
;; TODO Refactor `target' usage (ew!)
target)
(goto-char (1+ (elt state 1)))
(parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)
(cond ((and (elt state 2)
(or (not (looking-at-p "\\sw\\|\\s_"))
(eq (char-after) ?:)))
(unless (> (save-excursion (forward-line 1) (point))
calculate-lisp-indent-last-sexp)
(goto-char calculate-lisp-indent-last-sexp)
(beginning-of-line)
(parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t))
(backward-prefix-chars)
(current-column))
((and (save-excursion
(goto-char indent-point)
(skip-syntax-forward " ")
(not (eq (char-after) ?:)))
(save-excursion
(goto-char orig-point)
(and (eq (char-after) ?:)
(eq (char-before) ?\()
(setq target (current-column)))))
(save-excursion
(move-to-column target t)
target))
((let* ((function (buffer-substring (point) (progn (forward-sexp 1) (point))))
(method (or (function-get (intern-soft function) 'lisp-indent-function)
(get (intern-soft function) 'lisp-indent-hook))))
(cond ((or (eq method 'defun)
(and (null method)
(> (length function) 3)
(string-match-p "\\`def" function)))
(lisp-indent-defform state indent-point))
((integerp method)
(lisp-indent-specform method state indent-point normal-indent))
(method
(funcall method indent-point state))))))))
;;
@ -170,6 +214,18 @@ if it's callable, `apropos' otherwise."
load-path)))
(buttercup-run-discover)))
;;;###autoload
(defun +emacs-lisp/edebug-instrument-defun-on ()
"Toggle on instrumentalisation for the function under `defun'."
(interactive)
(eval-defun 'edebugit))
;;;###autoload
(defun +emacs-lisp/edebug-instrument-defun-off ()
"Toggle off instrumentalisation for the function under `defun'."
(interactive)
(eval-defun nil))
;;
;;; Hooks
@ -234,62 +290,3 @@ verbosity when editing a file in `doom-private-dir' or `doom-emacs-dir'."
(when (and start finish)
(put-text-property start finish 'display "...")))))
nil)
;;;###autoload
(defun +emacs-lisp-indent-function (indent-point state)
"A replacement for `lisp-indent-function'.
Indents plists more sensibly. Adapted from
https://emacs.stackexchange.com/questions/10230/how-to-indent-keywords-aligned"
(let ((normal-indent (current-column))
(orig-point (point))
;; TODO Refactor `target' usage (ew!)
target)
(goto-char (1+ (elt state 1)))
(parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)
(cond ((and (elt state 2)
(or (not (looking-at-p "\\sw\\|\\s_"))
(eq (char-after) ?:)))
(unless (> (save-excursion (forward-line 1) (point))
calculate-lisp-indent-last-sexp)
(goto-char calculate-lisp-indent-last-sexp)
(beginning-of-line)
(parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t))
(backward-prefix-chars)
(current-column))
((and (save-excursion
(goto-char indent-point)
(skip-syntax-forward " ")
(not (eq (char-after) ?:)))
(save-excursion
(goto-char orig-point)
(and (eq (char-after) ?:)
(eq (char-before) ?\()
(setq target (current-column)))))
(save-excursion
(move-to-column target t)
target))
((let* ((function (buffer-substring (point) (progn (forward-sexp 1) (point))))
(method (or (function-get (intern-soft function) 'lisp-indent-function)
(get (intern-soft function) 'lisp-indent-hook))))
(cond ((or (eq method 'defun)
(and (null method)
(> (length function) 3)
(string-match-p "\\`def" function)))
(lisp-indent-defform state indent-point))
((integerp method)
(lisp-indent-specform method state indent-point normal-indent))
(method
(funcall method indent-point state))))))))
;;;###autoload
(defun +emacs-lisp/edebug-instrument-defun-on ()
"Toggle on instrumentalisation for the function under `defun'."
(interactive)
(eval-defun 'edebugit))
;;;###autoload
(defun +emacs-lisp/edebug-instrument-defun-off ()
"Toggle off instrumentalisation for the function under `defun'."
(interactive)
(eval-defun nil))

View file

@ -84,6 +84,24 @@ This marks a foldable marker for `outline-minor-mode' in elisp buffers.")
;; Recenter window after following definition
(advice-add #'elisp-def :after #'doom-recenter-a)
(defadvice! +emacs-lisp-append-value-to-eldoc-a (orig-fn sym)
"Display variable value next to documentation in eldoc."
:around #'elisp-get-var-docstring
(when-let (ret (funcall orig-fn sym))
(concat ret " "
(let* ((truncated " [...]")
(limit (- (frame-width) (length ret) (length truncated) 1))
(str (symbol-value sym))
(str (prin1-to-string
(if (stringp str)
(replace-regexp-in-string "\n" " " str)
str)))
(str-length (length str))
(short (< str-length limit)))
(concat (substring (propertize str 'face 'warning)
0 (if short str-length limit))
(unless short truncated))))))
(map! :localleader
:map emacs-lisp-mode-map
:desc "Expand macro" "m" #'macrostep-expand

View file

@ -3,15 +3,16 @@
(package! elisp-mode :built-in t)
(package! highlight-quoted :pin "2410347815")
;; Fontification plugins
(package! highlight-quoted :pin "24103478158cd19fbcfb4339a3f1fa1f054f1469")
;; Tools
(package! macrostep :pin "424e3734a1")
(package! overseer :pin "02d49f582e")
(package! elisp-def :pin "368b04da68")
(package! elisp-demos :pin "57dd4ae3e4")
(package! macrostep :pin "424e3734a1ee526a1bd7b5c3cd1d3ef19d184267")
(package! overseer :pin "02d49f582e80e36b4334c9187801c5ecfb027789")
(package! elisp-def :pin "368b04da68783601b52e3169312183381871cf9e")
(package! elisp-demos :pin "4cd55a30d5dbd8d36a0e6f87261c4fef17fc6db0")
(when (featurep! :checkers syntax)
(package! flycheck-cask :pin "3457ae553c"))
(package! flycheck-cask :pin "3457ae553c4feaf8168008f063d78fdde8fb5f94"))
;; Libraries
(package! buttercup :pin "a91f282025")
(package! buttercup :pin "532d082a363add4f6d9838ca3f924a773ce12136")

View file

@ -1,15 +1,15 @@
;; -*- no-byte-compile: t; -*-
;;; lang/go/packages.el
(package! go-eldoc :pin "cbbd2ea1e9")
(package! go-guru :pin "10d6ab43d9")
(package! go-mode :pin "10d6ab43d9")
(package! gorepl-mode :pin "6a73bf352e")
(package! go-tag :pin "59b243f2fa")
(package! go-gen-test :pin "44c202ac97")
(package! go-eldoc :pin "cbbd2ea1e94a36004432a9ac61414cb5a95a39bd")
(package! go-guru :pin "734d5232455ffde088021ea5908849ac570e890f")
(package! go-mode :pin "734d5232455ffde088021ea5908849ac570e890f")
(package! gorepl-mode :pin "6a73bf352e8d893f89cad36c958c4db2b5e35e07")
(package! go-tag :pin "59b243f2fa079d9de9d56f6e2d94397e9560310a")
(package! go-gen-test :pin "44c202ac97e728e93a35cee028a0ea8dd6e4292c")
(when (featurep! :completion company)
(package! company-go :pin "4acdcbdea7"))
(package! company-go :pin "4acdcbdea79de6b3dee1c637eca5cbea0fdbe37c"))
(when (featurep! :checkers syntax)
(package! flycheck-golangci-lint :pin "8e446c6831"))
(package! flycheck-golangci-lint :pin "8e446c68311048f0b87febf8ef0379e29d358851"))

View file

@ -31,7 +31,9 @@
(map! :map haskell-mode-map
:n "o" #'+haskell/evil-open-below
:n "O" #'+haskell/evil-open-above)
:n "O" #'+haskell/evil-open-above
(:when (featurep! :tools lookup)
[remap haskell-mode-jump-to-def-or-tag] #'+lookup/definition))
(map! :localleader
:map haskell-mode-map

View file

@ -4,10 +4,18 @@
(use-package! lsp-java
:after lsp-clients
:preface
(setq lsp-java-server-install-dir (concat doom-etc-dir "eclipse.jdt.ls/server/")
lsp-java-workspace-dir (concat doom-etc-dir "java-workspace")
lsp-jt-root (concat doom-etc-dir "eclipse.jdt.ls/server/java-test/server/"))
(add-hook! java-mode-local-vars #'lsp!)
(setq lsp-java-workspace-dir (concat doom-etc-dir "java-workspace"))
(add-hook 'java-mode-local-vars-hook #'lsp!)
(map! :when (featurep! :tools debugger +lsp)
:after cc-mode ; where `java-mode' is defined
:map java-mode-map
:localleader
(:prefix ("t" . "Test")
:desc "Run test class or method" "t" #'+java/run-test
:desc "Run all tests in class" "a" #'dap-java-run-test-class
:desc "Debug test class or method" "d" #'+java/debug-test
:desc "Debug all tests in class" "D" #'dap-java-debug-test-class))
:config
;; TODO keybinds
)
(when (featurep! :tools debugger +lsp)
(setq lsp-jt-root (concat lsp-java-server-install-dir "java-test/server/")
dap-java-test-runner (concat lsp-java-server-install-dir "test-runner/junit-platform-console-standalone.jar"))))

View file

@ -13,10 +13,12 @@
- [[#oracle-jdk-11][Oracle JDK 11]]
- [[#ubuntu-1][Ubuntu]]
- [[#fedora-1][Fedora]]
- [[#multiple-java-versions][Multiple Java Versions]]
- [[#features][Features]]
- [[#lsp-features][=+lsp= features]]
- [[#meghanada-features][=+meghanada= features]]
- [[#configuration][Configuration]]
- [[#lsp][=+lsp=]]
* Description
This module adds [[https://www.java.com][java]] support to Doom Emacs, including =android-mode= and
@ -30,6 +32,9 @@ The =+lsp= and =+meghanada= packages are mutually exclusive and do not work
together. At the time of writing the =+meghanada= is already configured whereas
=+lsp= needs to manual configuring.
The =lsp= test runner requires that =:tools (debugger +lsp)= is enabled, as this
provides =dap-mode= which contains the Java test runner.
* Prerequisites
This module requires the Java SDK.
@ -72,6 +77,23 @@ source /etc/profile.d/jdk11.sh
java -version
#+END_SRC
** Multiple Java Versions
It is common to need support for multiple Java versions. You can use a generic
tool like [[https://github.com/shyiko/jabba][jabba]] to install and manage multiple Java versions on any OS.
To switch between Java versions in Doom, you can use [[https://github.com/direnv/direnv][direnv]] and the [[file:~/.emacs.d/modules/tools/direnv/README.org::+TITLE: tools/direnv][direnv module]]. To set a
Java version for a particular project, create a =.envrc= pointing to the Java
installation in the root of the project:
#+BEGIN_SRC conf-unix
PATH_add ~/.jabba/jdk/adopt@1.11.0-3
JAVA_HOME=~/.jabba/jdk/adopt@1.11.0-3
#+END_SRC
And then run =direnv allow .= in the project directory. If the =direnv= module
is enabled, then Doom will automatically source this environment before
executing the LSP server.
* Features
** =+lsp= features
According to [[https://github.com/emacs-lsp/lsp-java]] it adds
@ -111,4 +133,16 @@ According to [[https://github.com/mopemope/meghanada-emacs/]] it adds
+ Search references
+ Full-featured text search
* TODO Configuration
* Configuration
** =+lsp=
Install the eclipse server by executing =M-x lsp-install-server= and selecting
=jdtls=. After that any newly opened =java= files should start the LSP server
automatically.
To update the server, perform =SPC u M-x lsp-install-server=.
Note that if you change Java version you may need to remove the LSP server and
install it again. You can do this with =M-x +lsp/uninstall-server= followed by
=M-x lsp-install-server=.
Enable the =:tools (debugger +lsp)= module to get test runner support.

View file

@ -1,4 +1,4 @@
;;; lang/java/config.el -*- lexical-binding: t; -*-
;;; lang/java/autoload/java.el -*- lexical-binding: t; -*-
;; yasnippet defuns
;;;###autoload
@ -71,3 +71,10 @@ root)."
(user-error "This buffer has no filepath; cannot guess its class name"))
(or (file-name-sans-extension (file-name-base (buffer-file-name)))
"ClassName"))
;;;###autoload
(defun +java/groovy-open-repl ()
"Open a Groovy REPL."
(interactive)
(call-interactively #'run-groovy)
(get-buffer groovy-buffer))

View file

@ -0,0 +1,20 @@
;;; lang/java/autoload/lsp.el -*- lexical-binding: t; -*-
;;;###if (featurep! :tools debugger +lsp)
;;;###autoload
(defun +java/run-test ()
"Runs test at point.
If in a method, runs the test method, otherwise runs the entire test class."
(interactive)
(condition-case nil
(dap-java-run-test-method)
(user-error (dap-java-run-test-class))))
;;;###autoload
(defun +java/debug-test ()
"Runs test at point in a debugger.
If in a method, runs the test method, otherwise runs the entire test class."
(interactive)
(condition-case nil
(call-interactively #'dap-java-debug-test-method)
(user-error (call-interactively #'dap-java-debug-test-class))))

View file

@ -45,4 +45,6 @@ If the depth is 2, the first two directories are removed: net.lissner.game.")
(use-package! groovy-mode
:mode "\\.g\\(?:radle\\|roovy\\)$"
:config
(set-eval-handler! 'groovy-mode "groovy"))
(set-docsets! 'groovy-mode "Groovy" "Groovy_JDK")
(set-eval-handler! 'groovy-mode "groovy")
(set-repl-handler! 'groovy-mode #'+java/groovy-open-repl))

View file

@ -1,5 +1,5 @@
#+TITLE: lang/kotlin
#+DATE: March 28, @019
#+DATE: March 28, 2019
#+SINCE: v3.0.0
#+STARTUP: inlineimages

View file

@ -4,6 +4,7 @@
(when (featurep! +lsp)
(add-hook 'kotlin-mode-local-vars-hook #'lsp!))
(set-docsets! 'kotlin-mode "Kotlin")
(set-repl-handler! 'kotlin-mode #'kotlin-repl)
(map! :map kotlin-mode-map
:localleader

View file

@ -82,7 +82,6 @@ If no viewers are found, `latex-preview-pane' is used.")
:when (featurep! +fold)
:hook (TeX-mode . TeX-fold-buffer)
:hook (TeX-mode . TeX-fold-mode)
:config
;; Fold after all auctex macro insertions
(advice-add #'TeX-insert-macro :after #'+latex-fold-last-macro-a)
@ -91,17 +90,16 @@ If no viewers are found, `latex-preview-pane' is used.")
(advice-add #'cdlatex-math-modify :after #'+latex-fold-last-macro-a)
;; Fold after snippets
(when (featurep! :editor snippets)
(add-hook 'TeX-fold-mode-hook
(defun +latex-fold-set-yas-hook-h ()
"Set a local after-snippet-hook to fold the snippet contents."
(add-hook! 'TeX-fold-mode-hook
(defun +latex-fold-snippet-contents-h ()
(add-hook! 'yas-after-exit-snippet-hook :local
(TeX-fold-region yas-snippet-beg yas-snippet-end)))))
(add-hook 'mixed-pitch-mode-hook
(add-hook! 'mixed-pitch-mode-hook
(defun +latex-fold-set-variable-pitch-h ()
"Fix folded things invariably getting fixed pitch when using mixed-pitch.
Math faces should stay fixed by the mixed-pitch blacklist, this
is mostly for \\section etc."
Math faces should stay fixed by the mixed-pitch blacklist, this is mostly for
\\section etc."
(when mixed-pitch-mode
;; Adding to this list makes mixed-pitch clean the face remaps after us
(add-to-list 'mixed-pitch-fixed-cookie

View file

@ -92,10 +92,6 @@ capture, the end position, and the output buffer.")
(use-package! evil-markdown
:when (featurep! :editor evil +everywhere)
:hook (markdown-mode . evil-markdown-mode)
:init
;; REVIEW Until Somelauw/evil-markdown#1 is resolved:
(defun evil-disable-insert-state-bindings ()
evil-disable-insert-state-bindings)
:config
(add-hook 'evil-markdown-mode-hook #'evil-normalize-keymaps)
(map! :map evil-markdown-mode-map

View file

@ -1,8 +1,8 @@
;; -*- no-byte-compile: t; -*-
;;; lang/markdown/packages.el
(package! markdown-mode :pin "c927a114b1b23cf7538181d62fd14679cce7fa25")
(package! markdown-toc :pin "eda9650a1bf0015e52e9678bd92b0a8beb1d7d71")
(package! markdown-mode :pin "f47a2e9796dfdde6fae7920af23647fe027dc34e")
(package! markdown-toc :pin "a9f13eecd0c7d8be960055dbc2d6f5d3fe6f40ca")
(package! edit-indirect :pin "935ded353b9ed3da67bc61abf245c21b58d88864")
(when (featurep! +grip)
@ -11,4 +11,4 @@
(when (featurep! :editor evil +everywhere)
(package! evil-markdown
:recipe (:host github :repo "Somelauw/evil-markdown")
:pin "46cd81b37991c4325fc24015a610f832b0ff995d"))
:pin "685d7fbb81bc02fa32779d2a127b99a0c8c7436b"))

View file

@ -0,0 +1,57 @@
#+TITLE: lang/nix
#+DATE: May 4, 2020
#+SINCE: v2.0.7
#+STARTUP: inlineimages nofold
* Table of Contents :TOC_3:noexport:
- [[#description][Description]]
- [[#maintainers][Maintainers]]
- [[#module-flags][Module Flags]]
- [[#plugins][Plugins]]
- [[#prerequisites][Prerequisites]]
- [[#features][Features]]
- [[#keybindings][Keybindings]]
- [[#configuration][Configuration]]
- [[#troubleshooting][Troubleshooting]]
* Description
Adds many tools for [[https://nixos.org/][Nix(OS)]] users in nice package for Doom users.
+ Syntax highlighting
+ Completion through ~company~ / ~helm~
+ Nix option lookup
+ Formatting (~nixfmt~)
** Maintainers
This module has no dedicated maintainers.
** Module Flags
This module provides no flags.
** Plugins
+ [[https://github.com/NixOS/nix-mode][nix-mode]]
+ [[https://github.com/jwiegley/nix-update-el][nix-update]]
* Prerequisites
+ ~nixfmt~ is required to use formatting
+ If you have Nix(OS) installed it can be installed through Nix configuration ~environment.systemPackages = with pkgs; [ nixfmt ];~ (recommended)
+ Or through nix-env ~nix-env -iA nixpkgs.nixfmt~
+ Or through nix-shell ~nix-shell -f https://github.com/serokell/nixfmt/archive/master.tar.gz -i~
+ ~:editor format~ ~format-all~ also supports ~nixfmt~ so you can use that also to format Nix code, default binding is ~SPC c f~ in evil.
* Features
** Keybindings
| Binding | Description |
|-------------------+----------------------|
| ~<localleader> b~ | ~nix-build~ |
| ~<localleader> f~ | ~nix-update-fetch~ |
| ~<localleader> o~ | ~+nix/lookup-option~ |
| ~<localleader> p~ | ~nix-format-buffer~ |
| ~<localleader> r~ | ~nix-repl-show~ |
| ~<localleader> s~ | ~nix-repl-shell~ |
| ~<localleader> u~ | ~nix-unpack~ |
* Configuration
* Troubleshooting
+ There aren't any known problems.

View file

@ -1,12 +0,0 @@
;;; lang/org/autoload/contrib-dragndrop.el -*- lexical-binding: t; -*-
;;;###if (featurep! +dragndrop)
;;;###autoload
(defun +org-dragndrop-download-dnd-fn (uri action)
"Handle file links and base64 data uris."
(if (eq major-mode 'org-mode)
(+org/attach-file-and-insert-link uri)
(let ((dnd-protocol-alist
(rassq-delete-all '+org-dragndrop-download-dnd-fn
(copy-alist dnd-protocol-alist))))
(dnd-handle-one-url nil action uri))))

View file

@ -434,20 +434,14 @@ with `org-cycle')."
t))
;;;###autoload
(defun +org-unfold-to-2nd-level-or-point-h ()
"Alters '#+STARTUP overview' to only expand first-level headings.
Expands the first level, but no further. If a different startup option was
provided, do that instead."
(unless org-agenda-inhibit-startup
;; TODO Implement a custom #+STARTUP option?
(when (eq org-startup-folded t)
(outline-hide-sublevels +org-initial-fold-level))
;; If point was left somewhere deeper, unfold to point on startup.
(when (outline-invisible-p)
(defun +org-make-last-point-visible-h ()
"Unfold subtree around point if saveplace places it to a folded region."
(and (not org-agenda-inhibit-startup)
(outline-invisible-p)
(ignore-errors
(save-excursion
(outline-previous-visible-heading 1)
(org-show-subtree))))))
(org-show-subtree)))))
;;;###autoload
(defun +org-remove-occur-highlights-h ()

View file

@ -50,9 +50,6 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default
(defvar +org-capture-projects-file "projects.org"
"Default, centralized target for org-capture templates.")
(defvar +org-initial-fold-level 2
"The initial fold level of org files when no #+STARTUP options for it.")
(defvar +org-habit-graph-padding 2
"The padding added to the end of the consistency graph")
@ -322,11 +319,17 @@ I like:
(after! org-capture
(org-capture-put :kill-buffer t))
;; Fix #462: when refiling from org-capture, Emacs prompts to kill the
;; underlying, modified buffer. This fixes that.
(add-hook 'org-after-refile-insert-hook #'save-buffer)
;; HACK Doom doesn't support `customize'. Best not to advertise it as an
;; option in `org-capture's menu.
(defadvice! +org--remove-customize-option-a (orig-fn table title &optional prompt specials)
:around #'org-mks
(funcall orig-fn table title prompt (remove '("C" "Customize org-capture-templates") specials)))
(funcall orig-fn table title prompt
(remove '("C" "Customize org-capture-templates")
specials)))
(defadvice! +org--capture-expand-variable-file-a (file)
"If a variable is used for a file path in `org-capture-template', it is used
@ -337,13 +340,6 @@ relative to `org-directory', unless it is an absolute path."
(expand-file-name (symbol-value file) org-directory)
file))
(defadvice! +org--prevent-save-prompts-when-refiling-a (&rest _)
"Fix #462: when refiling from org-capture, Emacs prompts to kill the
underlying, modified buffer. This fixes that."
:after #'org-refile
(when (bound-and-true-p org-capture-is-refiling)
(org-save-all-org-buffers)))
(add-hook! 'org-capture-mode-hook
(defun +org-show-target-in-capture-header-h ()
(setq header-line-format
@ -374,7 +370,10 @@ underlying, modified buffer. This fixes that."
(unless org-attach-id-dir
(setq org-attach-id-dir (expand-file-name ".attach/" org-directory)))
(after! projectile
(add-to-list 'projectile-globally-ignored-directories org-attach-id-dir))))
(add-to-list 'projectile-globally-ignored-directories org-attach-id-dir)))
;; Add inline image previews for attachment links
(org-link-set-parameters "attachment" :image-data-fun #'+org-inline-image-data-fn))
(defun +org-init-custom-links-h ()
@ -437,12 +436,11 @@ underlying, modified buffer. This fixes that."
(defun +org-init-habit-h ()
"TODO"
(add-hook! 'org-agenda-mode-hook
(defun +org-habit-resize-graph-h ()
"Right align and resize the consistency graphs based on
`+org-habit-graph-window-ratio'"
(require 'org-habit)
(when (featurep 'org-habit)
(let* ((total-days (float (+ org-habit-preceding-days org-habit-following-days)))
(preceding-days-ratio (/ org-habit-preceding-days total-days))
(graph-width (floor (* (window-width) +org-habit-graph-window-ratio)))
@ -454,7 +452,7 @@ underlying, modified buffer. This fixes that."
nil)))
(setq-local org-habit-preceding-days preceding-days)
(setq-local org-habit-following-days following-days)
(setq-local org-habit-graph-column graph-column-adjusted)))))
(setq-local org-habit-graph-column graph-column-adjusted))))))
(defun +org-init-hacks-h ()
@ -464,6 +462,12 @@ underlying, modified buffer. This fixes that."
;; Open directory links in dired
(add-to-list 'org-file-apps '(directory . emacs))
;; HACK Org is known to use a lot of unicode symbols (and large org files tend
;; to be especially memory hungry). Compounded with
;; `inhibit-compacting-font-caches' being non-nil, org needs more memory
;; to be performant.
(setq-hook! 'org-mode-hook gcmh-high-cons-threshold (* 2 gcmh-high-cons-threshold))
;; When you create a sparse tree and `org-indent-mode' is enabled, the
;; highlighting destroys the invisibility added by `org-indent-mode'.
;; Therefore, don't highlight when creating a sparse tree.
@ -704,12 +708,12 @@ between the two."
:localleader
"d" #'org-agenda-deadline
(:prefix ("c" . "clock")
"c" #'org-agenda-clock-in
"C" #'org-agenda-clock-out
"c" #'org-agenda-clock-cancel
"g" #'org-agenda-clock-goto
"i" #'org-agenda-clock-in
"o" #'org-agenda-clock-out
"r" #'org-agenda-clockreport-mode
"s" #'org-agenda-show-clocking-issues
"x" #'org-agenda-clock-cancel)
"s" #'org-agenda-show-clocking-issues)
"q" #'org-agenda-set-tags
"r" #'org-agenda-refile
"s" #'org-agenda-schedule
@ -968,15 +972,8 @@ compelling reason, so..."
))
;;; Custom org modules
(if (featurep! +brain) (load! "contrib/brain"))
(if (featurep! +dragndrop) (load! "contrib/dragndrop"))
(if (featurep! +ipython) (load! "contrib/ipython"))
(if (featurep! +journal) (load! "contrib/journal"))
(if (featurep! +jupyter) (load! "contrib/jupyter"))
(if (featurep! +pomodoro) (load! "contrib/pomodoro"))
(if (featurep! +present) (load! "contrib/present"))
(if (featurep! +roam) (load! "contrib/roam"))
(if (featurep! +noter) (load! "contrib/noter"))
(dolist (flag doom--current-flags)
(load! (concat "contrib/" (substring (symbol-name flag) 1)) nil t))
;; Add our general hooks after the submodules, so that any hooks the
;; submodules add run after them, and can overwrite any defaults if necessary.
@ -988,7 +985,7 @@ compelling reason, so..."
#'doom-disable-show-trailing-whitespace-h
#'+org-enable-auto-reformat-tables-h
#'+org-enable-auto-update-cookies-h
#'+org-unfold-to-2nd-level-or-point-h)
#'+org-make-last-point-visible-h)
(add-hook! 'org-load-hook
#'+org-init-org-directory-h
@ -1022,6 +1019,16 @@ compelling reason, so..."
:config
(setq org-archive-subtree-save-file-p t) ; save target buffer after archiving
;; Autoload all these commands that org-attach doesn't autoload itself
(use-package! org-attach
:commands (org-attach-new
org-attach-open
org-attach-open-in-emacs
org-attach-reveal-in-emacs
org-attach-url
org-attach-set-directory
org-attach-sync))
;; Global ID state means we can have ID links anywhere. This is required for
;; `org-brain', however.
(setq org-id-track-globally t

View file

@ -10,7 +10,7 @@
:init
;; HACK We add these manually so that org-download is truly lazy-loaded
(pushnew! dnd-protocol-alist
'("^\\(?:https?\\|ftp\\|file\\|nfs\\):" . +org-dragndrop-download-dnd-fn)
'("^\\(?:https?\\|ftp\\|file\\|nfs\\):" . org-download-dnd)
'("^data:" . org-download-dnd-base64))
(advice-add #'org-download-enable :override #'ignore)

View file

@ -2,44 +2,40 @@
;;;###if (featurep! +journal)
(use-package! org-journal
:hook (org-mode . +org-journal-mode-maybe)
:defer t
:init
;; HACK org-journal does some file-path magic at load time that creates
;; duplicate and hard-coded `auto-mode-alist' entries, so we suppress it
;; and use the more generalize regexp (above).
(advice-add #'org-journal-update-auto-mode-alist :override #'ignore)
;; Not using the .org file extension causes so much needless headache with
;; file detection, and for no compelling reason, so we make it the default, so
;; `org-journal' doesn't have to do all this silly magic.
(setq org-journal-file-format "%Y%m%d.org")
(remove-hook 'org-mode-hook #'org-journal-update-auto-mode-alist)
;; HACK `org-journal-dir' has is surrounded by setter and `auto-mode-alist'
;; magic which makes its needlessly difficult to create an "overrideable"
;; default for Doom users, so we set this to an empty string (a
;; non-string would throw an error) so we can detect changes to it later.
(setq org-journal-dir ""
;; Not using the .org file extension causes needless headache with file
;; detection for no compelling reason, so we make it the default, so
;; `org-journal' doesn't have to do all its `auto-mode-alist' magic.
(defvar org-journal-file-format "%Y%m%d.org")
;; HACK `org-journal-dir' is surrounded with setters and `auto-mode-alist'
;; magic which makes it difficult to create an better default for Doom
;; users. We set this here so we can detect user-changes to it later.
(setq org-journal-dir "journal/"
org-journal-cache-file (concat doom-cache-dir "org-journal")
;; Doom opts for an "open in a popup or here" strategy as a default.
;; Open in "other window" is less consistent and harder to predict.
;; Open in "other window" is less predictable, and can replace a window
;; we wanted to keep visible.
org-journal-find-file #'find-file)
;; HACK `org-journal' does some file-path magic at load time that creates
;; duplicate entries in `auto-mode-alist'. We load org-journal in such a
;; way that we can generate a final entry after the user could possibly
;; customize `org-journal-dir'.
(after! org
(require 'org-journal)
;; Delete duplicate entries in `auto-mode-alist'
(rassq-delete-all 'org-journal-mode auto-mode-alist)
;; ...and exploit `org-journal-dir''s setter to set up
;; `org-journal-file-pattern' and call `org-journal-update-auto-mode-alist'
;; for us, to create the one-true-entry in `auto-mode-alist.'
(setq! org-journal-dir (expand-file-name org-journal-dir org-directory)))
:config
;; This is necessary if the user decides opens a journal file directly, via
;; `find-file' or something, and not through org-journal's commands.
(defun +org-journal-mode-maybe ()
"Activate `org-journal-mode', maybe."
(and (eq major-mode 'org-mode)
(stringp buffer-file-name)
(stringp org-journal-file-pattern)
(string-match-p org-journal-file-pattern buffer-file-name)
(let ((org-mode-hook (remq '+org-journal-mode-maybe org-mode-hook)))
(org-journal-mode))))
(when (string-empty-p org-journal-dir)
(setq org-journal-dir (expand-file-name "journal/" org-directory)))
(advice-remove #'org-journal-update-auto-mode-alist #'ignore)
(setq! org-journal-dir org-journal-dir)
(set-popup-rule! "^\\*Org-journal search" :select t :quit t)
(map! (:map org-journal-mode-map
:n "]f" #'org-journal-open-next-entry

View file

@ -4,3 +4,7 @@
(when (featurep! +gnuplot)
(unless (executable-find "gnuplot")
(warn! "Couldn't find gnuplot. org-plot/gnuplot will not work")))
(when (featurep! +roam)
(unless (executable-find "dot")
(warn! "Couldn't find the dot executable (from graphviz). org-roam will not be able to generate graph visuallizations.")))

View file

@ -27,7 +27,7 @@
:recipe (:host github
:repo "emacs-straight/org-mode"
:files ("*.el" "lisp/*.el" "contrib/lisp/*.el"))
:pin "e5eda0beeb3b6b0666550091bcc0df066d52c008")
:pin "20c13221942183290dc440ca6ba91597f243b9e7")
;; ...And prevent other packages from pulling org; org-plus-contrib satisfies
;; the dependency already: https://github.com/raxod502/straight.el/issues/352
(package! org :recipe (:local-repo nil))
@ -51,9 +51,9 @@
(when (featurep! :tools magit)
(package! orgit :pin "e147f055772cc934fe1f1d8619059badeb647c93"))
(when (featurep! +brain)
(package! org-brain :pin "ae7fe0f628bd093526786ece6917f7a4310e5e4d"))
(package! org-brain :pin "ed99f7e38dd687800fb898f8934a0da0541ebcd9"))
(when (featurep! +dragndrop)
(package! org-download :pin "48d3952ad8ebc5ef5a6a77b8c6a4a0da61653036"))
(package! org-download :pin "d248fcb8f2592a40507682e91eed9a31ead4e4a6"))
(when (featurep! +gnuplot)
(package! gnuplot :pin "f0001c30010b2899e36d7d89046322467e923088")
(package! gnuplot-mode :pin "601f6392986f0cba332c87678d31ae0d0a496ce7"))
@ -74,9 +74,9 @@
(package! org-tree-slide :pin "7bf09a02bd2d8f1ccfcb5209bfb18fbe02d1f44e")
(package! org-re-reveal :pin "61549f4c00284a30e34caa3d76001b233ea5d2ad"))
(when (featurep! +roam)
(package! org-roam :pin "e698ed7f5378106da8a8fec4537658392157657c")
(package! org-roam :pin "ad5fca5440e5c8a6b8078013684df43b3e43d773")
(when (featurep! :completion company)
(package! company-org-roam :pin "0913d86f167164e18831206e611f44bb8e7297e3")))
(package! company-org-roam :pin "3da3821d1736e0d05a042bd944b74ea1da4a021b")))
;;; Babel
(package! ob-async :pin "80a30b96a007d419ece12c976a81804ede340311")

View file

@ -79,14 +79,19 @@ This module has no direct prerequisites. Here are some of its soft dependencies.
** Language Server Protocol Support
This module must be enabled with the =+lsp= flag, and the =:tools lsp= module
must be enabled. LSP will try mspyls, then pyls; whichever is available.
must be enabled. LSP will try pyls then mspyls; the first that is available.
mypyls can be installed with ~M-x lsp-install-server~ after opening a python
buffer.
Alternatively, use the [[https://pypi.org/project/python-language-server/][Python Language Server]] instead. ~pip install
*To use [[https://pypi.org/project/python-language-server/][Python Language Server]] (pyls)* install it with ~pip install
'python-language-server[all]'~
*To use mspyls*, install it with ~M-x lsp-install-server~ and add this to your
private config.el:
#+BEGIN_SRC elisp
(after! lsp-python-ms
(set-lsp-priority! 'mspyls 1))
#+END_SRC
* Features
This module supports LSP. It requires installation of [[https://pypi.org/project/python-language-server/][Python Language
Server]] or [[https://github.com/Microsoft/python-language-server][Microsoft Language Server]], see [[Language Server Protocol Support][LSP Support]].

View file

@ -50,6 +50,11 @@
(set-lookup-handlers! 'ruby-mode
:definition #'robe-jump
:documentation #'robe-doc)
(when (boundp 'read-process-output-max)
;; Robe can over saturate IPC, making interacting with it slow/clobbering
;; the GC, so increase the amount of data Emacs reads from it at a time.
(setq-hook! '(robe-mode-hook inf-ruby-mode-hook)
read-process-output-max (* 1024 1024)))
(when (featurep! :editor evil)
(add-hook 'robe-mode-hook #'evil-normalize-keymaps))
(map! :localleader

View file

@ -3,34 +3,34 @@
;; Major modes
(package! ruby-mode :built-in t)
(package! yard-mode :pin "ba74a47463")
(package! yard-mode :pin "ba74a47463b0320ae152bd42a7dd7aeecd7b5748")
;; REPL
(package! inf-ruby :pin "41e5ed3a88")
(package! inf-ruby :pin "41e5ed3a886fca56990486f1987bb3bae0dbd54b")
(when (featurep! :completion company)
(package! company-inf-ruby :pin "fe3e4863bc"))
(package! company-inf-ruby :pin "fe3e4863bc971fbb81edad447efad5795ead1b17"))
;; Programming environment
(package! rubocop :pin "03bf15558a")
(package! robe :pin "68503b32bb")
(package! rubocop :pin "03bf15558a6eb65e4f74000cab29412efd46660e")
(package! robe :pin "68503b32bb3a005787ecb7a7fdeb3bb4a2317e2b")
;; Project tools
(package! bundler :pin "43efb6be4e")
(package! rake :pin "9c204334b0")
(package! bundler :pin "43efb6be4ed118b06d787ce7fbcffd68a31732a7")
(package! rake :pin "9c204334b03b4e899fadae6e59c20cf105404128")
;; Environment management
(when (featurep! +rbenv)
(package! rbenv :pin "2ea1a5bdc1"))
(package! rbenv :pin "2ea1a5bdc1266caef1dd77700f2c8f42429b03f1"))
(when (featurep! +rvm)
(package! rvm :pin "134497bc46"))
(package! rvm :pin "134497bc460990c71ab8fa75431156e62c17da2d"))
(when (featurep! +chruby)
(package! chruby :pin "42bc6d521f"))
(package! chruby :pin "42bc6d521f832eca8e2ba210f30d03ad5529788f"))
;; Testing frameworks
(package! rspec-mode :pin "9a2a9d2935")
(package! minitest :pin "97d7d1760b")
(package! rspec-mode :pin "9a2a9d2935ae17b8570485bdea7c347533b464f6")
(package! minitest :pin "ddd152c990a528ad09a696bfad23afa4330ea4d7")
;; Rails
(when (featurep! +rails)
(package! projectile-rails :pin "0398d940a2")
(package! inflections :pin "e4f1372cf2"))
(package! projectile-rails :pin "11980b2bcb99208888856a9b8666ff329b6f0142")
(package! inflections :pin "e4f1372cf22e811faca52fc86bdd5d817498a4d8"))

View file

@ -21,13 +21,15 @@
t))
(defun +eshell--bury-buffer (&optional dedicated-p)
(let ((directory default-directory))
(unless (switch-to-prev-buffer nil 'bury)
(switch-to-buffer (doom-fallback-buffer)))
(when (eq major-mode 'eshell-mode)
(switch-to-buffer (doom-fallback-buffer)))
(when +eshell-enable-new-shell-on-split
(when-let (win (get-buffer-window (+eshell/here)))
(set-window-dedicated-p win dedicated-p))))
(let ((default-directory directory))
(when-let (win (get-buffer-window (+eshell/here t)))
(set-window-dedicated-p win dedicated-p))))))
(defun +eshell--setup-window (window &optional flag)
(when (window-live-p window)

View file

@ -187,9 +187,8 @@ You should use `set-eshell-alias!' to change this.")
;; installed for bash completion to work. How frustrating. This way we
;; can at least get bash completion whether or not fish is present.
(defadvice! +eshell--fallback-to-bash-a (&rest _)
:before-while #'fish-completion--list-completions-with-desc
(executable-find "fish")))
:before-until #'fish-completion--list-completions-with-desc
(unless (executable-find "fish") "")))
;; Activate eshell-did-you-mean using its setup function (lazily)
(use-package! eshell-did-you-mean

View file

@ -33,7 +33,8 @@ If prefix ARG is non-nil, recreate vterm buffer in the current project's root."
(let ((buffer (get-buffer-create buffer-name)))
(with-current-buffer buffer
(unless (eq major-mode 'vterm-mode)
(vterm-mode)))
(vterm-mode))
(+vterm--change-directory-if-remote))
(pop-to-buffer buffer)))))
;;;###autoload
@ -55,7 +56,25 @@ If prefix ARG is non-nil, cd into `default-directory' instead of project root."
project-root))
display-buffer-alist)
(setenv "PROOT" project-root)
(vterm)))
(vterm)
(+vterm--change-directory-if-remote)))
(defun +vterm--change-directory-if-remote ()
"When `default-directory` is remote, use the corresponding
method to prepare vterm at the corresponding remote directory."
(when (and (featurep 'tramp)
(tramp-tramp-file-p default-directory))
(message "default-directory is %s" default-directory)
(with-parsed-tramp-file-name default-directory path
(let ((method (cadr (assoc `tramp-login-program
(assoc path-method tramp-methods)))))
(vterm-send-string
(concat method " "
(when path-user (concat path-user "@")) path-host))
(vterm-send-return)
(vterm-send-string
(concat "cd " path-localname))
(vterm-send-return)))))
(defvar +vterm--insert-point nil)

View file

@ -3,4 +3,4 @@
(package! vterm
:built-in 'prefer
:pin "e63bd65eece7c5de3a534b7e2fdbe58256ec2da0")
:pin "422ffe029b92c47e4acf0e2ed06cbc83636d7e44")

View file

@ -6,5 +6,5 @@
(package! realgud-trepan-ni :pin "6e9cac5e8097018aadf41c88de541168036cc227")))
(when (featurep! +lsp)
(package! dap-mode :pin "04d7e967f21a0ab1e2223e528baf55fe5b663882")
(package! dap-mode :pin "cc2eb2fc1b2958ef01dad8c004d2f3bc4dc38bc3")
(package! posframe :pin "093b29a53cbeda6d637ccc9ef4dfc47123e79b9e"))

View file

@ -40,6 +40,7 @@ or synonyms.
+ ~+dictionary~ Enable word definition and thesaurus lookup functionality.
+ ~+offline~ Install and prefer offline dictionary/thesaurus.
+ ~+docsets~ Enable integration with Dash.app docsets.
+ ~+xwidget~ Enable integration with [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Embedded-WebKit-Widgets.html][Embedded Webkit Widgets]].
** Plugins
+ [[https://github.com/jacktasia/dumb-jump][dumb-jump]]
@ -81,7 +82,7 @@ export PATH="/usr/local/opt/sqlite/bin:$PATH"
** Arch Linux
#+BEGIN_SRC sh
sudo pacman -S sqlite ripgrep
sudo yay -S wordnet-cli
yay -S wordnet-cli
#+END_SRC
** NixOS

View file

@ -96,6 +96,8 @@ Used by `+lookup/dictionary-definition' and `+lookup/synonyms'.
For `+lookup/dictionary-definition', this is ignored on Mac, where Emacs users
Dictionary.app behind the scenes to get definitions.")
(defvar +lookup--dash-docs-xwidget-webkit-last-session-buffer nil)
;;
;;; dumb-jump
@ -178,6 +180,21 @@ See https://github.com/magit/ghub/issues/81"
(let ((gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3"))
(funcall orig-fn url)))
;; Dash docset + Xwidget integration
(when (featurep! +xwidget)
(defun +lookup-dash-docs-xwidget-webkit-browse-url-fn (url &optional new-session)
(if (not (display-graphic-p))
(eww url new-session)
(setq xwidget-webkit-last-session-buffer +lookup--dash-docs-xwidget-webkit-last-session-buffer)
(save-window-excursion
(xwidget-webkit-browse-url url new-session))
(with-popup-rules!
'((set-popup-rule! "^\\*xwidget" :vslot -11 :size 0.35 :select nil))
(pop-to-buffer xwidget-webkit-last-session-buffer))
(setq +lookup--dash-docs-xwidget-webkit-last-session-buffer xwidget-webkit-last-session-buffer
xwidget-webkit-last-session-buffer nil)))
(setq dash-docs-browser-func #'+lookup-dash-docs-xwidget-webkit-browse-url-fn))
(cond ((featurep! :completion helm)
(require 'helm-dash nil t))
((featurep! :completion ivy)

View file

@ -5,7 +5,7 @@
"Change the PRIORITY of lsp CLIENT."
(require 'lsp-mode)
(if-let (client (gethash client lsp-clients))
(setf (lsp--client-priority (gethash server lsp-clients))
(setf (lsp--client-priority client)
priority)
(error "No LSP client named %S" client)))

View file

@ -91,6 +91,10 @@ This also logs the resolved project root, if found, so we know where we are."
;; development builds of Emacs 27 and above
(or (not (boundp 'read-process-output-max))
(setq-local read-process-output-max (* 1024 1024)))
;; REVIEW LSP causes a lot of allocations, with or without Emacs 27+'s
;; native JSON library, so we up the GC threshold to stave off
;; GC-induced slowdowns/freezes.
(setq-local gcmh-high-cons-threshold (* 2 gcmh-high-cons-threshold))
(prog1 (lsp-mode 1)
(setq-local lsp-buffer-uri (lsp--buffer-uri))
;; Announce what project root we're using, for diagnostic purposes

View file

@ -1,8 +1,8 @@
;; -*- no-byte-compile: t; -*-
;;; tools/lsp/packages.el
(package! lsp-mode :pin "941e6062a5b407675e13ba471e9878f4a2dbd10e")
(package! lsp-ui :pin "43f71e3837b07f377444ad631b12f8198c495aa7")
(package! lsp-mode :pin "11750e7b118858b38417a538c1c6eff8759c12f3")
(package! lsp-ui :pin "1288be94b4c37f89e80a03b1cff1b81aba9560bb")
(when (featurep! :completion ivy)
(package! lsp-ivy :pin "81e81ced99829358674c5a6bbe2c3e15cecd4ed8"))
(when (featurep! :completion helm)

View file

@ -0,0 +1,101 @@
#+TITLE: tools/pdf
#+DATE: February 6, 2018
#+SINCE: v2.0
#+STARTUP: inlineimages nofold
* Table of Contents :TOC_3:noexport:
- [[#description][Description]]
- [[#maintainers][Maintainers]]
- [[#module-flags][Module Flags]]
- [[#plugins][Plugins]]
- [[#hacks][Hacks]]
- [[#prerequisites][Prerequisites]]
- [[#building-epdfinfo-on-windows][Building =epdfinfo= on Windows]]
- [[#features][Features]]
- [[#configuration][Configuration]]
- [[#troubleshooting][Troubleshooting]]
* Description
This module improves Emacs' support for reading PDF files.
** Maintainers
This module has no dedicated maintainers.
** Module Flags
This module provides no flags.
** Plugins
+ [[https://github.com/politza/pdf-tools][pdf-tools]]
** Hacks
+ Added basic support for HiDPI or Retina displays.
* Prerequisites
This module will build the =epdfinfo= program when you first open a pdf file.
Linux and macOS don't need to do anything special. Windows users, however, must
build it themselves.
** Building =epdfinfo= on Windows
1. [[https://www.msys2.org/][Install MSYS2]] and update the package database and core packages using the
instructions provided.
2. Update and install dependencies, skipping any you already have
#+BEGIN_SRC sh
pacman -Syu
pacman -S base-devel
pacman -S mingw-w64-x86_64-toolchain
pacman -S mingw-w64-x86_64-zlib
pacman -S mingw-w64-x86_64-libpng
pacman -S mingw-w64-x86_64-poppler
pacman -S mingw-w64-x86_64-imagemagick
#+END_SRC
3. Install PDF tools in Emacs, but do not try to compile the server. Instead, get a separate copy of the source somewhere else.
#+BEGIN_SRC sh
git clone https://github.com/politza/pdf-tools
#+END_SRC
4. Open mingw64 shell (Note: You must use mingw64.exe and not msys2.exe)
5. Compile pdf-tools:
#+BEGIN_SRC sh
# Cask requires python2 (important: not 3!)
pacman -S python2
# Make the mingw-shell aware of your python installation. Adjust the path if
# Emacs is installed elsewhere!
export PATH="/c/Program Files (x86)/Emacs/bin/:$PATH"
# Cask needs to know where git.exe is; change this path if git is installed
# elsewhere!
export PATH="/c/Program Files/Git/bin:$PATH"
# Install cask. Certificate errors can be ignored with (unsafe) -k option.
curl -fsSL https://raw.githubusercontent.com/cask/cask/master/go | python
# Make sure the build process can see cask
export PATH="$HOME/.cask/bin:$PATH"
cd /path/to/pdf-tools
make -s
#+END_SRC
6. This should produce a file =server/epdfinfo.exe=. Copy this file into the
=~/.emacs.d/.local/straight/build/pdf-tools/=.
7. Start Emacs.
8. Open a pdf file (or run ~M-x pdf-tools-install~)
9. Test it out: ~M-x pdf-info-check-epdfinfo~
* TODO Features
# An in-depth list of features, how to use them, and their dependencies.
* TODO Configuration
# How to configure this module, including common problems and how to address them.
* TODO Troubleshooting
# Common issues and their solution, or places to look for help.

View file

@ -25,6 +25,18 @@
(setq pdf-view-use-scaling t
pdf-view-use-imagemagick nil)
;; Persist current page for PDF files viewed in Emacs
(add-hook! 'pdf-view-change-page-hook
(defun +pdf-remember-page-number-h ()
(when buffer-file-name
(doom-store-put buffer-file-name (pdf-view-current-page) nil "pdf-view"))))
(add-hook! 'pdf-view-mode-hook
(defun +pdf-restore-page-number-h ()
(when-let (page (doom-store-get buffer-file-name "pdf-view"))
(or (and (< page 1)
(> page (pdf-cache-number-of-pages)))
(pdf-view-goto-page page)))))
;; Add retina support for MacOS users
(when IS-MAC
(advice-add #'pdf-util-frame-scale-factor :around #'+pdf--util-frame-scale-factor-a)

View file

@ -0,0 +1,54 @@
#+TITLE: tools/rgb
#+DATE: May 6, 2020
#+SINCE: 3.0.0
#+STARTUP: inlineimages nofold
* Table of Contents :TOC_3:noexport:
- [[#description][Description]]
- [[#maintainers][Maintainers]]
- [[#module-flags][Module Flags]]
- [[#plugins][Plugins]]
- [[#prerequisites][Prerequisites]]
- [[#features][Features]]
- [[#configuration][Configuration]]
* Description
Highlights color hex values and names with the color itself, and provides tools
to easily modify color values or formats.
** Maintainers
This module has no dedicated maintainers.
** Module Flags
This module provides no flags.
** Plugins
# A list of linked plugins
+ [[https://elpa.gnu.org/packages/rainbow-mode.html][rainbow-mode]]
+ [[https://github.com/alphapapa/kurecolor][kurecolor]]
* Prerequisites
This module has no prerequisites.
* Features
# An in-depth list of features, how to use them, and their dependencies.
=rainbow-mode= provides automatic highlighting to hex color codes, and in
relevant modes, color names (e.g. html color names in =css-mode= or LaTeX color
names in =latex-mode=)
=kurecolor= provides commands to easily change the brightness, saturation, and
hue of hex colors (and a useful hydra for this, if =:ui hydra= is enabled), as
well as conversion between hex and css colors
* Configuration
# How to configure this module, including common problems and how to address them.
=hl-line-mode= overrides the color highlighting of =rainbow-mode=, which limits
the use of that plugin and on site color changes using =kurecolor=. To
automatically disable it only when =rainbow-mode= is active, you can add the
following hook:
#+BEGIN_SRC elisp
;; ~/.doom.d/config.el
(add-hook! 'rainbow-mode-hook
(hl-line-mode (if rainbow-mode -1 +1)))
#+END_SRC

View file

@ -0,0 +1,64 @@
#+TITLE: tools/upload
#+DATE: Feb 19, 2020
#+SINCE: 2.0.9
#+STARTUP: inlineimages nofold
* Table of Contents :TOC_3:noexport:
- [[#description][Description]]
- [[#maintainers][Maintainers]]
- [[#module-flags][Module Flags]]
- [[#plugins][Plugins]]
- [[#prerequisites][Prerequisites]]
- [[#features][Features]]
- [[#configuration][Configuration]]
- [[#troubleshooting][Troubleshooting]]
- [[#root-local-and-root-remote-must-match][~root-local~ and ~root-remote~ must match]]
* Description
Uses ~ssh-deploy~ to map a local folder to a remote one.
From the [[https://github.com/cjohansson/emacs-ssh-deploy/blob/master/README.md][ssh-deploy README]]:
#+BEGIN_QUOTE
The ssh-deploy plug-in for Emacs makes it possible to effortlessly deploy local files and directories to remote hosts via Tramp (including but not limited to SSH, SFTP, FTP). It tries to provide functions that can be easily used by custom scripts.
The idea for this plug-in was to mimic the behavior of PhpStorm deployment functionality.
#+END_QUOTE
** Maintainers
This module has no dedicated maintainers.
** Module Flags
This module provides no flags.
** Plugins
+ [[https://github.com/cjohansson/emacs-ssh-deploy][ssh-deploy]]
* Prerequisites
This module has no prerequisites.
* Features
Uses ~ssh-deploy~ to map a local folder to a remote one. Set
~ssh-deploy-root-remote~ and ~ssh-deploy-root-local~ in a .dir-locals.el file
to establish this mapping.
Example:
#+BEGIN_SRC emacs-lisp
((nil . ((ssh-deploy-root-local . "/local/path/to/project")
(ssh-deploy-root-remote . "/ssh:user@server:/remote/project/")
(ssh-deploy-on-explicity-save . t))))
#+END_SRC
Note: ~ssh-deploy-root-local~ is optional, and will resort to
~doom-project-root~ if unspecified.
* TODO Configuration
Check out [[https://github.com/cjohansson/emacs-ssh-deploy#deployment-configuration-examples][Deployment configuration examples]] for some ideas of what's possible.
* Troubleshooting
** ~root-local~ and ~root-remote~ must match
The final directory names much match
#+BEGIN_SRC emacs-lisp
((nil . ((ssh-deploy-root-local . "/local/path/to/example-project")
(ssh-deploy-root-remote . "/ssh:user@server:/remote/example-project/")
#+END_SRC

View file

@ -1,5 +1,5 @@
;; -*- no-byte-compile: t; -*-
;;; ui/doom/packages.el
(package! doom-themes :pin "254d476dd6790eaa6b563c5a4da286321ff75d38")
(package! doom-themes :pin "34f181c290d2c9fb9628e4ec85c16e633931ede1")
(package! solaire-mode :pin "adc8c0c60d914f6395eba0bee78feedda128b30b")

View file

@ -281,6 +281,13 @@ Ugh, such an ugly hack."
(apply orig-fn args))))
;;;###package org-journal
(defadvice! +popup--use-popup-window-a (orig-fn &rest args)
:around #'org-journal-search-by-string
(letf! ((#'switch-to-buffer #'pop-to-buffer))
(apply orig-fn args)))
;;;###package persp-mode
(defadvice! +popup--persp-mode-restore-popups-a (&rest _)
"Restore popup windows when loading a perspective from file."

View file

@ -86,7 +86,7 @@ emacs, this is implemented in two different ways :
automatically depending on the capabilities of the font, and no font-specific
configuration is necessary.
Emacs-mac port implements the /composition-function-table/ method in its code,
Emacs-mac port implements the /composition-function-table/ method in [[https://bitbucket.org/mituharu/emacs-mac/src/26c8fd9920db9d34ae8f78bceaec714230824dac/lisp/term/mac-win.el?at=master#lines-345:805][its code]],
nothing is necessary on Doom side; otherwise, Doom implements the
/composition-function-table/ for emacs 28+ built with Harfbuzz support, and the
/prettify-symbols-mode/ method otherwise.

View file

@ -51,33 +51,34 @@ besides what is listed.")
;;; Automatic font-specific ligatures
(defvar +prog-ligatures-alist
(eval-when-compile
`((?! . ,(regexp-opt '("!!" "!=" "!==")))
(?# . ,(regexp-opt '("##" "###" "####" "#(" "#:" "#=" "#?" "#[" "#_" "#_(" "#{")))
(?$ . ,(regexp-opt '("$>" "$>>")))
(?% . ,(regexp-opt '("%%" "%%%")))
(?& . ,(regexp-opt '("&&" "&&&")))
(?* . ,(regexp-opt '("*" "**" "***" "**/" "*/" "*>")))
(?+ . ,(regexp-opt '("+" "++" "+++" "+>")))
(?- . ,(regexp-opt '("--" "---" "-->" "-<" "-<<" "->" "->>" "-}" "-~")))
(?. . ,(regexp-opt '(".-" ".." "..." "..<" ".=")))
(?/ . ,(regexp-opt '("/*" "/**" "//" "///" "/=" "/==" "/>")))
(?: . ,(regexp-opt '(":" "::" ":::" ":=" ":<" ":=" ":>")))
'((?! . "\\(?:!\\(?:==\\|[!=]\\)\\)") ; (regexp-opt '("!!" "!=" "!=="))
(?# . "\\(?:#\\(?:###?\\|_(\\|[#(:=?[_{]\\)\\)") ; (regexp-opt '("##" "###" "####" "#(" "#:" "#=" "#?" "#[" "#_" "#_(" "#{"))
(?$ . "\\(?:\\$>>?\\)") ; (regexp-opt '("$>" "$>>"))
(?% . "\\(?:%%%?\\)") ; (regexp-opt '("%%" "%%%"))
(?& . "\\(?:&&&?\\)") ; (regexp-opt '("&&" "&&&"))
(?* . "\\(?:\\*\\(?:\\*[*/]\\|[)*/>]\\)?\\)") ; (regexp-opt '("*" "**" "***" "**/" "*/" "*>" "*)"))
(?+ . "\\(?:\\+\\(?:\\+\\+\\|[+:>]\\)?\\)") ; (regexp-opt '("+" "++" "+++" "+>" "+:"))
(?- . "\\(?:-\\(?:-\\(?:->\\|[>-]\\)\\|<[<-]\\|>[>-]\\|[:<>|}~-]\\)\\)") ; (regexp-opt '("--" "---" "-->" "--->" "->-" "-<" "-<-" "-<<" "->" "->>" "-}" "-~" "-:" "-|"))
(?. . "\\(?:\\.\\(?:\\.[.<]\\|[.=>-]\\)\\)") ; (regexp-opt '(".-" ".." "..." "..<" ".=" ".>"))
(?/ . "\\(?:/\\(?:\\*\\*\\|//\\|==\\|[*/=>]\\)\\)") ; (regexp-opt '("/*" "/**" "//" "///" "/=" "/==" "/>"))
(?: . "\\(?::\\(?:::\\|[+:<=>]\\)?\\)") ; (regexp-opt '(":" "::" ":::" ":=" ":<" ":=" ":>" ":+"))
(?\; . ";;") ; (regexp-opt '(";;"))
(?0 . "0\\(?:\\(x[a-fA-F0-9]\\).?\\)") ; Tries to match the x in 0xDEADBEEF
;; (?x . ,(regexp-opt '("x"))) ; Also tries to match the x in 0xDEADBEEF
(?\; . ,(regexp-opt '(";;")))
(?< . ,(regexp-opt '("<!--" "<$" "<$>" "<*" "<*>" "<+" "<+>" "<-" "<--" "<->" "</" "</>" "<<" "<<-" "<<<" "<<=" "<=" "<=" "<=<" "<==" "<=>" "<>" "<|" "<|>" "<~" "<~~")))
(?= . ,(regexp-opt '("=/=" "=:=" "=<<" "==" "===" "==>" "=>" "=>>")))
(?> . ,(regexp-opt '(">-" ">->" ">:" ">=" ">=>" ">>" ">>-" ">>=" ">>>")))
(?? . ,(regexp-opt '("??" "?." "?:" "?=")))
(?\[ . ,(regexp-opt '("[]" "[|]" "[|")))
(?\\ . ,(regexp-opt '("\\\\" "\\\\\\" "\\\\n")))
(?^ . ,(regexp-opt '("^=" "^==")))
(?w . ,(regexp-opt '("www" "wwww")))
(?{ . ,(regexp-opt '("{-" "{|" "{||" "{|}" "{||}")))
(?| . ,(regexp-opt '("|=" "|>" "||" "||=" "|->" "|=>" "|]" "|}")))
(?_ . ,(regexp-opt '("_|_" "__")))
(?~ . ,(regexp-opt '("~-" "~=" "~>" "~@" "~~" "~~>")))))
;; (?x . "x") ; Also tries to match the x in 0xDEADBEEF
;; (regexp-opt '("<!--" "<$" "<$>" "<*" "<*>" "<**>" "<+" "<+>" "<-" "<--" "<---" "<->" "<-->" "<--->" "</" "</>" "<<" "<<-" "<<<" "<<=" "<=" "<=<" "<==" "<=>" "<===>" "<>" "<|" "<|>" "<~" "<~~" "<." "<.>" "<..>"))
(?< . "\\(?:<\\(?:!--\\|\\$>\\|\\*\\(?:\\*?>\\)\\|\\+>\\|-\\(?:-\\(?:->\\|[>-]\\)\\|[>-]\\)\\|\\.\\(?:\\.?>\\)\\|/>\\|<[<=-]\\|=\\(?:==>\\|[<=>]\\)\\||>\\|~~\\|[$*+./<=>|~-]\\)\\)")
(?= . "\\(?:=\\(?:/=\\|:=\\|<<\\|=[=>]\\|>>\\|[=>]\\)\\)") ; (regexp-opt '("=/=" "=:=" "=<<" "==" "===" "==>" "=>" "=>>"))
(?> . "\\(?:>\\(?:->\\|=>\\|>[=>-]\\|[:=>-]\\)\\)") ; (regexp-opt '(">-" ">->" ">:" ">=" ">=>" ">>" ">>-" ">>=" ">>>"))
(?? . "\\(?:\\?[.:=?]\\)") ; (regexp-opt '("??" "?." "?:" "?="))
(?\[ . "\\(?:\\[\\(?:|]\\|[]|]\\)\\)") ; (regexp-opt '("[]" "[|]" "[|"))
(?\\ . "\\(?:\\\\\\\\[\\n]?\\)") ; (regexp-opt '("\\\\" "\\\\\\" "\\\\n"))
(?^ . "\\(?:\\^==?\\)") ; (regexp-opt '("^=" "^=="))
(?w . "\\(?:wwww?\\)") ; (regexp-opt '("www" "wwww"))
(?{ . "\\(?:{\\(?:|\\(?:|}\\|[|}]\\)\\|[|-]\\)\\)") ; (regexp-opt '("{-" "{|" "{||" "{|}" "{||}"))
(?| . "\\(?:|\\(?:->\\|=>\\||=\\|[]=>|}-]\\)\\)") ; (regexp-opt '("|=" "|>" "||" "||=" "|->" "|=>" "|]" "|}" "|-"))
(?_ . "\\(?:_\\(?:|?_\\)\\)") ; (regexp-opt '("_|_" "__"))
(?\( . "\\(?:(\\*\\)") ; (regexp-opt '("(*"))
(?~ . "\\(?:~\\(?:~>\\|[=>@~-]\\)\\)")) ; (regexp-opt '("~-" "~=" "~>" "~@" "~~" "~~>"))
"An alist of all ligatures used by `+prog-ligatures-modes'.
The car is the character ASCII number, cdr is a regex which will call