Commit Graph

43 Commits

Author SHA1 Message Date
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
345d09d393 lang/emacs-lisp: don't fontify function in quoted list 2019-07-18 13:13:31 +02:00
a201409fdd Minor refactors across the board 2019-07-10 21:27:12 +02:00
39faabab6a lang/emacs-lisp: fix imenu regexp for sections
Otherwise, section labels with non-symbol characters would be excluded
from imenu's results.
2019-06-16 19:16:23 +02:00
34b4ff12f4 lang/emacs-lisp: remove buggy read-only hook
Breaks package-install when it attempts to byte-compile package files.
2019-05-22 05:35:37 -04:00
3073bcbe39 lang/emacs-lisp: suppress errors during flycheck 2019-05-21 17:29:29 -04:00
3e15b71568 lang/emacs-lisp: optimize var/face highlighting
A slight performance improvement in files with a lot of comments and
strings, by skipping ahead a line if in a comment and to the next double
quote if in a string. Otherwise, this function would visit every symbol
in between, and syntax-ppss calls are relatively expensive here.
2019-05-20 21:09:12 -04:00
08bfd5879a Enable read-only-mode in package files
These files shouldn't be modified directly.
2019-05-20 21:09:12 -04:00
8aff431ed9 Fix "section" imenu regexp 2019-05-13 22:32:33 -04:00
bd79f942d3 lang/emacs-lisp: fix false errors from featurep! 2019-05-03 13:39:00 -04:00
25beb4bcfd lang/emacs-lisp: restore flycheck in elisp buffers
However, with `emacs-lisp-checkdoc` disabled and `emacs-lisp`
significantly gimped.

byte-compile-warnings may need to be adjusted to allow for *some*
warnings.

Also, reformat emacs-lisp-mode hooks
2019-05-02 21:23:33 -04:00
fd04f468e2 lang/emacs-lisp: reformat autoloads file
Moves public function away from interactive commands.
2019-05-01 21:02:29 -04:00
983f081369 lang/emacs-lisp: improve imenu support
Among other things:

- Recognizes after!, ;;;###package and use-package as "Packages"
- Recognizes outline-minor-mode "Sections"
2019-05-01 21:02:29 -04:00
6d314c2795 Revise and update docstrings and comments 2019-05-01 21:02:28 -04:00
784ae418da Fix wrong-type-argument on +emacs-lisp-eval
When using +eval commands in file-less buffers, like the scratch buffer.
2019-03-15 16:15:17 -04:00
6afe3d4115 Remove unneeded negation 2019-03-12 11:25:48 -04:00
7b4afa32e4 Improvements to apropos and describe-symbol
Patch the apropos button types so they call helpful instead of the
built-in describe functions.  Also add some bindings to apropos-mode-map
so it behaves like other help modes.

Add `doom/describe-symbol` function, which shows documentation for
callable and variable symbols.  If a symbol is both a variable and a
callable, it dispatches to apropos.  This gives a better workflow than
`helpful-symbol`, which annoyingly prompts the user.

Remap `describe-symbol` to `doom/describe-symbol`, and update
`+emacs-lisp-lookup-documentation` to call it also.
2019-03-12 18:52:24 +10:00
54d1c0dd56 Minor, general refactors 2019-03-09 03:42:55 -05:00
75b366285f lang/emacs-lisp: list package comments in imenu
Lines with ;; `package-name` will be considered package markers.
2019-03-05 00:11:57 -05:00
c7aa41599d Add new emacs-lisp :documentation lookup handler
Made to do-what-I-mean. Uses describe-symbol/helpful-symbol and falls
back to apropos.
2019-03-04 20:47:25 -05:00
0872b29767 Ensure doom--current-module is set
When evaluating elisp code through feature/eval's commands (e.g. gr/gR).
2019-02-24 13:55:57 -05:00
94b16cba6c Standardize REPL commands & improve SPC o r
- SPC o r now prompts for a REPL to open when none was found for the
  current buffer.
- REPL handlers must now follow the naming convention "*/open*-repl".
  e.g. +python/open-ipython-repl, +emacs-lisp/open-repl, etc.
- +eval/open-repl has been split in two:
  - +eval/open-repl-other-window
  - +eval/open-repl-same-window
2019-02-18 01:59:56 -05:00
b56639e31b Remove deprecated set! & def-setting! macros 2019-01-05 17:48:46 -05:00
2a84836c11 +emacs-lisp-eval: emit backtrace on error
Running +eval/region (gr) and +eval/buffer (gR) will use
+emacs-lisp-eval (in emacs-lisp-mode buffers). This change will force it
to emit a backtrace in case of an error.
2018-09-25 23:26:08 -04:00
9d445c8a1f make compile: fix error in emacs-lisp
```
In toplevel form:
../modules/lang/emacs-lisp/autoload.el:71:21:Error: Wrong type argument: listp, "~/.emacs.d/modules/lang/emacs-lisp/autoload"
✕ Failed to compile modules/lang/emacs-lisp/autoload.el
```

This apparently attempts to get compiled multiple times, avoid that by
attempting to compile only if it is not compiled already.
2018-09-12 22:55:13 +01:00
c58077810d General refactor of modules
General code and comment improvements.

Also, removed the :desc's for csv-mode because map! is currently unable
to set which-key descriptions mode-locally, and should be avoided for
anything but global keybinds. This will be fixed when General is
introduced into Doom.
2018-09-09 09:58:20 -04:00
7d3ffdff06 Remove third line in section headers
This is truly important stuff. We've saved many lives with this update.
2018-09-09 09:58:19 -04:00
4acb3f29ab lang/emacs-lisp: reformat & autoload functions 2018-08-21 02:56:53 +02:00
09cb4f6716 Major refactor & optimization of how modules load their packages
Now that we are loading package autoloads files (as part of the
generated doom-package-autoload-file when running make autoloads), many
:commands properties are redundant. In fact, many def-package! blocks
are redundant.

In some cases, we can do without a config.el file entirely, and can move
into the autoloads file or rely entirely on package autoloads.

Also, many settings have been moved in their module's autoloads files,
which makes them available ASAP; their use no longer depends on module
load order.

This gained me a modest ~10% boost in startup speed.
2018-05-25 00:46:16 +02:00
c421f3de64 lang/emacs-lisp: delay mode hooks in eval output buffer 2018-03-02 23:26:58 -05:00
d443aed25c feature/eval: improve compatibility with feature/popups
This makes quickrun, *doom eval* and *Pp Eval Output* buffers behave
better.

Eval output buffers should a) shrink themselves to the size of their
output (within reason), b) *not* grab focus, and c) be easy to close
from afar with C-g/Escape.

Gotchas:

1. Quickrun gets output asynchronously, so we shrink it on
   quickrun-after-run-hook, not in the popup rule.
2. *doom eval* and *Pp Eval Output* opens with its output ready, so the
   popup system may shrink those to fit.
3. *doom eval* and *Pp Eval Output* handle window selection themselves.
   Let them by setting the select window parameter to #'ignore.
2018-01-08 17:30:54 -05:00
8e7b822062 Remove core-popup coupling
New popup management system coming soon!
2018-01-03 03:44:34 -05:00
f440bc37a3 lang/emacs-lisp: fix +eval/buffer fn not capturing entire buffer #313 2017-12-29 13:37:26 -05:00
c7254e7bdc Major optimization refactor, across the board
+ enable lexical-scope everywhere (lexical-binding = t): ~5-10% faster
  startup; ~5-20% general boost
+ reduce consing, function calls & garbage collection by preferring
  cl-loop & dolist over lambda closures (for mapc[ar], add-hook, and
  various cl-lib filter/map/reduce functions) -- where possible
+ prefer functions with dedicated opcodes, like assq (see byte-defop's
  in bytecomp.el for more)
+ prefer pcase & cond (faster) over cl-case
+ general refactor for code readability
+ ensure naming & style conventions are adhered to
+ appease byte-compiler by marking unused variables with underscore
+ defer minor mode activation to after-init, emacs-startup or
  window-setup hooks; a customization opportunity for users + ensures
  custom functionality won't interfere with startup.
2017-06-09 00:47:45 +02:00
9ac3b1fea8 lang/emacs-lisp: refactor +emacs-lisp-eval 2017-05-15 20:26:33 +02:00
4aa1427811 feature/eval: :eval now accepts functions (refactor emacs-lisp eval fn) 2017-05-07 02:45:52 +02:00
cfc52a8d40 lang/emacs-lisp: remove ert commands 2017-04-04 03:36:07 -04:00
75d8ee079d lang/emacs-lisp: remove +emacs-lisp/find-function (use xref now) 2017-03-15 22:59:49 -04:00
ca75c1cf49 lang{emacs-lisp,python,ruby}: improve repl integration 2017-03-04 18:31:18 -05:00
6d6da0e9aa lang/emacs-lisp: improve +emacs-lisp/find-function (other-window/popup support) 2017-02-28 12:02:01 -05:00
774f55e867 lang/emacs-lisp: better imenu support; better doom fn/macro highlights; remove +emacs-lisp:byte-compile 2017-02-20 00:26:06 -05:00
b7fb8caa24 emacs-lisp: refactor autoloads 2017-02-20 00:23:07 -05:00
cea32a3957 lang/emacs-lisp: update for v2.0 2017-02-20 00:23:03 -05:00