1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-06 11:55:48 +00:00
Commit Graph

1201 Commits

Author SHA1 Message Date
Dmitry Gutov
0255a70c8a Don't mistake `for' inside a function for a part of array comprehension
* lisp/progmodes/js.el (js--indent-in-array-comp): Also check the
depth in parens between the bracket and `for' (bug#23391).

* test/indent/js.js: Add a corresponding example.
2016-04-28 02:00:48 +03:00
Lele Gaifax
fa7886a46f Add new keywords of Python 3.5
Python 3.5, released in mid September 2015, introduced a few new
keywords to better support asynchronous code, "async" and "await"
in particular. See https://www.python.org/dev/peps/pep-0492/ for
details. (Bug#21783)
* lisp/progmodes/python.el (python-rx-constituents): Add async
def/for/with as block-start and async def as defun.
* lisp/progmodes/python.el (python-font-lock-keywords): Add async
def/for/with as keyword.
* test/automated/python-tests.el (python-indent-after-async-block-1,
python-indent-after-async-block-2, python-indent-after-async-block-3,
python-nav-beginning-of-defun-3): New tests to test indentation and
navigation for the async keyword.
2016-04-26 13:50:26 -04:00
Michael Albinus
1b98a68b66 Fix Bug#20637. Do not merge to master
* lisp/vc/vc-hooks.el (vc-state, vc-working-revision):
Use `vc-backend' instead of `vc-responsible-backend'.  (Bug#20637)

* test/automated/vc-tests.el (vc-test--state)
(vc-test--working-revision): Deactivate now failing checks.
2016-04-14 20:28:18 +02:00
Paul Eggert
80128a7849 Fix stability confusion in sort-tests
Problem reported by Philipp Stephani (Bug#23205).
* test/automated/sort-tests.el:
(sort-tests--insert-words-sort-and-compare):
Don’t assume that reversing a sorted list is the same
as sorting with the reverse predicate.  This is not true
for stable sorts when items compare equal.
2016-04-06 01:22:32 -07:00
Dmitry Gutov
c28f87a53d (js--continued-expression-p): Special-case unary plus and minus
* lisp/progmodes/js.el (js--continued-expression-p): Make an
effort to recognize unary plus and minus, in the contexts where
they make sense (https://github.com/mooz/js2-mode/issues/322).
2016-04-02 03:07:09 +03:00
Michael Albinus
df441b362c Fix OS X specific settings in tramp-tests
* lisp/net/tramp-sh.el (tramp-maybe-open-connection): Use it.

* lisp/net/tramp.el (tramp-get-local-locale): New defun.

* test/automated/tramp-tests.el (tramp--test-darwin-p): Remove.
(tramp--test-utf8): Improve settings of coding systems.
Do not use `tramp--test-darwin-p' anymore.  (Bug#22145)
2016-03-31 11:45:45 +02:00
Nicolas Petton
3a13472ade Fix map-put and map-delete for alists (Bug#23105)
* lisp/emacs-lisp/map.el (map-put): Do not bind the evaluated place
expression to a new symbol.
* test/lisp/emacs-lisp/map-tests.el: Add a regression test.
2016-03-25 15:11:23 +01:00
Philipp Stephani
90fb9b38dd Add customization option for using UTF-8 coordinates in xt-mouse
* lisp/xt-mouse.el (xterm-mouse-utf-8): New customization option.
(xterm-mouse--read-coordinate): New function to replace
`xterm-mouse--read-utf8-char'; uses UTF-8 only if enabled.
(xterm-mouse--read-number-from-terminal): Adapt to new name.
(xterm-mouse-tracking-enable-sequence)
(xterm-mouse-tracking-disable-sequence): Replace constants with
functions, mark constants as obsolete.
(xterm-mouse--tracking-sequence): New helper function.
(turn-on-xterm-mouse-tracking-on-terminal): Use new functions;
enable UTF-8 only if customization option says so; store UTF-8
flag in terminal parameter.  (Bug#23009)

* test/automated/xt-mouse-tests.el: Add tests for xt-mouse.el.
2016-03-25 13:17:38 +03:00
Michael Albinus
dca240a70d Suppress some Tramp tests for OSX, do not merge with master
* test/automated/tramp-tests.el (tramp--test-darwin-p): New defun.
(tramp--test-utf8): Use it.  (Bug#22145)
2016-03-17 20:33:51 +01:00
Dmitry Gutov
2036be4666 Fix Ruby's operator precedence
* lisp/progmodes/ruby-mode.el (ruby-smie-grammar):
Rearrange the smie-precs->prec2 form.
2016-03-16 04:32:59 +02:00
Dmitry Gutov
1d686c2afb (ruby-interpolation-inside-another-interpolation): New failing test
* test/automated/ruby-mode-tests.el
(ruby-interpolation-inside-another-interpolation):
New failing test.
2016-03-16 01:48:33 +02:00
Glenn Morris
218ae59019 * test/automated/package-test.el (package-test-signed): Tweak skip
condition, for hydra.
2016-03-15 16:24:26 -04:00
Dmitry Gutov
dbfbedd3d0 Do not tokenize a comment before continuation as ';'
* lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p):
Account for a comment right after point.
2016-03-15 03:16:27 +02:00
Dmitry Gutov
040362001d Don't misindent arguments of a method call inside continuation
* lisp/progmodes/ruby-mode.el (ruby-smie-rules):
Use smie-indent-virtual instead of smie-rule-parent (bug#23015).
Simplify the traversal loop.
2016-03-15 03:16:27 +02:00
Dmitry Gutov
9d463aec8b Tweak the left precedence of '=>'
* lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Tweak the left
precedence of '=>', to improve indentation and sexp navigation.
2016-03-14 01:45:01 +02:00
Dmitry Gutov
5b705bc97d Indent '.' relative to the first sibling expression
* lisp/progmodes/ruby-mode.el (ruby-smie-rules):
Indent '.' relative to the first sibling expression, instead of the
parent token (bug#17213).
2016-03-14 01:45:01 +02:00
Dmitry Gutov
576e09e150 Support Ruby 2.3.0's safe navigation operator
* lisp/progmodes/ruby-mode.el (ruby-smie--forward-token)
(ruby-smie--backward-token): Tokenize '&.' as '.'.
(ruby-smie--implicit-semi-p): Check for possible '&' before '.'.

* test/indent/ruby.rb: Add an example using safe navigation
operator.  Fix a syntax error in existing example.
2016-03-12 00:18:42 +02:00
Paul Eggert
7352c6c695 Rework C source files to avoid ^(
Work around Bug#22884 by rewording comments and strings to avoid ‘(’
at the start of a line unless it starts a function.  This change
is a short-term hack; in the longer run we plan to fix cc-mode’s
performance for C files that have ‘(’ at the start of a line in a
comment or string.
2016-03-10 07:59:19 -08:00
Eli Zaretskii
a589e9aed5 By default, etags produces unqualified Perl tag names
* lib-src/etags.c (Perl_functions): Produce unqualified names,
unless -Q was specified.
(print_help): Update the description of -Q.

* doc/man/etags.1: Update the documentation of -Q.

* test/etags/ETAGS.good_1:
* test/etags/ETAGS.good_2:
* test/etags/ETAGS.good_3:
* test/etags/ETAGS.good_4:
* test/etags/ETAGS.good_5:
* test/etags/CTAGS.good: Adapt the expected test results to the
changed Perl functionality.
2016-03-10 17:27:26 +02:00
Dmitry Gutov
72c7438c4c Indent methods with keyword names correctly
* lisp/progmodes/ruby-mode.el (ruby-smie--at-dot-call):
Rename to ruby-smie--before-method-name.  Now also check if we're
after a 'def' keyword.  Update both callers.
2016-03-10 14:36:08 +02:00
Dmitry Gutov
28532a91a9 Propertize character literals and special global variables differently
* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize): Propertize
character literals and global variables with special names with
prefix and symbol syntax classes, for SMIE to tokenize them
together automatically.
(ruby-font-lock-keywords): Fix an old regression in highlighting
character literals.
2016-03-10 14:36:08 +02:00
Dmitry Gutov
1b9d6163b0 Propertize operator symbol names with symbol syntax class
* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize):
Do it here.
(ruby-font-lock-keywords): Instead of handling them here.  Leave
highlighting them to the "normal" matcher, because now we can.
(ruby-smie--forward-token, ruby-smie--backward-token):
Likewise, don't special-case operator symbols anymore.
(ruby-smie--args-separator-p): Simplify the regexp, match operator
names with \s_.
(ruby-smie--implicit-semi-p): Handle the special cases of ? and =
at EOL the same way: check if the character has been assigned the
symbol syntax class by syntax-propertize.
2016-03-09 17:22:56 +02:00
Dmitry Gutov
366ec7719f Allow using the left shift operator without spaces on both sides
* lisp/progmodes/ruby-mode.el (ruby-singleton-class-p): Rename to
ruby-verify-heredoc, reverse the meaning of the return value, and
short-circuit if preceded by a symbol not separated by whitespace.

* test/automated/ruby-mode-tests.el (ruby-no-heredoc-left-shift)
(ruby-no-heredoc-class-self): New tests.
2016-03-09 17:22:56 +02:00
Dmitry Gutov
6e63b3e997 Guard against nested percent literals
* lisp/progmodes/ruby-mode.el
(ruby-syntax-propertize-percent-literal):
Don't check the syntax status.
(ruby-syntax-propertize): Check it here.  And also guard against
being in a larger percent literal.

* test/automated/ruby-mode-tests.el
(ruby-no-nested-percent-literals): New test.
2016-03-07 05:07:34 +02:00
Dmitry Gutov
066f3bc3f3 Recognize iuwu-mod after an escaped newline
* lisp/progmodes/ruby-mode.el (ruby-smie--bosp): Check if the
newline is escaped.
(ruby-smie-rules): Indent iuwu-mod after an escaped newline
correctly.
2016-03-07 05:07:33 +02:00
Dmitry Gutov
dc9d837d02 Don't misindent computed property generator methods
* lisp/progmodes/js.el (js--looking-at-operator-p):
Don't misindent computed property generator methods
(https://github.com/mooz/js2-mode/issues/317).
2016-03-05 14:35:35 +02:00
Ulf Jasper
8b01e6969f Prevent infinite loop on not-well-formed xml. (Bug#16344)
* lisp/xml.el (xml-parse-tag-1): Prevent inifinite loop. (Bug#16344)
* test/automated/xml-parse-tests.el (xml-parse-tests--bad-data): Add
  test cases for Bug#16344.
2016-03-02 19:03:27 +01:00
Alan Third
100346aa22 Add the missing test case for the previous patch
lisp/dabbrev.el (dabbrev--substitute-expansion): Return EXPANSION after
any processing.
lisp/dabbrev.el (dabbrev-expand): Set EXPANSION to the return value of
DABBREV--SUBSTITUTE-EXPANSION.
test/automated/dabbrev-tests.el (dabbrev-expand-test): Test for bug#1948.
2016-03-02 17:21:39 +00:00
Michael Albinus
f5d14353c2 Fix targets in test/automated/Makefile.in
* test/automated/Makefile.in: Use $(SELECTOR_DEFAULT) also for
empty target and target all.
2016-03-01 10:58:01 +01:00
Michael Albinus
c582def527 Further adaptions in file-notify-tests.el for w32notify
* test/automated/file-notify-tests.el
(file-notify--test-read-event-timeout, file-notify--test-timeout):
Decrease values.
(file-notify-test03-autorevert)
(file-notify-test04-file-validity)
(file-notify-test05-dir-validity): Run tests also for w32notify.
(file-notify-test08-watched-file-in-watched-dir):
Adapt expected events for w32notify.
2016-02-23 13:51:36 +01:00
Nicolas Richard
6620944f83 (cl-union): Do not ignore :test argument when lists are equal.
* cl-seq.el (cl-union): Do not ignore :test argument when lists are equal.

* test/automated/cl-seq-tests.el: New file (bug#22729).
2016-02-23 14:38:30 +11:00
Michael Albinus
a9c48d5c9e Additional fixes for file notification
* lisp/filenotify.el (top): Require 'cl when compiling.
(file-notify--event-watched-file): New defun.
(file-notify--rm-descriptor, file-notify-callback):
Handle case of several monitors running in parallel.

* test/automated/file-notify-tests.el
(file-notify--test-event-test): Simplify test.
(file-notify--test-with-events): Get rid of outer definition.
Check also results of tests performed in callbacks.
(file-notify-test02-events): No wrapping when calling
`file-notify-rm-watch'.  No special checking for callback tests.
(file-notify-test07-backup): Adapt expected events for gfilenotify.
(file-notify-test08-watched-file-in-watched-dir): Improve.
2016-02-22 18:52:37 +01:00
Michael Albinus
5baa001cec Fix Bug#22736
* lisp/filenotify.el (file-notify-callback): Use the proper
descriptor when calling the callback.  (Bug#22736)

* test/automated/file-notify-tests.el
(file-notify--test-event-handler): Deactivate trace.
(file-notify-test08-watched-file-in-watched-dir): Bind
`file-notify--test-tmpfile' temporarily in `dir-callback'.
2016-02-21 09:58:55 +01:00
Michael Albinus
6de26a78de Report also result in `file-notify--test-event-handler' 2016-02-20 14:20:54 +01:00
Michael Albinus
5d17ae7d46 Improve file-notify-test08-watched-file-in-watched-dir
* test/automated/file-notify-tests.el (file-notify--test-desc2):
New variable.
(file-notify--test-cleanup): Use it.
(file-notify--test-event-handler): Enable trace.
(file-notify-test08-watched-file-in-watched-dir): Tag it as
:expensive-test.  Rewrite callbacks to use
`file-notify--test-event-handler'.  Read events in loop.  Check
`file-notify--test-results'.
(file-notify-test08-watched-file-in-watched-dir): Fix docstring.
2016-02-20 14:04:36 +01:00
Tassilo Horn
2a75f64dd2 New filenotify test for bug#22736
* test/automated/file-notify-tests.el
(file-notify-test08-watched-file-in-watched-dir):
(file-notify--test-desc1): New filenotify test for bug#22736
2016-02-20 08:44:51 +01:00
Michael Albinus
3ad05a0dc4 Describe Makefile test targets in test/README
* CONTRIBUTE: Move Makefile test targets to test/README.

* Makefile.in:
* test/README: Describe Makefile test targets.
2016-02-10 12:18:30 +01:00
Michael Albinus
37eae51767 Some fixes in file-notify-tests.el
* test/automated/file-notify-tests.el
(file-notify--test-with-events-check)
(file-notify--test-with-events-explainer): New defuns.
(file-notify--test-with-events): Use it.
(file-notify-test07-backup): Fix docstring.  Some of the
backends fire two `changed' events.  Backup by rename doesn't
work for kqueue.
2016-02-08 10:54:43 +01:00
Michael Albinus
d5a10aefee Fix Bug#22557
* lisp/filenotify.el (file-notify-callback): Do not send a
`stopped' event in case of backup by renaming.  (Bug#22557)

* test/automated/Makefile.in: Use $(SELECTOR_EXPENSIVE) for
all targets but check and check-maybe.

* test/automated/file-notify-tests.el
(file-notify--test-read-event-timeout): New defconst.
(file-notify--deftest-remote, file-notify--wait-for-events)
(file-notify-test02-events)
(file-notify-test04-file-validity)
(file-notify-test06-many-events): Use it.
(file-notify--test-cleanup): Make it more robust.  Delete also
backup file.
(file-notify-test07-backup): New test.
2016-02-07 19:30:01 +01:00
Eli Zaretskii
49e57490d0 Fix file-notify-test on MS-Windows
* test/automated/file-notify-tests.el (file-notify--test-timeout):
Reduce w32notify timeout to 10 sec.
(file-notify-test06-many-events): Call read-event after each
rename, to keep the w32notify backend happy in batch mode.
(Bug#22534)
2016-02-06 21:53:38 +02:00
Eli Zaretskii
87ae21858a Extend etags Ruby support for accessors
* lib-src/etags.c (Ruby_functions): Support accessors defined with
parentheses.  (Bug#22563)

* test/etags/ruby-src/test1.ru (A::B): Add tests for accessors
defined with parentheses.
* test/etags/ETAGS.good_1:
* test/etags/ETAGS.good_2:
* test/etags/ETAGS.good_3:
* test/etags/ETAGS.good_4:
* test/etags/ETAGS.good_5:
* test/etags/ETAGS.good_6:
* test/etags/CTAGS.good: Adapt to changes in Ruby tests.
2016-02-06 11:08:20 +02:00
Michael Albinus
1eaf68f368 * test/automated/file-notify-tests.el (file-notify-test06-many-events):
Reduce the number of iterations to 250 in case of w32notify.
2016-02-05 22:55:28 +01:00
Dmitry Gutov
3dda11032f Remove 'def X' from the example
* test/etags/ruby-src/test1.ru (A::B): Remove 'def X'
(http://lists.gnu.org/archive/html/emacs-devel/2016-02/msg00167.html).
* test/etags/CTAGS.good:
* test/etags/ETAGS.good_1:
* test/etags/ETAGS.good_2:
* test/etags/ETAGS.good_3:
* test/etags/ETAGS.good_4:
* test/etags/ETAGS.good_5:
* test/etags/ETAGS.good_6: Adjust accordingly.
2016-02-04 12:21:03 +03:00
Eli Zaretskii
504696d75d Etags: yet another improvement in Ruby tags
* lib-src/etags.c (Ruby_functions): Handle continuation lines in
Ruby accessor definitions.  (Bug#22241)

* test/etags/ruby-src/test1.ru (A::B#X): Add some more tests for
accessors and multiline definitions.
* test/etags/ETAGS.good_1:
* test/etags/ETAGS.good_2:
* test/etags/ETAGS.good_3:
* test/etags/ETAGS.good_4:
* test/etags/ETAGS.good_5:
* test/etags/ETAGS.good_6:
* test/etags/CTAGS.good: Adapt to changes in Ruby tags.
2016-02-03 18:24:20 +02:00
Eli Zaretskii
860da4dccb Fix names of tags generated for Ruby accessors
* lib-src/etags.c (Ruby_functions): Don't include the leading
colon ':' in tags for Ruby accessors and aliases.  (Bug#22241)

* test/etags/ETAGS.good_1:
* test/etags/ETAGS.good_2:
* test/etags/ETAGS.good_3:
* test/etags/ETAGS.good_4:
* test/etags/ETAGS.good_5:
* test/etags/ETAGS.good_6:
* test/etags/CTAGS.good: Adapt to changes in Ruby tags.
2016-02-02 20:31:43 +02:00
Eli Zaretskii
f6213ce799 Fix file-name recognition in 'etags'
* lib-src/etags.c (get_language_from_filename): If FILE includes a
leading directory, compare only its basename to the known file
names in lang_names[].

* test/etags/Makefile (RBSRC): Adapt to recent test1.ruby
renaming.
* test/etags/ETAGS.good_1:
* test/etags/ETAGS.good_2:
* test/etags/ETAGS.good_3:
* test/etags/ETAGS.good_4:
* test/etags/ETAGS.good_5:
* test/etags/ETAGS.good_6:
* test/etags/CTAGS.good: Adapt to changes in Ruby file names and
to the results in Makefile due to the above etags.c fix.
2016-02-02 20:01:33 +02:00
Eli Zaretskii
e42e662f26 Change Ruby file names and extensions recognized by 'etags'
* lib-src/etags.c <Ruby_filenames>: New variable, holds names
of Ruby files.
<Ruby_suffixes>: Treat .rb, .ru, and .rbw as Ruby extensions.
<lang_names>: Add Ruby_filenames to the Ruby entry.
* test/etags/ruby-src/test1.ru: Renamed from test1.ruby.
(Bug#22241)
2016-02-02 19:50:08 +02:00
Eli Zaretskii
58bfb6a4f5 More improvements for Ruby support in 'etags'
* lib-src/etags.c (Ruby_functions): Tag Ruby accessors and
alias_method.  Identify constants even if the assignment is not
followed by whitespace.  (Bug#22241)

* test/etags/ruby-src/test1.ruby: Add tests for constants,
accessors, and alias_method.
* test/etags/ETAGS.good_1:
* test/etags/ETAGS.good_2:
* test/etags/ETAGS.good_3:
* test/etags/ETAGS.good_4:
* test/etags/ETAGS.good_5:
* test/etags/ETAGS.good_6:
* test/etags/CTAGS.good: Adapt to changes in Ruby tests.
2016-02-02 19:16:22 +02:00
Simen Heggestøyl
1d07dcd720 Highlight two additional SCSS keywords
* lisp/textmodes/css-mode.el (css-bang-ids): New defconst holding CSS
identifiers on the form !foo.
(scss-bang-ids): New defconst holding SCSS identifiers on the form
!foo.
(css--font-lock-keywords): Highlight the new SCSS bang identifiers in
`font-lock-builtin-face'.

* test/indent/css-mode.css: Add bang rule test case.

* test/indent/scss-mode.css: Add test cases for the introduced bang
rules.
2016-02-01 21:38:25 +01:00
lu4nx
40a85fba44 Support Go language in 'etags'
* lib-src/etags.c <Ruby_help>: Fix documentation of Ruby tags.
<Go_help>: New help.
<Go_suffixes>: New variable.
(Go_functions): New function.
<lang_names>: Add entry for Go.  (Bug#22370)

* doc/emacs/maintaining.texi (Tag Syntax): Document Go support.
* doc/man/etags.1: Mention Go support.

* etc/NEWS: Mention Go support.

* test/etags/go-src/test.go:
* test/etags/go-src/test1.go: New test files.
* test/etags/Makefile (GOSRC): New variable.
(SRCS): Add $(GOSRC).
* test/etags/ETAGS.good_1:
* test/etags/ETAGS.good_2:
* test/etags/ETAGS.good_3:
* test/etags/ETAGS.good_4:
* test/etags/ETAGS.good_5:
* test/etags/ETAGS.good_6:
* test/etags/CTAGS.good: Adapt to addition of Go tests.
2016-01-30 14:56:43 +02:00