Commit Graph

410 Commits

Author SHA1 Message Date
f34c33aa07 Fix clipboard in tty Emacs
xclip has support for a number of clipboard programs (xclip, xsel,
pb{copy,paste}, wl-copy, termux-clipboard and getclip).
2019-10-23 05:05:45 -04:00
e1622142ed Minor, general refactors 2019-10-23 03:57:48 -04:00
6e6672b135 Disable read-only-mode in so-long-minor-mode 2019-10-22 12:36:43 -04:00
5b9b029bbf Comment & further optimize so-long-mode 2019-10-20 10:58:53 -04:00
634b4b2bc7 Associate *.log files with text-mode 2019-10-20 10:58:53 -04:00
70e6c17de5 Don't autorevert if minibuffer is active
Some ivy/helm commands allow you to preview buffers, which is not an
appropriate time to (invisibly) revert them. The message could be missed
and expensive machinary could be triggered (e.g. updating git-gutter),
which could appear slow. Best to defer reverting until the user has
deliberately landed on the target, and is more likely to notice a revert
notification in the minibuffer.

Suggested by @flatwhatson
2019-10-20 10:58:53 -04:00
63c41fefcb doom-guess-mode-h: affect interactively saved files
A half revert of 9b003e051.
2019-10-19 14:18:14 -04:00
9b003e0516 Fix doom-guess-mode-h being too aggressive
It would trigger set-auto-mode whenever files are written to (e.g. when
persp-mode writes its workspace/session files, which have unsafe local
variables, so the user is inundated with prompts to accept them).

Now, doom-guess-mode-h will only work on files with shebang lines.
2019-10-19 13:50:42 -04:00
ee5cdd13dd Guess major-mode when saving a fundamental-mode file 2019-10-18 21:10:55 -04:00
323e0adf45 Minor refactors & reformatting across the board 2019-10-17 01:47:58 -04:00
88af741597 Stop auto-revert prompting for confirmation
I misunderstood revert-without-query.
2019-10-14 18:43:40 -04:00
51973dca9b Move auto-fill-mode to text-mode-hook 2019-10-14 18:25:02 -04:00
94406c0f36 Set a jump point when using imenu 2019-10-10 13:43:47 +10:00
dc24237800 Perform large-file checks after major-mode is decided
Fixes an issue where pdfs (in pdf-view-mode) weren't been converted
correctly because the file was declared large while it was being read in
fundamental-mode.
2019-10-08 21:10:42 -04:00
cb495aabe6 Have so-long-minor-mode disable more expensive minor modes
And not disable font-lock-mode or display-line-numbers-mode, so we can
have basic highlighting.
2019-10-08 21:09:52 -04:00
0426b9d514 Create a jump point before kill-current-buffer
So you can easily "undo" killing it.
2019-10-07 23:56:47 -04:00
95258c55d6 Remove xclip-mode & osx-clipboard-mode
Due to the varied approaches to terminal environments, I leave it up to
the user to handle restoration of the clipboard.
2019-10-07 18:06:13 -04:00
6ee96d15aa Merge pull request #1842 from flatwhatson/undo-tree
Experimental fixes for undo-tree
2019-10-07 16:24:25 -04:00
774ca43e32 dtrt-indent-max-lines = 2000
Reduced from default of 5000 for slightly faster analysis
2019-10-07 16:07:38 -04:00
616dec5b93 Optimize opening large files #1834
Fixes an issue where dtrt-indent and/or nav-flash would hang Emacs when
opening large files, and disables all mode hooks for large
files (without using fundamental-mode so you can at least get syntax
highlighting).
2019-10-07 16:02:23 -04:00
bb5ff21203 Remove redundant bookmark-save-flag setting
Its default value is `t`
2019-10-05 20:20:30 -04:00
ed96d60e2c Add comments for undo-tree advice
Describes why we try to compress undo-tree history data. I'm aware that
undo-tree-auto-save-history is disabled, but that may change in the near
future.
2019-10-03 12:04:54 -04:00
aa087e3af2 Experimental fixes for undo-tree
Increase `undo-limit`, `undo-strong-limit` and `undo-outer-limit` by a
factor of ten, which should prevent emacs from prematurely truncating
the undo history and corrupting the tree.

Restore `undo-tree-auto-save-history` which was disabled to avoid
exacerbating the undo history truncation.

Change the `undo-tree` recipe to grab the latest version from the
maintainer's repostiory instead of the outdated ELPA version.

Restore `undo-tree-enable-undo-in-region` which should be fixed in the
latest version of `undo-tree`.
2019-10-01 22:37:18 +10:00
c080ae8c9f Only disable smartparens in replace mode if it is enabled
Prevents an issue where smartparens would re-enable itself, even when it
has been disabled by the user.
2019-09-30 14:58:34 -04:00
67617254bc Optimize save-place caching
By reducing its limit from 200 to 100 (its default is 400) and by *not*
prettifying its cache file (pp is much more expensive than prin1).
2019-09-28 12:47:20 -04:00
1aaf229473 Silence byte-compiler warning from better-jumper
At least until gilbertw1/better-jumper#2 is merged.
2019-09-20 17:18:16 -04:00
3b7711420f General comment revision & cleanup 2019-09-06 00:25:35 -04:00
c0d2ab331e Remove command-log-mode
This isn't vital enough a package to be included in core. Emacs already
provides view-lossage, and there are other, better packages for
displaying your keybinds as you type.

Even one that I've been working on (with special evil support):
https://github.com/hlissner/doom-emacs-private/blob/master/lisp/keycast.el
2019-09-06 00:13:40 -04:00
4b736bef68 Introduce doom-interactive-mode
As soft inverse alias for noninteractive; this makes it easier to unit
test functionality that depends on the session type.
2019-09-03 00:37:30 -04:00
4d73f659f5 Refactor out nested hook defuns & refactor core.el
Moves file-handling config to core-editor.el.
2019-07-27 02:46:49 +02:00
82ae3a73f3 def-advice!->defadvice! & conform to new advice conventions
This commit does two things:

- Renames def-advice! to defadvice!, in the spirit of naming convenience
  macros after the function/macro they enhance or replace.
- Correct the names of advice functions to indicate visibility and
  intent. A public advice function like doom-set-jump-a is meant to be
  used elsewhere. A private one like +dired--cleanup-header-line-a
  shouldn't -- it likely won't work anywhere but the function(s) it was
  made to advise.
2019-07-23 17:24:56 +02:00
76cacb5bfe 💥 Rename def-package! -> use-package!
Calling this pivotal macro "def-package!" has frequently been a source
of confusion. It is a thin wrapper around use-package, and it should be
obvious that it is so. For this reason, and to match the naming
convention used with other convenience macros/wrappers, it is now
use-package!.

Also changes def-package-hook! -> use-package-hook!

The old macros are now marked obsolete and will be removed when straight
integration is merged.
2019-07-23 12:50:45 +02:00
c795a988e6 Conform many modules to new conventions 2019-07-23 12:30:47 +02:00
7ac155f68d Fix company help replacing the current buffer
Instead of displaying in a popup.
2019-07-23 02:04:44 +02:00
b465500a27 Improve smartparens config and comments 2019-07-22 02:38:20 +02:00
060ede0e2e General, minor reformatting across the board
And an offering of blood to our great lord Byte Compiler-sama.
2019-07-22 02:37:45 +02:00
5005721039 lang/emacs-lisp: make company-elisp use helpful
Instead of describe-*
2019-07-22 02:30:40 +02:00
2df56b93a9 Add so-long package
This package kicks in if you open a file whose lines are too long.

It is built into Emacs 27+, but I've backported it for earlier users.
2019-07-22 02:30:38 +02:00
fdcb259bcd Major refactor of Doom core files
- Remove core-os and move many of its settings out to other core
  libraries, where they belong
- Significantly improve commenting & compartmentalization of many
  settings
- Correct some mis-named public hooks (that were named as if they were
  private)
- Move the vast majority of optimizations to "Optimizations" section in
  core.el
- Don't activate xclip-mode or osx-clipboard-mode if we're accessing
  Emacs through an SSH connection (does more bad than good there)
- Add fast-but-imprecise-scrolling = t
- Set bidi-display-reordering = 'left-to-right, at the recommendation of
  an Emacs dev. Apparently setting it to nil is undefined, as Emacs is
  designed to always assume it's set; setting it explicitly to
  left-to-right will still do what was originally intended by turning it
  off: to reduce line/text scans for bidirectional text, which gives us
  a moderate boost in general runtime snappiness
- Set inhibit-compacting-fon-caches = t on windows (where it struggles
  especially with icon fonts)
- Disables "literal" mode for very large files (because I will be
  backporting so-long.el from Emacs 27 in the next commit)
2019-07-22 02:30:38 +02:00
149b2617b0 💥 revise hook/var fns naming convention (2/2)
This is second of three big naming convention changes. In this commit,
we change the naming conventions for hook functions and variable
functions:

1. Replace the bar | to indicate a hook function with a -h suffix, e.g.

     doom|init-ui -> doom-init-ui-h
     doom|run-local-var-hooks -> doom-run-local-var-hooks-h

2. And add a -fn suffix for functions meant to be set on variables,
   e.g.

     (setq magit-display-buffer-function #'+magit-display-buffer-fn)

See ccf327f8 for the reasoning behind these changes.
2019-07-22 02:30:38 +02:00
51d3b1b424 💥 revise advice naming convention (1/2)
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.

In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.

  doom*shut-up -> doom-shut-up-a
  doom*recenter -> doom-recenter-a
  +evil*static-reindent -> +evil--static-reindent-a

The rationale behind this change is:

1. Elisp's own formatting/indenting tools would occasionally struggle
   with | and * (particularly pp and cl-prettyprint). They have no
   problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
   github markdown) struggle with it, sometimes refusing to highlight
   code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
   intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
   on haphazardly way back when Doom was simply "my private config".

Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.

Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
  macro. The old pair weren't as useful. The new def-advice! saves on a
  lot of space.
- Removed "stage" assertions to make sure you were using the right
  macros in the right place. Turned out to not be necessary, we'll
  employ better checks later.
2019-07-22 02:27:45 +02:00
0b28480a21 Remap xref-pop-marker-stack -> better-jumper
Better to have only one jumplist system.

Also remaps xref-find-* commands to +lookup commands earlier in the
startup process.
2019-07-13 15:47:19 +02:00
3423ecc3d3 Load server on focus-out
In case the user switches to a terminal to use emacsclient as soon as
emacs is started.
2019-07-10 20:35:28 +02:00
a9951ee63b Autorevert on switch window
Better coverage for lazy autoreverting
2019-06-26 14:31:07 +02:00
9a02bd8ac8 Minor refactors across the board
- when-let* -> when-let
- Fix projectile-locate-dominating-file for connected remote files
2019-06-26 14:31:06 +02:00
c0eb1f524d Fix exclusion of doom local files in recentf
Due to a load order issue, the doom-local-dir regexp wouldn't be mapped
through our custom recentf-filename-handlers. `file-in-directory-p` is
more robust.
2019-06-26 14:28:40 +02:00
3589ce4c5b Fix exclusion of doom-local-dir from recentf list 2019-06-18 13:38:21 +02:00
12fa049012 Disable lazy autorevert if auto-revert-mode is used 2019-06-18 00:51:59 +02:00
6be401f1a7 Refactor Doom core & reload autoloads remotely
- Move subr-x/cl-lib loading to core-lib
- Revise docstrings for and rename various CLI functions to be more
  descriptive and up-to-date
- After regenerating autoloads file, bin/doom will try to reload
  autoloads files remotely, through the server/daemon, if possible. This
  is highly experimental and could break
2019-06-16 23:01:17 +02:00
4ae6faf627 scroll-margin = 0 2019-06-10 09:38:56 +02:00