(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.
* 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.
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.
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.
* 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.
(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'.
(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.
* automated/electric-tests.el: Fix spelling error in test name.
(whitespace-skipping-for-quotes-not-outside):
Rename from whitespace-skipping-for-quotes-not-ouside.
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.
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'.
* 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
* 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.
* 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.
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
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.
inconsistent second element of the list returned by
`smie-indent--parent'.
(ruby-font-lock-keywords): Disqualify any identifier before `=' as
method call.
(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.
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'.
* 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.
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'.
(tramp-test27-start-file-process): Use "_p" as argument of lambda.
(tramp-test28-shell-command): Improve `shell-command' test. Add
`async-shell-command' tests.
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'.
* 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.
* 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
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'.
(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'.
* 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.
* 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).
* 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.
(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
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
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
* 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'.
* 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.
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
* 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.
* 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.