Commit graph

6370 commits

Author SHA1 Message Date
Dmitry Gutov
6a79a169e7 Rename project-directories to project-roots
* lisp/progmodes/project.el (project-search-path-function)
(project-search-path): Update the docstring.
(project-directories): Rename to `project-roots', update all
callers and implementations accordingly.
(project-root): Remove.

* lisp/progmodes/xref.el (xref-find-regexp): Use * instead of *.*
as the default file mask.
2015-07-31 05:53:14 +03:00
Dmitry Gutov
a0b8421e3b ; xref-find-regexp: (require 'grep), for grep-read-files 2015-07-22 23:08:50 +03:00
Dmitry Gutov
b6ac30ab43 Add new xref-query-replace command
* lisp/progmodes/xref.el (xref--match-buffer-bounds): New
function, extracted from xref-pulse-momentarily.
(xref-query-replace): New command.
(xref--query-replace-1): New helper function.
(xref--xref-buffer-mode-map): Add `r' binding.
2015-07-21 03:25:24 +03:00
Dmitry Gutov
4051fb202e ; Fix a typo 2015-07-21 00:44:41 +03:00
Dmitry Gutov
057f93499e Do not corrupt grep-find-ignored-files
* lisp/progmodes/project.el (project-ignores): Change the order of
the arguments to nconc, in order not to corrupt grep-find-ignored-files.
2015-07-20 04:42:53 +03:00
Dmitry Gutov
5330a45ebf Add xref-match-item, and use it
* lisp/progmodes/xref.el (xref-match-bounds): New generic function.
(xref-file-location): Add reader for the column slot.
(xref-match-item): New class.
(xref-match-bounds): A method implementation for it.
(xref-make-match): New constructor function.
(xref--current-item): New private variable.
(xref-pulse-momentarily): Use it.
(xref--pop-to-location): Change the first argument to an xref
item, instead of location, bind xref--current-item.
Update all callers.
(xref-next-line, xref-prev-line, xref--next-error-function)
(xref--mouse-2): Look for the property `xref-item',
instead of `xref-location'.
(xref--item-at-point): Likewise.  This function replaces
`xref-location-at-point'.  Update all callers.
(xref--insert-xrefs): Add the `xref-item' text property, instead
of `xref-location'.
(xref--collect-match): Use xref-make-match.
2015-07-20 04:32:58 +03:00
Dmitry Gutov
10ac9dbdcf Rename xref--xref to xref-item
* lisp/progmodes/xref.el (xref-item): Rename from `xref--xref'.
Update all references.
2015-07-20 03:26:01 +03:00
Dmitry Gutov
e29206e84a Rename xref description slot to summary
* lisp/progmodes/xref.el (xref--xref): Rename the `description'
slot to `summary'.
2015-07-20 03:12:32 +03:00
Dmitry Gutov
50ad176d28 Add xref-after-jump-hook and xref-after-return-hook
* lisp/progmodes/xref.el (xref-after-jump-hook)
(xref-after-return-hook): New hooks.
(xref-pulse-on-jump): Remove, in favor of the above.
(xref-pulse-momentarily): Rename from xref--maybe-pulse.
(xref--pop-to-location, xref--display-position)
(xref-pop-marker-stack): Use the new hooks, as requested in
http://lists.gnu.org/archive/html/emacs-devel/2015-07/msg00213.html
2015-07-19 20:51:28 +03:00
Bozhidar Batsov
83fbe89537 Correct js-mode's lighter
* lisp/progmodes/js.el (js-mode): Correct the lighter.
2015-07-19 08:18:56 +03:00
Leo Liu
f7ba648def Fix a bug in cfengine3-mode
* progmodes/cfengine.el (cfengine3-mode): Handle nil
  eldoc-documentation-function.
2015-07-19 12:39:37 +08:00
Dmitry Gutov
8b57f12ab7 Consider a jsdoc tag to be a beginning of a paragraph as well
* lisp/progmodes/js.el (js-mode): Change c-paragraph-start to
consider a jsdoc tag to be a beginning of a paragraph as well.
2015-07-18 04:01:30 +03:00
Dmitry Gutov
35ad161d9a Show the default value in the prompt
* lisp/progmodes/xref.el: Add `M-?' binding for
xref-find-references.  Declare functions `grep-read-files' and
`grep-expand-template'.
(xref--read-identifier): Show the default value in the prompt.
2015-07-13 04:27:32 +03:00
Dmitry Gutov
5153d30c16 When called with prefix argument, ask for file patterns to search as well
* lisp/progmodes/xref.el (xref-find-regexp): When called with
prefix argument, ask for file patterns to search as well.  When
prompting for the directory, require an existing one.
(xref-collect-matches): Add a new argument, FILES.  Use it in the
above function.
2015-07-12 18:35:08 +03:00
Dmitry Gutov
62d5d46551 Add `project-ignores'
* lisp/progmodes/project.el (project-ignores): New generic
function, and an implementation for the	VC project type.

* lisp/progmodes/xref.el (xref--rgrep-command): Split, as a
variant of rgrep-default-command that handles a generic list of
ignores.
(xref-collect-matches): Use it, and pass through to it the value
of the newly added argument.
(xref-find-regexp): Handle ignored paths within the project.
Remove outdated comment.

* lisp/vc/vc.el (vc-default-ignore-completion-table):
Skip the comments and the empty lines.
2015-07-12 17:19:08 +03:00
Dmitry Gutov
d6c2b34e9e Bind grep-highlight-matches to nil
* lisp/progmodes/xref.el (xref-collect-matches):
Bind grep-highlight-matches to nil (bug#20728).
2015-07-11 18:56:42 +03:00
Dmitry Gutov
53cf3cfec1 Don't check the exit status, it can be misleading
* lisp/progmodes/xref.el (xref-collect-matches): Don't check the
exit status, it can be misleading.
2015-07-10 04:40:09 +03:00
Dmitry Gutov
f8c720b55b Introduce a Project API
* lisp/progmodes/project.el: New file.

* lisp/cedet/ede.el: (project-try-ede): New function.
(project-root): New implementation.

* lisp/progmodes/elisp-mode.el (emacs-lisp-mode):
Set project-search-path-function.
(elisp--xref-find-references): Delegate some logic to
project-search-path.
(elisp-search-path): New function.
(elisp-xref-find): Don't implement `matches' anymore.

* lisp/progmodes/etags.el: Don't implement `matches'.
Delegate some logic to project-search-path.
(etags-search-path): New function.

* lisp/progmodes/xref.el (xref-find-function):
Remove `matches' from the API.
(xref-find-regexp): Move whatever common logic was in elisp and
etags implementations, and search the directories returned by
project-directories and project-search-path.
2015-07-10 04:40:09 +03:00
Dmitry Gutov
c7e9792565 Syntax-propertize until the end of the line first
* lisp/progmodes/xref.el (xref--collect-match): Syntax-propertize
until the end of the line first.
2015-07-09 15:30:33 +03:00
Dmitry Gutov
15fafa34d0 * lisp/progmodes/xref.el (xref-collect-matches): Use `nreverse' in the end. 2015-07-09 05:15:50 +03:00
Fabián Ezequiel Gallina
287bce9888 python.el: Fix local/remote shell environment setup
* lisp/progmodes/python.el (python-shell-with-environment): Fix
remote/local environment setup.

* test/automated/python-tests.el (python-shell-with-environment-1)
(python-shell-with-environment-2): New tests.
2015-07-06 20:08:01 -03:00
Fabián Ezequiel Gallina
0fdc3f2ee8 python.el: Respect process environment for remote shells
* lisp/progmodes/python.el
(python-shell-calculate-process-environment): Calculate
process-environment or tramp-remote-process-environment depending
whether current file is remote.
(python-shell-calculate-exec-path): Calculate exec-path or
tramp-remote-path depending whether current file is remote.
(python-shell-with-environment): New macro.
(python-shell-prompt-detect, python-shell-calculate-command)
(python-shell-make-comint, python-check): Use it.
2015-07-06 07:57:14 -03:00
Fabián Ezequiel Gallina
f3400f4ca6 python.el: Avoid making let-bound defvars buffer local (Bug#18244)
* lisp/progmodes/python.el (python-shell--interpreter)
(python-shell--interpreter-args): New vars.
(inferior-python-mode, python-shell-make-comint): Use them.
2015-07-06 02:34:44 -03:00
Fabián Ezequiel Gallina
8867296609 ; python.el: Replace eval-when-compile with eval-and-compile 2015-07-06 02:02:06 -03:00
Fabián Ezequiel Gallina
02dc8dac7e python.el: Fixes for IPython 3.x (Bug#20580)
* lisp/progmodes/python.el:
(python-shell-completion-native-setup): Fix IPython 3.x setup.
(python-shell-completion-native-get-completions): Fix timeout
logic.
2015-07-06 01:59:02 -03:00
Fabián Ezequiel Gallina
a5e39bfae8 python.el: Fix mark-defun behavior (Bug#19665)
* lisp/progmodes/python.el: (python-mark-defun): New function.

* test/automated/python-tests.el (python-mark-defun-1)
(python-mark-defun-2, python-mark-defun-3): New tests.
2015-07-06 01:04:00 -03:00
Glenn Morris
342ed936e1 * lisp/progmodes/f90.el (f90-type-def-re): Handle attribute lists
such as "extends(parent), private".  (Bug#20969)

* test/automated/f90.el (f90-test-bug20969, f90-test-bug20969b):
New tests.
2015-07-05 19:25:04 -07:00
Glenn Morris
23818bba0d * lisp/progmodes/fortran.el (fortran-line-length): Doc fix. 2015-07-05 17:16:01 -07:00
Christoph Wedler
044d4cc0c0 Respect `prog-indentation-context' in python.el
* lisp/progmodes/python.el (python-indent-guess-indent-offset)
(python-indent-context, python-indent--calculate-indentation)
(python-info-current-defun)
(python-info-dedenter-opening-block-message)
(python-info-line-ends-backslash-p)
(python-info-beginning-of-backslash)
(python-info-continuation-line-p): Use `prog-widen'.
(python-indent--calculate-indentation)
(python-indent--calculate-levels)
(python-indent-calculate-indentation): Use `prog-first-column'.
(python-indent--calculate-levels): Simplify.

Ignore also initial empty lines for syntax calculation.
* lisp/progmodes/python.el (python-indent-context): Return
:no-indent for first non-empty line, not just in line 1.
* test/automated/python-tests.el (python-indent-base-case)
(python-indent-inside-paren-1, python-indent-inside-paren-2)
(python-indent-inside-paren-3, python-indent-inside-paren-4)
(python-indent-inside-paren-5, python-indent-inside-paren-6)
(python-indent-after-backslash-1)
(python-indent-after-backslash-2)
(python-indent-after-backslash-3)
(python-indent-after-backslash-4, python-indent-inside-string-1):
Expect :no-indent for first non-empty line.
2015-07-05 08:52:03 +00:00
Martin Rudalics
19f71dcdc4 Have `compilation-set-window' use right window for getting fringes (Bug#20829)
* lisp/progmodes/compile.el (compilation-set-window): Take
`window-fringes' from argument window.  (Bug#20829)
2015-07-04 10:13:22 +02:00
Paul Eggert
3213d77070 In strings, prefer plain and ' to \ and \'
* lisp/allout.el (allout-insert-listified):
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
* lisp/ls-lisp.el (ls-lisp-UCA-like-collation)
(ls-lisp-string-lessp):
* lisp/menu-bar.el (menu-bar-open):
* lisp/obsolete/otodo-mode.el (todo-top-priorities):
* lisp/progmodes/compile.el (compile):
* lisp/progmodes/etags.el (tags-loop-scan):
* lisp/progmodes/make-mode.el (makefile-browser-insert-continuation):
* lisp/subr.el (posn-actual-col-row):
* lisp/term/pc-win.el (x-list-fonts):
* lisp/textmodes/texinfmt.el (texinfmt-version):
* lisp/textmodes/texnfo-upd.el (texinfo-master-menu):
* lisp/time.el (display-time-world-list):
* lisp/tmm.el (tmm-menubar):
* src/buffer.c (syms_of_buffer):
* src/fileio.c (syms_of_fileio):
Omit unnecessary and confusing backslash before quote.
* lisp/erc/erc.el (erc-cmd-LASTLOG):
* lisp/progmodes/flymake.el (flymake-fix-file-name):
* lisp/progmodes/vhdl-mode.el (vhdl-in-extended-identifier-p):
Fix string that was intended to escape a backslash and not a quote.
2015-06-30 15:08:02 -07:00
Ted Zlatanov
1b3004cbf4 cfengine.el: update for the upcoming CFEngine 3.7 release
Update for the upcoming CFEngine 3.7 release: support macros and
quoted context strings; reformat JSON; indent promise attributes 2
units by default; give function parameter descriptions in the eldoc
glue.
* cfengine.el: Update version and docs and fix name.  Autoload
`json-pretty-print'.  Support new features in 3.7.
(cfengine-parameters-indent): Set default promise attribute indent to
2 more than the promise itself.
(cfengine3-macro-regex): New variable to match the new macro syntax.
(cfengine3-font-lock-keywords): Use it to highlight macros.
(cfengine3-indent-line): Use it to indent macros to column 0.
(cfengine3-class-selector-regex): Update for the new quoted strings
format.
(cfengine3-reformat-json-string): New function to reformat a JSON
string using `json-pretty-print'.
(cfengine3-format-function-docstring): Use function parameter
description if it's provided by the cf-promises syntax dump.
2015-06-29 23:07:30 -04:00
Dmitry Gutov
bbf63ee00a Bind grep-highlight-matches around the rgrep call
* lisp/progmodes/grep.el (zrgrep): Bind grep-highlight-matches
around the rgrep call (bug#20728).
2015-06-28 04:38:11 +03:00
Dmitry Gutov
a1dde6b50f Put "--color" before the other options in grep-command
* lisp/progmodes/grep.el (grep-compute-defaults): Put "--color"
before the other options in grep-command (bug#20912).
2015-06-28 04:29:03 +03:00
Dmitry Gutov
9b4b4a8355 Add --color Grep option to the command dynamically
* lisp/progmodes/grep.el (grep-template, grep-find-template):
Update the description for <C>.  (Bug#20728)
(grep-compute-defaults): Don't add the --color option to
grep-options.  Only add it to grep-command.
(grep-expand-keywords): Expand the env value opts into <C>.
(grep-expand-template): Replace cf in the env with the opts list,
that can include -i and --color.

* lisp/progmodes/xref.el (xref-collect-matches): Do not remove
"--color=always" from the template, because we don't have to.
2015-06-27 23:57:28 +03:00
Stefan Monnier
4fba36ce11 * lisp/progmodes/xref.el: Avoid init-args in oref.
* lisp/progmodes/xref.el (xref-location-group, xref-location-marker)
(xref--insert-xrefs, xref-collect-references): Avoid init-args in oref.
2015-06-24 16:32:09 -04:00
Stephen Leake
4b1613762f Add missing function xref-location-group for elisp-mode.
* lisp/progmodes/elisp-mode.el: Add missing function xref-location-group.
2015-06-17 09:35:00 -05:00
Glenn Morris
fb77502f69 Address some check-declare warnings.
* lisp/simple.el (tabulated-list-print):
* lisp/progmodes/elisp-mode.el (xref-collect-matches):
* lisp/term/ns-win.el (ns-selection-owner-p, ns-selection-exists-p)
(ns-get-selection): Update declarations.
2015-06-16 20:33:48 -04:00
Glenn Morris
55b41a82cd Address some compilation warnings.
* lisp/face-remap.el (text-scale-adjust):
* lisp/menu-bar.el (popup-menu-normalize-position):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand):
* lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-warn):
* lisp/emacs-lisp/generator.el (cps--transform-1):
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all):
* lisp/obsolete/vc-arch.el (vc-arch-mode-line-string):
* lisp/progmodes/octave.el (octave-goto-function-definition)
(octave-find-definition-default-filename):
Replace 't' with '_' in pcase.
2015-06-16 20:04:35 -04:00
Glenn Morris
e80225000d ; Comment fixes. 2015-06-15 21:24:24 -04:00
Stefan Monnier
f784272f73 * lisp/progmodes/perl-mode.el: Refine handling of /re/ and y/abc/def/
(perl--syntax-exp-intro-keywords): New var.
(perl--syntax-exp-intro-regexp, perl-syntax-propertize-function): Use it.
(bug#20800).
2015-06-15 17:10:06 -04:00
Christoph Wedler
52da972751 Some generic support for multi-mode indentation.
* lisp/progmodes/prog-mode.el (prog-indentation-context): New
	variable.
	(prog-first-column, prog-widen): New convenience functions.
2015-06-14 14:47:16 +00:00
Paul Eggert
b220562637 Fix quoting of help for functions with odd names
While investigating Bug#20759, I discovered other quoting problems:
C-h f mishandled characters like backslash and quote in function names.
This fix changes the behavior so that 'C-h f pcase RET' now
generates "... (\` QPAT) ..." instead of "... (` QPAT) ...",
because '(format "%S" '(` FOO))' returns "(\\` FOO)".  A comment
in src/lread.c's read1 function says that the backslash will be
needed starting in Emacs 25, which implies that 'format' is
correct and the old pcase documention was wrong to omit the backslash.
* lisp/emacs-lisp/nadvice.el (advice--make-docstring):
* lisp/help-fns.el (help-fns--signature):
* lisp/help.el (help-add-fundoc-usage):
* lisp/progmodes/elisp-mode.el (elisp-function-argstring):
Use help--make-usage-docstring rather than formatting
help-make-usage.
* lisp/emacs-lisp/pcase.el (pcase--make-docstring):
Return raw docstring.
* lisp/help-fns.el (help-fns--signature): New arg RAW, to return
raw docstring.  Take more care to distinguish raw from cooked dstrings.
(describe-function-1): Let help-fns--signature substitute
command keys.
* lisp/help.el (help--docstring-quote): New function.
(help-split-fundoc): Use it, to quote funny characters more
systematically.
(help--make-usage): Rename from help-make-usage, since this
should be private.  Leave an obsolete alias for the old name.
(help--make-usage-docstring): New function.
* test/automated/help-fns.el (help-fns-test-funny-names): New test.
2015-06-11 10:24:38 -07:00
Glenn Morris
7de8137710 * lisp/progmodes/f90.el (f90-backslash-not-special): Use user-error. 2015-06-10 16:57:59 -04:00
Glenn Morris
d9d04bfa49 * lisp/progmodes/executable.el (executable-self-display): Obsolete.
No longer autoload.

* doc/misc/autotype.texi (Executables):
Undocument executable-self-display.
2015-06-10 16:24:32 -04:00
Glenn Morris
dfa1dc1c2b * lisp/progmodes/executable.el (executable-self-display):
Use non-obsolete tail syntax.  (Bug#20779)
(executable-self-display): Doc update.
2015-06-10 16:19:13 -04:00
Stefan Monnier
06193432f2 * lisp/progmodes/sh-script.el: Better handle nested quotes
(sh-here-doc-open-re): Don't mis-match the <<< operator (bug#20683).
(sh-font-lock-quoted-subshell): Make sure double quotes within single
quotes don't mistakenly end prematurely the surrounding string.
2015-06-09 22:10:38 -04:00
Stefan Monnier
26a17f5ac9 * lisp/progmodes/elisp-mode.el: Require cl-lib for cl-defstruct. 2015-06-09 21:21:29 -04:00
Dmitry Gutov
68273707ec Skip past `#' to find BEG
* lisp/progmodes/elisp-mode.el (elisp-completion-at-point): Skip
past `#' to find BEG (bug#20771).

* test/automated/elisp-mode-tests.el
(elisp-completes-functions-after-hash-quote): New test.
2015-06-09 01:08:28 +03:00
Juri Linkov
6fec047e94 * lisp/progmodes/grep.el (zrgrep): Let-bind grep-highlight-matches
before calling grep-compute-defaults because now it affects the
command lines computed in grep-compute-defaults. (Bug#20728)
2015-06-07 01:02:38 +03:00