1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-01 08:17:38 +00:00
Commit Graph

547 Commits

Author SHA1 Message Date
Michael Albinus
7a458be33c * automated/tramp-tests.el (tramp-test29-vc-registered):
Instrument failed test case.
2014-06-01 11:33:24 +02:00
Stefan Monnier
15ad4013c4 * lisp/emacs-lisp/nadvice.el (advice--member-p): Change second arg.
(advice-function-member-p): Tell it to check both names and functions.
(advice--add-function): Adjust call accordingly.

Fixes: debbugs:17531
2014-05-23 12:17:14 -04:00
Stefan Monnier
5d03fb436f * lisp/emacs-lisp/nadvice.el: Support adding a given function multiple times.
(advice--member-p): If name is given, only compare the name.
(advice--remove-function): Don't stop at the first match.
(advice--normalize-place): New function.
(add-function, remove-function): Use it.
(advice--add-function): Pass the name, if any, to
advice--remove-function.
2014-05-10 16:07:01 -04:00
Glenn Morris
833737d71e * test/automated/vc-bzr.el: Tweak previous to use BZR_HOME rather than HOME 2014-05-08 00:23:40 -07:00
Glenn Morris
1b70208568 Fix comment typo in previous 2014-05-08 00:14:15 -07:00
Glenn Morris
b2a929a2e6 test/automated/vc-bzr.el: revise previous change
* test/automated/vc-bzr.el (vc-bzr-test-bug9726, vc-bzr-test-bug9781)
(vc-bzr-test-faulty-bzr-autoloads):
Give bzr a temporary home-directory, in case the real one is missing.
Simply disabling logging wasn't enough.
2014-05-07 23:58:46 -07:00
Glenn Morris
606695a678 test/automated/vc-bzr.el: disable bzr's logging
This is for systems like hydra, where HOME can be read-only/absent.
See e.g. <http://hydra.nixos.org/build/10870893>.

* test/automated/vc-bzr.el (vc-bzr-test-bug9726, vc-bzr-test-bug9781)
(vc-bzr-test-faulty-bzr-autoloads): Disable bzr logging.
2014-05-07 20:34:20 -07:00
Dmitry Gutov
4dd3c4d53a * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function):
Backtrack one char if the global/char-literal var matcher hits
inside a string.  The next char could be the beginning of an
expression expansion.

* test/automated/ruby-mode-tests.el
(ruby-interpolation-after-dollar-sign): New test.
2014-05-06 03:18:18 +04:00
Glenn Morris
6da8d06975 * lisp/help-fns.el (describe-function-1): Test for an autoload before a macro
since `macrop' works on autoloads. 

* test/automated/help-fns.el: New file.

Fixes: debbugs:17410
2014-05-05 17:33:07 -04:00
Michael Albinus
844465d6ca * automated/tramp-tests.el (top):
* automated/file-notify-tests.el (top): Do not disable interactive
passwords in batch mode.
(password-cache-expiry): Set to nil.
2014-04-25 12:35:01 +02:00
Michael Albinus
c0b9bc72cc Use a mock-up connection method for remote files.
* automated/file-notify-tests.el
(file-notify-test-remote-temporary-file-directory):
* automated/tramp-tests.el (tramp-test-temporary-file-directory):
Use a mock-up method as default.
(tramp-test00-availability): Print the used directory name.
(tramp-test33-recursive-load): Fix typo.
2014-04-24 10:21:58 +02:00
Stefan Monnier
c08684513a * lisp/progmodes/perl-mode.el (perl-syntax-propertize-function): Slash after
&, |, +, - and * can't be a division.

Fixes: debbugs:17317
2014-04-22 21:56:18 -04:00
Michael Albinus
d5ff4ded7a * automated/tramp-tests.el (tramp--test-check-files): Remove traces. 2014-04-22 12:52:08 +02:00
Michael Albinus
84b2095cba * automated/tramp-tests.el (tramp-test30-special-characters):
Remove test for backslash.
2014-04-22 09:50:58 +02:00
Stefan Monnier
622eef687c * lisp/emacs-lisp/cl-macs.el (cl--loop-let): Avoid `nil' as var name. 2014-04-21 17:18:12 -04:00
Michael Albinus
f3a4812cf2 * automated/tramp-tests.el (tramp-test19-directory-files-and-attributes)
(tramp-test22-file-times): Check for `file-attributes' equality
only if there is a usable timestamp.
(tramp--test-check-files): Do not use `copy-sequence'.
2014-04-20 23:39:43 +02:00
Michael Albinus
ca2e9fb306 Instrument `tramp--test-check-files' in order to get traces on hydra. 2014-04-19 23:05:30 +02:00
Michael Albinus
5305137ad6 * automated/tramp-tests.el (tramp--test-check-files): Extend test.
(tramp-test31-utf8): Let-bind also `file-name-coding-system'.
2014-04-19 16:14:26 +02:00
Michael Albinus
2a2e6726d1 * automated/tramp-tests.el (tramp-copy-size-limit): Set to nil.
(tramp--test-make-temp-name): Optional argument LOCAL.
(tramp--instrument-test-case): Show messages.  Catch also `quit'.
(tramp-test10-write-region): No special test for out-of-band copy
needed anymore.
(tramp-test11-copy-file, tramp-test12-rename-file)
(tramp-test21-file-links): Extend tests.
(tramp-test20-file-modes): More robust check for user "root".
(tramp--test-check-files): New defun.
(tramp-test30-special-characters, tramp-test33-recursive-load)
(tramp-test34-unload): New tests.
(tramp-test31-utf8, tramp-test32-asynchronous-requests):  Rename.
2014-04-18 20:58:13 +02:00
Stefan Monnier
b262bde327 * lisp/nxml/nxml-mode.el (nxml-fontify-matcher): Make sure propertization
was done.
* lisp/nxml/xmltok.el (xmltok-scan-after-comment-open): Extend unclosed
comment to EOB.

Fixes: debbugs:17264
2014-04-16 11:28:26 -04:00
Paul Eggert
10ee3b3f17 Spelling fixes.
* automated/electric-tests.el: Fix spelling error in test name.
(whitespace-skipping-for-quotes-not-outside):
Rename from whitespace-skipping-for-quotes-not-ouside.
2014-04-10 12:12:34 -07:00
Feng Li
39764caa7f * lisp/progmodes/pascal.el (pascal-font-lock-keywords): Fix incorrect format
entry; use symbol boundaries to avoid mis-matches.
2014-04-10 09:56:28 -04:00
Glenn Morris
50c9a9b8a8 Fix python-triple-quote-pairing test
* test/automated/python-tests.el (python-triple-quote-pairing):
Enable/disable electric-pair-mode as needed.
2014-04-08 21:50:29 -04:00
Glenn Morris
3b7fab2504 * electric-tests.el (electric-pair-backspace-1): Replace deleted function. 2014-04-08 21:34:16 -04:00
Glenn Morris
c17a8019bf ChangeLog fix (no need to merge to trunk) 2014-04-07 17:15:45 -04:00
João Távora
190f899aed Improve on previous quote autopairing change
Backported from trunk 2014-04-04T23:31:02Z!joaotavora@gmail.com

* lisp/elec-pair.el:
(electric-pair--syntax-ppss): When inside comments parse from
comment beginning.
(electric-pair--balance-info): Fix typo in comment.
(electric-pair--in-unterminated-string-p): Delete.
(electric-pair--unbalanced-strings-p): New function.
(electric-pair-string-bound-function): New var.
(electric-pair-inhibit-if-helps-balance): Decide quote pairing
according to `electric-pair--in-unterminated-string-p'

* test/automated/electric-tests.el (define-electric-pair-test): Don't
overtest..
(inhibit-in-mismatched-string-inside-ruby-comments): New test.
(inhibit-in-mismatched-string-inside-c-comments): New test.
2014-04-07 08:29:50 +01:00
João Távora
528c33b528 Inhibit quote autopairing more frequently
Backported from trunk 2014-04-02T09:59:06Z!joaotavora@gmail.com

* lisp/elec-pair.el (electric-pair-inhibit-if-helps-balance): Inhibit
quote pairing if point-max is inside an unterminated string.
(electric-pair--looking-at-unterminated-string-p):
Delete.
(electric-pair--in-unterminated-string-p): New function.

* test/automated/electric-tests.el (inhibit-if-strings-mismatched):
New test, change from `inhibit-only-of-next-is-mismatched'.
2014-04-07 08:24:03 +01:00
João Távora
7aecc2f6ca Fix triple-quoting electricity in python-mode
* lisp/progmodes/python.el (python-electric-pair-string-delimiter): Fix
triple-quoting electricity. 

* test/automated/python-tests.el (python-triple-quote-pairing): New test.
(python-syntax-after-python-backspace): New test.

Fixes: debbugs:17192
2014-04-07 00:23:45 +01:00
João Távora
89f20f76d8 Fix electric-pair-skip-whitespace with quotes in text-mode
* lisp/elec-pair.el (electric-pair-post-self-insert-function): Don't
skip whitespace for quote syntax when `electric-pair-text-pairs'
and `electric-pair-pairs' were used.

* test/automated/electric-tests.el (electric-pair-define-test-form):
More readable test docstrings.
(whitespace-skipping-for-quotes-not-ouside)
(whitespace-skipping-for-quotes-only-inside)
(whitespace-skipping-not-without-proper-syntax):

Fixes: debbugs:17183
2014-04-07 00:09:19 +01:00
Stefan Monnier
062e286b7c * lisp/progmodes/perl-mode.el (perl-syntax-propertize-function): Handle $'
used as a variable.

Fixes: debbugs:17174
2014-04-02 20:41:09 -04:00
Dmitry Gutov
42ebc34ea8 Fix bug#17097
* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function):
Don't propertize `?' or `!' as symbol constituent when after
colon.
2014-03-27 08:53:13 +02:00
Michael Albinus
c7d0e04c9d Fix last ChangeLog entry. 2014-03-25 08:34:30 +01:00
Barry O'Reilly
37ea8275f7 Undo in region after markers in undo history relocated
* simple.el (primitive-undo): Only process marker adjustments
validated against their corresponding (TEXT . POS).  Issue warning
for lone marker adjustments in undo history.  (Bug#16818)
(undo-make-selective-list): Add marker adjustments to selective
undo list based on whether their corresponding (TEXT . POS) is in
the region.  Remove variable adjusted-markers, which was unused
and only non nil during undo-make-selective-list.
(undo-elt-in-region): Return nil when passed a marker adjustment
and explain in function doc.

Have (MARKER . ADJUSTMENT) undo records always be immediately
after their corresponding (TEXT . POS) record in undo list.
(Bug#16818)
* lisp.h (record-delete): New arg record_markers.
(record_marker_adjustment): No longer needed outside undo.c.
* insdel.c (adjust_markers_for_delete): Move calculation of marker
adjustments to undo.c's record_marker_adjustments.  Note that
fileio.c's decide_coding_unwind is another caller to
adjust_markers_for_delete.  Because it has undo list bound to t,
it does not rely on adjust_markers_for_delete to record marker
adjustments.
(del_range_2): Swap call to record_delete and
adjust_markers_for_delete so as undo marker adjustments are
recorded before current deletion's adjustments, as before.
(adjust_after_replace):
(replace_range): Pass value for new record_markers arg to
delete_record.
* undo.c (record_marker_adjustment): Renamed to
record_marker_adjustments and made static.
(record_delete): Check record_markers arg and call
record_marker_adjustments.
(record_change): Pass value for new record_markers arg to
delete_record.
(record_point): at_boundary calculation no longer needs to account
for marker adjustments.

* undo-tests.el (undo-test-marker-adjustment-nominal):
(undo-test-region-t-marker): New tests of marker adjustments.
(undo-test-marker-adjustment-moved):
(undo-test-region-mark-adjustment): New tests to demonstrate
bug#16818, which fail without the fix.

* markers.texi (Moving Marker Positions): The 2014-03-02 doc
change mentioning undo's inability to handle relocated markers no
longer applies.  See bug#16818.
* text.texi (Undo): Expand documentation of (TEXT . POS) and
(MARKER . ADJUSTMENT) undo elements.
2014-03-24 22:47:39 -04:00
Daniel Colascione
7eab98da1b Fix keyword argument parsing. Please bootstrap. 2014-03-22 23:00:18 -07:00
Dmitry Gutov
0ceba22e53 Fix test failure in non-graphical mode
* test/automated/package-test.el (package-test-describe-package):
Fix test failure in non-graphical mode.

Add some missing ChangeLog entries.
2014-03-23 05:26:13 +02:00
Dmitry Gutov
1197f2e665 Fix bug#16873
* lisp/emacs-lisp/package.el (package-desc): Use the contents of the
quoted form, not its cdr.
2014-03-22 10:43:30 +02:00
Dmitry Gutov
dcf7866712 Fix bug#16826
* lisp/emacs-lisp/package.el (package-compute-transaction):
Use `version-list-<=' to compare the requirement version against
the package version already to be installed.  Update the error
message.
2014-03-21 08:06:52 +02:00
Dmitry Gutov
1fc8f6559a Fix bug#17050
* lisp/progmodes/ruby-mode.el (ruby-smie-rules):
Add indentation rule for ` @ '.
2014-03-21 06:26:39 +02:00
Michael Albinus
162427fe6a * automated/tramp-tests.el (tramp-copy-size-limit): Declare.
(tramp-test10-write-region): Extend for out-of-band copy.
(tramp-test31-asynchronous-requests): New test.
2014-03-07 15:11:37 +01:00
Paul Eggert
fbaddd63ab Spelling fixes. 2014-03-02 21:12:12 -08:00
Juanma Barranquero
35e951cd4b */ChangeLog: Trivial fixes. 2014-03-03 05:57:26 +01:00
Barry O'Reilly
e3d090b4c5 * simple.el (undo-elt-in-region): Fix buffer corruption for edge
case of undo in region.
* automated/undo-tests.el (undo-test-in-region-not-most-recent):
Add new test of undo in region.
(undo-test-in-region-eob): Add test case described at
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16411#41
2014-03-02 12:37:32 -05:00
Dmitry Gutov
1850913d96 * lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight
regexp options.

Fixes: debbugs:16914
2014-03-02 00:04:59 +02:00
Michael Albinus
5b5774e5d5 * automated/tramp-tests.el (tramp--test-enabled)
(tramp-test15-copy-directory): No special handling of tramp-adb.el
anymore.  It's fixed in that package.
2014-02-28 09:47:43 +01:00
Michael Albinus
154ba7966c * automated/tramp-tests.el (tramp--test-enabled): Move connection
cleanup into this function.  Remove respective code from all test cases.
(tramp--instrument-test-case): Declare `indent' and `debug'.
Handle other errors as well.
(tramp-test14-delete-directory): Check for `file-error' error.
(tramp-test15-copy-directory): Ignore return value of
`copy-directory'.  It's too much hassle to handle it for tramp-adb.el.
(tramp-test19-directory-files-and-attributes): Take care of
timestamp of "../".
(tramp-test20-file-modes, tramp-test27-start-file-process)
(tramp-test28-shell-command): Skip for tramp-adb.el.
(tramp-test21-file-links): `file-truename' shall preserve trailing
link of directories.
(tramp-test22-file-times): Skip if `set-file-times' returns nil.
(tramp-test26-process-file, tramp-test28-shell-command): Let-bind
`kill-buffer-query-functions' to nil.
(tramp-test28-shell-command): Run `async-shell-command' with timeouts.
2014-02-27 13:07:10 +01:00
Paul Eggert
9a89cfa29d Spelling fix. 2014-02-25 10:40:54 -08:00
Dmitry Gutov
dfdb365c4c * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Handle the
inconsistent second element of the list returned by
`smie-indent--parent'.
(ruby-font-lock-keywords): Disqualify any identifier before `=' as
method call.
2014-02-23 10:26:40 +02:00
Dmitry Gutov
62f9502226 * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Don't indent specially
after `=>'.

Fixes: debbugs:16811
2014-02-23 07:53:53 +02:00
Michael Albinus
c6e08d12a9 * automated/tramp-tests.el
(tramp-test19-directory-files-and-attributes): Do not include
directories in comparison; they might have changed their
timestamps already.
2014-02-21 11:43:49 +01:00
Michael Albinus
146a4cf202 * tramp-tests.el (tramp-test19-directory-files-and-attributes):
Instrument failed test case.
2014-02-20 19:26:40 +01:00
Michael Albinus
d9386b0ca0 * automated/tramp-tests.el (tramp--instrument-test-case): New macro.
(tramp-test17-insert-directory): First line could contain more
text, when produced by `ls-lisp'.
(tramp-test19-directory-files-and-attributes): Instrument failed
test case.
2014-02-20 15:08:00 +01:00
Michael Albinus
76c92fdd00 * automated/tramp-tests.el (tramp-test17-insert-directory):
Make first line "total 123" optional.
(tramp-test20-file-modes, tramp-test22-file-times)
(tramp-test26-process-file, tramp-test27-start-file-process)
(tramp-test28-shell-command): Skip for tramp-gvfs.el and
tramp-smb.el.
(tramp-test20-file-modes): Check for "root" only when there is an
explicit user name.
(tramp-test21-file-links): Handle "... not supported" error.
(tramp-test22-file-times): Skip for "don't know" return values.
(tramp-test26-process-file, tramp-test28-shell-command):
Remove color escape sequences.
(tramp-test28-shell-command): Use `accept-process-output' rather
than `sit-for'.
(tramp-test30-utf8): Set coding system `utf-8'.
2014-02-19 20:28:32 +01:00
Michael Albinus
2830e9b6b9 * automated/tramp-tests.el (tramp-test28-shell-command): Perform
an initial `sit-for' prior the while loop.
2014-02-17 08:05:44 +01:00
Michael Albinus
dd7691b7f3 Sync with Tramp 2.2.9.
* doc/misc/trampver.texi: Update release number.

* lisp/net/trampver.el: Update release number.

* test/automated/tramp-tests.el (password-cache-expiry): Set to nil.
(tramp-test28-shell-command): Make a while loop when waiting for
process exit.
2014-02-16 18:23:00 +01:00
Juanma Barranquero
c295fc18e3 Fix typos in Changelogs. 2014-02-13 03:19:48 +01:00
Michael Albinus
581d24e701 * automated/tramp-tests.el (top): Require vc', vc-bzr', `vc-git'
and `vc-hg'.  Declare `tramp-find-executable' and
`tramp-get-remote-path'.
(tramp-test29-vc-registered): New test.
(tramp-test30-utf8): Rename from `tramp-test29-utf8'.
2014-02-11 09:31:39 +01:00
Glenn Morris
34dc21db6e Replace "Maintainer: FSF" with the emacs-devel mailing address 2014-02-09 17:34:22 -08:00
Michael Albinus
5a327e991e Remove superfluous argument. 2014-02-07 16:56:15 +01:00
Michael Albinus
cad6dfb67f * automated/tramp-tests.el (tramp-test26-process-file): Improve test.
(tramp-test27-start-file-process): Use "_p" as argument of lambda.
(tramp-test28-shell-command): Improve `shell-command' test.  Add
`async-shell-command' tests.
2014-02-07 16:47:18 +01:00
Michael Albinus
40d2f2e4bb * automated/file-notify-tests.el (file-notify--wait-for-events):
Use `read-event' instead of `sit-for'.
(file-notify-test02-events): Remove expected result, the bug is
fixed meanwhile.
(file-notify-test02-events, file-notify-test03-autorevert):
Use `sleep-for' instead of `sit-for'.
2014-02-04 12:41:20 +01:00
Dmitry Gutov
a09beb3df2 Fix bug#16609
* lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Check for
`:' before binary operators.  Don't check for `:'
before `[' and `(', or their syntax status.  A percent literal
can't end with either.
2014-02-01 16:54:58 +02:00
Dmitry Gutov
e2a67bd08e Implement user option ruby-align-chained-calls
* lisp/progmodes/ruby-mode.el (ruby-align-chained-calls): New option.
(ruby-smie-grammar): Make "." right-associative.  Make its priority
lower than the ternary and all binary operators.
(ruby-smie-rules): Indent "(" relative to the first non-"."
parent, or the first "." parent at indentation.  Use
`ruby-align-chained-calls' for indentation of "." tokens.

* test/automated/ruby-mode-tests.el (ruby-align-chained-calls):
New test.

Fixes: debbugs:16593
2014-01-31 19:13:49 +02:00
Michael Albinus
dc9c8c62df * automated/file-notify-tests.el (file-notify--deftest-remote):
Do not skip when the local test has failed.  They are unrelated.
(file-notify--wait-for-events): Use `sit-for'.  Let-bind
`noninteractive' to nil, otherwise `sit-for' could be degraded to
`sleep-for'.
(file-notify-test02-events): Check for `file-remote-p' instead of
`file-notify--test-remote-enabled'.
2014-01-27 20:10:02 +01:00
Michael Albinus
748650f087 * file-notify-tests.el (file-notify-test02-events): Let it fail in the
local case only.
2014-01-26 17:29:50 +01:00
Michael Albinus
5511e5c59a * automated/file-notify-tests.el (file-notify-test02-events):
Let test case fail for Bug#16519.
2014-01-26 17:20:13 +01:00
Michael Albinus
29f5e020a2 * automated/file-notify-tests.el (file-notify-test02-events):
Hide Bug#16519, until it is solved.
2014-01-22 11:02:46 +01:00
Glenn Morris
213763c134 Set Maintainer: FSF in some files 2014-01-21 20:54:10 -05:00
Michael Albinus
63389c254e * automated/file-notify-tests.el
(file-notify--test-local-enabled): Fix error in logic.
(file-notify--wait-for-events): New defmacro.
(file-notify-test02-events): Make short breaks between file operations.
Use `file-notify--wait-for-events'.  Check, that events have arrived.
(file-notify-test03-autorevert): Use `file-notify--wait-for-events'.
2014-01-21 14:31:39 +01:00
Michael Albinus
ca4cfde314 * automated/comint-testsuite.el
(comint-testsuite-password-strings): Add localized examples.
2014-01-21 09:32:06 +01:00
Glenn Morris
812a093042 ChangeLog and Author: header comment fixes 2014-01-17 20:51:38 -05:00
Michael Albinus
160630163c Fix Bug#13662.
* automated/inotify-test.el (inotify-file-watch-simple): Skip test
case if inotify is not linked with Emacs.  Use `read-event' rather
than `sit-for' in order to process events.
2014-01-17 12:50:15 +01:00
Dmitry Gutov
fb3d479c91 ruby-mode: Align def...end to the beginning of statement
* lisp/progmodes/ruby-mode.el (ruby-alignable-keywords): New constant.
(ruby-align-to-stmt-keywords): Change the default value.  Use
`ruby-alignable-keywords' to generate the possible customization
choices.
(ruby-smie-rules): Instead of using a hardcoded list of alignable
keywords, check against the value of `ruby-alignable-keywords'
(http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01439.html).
2014-01-17 05:15:02 +02:00
Paul Eggert
ae93878a92 Spelling fixes. 2014-01-13 14:21:32 -08:00
Michael Albinus
6a1f3c119c Bug#13064
* automated/ert-tests.el (ert-test-record-backtrace): Reenable
test case with adapted test string.  (Bug#13064)
2014-01-13 11:53:36 +01:00
Glenn Morris
a12bf61ed4 ChangeLog fixes 2014-01-10 19:55:50 -08:00
Paul Eggert
06827ec842 Spelling fixes.
* mail/unrmail.el (unrmail-mbox-format): Choice is mboxo, not mboxro.
* woman.el (woman-mark-horizontal-position):
Rename from woman-mark-horizonal-position.  Use changed.
2014-01-09 23:10:37 -08:00
Paul Eggert
ba3189039a Update copyright year to 2014 by running admin/update-copyright. 2014-01-01 07:43:34 +00:00
Paul Eggert
7e99158aac Spelling and typo fixes. 2013-12-27 22:37:35 -08:00
Glenn Morris
1f5afa8c1c * test/automated/electric-tests.el: Require 'elec-pair.
Set copyright holder to FSF.
2013-12-27 16:04:56 -08:00
João Távora
8a6212d71d Fix Electric Pair mode's autowrapping tests in batch-mode. 2013-12-27 18:05:03 +00:00
João Távora
3b8d5131a3 Make Electric Pair mode smarter/more useful:
* lisp/electric.el: Pairing/skipping helps preserve
  balance. Autobackspacing behaviour. Opens extra newlines between
  pairs. Skip whitespace before closing delimiters.

* lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables): Use new
  features.

* test/automated/electric-tests.lisp: New file.

* doc/emacs/programs.texi: Describe new features.

* lisp/simple.el: Pass non-nil interactive arg to newline call inside
  newline-and-indent.
2013-12-26 22:02:49 +00:00
Fabián Ezequiel Gallina
0137922173 * lisp/progmodes/python.el:
(python-nav--lisp-forward-sexp): New function.
(python-nav--lisp-forward-sexp-safe): Use it.  Rename from
python-nav-lisp-forward-sexp-safe.
(python-nav--forward-sexp): New argument SAFE allows switching
forward sexp movement behavior for parens.
(python-nav-forward-sexp): Throw errors on unterminated parens.
(python-nav-backward-sexp, python-nav-forward-sexp-safe)
(python-nav-backward-sexp-safe): New functions.
(python-shell-buffer-substring): Use
`python-nav-forward-sexp-safe'.

* test/automated/python-tests.el
(python-nav-lisp-forward-sexp-safe-1): Remove test.
(python-nav-forward-sexp-safe-1): New test.

Fixes: debbugs:16191
2013-12-25 15:07:31 -03:00
Dmitry Gutov
f235149801 * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Return t
after `{'.  We need it after block openers, and it doesn't seem
to hurt after hash openers.
2013-12-22 08:04:40 +02:00
Dmitry Gutov
65a1da00fe * lisp/progmodes/ruby-mode.el (ruby-align-to-stmt-keywords): Tweak the
docstring.
(ruby-smie-rules): Indent plus one level after `=>'.
2013-12-22 04:31:21 +02:00
Dmitry Gutov
b520f210b1 * lisp/progmodes/ruby-mode.el (ruby-align-to-stmt-keywords): New
option. 
(ruby-smie--indent-to-stmt-p): Use it.
(ruby-smie-rules): Revert the logic in the handling of `when'.
Expand the `begin' clause to handle `ruby-align-to-stmt-keywords'.
(ruby-deep-arglist, ruby-deep-indent-paren)
(ruby-deep-indent-paren-style): Update docstrings to note that the
vars don't have any effect with SMIE.

* test/automated/ruby-mode-tests.el: Add tests for
`ruby-align-to-stmt-keywords'.

* test/indent/ruby.rb: Update examples to reflect the lack of change in
default indentation of `begin' blocks.

Fixes: debbugs:16182
2013-12-20 07:20:33 +02:00
Dmitry Gutov
ce41edb426 * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Indent middle-of-block
keywords to their parent.
2013-12-19 07:06:24 +02:00
Dmitry Gutov
7e1549c91d * lisp/progmodes/ruby-mode.el (ruby-smie--args-separator-p): Allow the
first arg to be a string (fixed dead code), or an operator symbol.
(ruby-smie--forward-token): Tokenize ` @ ' before strings and
operator symbols.
(ruby-smie-rules): Remove parent token check in the `.' clause, it
did nothing.  Don't respond to `(:after ".")', it will be called
with :before anyway.  Remove the ` @ ' rule, it didn't seem to
change anything.  Only return indentation for binary operators
when they are hanging.  De-dent opening paren when its parent is
`.', otherwise it looks bad when the dot is not at bol or eol.

Fixes: debbugs:16182
2013-12-19 06:21:44 +02:00
Dmitry Gutov
35b249a653 * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Indent ternary if. 2013-12-17 14:04:23 +02:00
Dmitry Gutov
5556c0cef1 Fix bug#16116
* lisp/emacs-lisp/smie.el (smie-indent--rule): Extract `smie-indent--rule-1'.
(smie-indent-close): Call `smie-indent--rule-1' with METHOD
:close-all, to see which indentation method to use.
(smie-rules-function): Document the method :close-all.

* test/indent/ruby.rb: Update examples according to the change
in `smie-indent-close'.
2013-12-17 03:31:55 +02:00
Dmitry Gutov
276bc3337b Fix bug#16118
* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Return nil before
open-paren tokens when preceded by a open-paren, too.
(ruby-smie-rules): Handle virtual indentation after open-paren
tokens specially.  If there is code between it and eol, return the
column where is starts.

* test/indent/ruby.rb: New examples.
2013-12-14 08:46:13 +02:00
Fabián Ezequiel Gallina
bc9222c934 * lisp/progmodes/python.el (python-indent-calculate-indentation): Fix
de-denters cornercase.

* test/automated/python-tests.el (python-indent-dedenters-2): New test.

Fixes: debbugs:15731
2013-12-12 20:32:05 -03:00
Paul Eggert
32e93c9e89 Spelling fixes. 2013-12-12 12:07:40 -08:00
Fabián Ezequiel Gallina
09faee72dd * lisp/progmodes/python.el (python-indent-context)
(python-indent-calculate-indentation): Fix auto-identation
behavior for comment blocks.

* test/automated/python-tests.el (python-indent-after-comment-1)
(python-indent-after-comment-2): New tests.

Fixes: debbugs:15916
2013-12-12 02:37:09 -03:00
Nathan Trapuzzano
f54de22e65 * lisp/progmodes/python.el (python-indent-calculate-indentation): When
determining indentation, don't treat "return", "pass", etc., as
operators when they are just string constituents. 

* automated/python-test.el (python-indent-block-enders-1): Rename
from python-indent-block-enders.
(python-indent-block-enders-2): New test.

Fixes: debbugs:15812
2013-12-12 00:47:41 -03:00
Dmitry Gutov
8212d9c0da * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Return t
after the end of a percent literal.
2013-12-09 06:19:16 +02:00
Dmitry Gutov
939fef2978 Mention test/indent/js.js, and restore one lost piece of it
* test/indent/js.js: New file.
2013-12-08 18:11:08 +02:00
Dmitry Gutov
47e59c666a Port indentation code from js2-mode to js-mode
* lisp/progmodes/js.el (js-auto-indent-flag): Remove, was unused.
(js-switch-indent-offset): New option.
(js--proper-indentation): Use it.  And handle the case when
"default" is actually a key in an object literal.
(js--same-line): New function.
(js--multi-line-declaration-indentation): Use it.
(js--indent-in-array-comp, js--array-comp-indentation): New
functions.
(js--proper-indentation): Use them, to handle array comprehension
continuations.
2013-12-08 18:08:45 +02:00
Michael Albinus
0494d994cd Commit missing ChangeLog entry. 2013-12-06 16:35:11 +01:00
Dmitry Gutov
af67e79a52 Fix Bug#15874
* lisp/progmodes/ruby-mode.el (ruby-mode-syntax-table): Don't modify
syntax for `?'.
(ruby-expr-beg): Expect that `!' will have syntax class "symbol"
where appropriate already.
(ruby-syntax-propertize-function): Propertize `?' and `!' at the
end of method names.
2013-12-06 06:22:08 +02:00
Cameron Desautels
bf4906d7ca * lisp/emacs-lisp/regexp-opt.el (regexp-opt-charset): Fix ^.
* test/automated/regexp-tests.el: New file.

Fixes: debbugs:16046
2013-12-05 15:25:54 -05:00