Commit Graph

103 Commits

Author SHA1 Message Date
3308fb3718 Minor updates to documentation
- Update the keybinding for +doom/help-autodefs
- Remove silver_search from the lookup module. Ripgrep is the supported
dependency.
2020-01-13 09:54:22 +01:00
780100131d Fix #2346: reference to removed function 2020-01-10 04:22:49 -05:00
27599f308d Add Doom Emacs issue tracker to search engine providers 2020-01-09 22:56:26 -05:00
27bf3c85b5 Generalize thing-at-point & region functions 2020-01-03 02:39:47 -05:00
8f6161f480 Generalize lookup thing-at-pt fn; fix dict/synonym commands 2020-01-02 21:16:01 -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
5fe658e583 Rename synonym/dictionary definition lookup commands 2020-01-02 19:53:49 -05:00
56ef4d8800 Use powerthesaurus-lookup-word-dwim in +lookup/word-synonyms 2020-01-02 19:52:10 -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
d00a0af925 tools/lookup: fix missing libs for dictionary/thesaurus lookup 2019-12-24 21:59:36 -05:00
55f0be7074 tools/lookup: fix definition (on mac) & synonym lookup 2019-12-24 20:48:15 -05:00
b53703d527 General comment revision & reformatting 2019-12-21 15:01:05 -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
3cefe161fa tools/lookup: fix +lookup/online 2019-12-16 17:05:11 -05:00
eaa5621b36 Update comments 2019-12-15 23:51:59 -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
a66872fe25 Focus on ripgrep; remove ag, git-grep & grep support
We're focusing on ripgrep so we can iterate on search functionality in
Doom quicker. There is nothing the other search backends can do that
ripgrep can't. It is now a hard dependency for Doom.
2019-11-17 01:19:59 -05:00
8e394ba3f0 tools/lookup: lazy load dash-docs 2019-11-08 16:02:07 -05:00
957e1dd080 Fix (set-lookup-handlers! MODES nil) syntax 2019-10-15 22:24:57 -04:00
daee52d358 Fix duplicate backends in +lookup prompts
When running a +lookup/* command with the prefix arg, you are prompted
for which backend to use, which could contain duplicates if the current
buffer has no local backends.
2019-10-03 17:16:06 -04: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
832b7e9294 Remove witout-project-cache!, rename project-file-exists-p
To doom-project-file-exists-p, which is now a function.
2019-07-22 02:30:41 +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
6973a8926d tools/lookup: remove duplicate code & minor fixes
- Removes vestigial definition of +lookup/in-docsets, which would throw
  an error.
- Fixes the universal argument for this function.
- Fix multiple set-docsets! calls prepending rather than setting
  dash-docs-docsets.
- Logs search attempts for debugging purposes.
2019-07-05 16:50:03 +02:00
380c3ac268 Disable lookup handlers if minor mode is disabled 2019-06-29 00:23:13 +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
5683ffe0d2 Fix +lookup/file in non-project files
file-in-directory-p threw wrong-type-argument stringp errors because
project-root was nil.
2019-06-10 09:38:57 +02:00
571e7bd527 Fix +lookup/in-docsets & docsets lookup backend
They were throwing 'cannot find docset' errors.

- Adds new +lookup/in-all-docsets command.
- If a prefix arg is passed to +lookup/in-docsets, it will search all
  docsets in dash-docs-common-docsets.
2019-05-17 21:02:24 -04:00
ae8aa26c33 tools/lookup: add prefix arg to lookup commands
The prefix arg causes +lookup/{definition,references,documentation} to
prompt you for which lookup backend to use.
2019-05-16 00:37:27 -04: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
fb8b7c38d2 Make lookup handlers easier to debug
If debug-mode is on, errors in lookup handlers will not emit a full
backtrace.
2019-05-14 22:26:21 -04:00
9cfbe53d37 Fix "selected dead buffer" errors on gD
Because the popup manager was auto-killing the *xref* buffer (that
ivy-xref closes immediately).
2019-05-14 21:35:30 -04:00
3d53aa5dad Fix google images url for +lookup/online 2019-05-14 15:18:17 -04:00
8ec44959c5 tools/lookup: update to reflect changes upstream
counsel-dash no longer depends on helm
2019-05-12 01:45:48 -04:00
927dcb274d tools/lookup: log handler errors
Silences them unless debug mode is on
2019-05-03 20:45:11 -04:00
d481fc1dd4 tools/lookup: update README & docstrings
And minor reformatting of config.el
2019-05-03 20:44:49 -04:00
96ca04d488 Set lsp lookup handlers rather than remapping them
Now that the lookup module has beter deferred handler support.
2019-05-03 20:03:32 -04:00
d17764366e Rewrite lookup handling
- Rewrite documentation for set-lookup-handlers!
- Remove opening lookup targets in other-window; sorry, but there is no
  consistent, stable way to do this, when many jump handlers are
  asynchronous. If you want to open a jump target in another window,
  create a split beforehand.
- Add support for jump handlers returning 'fail or 'deferred
- Fix xref backends when using async UIs like ivy or helm
- Conditionalize creating a better-jump jump point, and create it in the
  spot we jumped *from*, not where we jumped *to*.
2019-05-02 17:53:59 -04:00
0f21e2b44a Fix lookup handlers not being used #1378 2019-05-02 17:51:51 -04:00
6d314c2795 Revise and update docstrings and comments 2019-05-01 21:02:28 -04:00
adc8fc0ad1 tools/lookup: autoload +lookup-online-backend #1375 2019-04-30 20:22:28 -04:00
ed5d27eee7 tools/lookup: stop prompting for TAGS file 2019-04-30 15:11:23 -04:00