Commit Graph

58 Commits

Author SHA1 Message Date
14b2395424 refactor: remove unused core variables
doom-debug-p and doom-interactive-p have always been intentionally
redundant, because changing the variables they replaced had other
side-effects, which made writing tests for them difficult. Since our
new (yet unpublished) tests lean heavily toward integration testing more
than unit testing, this becomes an implementation detail.

And doom-init-p's only use was refactor out at some point in the past,
so it's no longer used.

Also done to reduce Doom's footprint, in general.
2022-06-29 18:14:20 +02:00
7ada538991 perf(lookup): defer consult-xref
`consult-xref` is autoloaded anyway. There are some packages that
require `xref` (such as lispy through requiring etags) so without
deferring, loading those packages may cause `consult.el` to be loaded.
2022-04-03 14:22:10 +02:00
2a515c683a bump: :tools lookup
abo-abo/define-word@6e4a427503 -> abo-abo/define-word@31a8c67405

Ref: abo-abo/define-word#31
2022-01-04 20:59:28 +01:00
cdb59b0a3d fix(lookup): wordnik dict backend returning nothing
Ref abo-abo/define-word#31
2021-09-27 21:58:18 +02:00
06392a723f refactor: rename orig-fn arg in advice to fn
A minor tweak to our naming conventions for the first argument of an
:around advice.
2021-08-04 01:53:12 -04:00
24eaa1317c completion/selectrum -> completion/vertico, part 2
- Rename module from `:completion selectrum` to `:completion vertico`
- Rename all files involved
- Do *not* yet rename all the functions, as that messes up git's rename
  detection.
2021-07-25 02:51:15 +03:00
1fe0ad318b selectrum: improve :tools lookup integration
- move `consult-xref` stuff to `:tools lookup` where it belongs
- add selectrum functionality where possible, document what's beyond the
  scope of this PR
2021-07-25 02:50:42 +03:00
34fae1c01c Remove remaining Emacs27+ checks
- Remove remaining `EMACS27+` checks, since the whole codebase is
  assumed to run at version 27 or above now
- Remove `EMACS27+` definition since it's no longer needed
2021-07-10 16:03:41 +03:00
259cf83ef1 Enhance FFAP lookup backend
gf (+lookup/file) has been changed to:

+ Use the active selection instead of the filename-at-point when
  searching for a file (as requested in #4942).
+ Pre-fill the FFAP prompt with the thing at point if no obvious
  filepath can be guessed from it (via ffap-alist).
+ Offer to search the current project for the thing-at-point (if
  counsel-file-jump is available).
+ Fall back to a standard ffap prompt if all else fails.

I've also reversed te order of file lookup backends so that our FFAP
backend is treated as a never-failing last resort (also because the
bug-reference backend is known to fail gracefully, so we can trust it to
run first).

Closes #4942
2021-04-29 17:24:40 -04:00
fbb8d1b99e Merge pull request #4392 from rfaulhaber/add-mdn-search-to-lookup
Adds MDN search to online lookup
2020-12-08 23:01:07 -05:00
fc9dd5748e Fix #4386: interop between ivy-xref & dired-do-find-regexp 2020-12-08 22:44:53 -05:00
65bd7c3414 Adds MDN search to online lookup 2020-12-08 22:20:56 -05:00
f02879dd04 Add ffap & bug-reference support to +lookup/file
And disable bug-reference-mode by default. It produces too many false
positives, particularly in web modes where color hexes in strings and
comments are very common. Now that bug-reference support is built into
+lookup/file (on gf), users can use that instead.
2020-10-30 19:09:31 -04:00
1757dd1700 Bump :editor evil
emacs-evil/evil@1e7aa5b -> emacs-evil/evil@373a57e
redguardtoo/evil-nerd-commenter@87734b9 -> redguardtoo/evil-nerd-commenter@b670f69
emacs-evil/evil-collection@c136589 -> emacs-evil/evil-collection@a21725f
2020-10-09 04:41:45 -04:00
5a80db875c lang/org: add lookup handlers for src blocks
- Fixes: `set-lookup-handlers!` couldn't define :definition or
  :references handlers in text-mode derivatives.
- Adds: support for evaluating code in jupyter blocks (#2477).
2020-08-06 00:23:09 -04:00
84fe780b34 tools/lookup: remove redundant Emacs 26 gnutls fix
A fix for this issue is already part of Doom core, so this is redundant.
2020-07-31 18:14:07 -04:00
9bdb2a3406 Merge pull request #3447 from thevirtuoso1973/develop
change rust doc lookup to std library
2020-06-24 18:47:07 -04:00
9caf05ffe4 Update :tools/lookup +xwidget support
Remove :tools/lookup +xwidget. Provide
`+lookup-xwidget-webkit-open-url-fn` so that we can manually configure
Xwidget WebKit browser for `+lookup/online` or `+lookup/in-docsets`.
2020-06-24 12:37:56 +09:00
13fa9c88a6 change rust doc lookup to std library 2020-06-23 22:17:08 +01:00
a724ce0f8e Fix xwidget dash docset popup display function
The popup rule was malformed.
2020-06-06 01:04:41 -04:00
3a38fc633c Change doom-{interactive,debug}-mode suffix to -p
Because these are not really modes.

Also makes `doom-debug-mode` an actual (global) minor mode.
2020-05-25 03:43:40 -04:00
d08f2dd888 tools/lookup: Support type definition lookup handlers 2020-05-12 01:06:23 +09:00
13134726dc tools/lookup: Support implementations lookup handlers 2020-05-12 01:03:52 +09:00
622e1ea06b Minor refactoring 2020-05-08 09:59:15 +09:00
6f8c501ce4 Improve Emacs graphical mode checking 2020-05-07 09:20:52 +09:00
051ea0a602 Remove redundant +evil-collection-init for Xwidget 2020-05-07 09:16:13 +09:00
1d0c79d63c Fix Dash docsets + Xwidget integration
Make Xwidget popup rules and advices less general.

fix
2020-05-07 09:14:06 +09:00
174ab0303f Add Dash docsets + Xwidget integration 2020-05-07 01:05:57 +09:00
9509897db1 dumb-jump-prefer-searcher = rg 2020-04-26 19:21:51 -04:00
ecdeb489f8 Update {ivy,helm}-xref for Emacs 27
More variables to set!
2020-04-24 15:12:33 -04:00
06d5d5e6c0 General refactors, reformatting & comment revision 2020-04-23 23:56:17 -04:00
6a8ac7f5fd Fix helm-xref when using Emacs 27+
Fixes https://github.com/hlissner/doom-emacs/issues/2852
2020-04-08 19:11:33 +01:00
038e52d709 tools/lookup: add +offline feature
For offline dictionary/thesaurus lookup, using wordnut and synosaurus.
2020-01-25 19:02:01 -05:00
27599f308d Add Doom Emacs issue tracker to search engine providers 2020-01-09 22:56:26 -05:00
6938f8b97d Fix references to old dictionary/thesaurus lookup commands
And pass word explicitly to powerthesaurus.
2020-01-02 20:04:20 -05:00
c57aff9b81 Change how +lookup/online populates initial input
If no selection is active, there is no initial input.
If selection is active, use the selection.

Also remove helm-google package, as the helm functionality is provided
by the core helm package already (and actually works).
2019-12-29 19:24:45 -05:00
7742813a06 tools/lookup: add +dictionary feature
For looking up words in dictionaries and thesauruses. Requires internet
connection (for now).
2019-12-20 00:59:51 -05:00
48a943b09f tools/lookup: fix helm-google integration for +lookup/online 2019-12-15 18:03:43 -05:00
dfb5a0cc54 tools/lookup: add autocompletion for google/duckduckgo providers
For +lookup/online, on `SPC s o`

- Change the signature of `+lookup/online`
- Change format of +lookup-provider-url-alist.
2019-12-15 18:00:43 -05:00
8e394ba3f0 tools/lookup: lazy load dash-docs 2019-11-08 16:02:07 -05: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
6cda303ae6 tools/lookup: conform to new conventions 2019-07-22 23:51:13 +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
cc3a793407 Add rust docs to online lookup providers
If :lang rust is enabled.
2019-07-09 17:55:35 +02:00
1f88efeb82 tools/lookup: fix missing +lookup-symbol-or-region error 2019-05-16 00:10:56 -04:00
4002313e79 tools/lookup: declare gnutls-algorithm-priority early
Otherwise, gnutls-algorithm-priority won't be in scope for
`dash-docs-read-json-from-url`.
2019-05-15 23:59:03 -04:00
bc501ef28e doom*dash-docs-read-json-from-url -> +lookup*fix-gnutls-error
Conform to naming conventions.
2019-05-15 23:50:29 -04:00
0c243e6d5c tools/lookup: fix dash-docs-install-docset
Addresses a integer-or-marker-p error emitted from the
`url-retrieve-synchronously' call in `dash-docs-read-json-from-url'.
This is apparently a systemic issue in Emacs 26's networking library.
See https://github.com/magit/ghub/issues/81
2019-05-15 23:40:27 -04:00