New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various counsel-compile cleanups #1963
Changes from 1 commit
5f4e944
072f238
876b4ac
adea72f
859e3cb
8a40934
0c30e3f
1439e8d
50dc9e6
4e0d403
82e6c54
7e8a362
144e7d9
11487d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5103,29 +5103,29 @@ in the current window." | |
(defvar counsel-compile-history nil | ||
"History for `counsel-compile'. | ||
|
||
This is a list of strings with additional properties which allow the | ||
history to be filtered depending on the context of the call. The | ||
properties include: | ||
This is a list of strings with additional properties which allow | ||
the history to be filtered depending on the context of the call. | ||
The properties include: | ||
|
||
`srcdir' | ||
the root directory of the source code | ||
the root directory of the source code | ||
`blddir' | ||
the root directory of the build (in or outside the srcdir) | ||
the root directory of the build (in or outside the `srcdir') | ||
`recursive' | ||
the completion should be run again in `blddir' of this result | ||
the completion should be run again in `blddir' of this result | ||
`cmd' | ||
if set only the region with this property will be passed to `compile' | ||
if set, pass only the substring with this property to `compile' | ||
|
||
If you want to persist history between Emacs sessions you can as this | ||
to variable to `savehist-additional-variables'.") | ||
This variable is suitable for addition to | ||
`savehist-additional-variables'.") | ||
|
||
(defvar counsel-compile-root-function 'counsel-project-current | ||
(defvar counsel-compile-root-function #'counsel-project-current | ||
"Function to find the project root for compile commands.") | ||
|
||
(defun counsel-project-current () | ||
"Locate the root of the project by trying a series of things." | ||
(or (when (fboundp 'project-current) | ||
(cdr (project-current))) | ||
(or (and (fboundp 'project-current) | ||
(cdr (project-current))) | ||
(counsel--dominating-file ".dir-locals.el") | ||
(counsel--dominating-file ".git") | ||
(error "Couldn't find project root"))) | ||
|
@@ -5136,25 +5136,26 @@ to variable to `savehist-additional-variables'.") | |
counsel-compile-get-make-invocation) | ||
"Additional compile invocations to feed into `counsel-compile'. | ||
|
||
This can either be a list of compile invocations strings or | ||
This can either be a list of compile invocation strings or | ||
functions that will provide such a list. You should customise | ||
this if you want to provide specific non-standard build types to | ||
`counsel-compile'. The default helpers are set up to handle common | ||
build environments.") | ||
`counsel-compile'. The default helpers are set up to handle | ||
common build environments.") | ||
|
||
(defcustom counsel-compile-make-args "-k" | ||
"Additional arguments for make. | ||
You may for example want to add -jN for the number of cores you have." | ||
You may, for example, want to add \"-jN\" for the number of cores | ||
N in your system." | ||
:type 'string) | ||
|
||
(defcustom counsel-compile-make-pattern "\\(?:GNUM\\|[Mm]\\)akefile" | ||
"Pattern for matching against makefiles." | ||
:type 'regex) | ||
(defcustom counsel-compile-make-pattern "\\`\\(?:GNUM\\|[Mm]\\)akefile\\'" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. huh, I missed that rx usage had been dropped. I guess no love for rx then... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally, I always use |
||
"Regexp for matching the names of Makefiles." | ||
:type 'regexp) | ||
|
||
(defcustom counsel-compile-build-directories | ||
'("build" "builds" "bld" ".build") | ||
"Patterns for matching build directories." | ||
:type 'list) | ||
"List of potential build subdirectory names to check for." | ||
:type '(repeat directory)) | ||
|
||
;; This is loosely based on the Bash Make completion code | ||
(defun counsel--get-make-targets (srcdir &optional blddir) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be worth the extra verbiage for those not familiar with what savehist-additional-variables does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users of
savehist
will know or have to learn how to use it anyway. It would absolutely be overkill and even a nuisance for every variable under the sun to mention that it can be persisted viasavehist
. Personally, I wouldn't mention it all, but there's no harm in keeping this one case. Besides, keeping this last sentence lets the docstring be auto-filled nicely.