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

340 Commits

Author SHA1 Message Date
Michael Albinus
dd42ca427c Add Tramp tests
* lisp/net/tramp.el (tramp-syntax): Adapt docstring.

* test/lisp/net/tramp-tests.el
(tramp-test01-file-name-syntax-simplified)
(tramp-test01-file-name-syntax-separate)
(tramp-test02-file-name-dissect-simplified)
(tramp-test02-file-name-dissect-separate): New tests.
2017-04-10 17:22:13 +02:00
Philipp Stephani
98bfac68b9 Validate SPEC of `dolist', cf. Bug#25477.
* lisp/subr.el (dolist): Test type and length of SPEC.
* test/lisp/subr-tests.el (subr-tests--dolist--wrong-number-of-args):
Add unit test.
2017-04-08 17:15:31 +02:00
Philipp Stephani
5ea696fd24 Add unit test for Bug#26378
* test/lisp/vc/ediff-diff-tests.el
(ediff-diff-tests--ediff-exec-process--nil): New unit test.
2017-04-08 16:55:56 +02:00
Paul Eggert
cea942e5a6 ; Spelling and punctuation fixes 2017-04-06 19:27:00 -07:00
Michal Nazarewicz
b3b9b258c4 Support casing characters which map into multiple code points (bug#24603)
Implement unconditional special casing rules defined in Unicode standard.

Among other things, they deal with cases when a single code point is
replaced by multiple ones because single character does not exist (e.g.
‘fi’ ligature turning into ‘FL’) or is not commonly used (e.g. ß turning
into SS).

* admin/unidata/SpecialCasing.txt: New data file pulled from Unicode
standard distribution.
* admin/unidata/README: Mention SpecialCasing.txt.

* admin/unidata/unidata-get.el (unidata-gen-table-special-casing,
unidata-gen-table-special-casing--do-load): New functions generating
‘special-uppercase’, ‘special-lowercase’ and ‘special-titlecase’
character Unicode properties built from the SpecialCasing.txt Unicode
data file.

* src/casefiddle.c (struct casing_str_buf): New structure for
representing short strings used to handle one-to-many character
mappings.

(case_character_imlp): New function which can handle one-to-many
character mappings.
(case_character, case_single_character): Wrappers for the above
functions.  The former may map one character to multiple (or no)
code points while the latter does what the former used to do (i.e.
handles one-to-one mappings only).

(do_casify_natnum, do_casify_unibyte_string,
do_casify_unibyte_region): Use case_single_character.
(do_casify_multibyte_string, do_casify_multibyte_region): Support new
features of case_character.
* (do_casify_region): Updated to reflact do_casify_multibyte_string
changes.

(casify_word): Handle situation when one character-length of a word
can change affecting where end of the word is.

(upcase, capitalize, upcase-initials): Update documentation to mention
limitations when working on characters.

* test/src/casefiddle-tests.el (casefiddle-tests-char-properties):
Add test cases for the newly introduced character properties.
(casefiddle-tests-casing): Update test cases which are now passing.

* test/lisp/char-fold-tests.el (char-fold--ascii-upcase,
char-fold--ascii-downcase): New functions which behave like old ‘upcase’
and ‘downcase’.
(char-fold--test-match-exactly): Use the new functions.  This is needed
because otherwise fi and similar characters are turned into their multi-
-character representation.

* doc/lispref/strings.texi: Describe issue with casing characters versus
strings.
* doc/lispref/nonascii.texi: Describe the new character properties.
2017-04-06 20:54:58 +02:00
Tom Tromey
335174ee50 add mhtml-mode.el
* etc/NEWS: Update.
* lisp/textmodes/mhtml-mode.el: New file.
* test/manual/indent/html-multi.html: New file.
* test/lisp/textmodes/mhtml-mode-tests.el: New file.
* doc/emacs/text.texi (HTML Mode): Mention mhtml-mode.
2017-04-05 15:53:39 -06:00
Philipp Stephani
604eb02fff Make subprocess functions resolve the default directory
`call-process' doesn't respect file name handlers in
`default-directory', so `file-name-non-special' has to resolve them
for `process-file', `start-file-process', and
`shell-command' (Bug#25949).

* lisp/files.el (file-name-non-special): Also resolve default
directory for 'process-file', 'start-file-process', and
'shell-command'.
* test/lisp/files-tests.el
(files-tests--file-name-non-special--subprocess): Add unit test.
2017-04-04 14:32:01 +02:00
Philipp Stephani
f4b50dad8d Make ediff handle remote and quoted file names
Quoted file names need to be unquoted before passed to
subprocesses (Bug#25950).

* lisp/vc/ediff-diff.el (ediff-exec-process): Handle remote and quoted
file names.
* test/lisp/vc/ediff-diff-tests.el
(ediff-diff-tests--ediff-exec-process--quoted-file): Add unit test.
2017-04-04 11:37:10 +02:00
Stefan Monnier
2c68192c6b Backward compatibility with pre-existing struct instances.
* lisp/emacs-lisp/cl-lib.el (cl--old-struct-type-of): New function.
(cl-old-struct-compat-mode): New minor mode.

* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Pass `record' to
cl-struct-define to signal use of record objects.

* lisp/emacs-lisp/cl-preloaded.el (cl--struct-get-class,
cl-struct-define): Enable legacy defstruct compatibility.

* test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-old-struct,
old-struct): New tests.

* doc/lispref/elisp.texi, doc/lispref/records.texi: Document
`old-struct-compat'.
2017-04-04 08:23:46 +02:00
Lars Brinkhoff
0565482838 Make cl-defstruct use records.
* lisp/emacs-lisp/cl-extra.el (cl--describe-class)
(cl--describe-class-slots): Use the new `type-of'.

* lisp/emacs-lisp/cl-generic.el (cl--generic-struct-tag): Use type-of.
(cl--generic-struct-specializers): Adjust to new tag.

* lisp/emacs-lisp/cl-macs.el (cl-defstruct): When type is nil, use records.
Use the type symbol as the tag.  Use copy-record to copy structs.
(cl--defstruct-predicate): New function.
(cl--pcase-mutually-exclusive-p): Use it.
(cl-struct-sequence-type): Can now return `record'.

* lisp/emacs-lisp/cl-preloaded.el (cl--make-slot-desc): Adjust ad-hoc
code to new format.
(cl--struct-register-child): Work with records.
(cl-struct-define): Don't touch the tag's symbol-value and
symbol-function slots when we use the type as tag.

* lisp/emacs-lisp/cl-print.el (cl-print-object): Adjust to new tag.

* test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-defstruct-record):
New test.

* doc/lispref/records.texi, doc/misc/cl.texi: Update for records.
2017-04-04 08:23:46 +02:00
Lars Brinkhoff
a2c3343029 Add record objects with user-defined types.
* src/alloc.c (allocate_record): New function.
(Fmake_record, Frecord, Fcopy_record): New functions.
(syms_of_alloc): defsubr them.
(purecopy): Work with records.

* src/data.c (Ftype_of): Return slot 0 for record objects, or type
name if record's type holds class.
(Frecordp): New function.
(syms_of_data): defsubr it.  Define `Qrecordp'.
(Faref, Faset): Work with records.

* src/fns.c (Flength): Work with records.

* src/lisp.h (prec_type): Add PVEC_RECORD.
(RECORDP, CHECK_RECORD, CHECK_RECORD_TYPE): New functions.

* src/lread.c (read1): Add syntax for records.

* src/print.c (PRINT_CIRCLE_CANDIDATE_P): Add RECORDP.
(print_object): Add syntax for records.

* test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-2):
New test.

* test/src/alloc-tests.el (record-1, record-2, record-3):
New tests.

* doc/lispref/elisp.texi, doc/lispref/objects.texi,
doc/lispref/records.texi: Add documentation for records.
2017-04-04 08:23:46 +02:00
Tino Calancha
19b92cdfb0 Fix a test in python-test.el
Fix a test that breaks the test suite when it is run within a
virtual environment.
See following link for details:
https://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00857.html
* test/lisp/progmodes/python-tests.el
(python-shell-calculate-process-environment-7): Bind
python-shell-virtualenv-root to VIRTUAL_ENV when this var is set; otherwise
bind it to '/env'.
2017-04-04 15:16:15 +09:00
Michael Albinus
49197e6e3d Add Tramp test
* doc/misc/tramp.texi (Remote processes): Fix typo.

* lisp/shell.el (shell): Fix typo.

* lisp/net/tramp.el (tramp-set-connection-local-variables): Simplify.

* test/lisp/net/tramp-tests.el (tramp-test30-explicit-shell-file-name):
New test.
(tramp--test-special-characters, tramp--test-utf8): Adapt docstring.
(tramp-test31-vc-registered)
(tramp-test32-make-auto-save-file-name)
(tramp-test33-make-nearby-temp-file)
(tramp-test34-special-characters)
(tramp-test34-special-characters-with-stat)
(tramp-test34-special-characters-with-perl)
(tramp-test34-special-characters-with-ls, tramp-test35-utf8)
(tramp-test35-utf8-with-stat, tramp-test35-utf8-with-perl)
(tramp-test35-utf8-with-ls)
(tramp-test36-asynchronous-requests)
(tramp-test37-recursive-load, tramp-test38-unload): Rename.
2017-04-03 14:04:06 +02:00
Tom Tromey
f4ecb65f33 fix two js-mode syntax propertization bugs
Bug#26070:
* lisp/progmodes/js.el (js--syntax-propertize-regexp-regexp): Add
zero-or-one to regular expression.
(js-syntax-propertize-regexp): Update.  Propertize body of regexp
literal up to END.
* test/lisp/progmodes/js-tests.el (js-mode-propertize-bug-1)
(js-mode-propertize-bug-2): New tests.
2017-04-01 15:03:46 -06:00
Stefan Monnier
acce29d6c5 * test/lisp/emacs-lisp/cl-lib-tests.el: Improve symbol-macrolet tests
(cl-lib-symbol-macrolet): Fix last test so it doesn't break the whole
test suite.
(cl-lib-symbol-macrolet-2): New test.
2017-04-01 12:11:07 -04:00
Tino Calancha
9cf6a408c8 Use only posix options in a ediff-ptch test
* test/lisp/vc/ediff-ptch-tests.el (ediff-ptch-test-bug26084):
Use just "-b" patch option.  Don't assume a particular suffix for
the backup files.
2017-04-01 17:02:49 +09:00
Jarno Malmari
5b264d8879 Initial implementation of HTTP Digest qop for url
This also refactors digest authentication functions in url-auth.el.

* lisp/url/url-auth.el (url-digest-auth, url-digest-auth-create-key):
(url-digest-auth-build-response, url-digest-auth-directory-id-assoc):
(url-digest-auth-name-value-string, url-digest-auth-source-creds):
(url-digest-cached-key, url-digest-cache-key, url-digest-find-creds):
(url-digest-find-new-key, url-digest-prompt-creds): Add new functions
to simplify code and aid in unit testing.
(url-digest-auth-build-response): Hook up new functionality, or fall
back to previous.
(url-digest-auth-make-request-digest-qop):
(url-digest-auth-make-cnonce, url-digest-auth-nonce-count):
(url-digest-auth-name-value-string): Add new helper functions.
* test/lisp/url/url-auth-tests.el (url-auth-test-colonjoin):
(url-auth-test-digest-ha1, url-auth-test-digest-ha2):
(url-auth-test-digest-request-digest): Add a few tests as now more
features are testable via intermediate functions.
(url-auth-test-challenges, url-auth-test-digest-request-digest): Test
the new implementation.  Parts of these were accidentally already
merged in the past.
2017-04-01 09:19:46 +03:00
Tino Calancha
226cafd24d Tweak ediff-ptch test in previous commit a bit more
* test/lisp/vc/ediff-ptch-tests.el (ediff-ptch-test-bug26084):
Apply patches without requiring a shell.  Add some comments.
2017-04-01 12:28:54 +09:00
Glenn Morris
d23287a949 Tweak an ediff-ptch test
* test/lisp/vc/ediff-ptch-tests.el (ediff-ptch-test-bug26084):
Add skip conditions.  Avoid going through shell where not needed.
2017-03-31 17:30:01 -04:00
Stefan Monnier
1f5b4ed628 * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-symbol-macrolet): New test. 2017-03-31 10:05:12 -04:00
Tino Calancha
1da9a20766 dired-mark-suffix: New command
Now dired-mark-extension prepends '.' to extension when not present.
Add command dired-mark-suffix to preserve the previous
behaviour (Bug#25942).
* lisp/dired-x.el (dired-mark-suffix): New command;
mark files ending in a given suffix.
(dired--mark-suffix-interactive-spec): New defun.
(dired-mark-extension, dired-mark-suffix): Use it.
* doc/misc/dired-x.texi (Advanced Mark Commands): Update manual.
* test/lisp/dired-x-tests.el: New test suite; add test for these features.
; * etc/NEWS (Incompatible Lisp Changes in Emacs 26.1):
; Mention these changes.
2017-03-31 17:27:08 +09:00
Andreas Politz
158bb8555d Fix issues regarding inotify file-notification
Remove special code handling the inotify back-end.
* lisp/filenotify.el (file-notify--watch): New struct
representing a file-watch.
(file-notify-descriptors): Use the new struct as hash-value.
(file-notify-handle-event): Check that event is a cons.
(file-notify--rm-descriptor, file-notify--event-watched-file)
(file-notify--event-file-name, file-notify--event-file1-name)
(file-notify-callback, file-notify-add-watch)
(file-notify-rm-watch, file-notify-valid-p): Use new struct.
Remove special code handling inotify descriptors.  Remove code
handling multiple clients per descriptor.
(file-notify--descriptor): Remove unused function.

Let inotify-add-watch return a unique descriptor on every
call, like every other back-end does (Bug#26126).  Prevent
multiple clients from interfering with each other, when
watching a shared descriptor.
* src/inotify.c (watch_list): Extend the format by including a
id and the provided mask.
(INOTIFY_DEFAULT_MASK): Default mask used for all clients.
(make_watch_descriptor): Removed.
(make_lispy_mask, lispy_mask_match_p): New functions.
(inotifyevent_to_event): Match event against the mask provided
by the client.
(add_watch, remove_descriptor, remove_watch): New functions
for managing the watch_list.
(inotify_callback): Use the new functions.
(Finotify_add_watch, Finotify_rm_watch): Remove deprecated
flags from documentation.  Add check for validity of provided
descriptor.  Use the new functions.  Use the default mask.
(INOTIFY_DEBUG): Add new debug conditional.
(inotify-watch-list, inotify-allocated-p): New debug functions.
(symbol_to_inotifymask, syms_of_inotify): Remove deprecated symbols.

* test/lisp/filenotify-tests.el:
(file-notify-test02-rm-watch): Remove expected failure for inotify.
2017-03-26 09:21:56 +02:00
Philipp Stephani
4fbd330fae Protect against an infloop in python-mode
There appears to be an edge case caused by using `syntax-ppss' in a
narrowed buffer during JIT lock inside of Python triple-quote strings.
Unfortunately it is impossible to reproduce without manually
destroying the syntactic information in the Python buffer, but it has
been observed in practice.  In that case it can happen that the syntax
caches get sufficiently out of whack so that there appear to be
overlapping strings in the buffer.  As Python has no nested strings,
this situation is impossible and leads to an infloop in
`python-nav-end-of-statement'.  Protect against this by checking
whether the search for the end of the current string makes progress.

* python.el (python-nav-end-of-statement): Protect against infloop.
* progmodes/python-tests.el
(python-tests--python-nav-end-of-statement--infloop): Add unit test.
2017-03-23 23:05:19 +01:00
Michael Albinus
e1392faae5 Use lexical-bind in Tramp
* lisp/net/tramp*.el: Add lexical-binding cookie.  Move declarations up.

* lisp/net/tramp-adb.el (tramp-adb-parse-device-names): Use `push'
rather than `add-to-list'.
(tramp-adb-get-device): Remove unused variable.

* lisp/net/tramp-gvfs.el (tramp-gvfs-parse-device-names): Remove unused
variable.

* lisp/net/tramp.el (auto-save-file-name-transforms): Declare.
(tramp-find-file-name-coding-system-alist): Use `push' rather
than `add-to-list'.

* test/lisp/net/tramp-tests.el: Add lexical-binding cookie.
Require 'dired.  Move declarations up.
(tramp-test32-make-nearby-temp-file): Wrap `make-nearby-temp-file'
and `temporary-file-directory' calls with `with-no-warnings'.
(tramp-test35-asynchronous-requests): Mark unused variable.
2017-03-23 14:58:04 +01:00
Michael Albinus
560d6f9124 Fix filenotify.el issue for kqueue
* lisp/filenotify.el (file-notify-add-watch): Use directory
for remote file name handlers.

* test/lisp/filenotify-tests.el (file-notify-test01-add-watch):
Create/delete temporary file only for "kqueue".
(file-notify-test02-rm-watch): Create/delete temporary files.
2017-03-22 19:33:03 +00:00
Michael Albinus
716b468489 Extend `file-notify-test02-rm-watch'
* test/lisp/filenotify-tests.el (file-notify-test02-rm-watch):
Expect it failed for inotify.  Divide tests into different
`unwind-protect' clauses.  Check, that removing watch
descriptors out of order do not harm.  (Bug#26126)
2017-03-22 14:15:45 +01:00
Noam Postavsky
0b60d7657a * test/lisp/emacs-lisp/lisp-mode-tests.el (indent-subsexp): Test for Bug#26187 2017-03-21 20:45:32 -04:00
Tino Calancha
abe731eef0 epatch: Save right backups in Git multipatches
Multipatches on N Git files save wrong backups for
N-1 files; only the last one has a correct backup (Bug#26084).
* lisp/vc/diff-mode.el (diff-file-junk-re): Add 'Prereq: '
* lisp/vc/ediff-ptch.el (ediff-map-patch-buffer): Use 'diff-file-junk-re'.
* test/lisp/vc/ediff-ptch-tests.el (ediff-ptch-test-bug25010):
Rename from ibuffer-test-bug25010.
(ediff-ptch-test-bug26084): New test.
2017-03-21 17:25:55 +09:00
Michael Albinus
6b2f3ba02a Fix Bug#26127
* lisp/filenotify.el (file-notify--rm-descriptor): Check, that
there is a function which could be called.  (Bug#26127)

* test/lisp/filenotify-tests.el (file-notify--test-cleanup):
Clear also `file-notify-descriptors'.
(file-notify--test-make-temp-name): Move up.
(file-notify-test02-rm-watch): New test.
(file-notify-test03-events, file-notify-test04-autorevert)
(file-notify-test05-file-validity)
(file-notify-test06-dir-validity)
(file-notify-test07-many-events, file-notify-test08-backup)
(file-notify-test09-watched-file-in-watched-dir)
(file-notify-test10-sufficient-resources): Rename.
2017-03-17 10:25:46 +01:00
Stefan Monnier
ffbb468499 Add obarray-size and fix tests accordingly. Use obarrayp in cedet.
* lisp/obarray.el (obarray-size): New function.

* lisp/cedet/semantic/lex-spp.el (semantic-lex-spp-symbol)
(semantic-lex-spp-save-table, semantic-lex-spp-macros):
* lisp/cedet/semantic/bovine/c.el (semantic-c-describe-environment):
Use obarrayp.

* test/lisp/obarray-tests.el (obarray-make-default-test)
(obarray-make-with-size-test): Use it.
2017-03-16 12:31:07 -04:00
Michael Albinus
a568d0a7d4 Reenable lost Tramp test case
* test/lisp/net/tramp-tests.el (tramp-test24-file-name-completion):
Reenable lost test case.
2017-03-14 15:52:16 +01:00
Michael Albinus
ed33337c3e Require method in remote file name syntax
* lisp/minibuffer.el (completion--nth-completion):
Do not bind `non-essential'.

* lisp/net/tramp-adb.el (tramp-adb-maybe-open-connection):
* lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
* lisp/net/tramp-sh.el (tramp-maybe-open-connection):
* lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection): Do not call
`tramp-check-proper-method-and-host'.

* lisp/net/tramp-sh.el (tramp-ssh-controlmaster-options): Better traces.
(tramp-maybe-open-connection): Do not use argument for
´tramp-completion-mode-p'.

* lisp/net/tramp.el (tramp-default-method-marker): New defconst.
(tramp-prefix-format, tramp-postfix-method-format)
(tramp-prefix-ipv6-format, tramp-postfix-ipv6-format)
(tramp-prefix-port-format, tramp-postfix-host-format)
(tramp-file-name-regexp, tramp-completion-file-name-regexp):
Use `eq' instead of `eqal'.
(tramp-method-regexp, tramp-domain-regexp)
(tramp-remote-file-name-spec-regexp)
(tramp-file-name-regexp-unified)
(tramp-completion-file-name-regexp-unified)
(tramp-completion-file-name-regexp-separate): Adapt regexp.
(tramp-completion-file-name-handler-alist)
(tramp-run-real-handler): Autoload them.
(tramp-find-method): Handle `tramp-default-method-marker'.
(tramp-check-proper-method-and-host)
(tramp-completion-run-real-handler): Remove them.
(tramp-error-with-buffer, tramp-connectable-p): Do not use
argument for ´tramp-completion-mode-p'.
(tramp-find-foreign-file-name-handler): Remove COMPLETION
argument.  Do not apply heuristic for completion.
(tramp-file-name-handler): Do not modify `non-essential'.
(tramp-completion-file-name-handler): Change implementation.
(tramp-autoload-file-name-handler)
(tramp-completion-handle-file-name-all-completions):
Call `tramp-run-real-handler'.
(tramp-completion-mode-p): Do not autoload.  Remove argument.
Do not apply heuristic for completion.
(tramp-completion-dissect-file-name): Simplify implementation.
(tramp-handle-file-name-as-directory): Call `tramp-connectable-p'.

* test/lisp/net/tramp-tests.el (tramp-test01-file-name-syntax)
(tramp-test02-file-name-dissect)
(tramp-test03-file-name-defaults)
(tramp-test06-directory-file-name): Adapt to the new syntax.
(tramp-test11-copy-file, tramp-test12-rename-file)
(tramp--test-check-files): Deactivate temporarily tests with
quoted file names.
(tramp-test16-directory-files, tramp-test17-insert-directory):
Adapt tests.
(tramp-test24-file-name-completion): Do not check for
completion mode.
(tramp-test31-make-auto-save-file-name): Deactivate temporarily
two tests.
2017-03-13 18:05:59 +01:00
Tino Calancha
7a50abee22 * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-1): Fix regexp. 2017-03-13 20:01:40 +09:00
Noam Postavsky
3ee3995d10 * lisp/emacs-lisp/lisp-mode.el (indent-sexp): Simplify.
* test/lisp/emacs-lisp/lisp-mode-tests.el (indent-sexp):
(indent-subsexp, indent-sexp-in-string): New tests.
2017-03-12 20:08:32 -04:00
Michael Albinus
7e434ed2eb Adapt tramp-tests.el
* test/lisp/net/tramp-tests.el (tramp-test06-directory-file-name)
(tramp-test24-file-name-completion): Call
`tramp-completion-mode-p' with argument.
2017-03-10 14:34:23 +01:00
Glenn Morris
de610c4b67 Update a cl-print test
* test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-1):
Update for recent change in cl-print-object function output.
2017-03-08 14:43:16 -05:00
Tino Calancha
244de7b0ed Use lexical binding in benchmark.el
* lisp/emacs-lisp/benchmark.el: Enable lexical binding.
(benchmark-elapse): Use 'declare'.
* test/lisp/emacs-lisp/benchmark-tests.el: Add test suite.
2017-03-03 18:26:30 +09:00
Noam Postavsky
f5388ba8a7 Switch pp.el to lexical binding
Additionally, do some minor code cleanup.

* lisp/emacs-lisp/pp.el: Set lexical-binding.
(pp-buffer): Use skip-syntax-forward.
(pp-eval-expression): Use push.
(pp-last-sexp): Use with-syntax-table.
* test/lisp/emacs-lisp/pp-tests.el: New tests.
2017-03-02 23:03:20 -05:00
Glenn Morris
41f91d367a * test/lisp/net/puny.el: New file. 2017-03-01 20:36:19 -05:00
Noam Postavsky
b7250496bd Fix epg-tests with dummy-pinentry program (Bug#23619)
* test/data/epg/dummy-pinentry: New file.
* test/lisp/epg-tests.el (with-epg-tests): Add it to gpg-agent.conf
when a passphrase is required.  Add debug declaration.  Set
GPG_AGENT_INFO non-destructively.
2017-02-28 19:57:35 -05:00
Tino Calancha
4daca38d5c Prevent for consing in cl-mapc and cl-mapl
* lisp/emacs-lisp/cl-extra.el (cl--mapcar-many): Add optional arg ACC;
If non-nil, accumulate values in the result (Bug#25826).
(cl-mapc): Do computations inside function instead of call cl-map.
(cl-mapl): Do computations inside function instead of call cl-maplist.
* lisp/emacs-lisp/cl-lib.el (mapcar): Add autoload cookie.
Call cl--mapcar-many with non-nil 3rd argument.
* test/lisp/emacs-lisp/cl-extra-tests.el (cl-extra-test-map)
(cl-extra-test-mapc, cl-extra-test-mapcar, cl-extra-test-mapl)
(cl-extra-test-maplist): New tests.
2017-02-27 16:32:10 +09:00
Tino Calancha
841e3e377c Choose the right target dir on dired operations
Prevent from changing the input target dir
when dired-dwim-target is non-nil (Bug#25609).
* lisp/dired-aux.el (dired-do-create-files):
If dired-dwim-target is non-nil, then bind 'default' to nil.
* test/lisp/dired-tests.el (dired-test-bug25609): Add test.
2017-02-27 16:26:06 +09:00
Tom Tromey
8db75f0ef9 Use font-lock-doc-face in js-mode
Bug#25858:
* lisp/progmodes/js.el (js-font-lock-syntactic-face-function): New
defun.
(js-mode): Use it.
* test/lisp/progmodes/js-tests.el (js-mode-doc-comment-face): New
test.
2017-02-25 14:02:37 -07:00
Noam Postavsky
546d30ed14 Don't use IP 0.0.0.0 for package test server (Bug#22582)
* test/lisp/emacs-lisp/package-resources/package-test-server.py: Set
'server_address' when port number is given on the command line.  Print
IP and port number as a URL, and flush it after printing.
* test/lisp/emacs-lisp/package-tests.el:
(package-test-update-archives-async): Grab the whole URL from server
output.
2017-02-25 12:56:09 -05:00
Tom Tromey
e52287ca3e Fix indentation error in js.el
* lisp/progmodes/js.el (js--indent-in-array-comp): Wrap forward-sexp
call in condition-case.
* test/lisp/progmodes/js-tests.el (js-mode-indentation-error): New
test.
2017-02-24 20:33:41 -07:00
Stefan Monnier
407e650413 * lisp/emacs-lisp/cl-print.el: New file
* lisp/emacs-lisp/nadvice.el (advice--where): New function.
(advice--make-docstring): Use it.

* src/print.c (print_number_index): Don't declare here any more.
(Fprint_preprocess): New function.

* test/lisp/emacs-lisp/cl-print-tests.el: New file.
2017-02-23 21:06:54 -05:00
Noam Postavsky
2f53c0c468 Simplify cl-get using `plist-member'
* lisp/emacs-lisp/cl-extra.el (cl-get, cl-getf, cl--set-getf): Use
`plist-member' instead of explicit loop.
* test/lisp/emacs-lisp/cl-extra-tests.el: New tests.
2017-02-20 16:53:14 -05:00
Michael Albinus
143bc75c41 Rework connection local variables
For connection local variables interface, `class' is renamed
to `profile'.  All arguments `criteria' are a plist now.

* doc/lispref/variables.texi (Connection Local Variables):
Rewrite.

* lisp/files-x.el (connection-local-profile-alist): Rename
from `connection-local-class-alist'.  Adapt docstring.
(connection-local-criteria-alist): Adapt docstring.
(connection-local-normalize-criteria): New defun.
(connection-local-get-profiles): Rename from
`connection-local-get-classes'.  Rewrite.
(connection-local-set-profiles): Rename from
`connection-local-set-classes'.  Rewrite.
(connection-local-get-profile-variables): Rename from
`connection-local-get-class-variables'.  Rewrite.
(connection-local-set-profile-variables): Rename from
`connection-local-set-class-variables'.  Rewrite.
(hack-connection-local-variables)
(hack-connection-local-variables-apply)): Rewrite.
(with-connection-local-profiles): Rename from
`ith-connection-local-classes'.  Rewrite.

* lisp/net/tramp.el (tramp-set-connection-local-variables):
Compute criteria.

* lisp/net/tramp-cmds.el (tramp-bug):
Use `connection-local-profile-alist'.

* test/lisp/files-x-tests.el (files-x-test--variables1)
(files-x-test--variables2, files-x-test--variables3)
(files-x-test--variables4, files-x-test--criteria1)
(files-x-test--criteria2): Make them a defconst.
(files-x-test--application)
(files-x-test--another-application, files-x-test--protocol)
(files-x-test--user, files-x-test--machine): New defconst.
(files-x-test--criteria): New defvar.
(files-x-test--criteria3): Remove.
(files-x-test-connection-local-set-profile-variables):
Rename from `files-x-test-connection-local-set-class-variables'.
Rewrite.
(files-x-test-connection-local-set-profiles): Rename from
`files-x-test-connection-local-set-classes'.  Rewrite.
(files-x-test-hack-connection-local-variables-apply)  Rewrite.
(files-x-test-with-connection-local-profiles): Rename from
`files-x-test-with-connection-local-classes'.  Rewrite.
2017-02-19 17:14:35 +01:00
Vibhav Pant
96e18ebb99 bytecomp-tests.el: Store all test forms in one constant.
* test/lisp/emacs-lisp/bytecomp-tests.el: Store all test expressions
in a single constant (byte-opt-testsuite-arith-data), add new forms
which generate lapcode with adjacent/redundant tags.
2017-02-15 21:12:44 +05:30
Noam Postavsky
0a64666288 Test comment-multi-line = nil auto fill case too
* test/lisp/progmodes/js-tests.el (js-mode-auto-fill): Test with
`comment-multi-line' both nil and non-nil.
* lisp/newcomment.el (comment-multi-line): Mark safe if it's a
boolean.
* etc/NEWS: Mention that `js-mode' now sets `comment-multi-line'.
2017-02-14 22:29:56 -05:00