1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-16 09:50:25 +00:00
Commit Graph

3281 Commits

Author SHA1 Message Date
Michael Albinus
f87ace2aed ; Continued attempt to fix Bug#36940
* test/lisp/net/tramp-tests.el (tramp--test-file-attributes-equal-p):
Handle link number.
(tramp--test-check-files): Encode search string on macOS.  (Bug#36940)
2019-08-26 16:14:16 +02:00
Paul Eggert
575179f74d Make (mod 1.0 0) consistent with (/ 1.0 0)
* src/data.c (Fmod): Do not signal an error for (mod 1.0 0), for
the same reason (/ 1.0 0) does not signal an error.
* test/src/data-tests.el (data-tests-mod-0): New test.
2019-08-24 15:55:08 -07:00
Noam Postavsky
aa49aa8840 Fix non-deterministic process test
* test/src/process-tests.el (set-process-filter-t): Don't assume
subprocess output will come in a single chunk, keep waiting for more
data until next "prompt" is read from subprocess.
2019-08-24 12:16:26 -04:00
Robert Pluim
649fb17443 Fix DNS tests
* test/src/process-tests.el: (lookup-family-specification,
lookup-unicode-domains, unibyte-domain-name, lookup-google,
non-existent-lookup-failure): Skip on Hydra, which doesn't have DNS.
Fix buggy test condition.  (Bug#37165)
2019-08-24 14:57:58 +02:00
Michael Albinus
42f8fa8070 Fix some problems of Bug#36940
* test/lisp/net/tramp-tests.el (tramp-test22-file-times): Do not
compare time value lists by `equal'.  (Bug#36940).
(tramp-test30-make-process): Adapt "kill" message to match on macOS.
2019-08-24 10:10:05 +02:00
Lars Ingebrigtsen
53cb3d3e0d Merge remote-tracking branch 'origin/netsec' 2019-08-23 04:49:52 +02:00
Paul Eggert
951ea375d5 Don’t hard-loop on cycles in ‘read’ etc.
Problem for ‘read’ reported by Pip Cet in:
https://lists.gnu.org/r/emacs-devel/2019-08/msg00316.html
* src/fns.c (Frequire): Protect against circular current-load-list.
* src/lread.c (Fget_load_suffixes):
Protect against circular load-suffixes or load-file-rep-suffixes.
(Fload): Protect against circular loads-in-progress.
(openp): Protect against circular PATH and SUFFIXES.
(build_load_history): Protect against circular load-history or
current-load-list.
(readevalloop_eager_expand_eval): Protect against circular SUBFORMS.
(read1): Protect against circular data.
* test/src/lread-tests.el (lread-circular-hash): New test.
2019-08-21 17:21:06 -07:00
Michael Albinus
0f801d4a5e ; Fix typo introduced by last autorevert-tests patch 2019-08-21 11:03:34 +02:00
Michael Albinus
c2abe6abba ; Add traces to auto-revert-test02-auto-revert-deleted-file 2019-08-21 09:19:28 +02:00
Paul Eggert
396ed88a50 Avoid some excess precision in time arithmetic
* doc/misc/emacs-mime.texi (time-date):
Adjust example to match new behavior.
* etc/NEWS: Mention this.
* lisp/calendar/time-date.el (decoded-time-add)
(decoded-time--alter-second):
Don’t lose underestimate precision of seconds component.
* src/bignum.c (mpz): Grow by 1.
* src/timefns.c (trillion_factor): New function.
(timeform_sub_ps_p): Remove.
(time_arith): Avoid unnecessarily-large hz, by reducing the hz
to a value no worse than the worse hz of the two arguments.
The result is always exact unless an error is signaled.
* test/src/timefns-tests.el (timefns-tests--decode-time):
New function.
(format-time-string-with-zone): Test (decode-time LOOK ZONE t)
resolution as well as its numeric value.
2019-08-20 17:36:46 -07:00
Paul Eggert
5a95521282 Support larger TIMEs in (time-convert TIME t)
Also, improve the doc to match current behavior.
* doc/lispref/os.texi (Time Conversion): Document that
time-convert signals an error for infinite or NaN args,
and that (time-convert TIME t) is exact otherwise.
Mention float-time as an alternative to time-convert.
(Time Calculations): Document that time-add and time-subtract
are exact and do not decrease HZ below the minimum of their args.
* src/timefns.c (decode_float_time): Don’t signal an error for
floating-point arguments whose base-FLT_RADIX exponent is not less
than DBL_MANT_DIG.  Instead, convert them to (TICKS . 1) values.
Use two (instead of three) integer exponent comparisons in the
typical case.
* test/src/timefns-tests.el (time-arith-tests):
Add more floating-point tests, including some tests
that the old code fails.
2019-08-20 15:45:59 -07:00
Michael Albinus
fde614f4cc Another attempt to fix bug#32645
* test/lisp/autorevert-tests.el ()
(auto-revert-test02-auto-revert-deleted-file):
* test/lisp/filenotify-tests.el (file-notify-test04-autorevert):
Check `file-notify-valid-p', not that the descriptor is nil.
2019-08-20 21:32:34 +02:00
Glenn Morris
af103ef3c9 Merge from origin/emacs-26
615cff4 (origin/emacs-26) Fix process filter documentation (Bug#13400)
beb1d22 Fix query-replace-regexp undo feature

# Conflicts:
#	test/lisp/replace-tests.el
2019-08-20 09:04:53 -07:00
Glenn Morris
8f68449c94 Merge from origin/emacs-26
0b810eb Fix a typo in char-width-table
3f00db7 Minor update in admin/notes/unicode
bcd0115 Fix lisp indent infloop on unfinished strings (Bug#37045)
5f992d1 Improve commentary in composite.el
3a04be2 ; Improve commentary in xdisp.c
15de1d1 Fix markup in dired-x.texi
bda7fc7 ; Fix typo in a doc string of speedbar.el
6f57ef9 * src/callproc.c (Fcall_process): Doc fix.

# Conflicts:
#	doc/misc/dired-x.texi
#	lisp/international/characters.el
#	src/callproc.c
2019-08-20 09:01:55 -07:00
Paul Eggert
2197ea89bf Fix time-add/time-sub validity checking
* src/timefns.c (time_arith): Check the first arg for
validity even if the second arg is not finite.
* test/src/timefns-tests.el (time-arith-tests): Test this.
2019-08-19 18:05:15 -07:00
Tino Calancha
beb1d22260 Fix query-replace-regexp undo feature
Ensure that non-regexp strings used with `looking-at' are quoted.
* lisp/replace.el (perform-replace): Quote regexp (Bug#37073).
* test/lisp/replace-tests.el (replace-tests-perform-replace-regexp-flag):
New variable.
(replace-tests-with-undo): Use it.
(query-replace-undo-bug37073): Add tests.
2019-08-19 17:32:09 +02:00
Noam Postavsky
f9464020d4 Handle more subprocess chunking in M-x man (Bug#36927)
* lisp/man.el (Man-bgproc-filter): Make sure not to chop man sections
by narrowing.
(Man-highlight-references0): Revert previous fix, as it's no longer
needed.
* test/lisp/man-tests.el (man-tests-filter-strings): New function.
(man-bgproc-filter-buttonize-includes): New test.
2019-08-18 18:19:21 -04:00
Eli Zaretskii
190565b239 Support the new Japanese era name
* admin/unidata/NormalizationTest.txt:
* admin/unidata/UnicodeData.txt: Add U+32FF SQUARE ERA NAME REIWA.
Do not merge to master.

* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--failing-lines-part1)
(ucs-normalize-tests--failing-lines-part2): Update.  Do not
merge to master.

* etc/NEWS: Mention the change.
2019-08-18 19:36:31 +03:00
Paul Eggert
643df79279 Port test harness to Solaris 10
* test/Makefile.in (ELFILES): Port to Solaris 10, where
‘find’ does not support ‘-path’.
2019-08-17 09:16:59 -07:00
Noam Postavsky
bcd0115e4d Fix lisp indent infloop on unfinished strings (Bug#37045)
* lisp/emacs-lisp/lisp-mode.el (lisp-indent-calc-next): Stop trying to
skip over strings if we've hit the end of buffer.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-indent-unfinished-string): New test.
2019-08-17 09:42:34 -04:00
Paul Eggert
37257d6aca More-compatible subsecond calendrical timestamps
Instead of appending a subseconds member to the result of
‘decode-time’, this keeps the format unchanged unless you give
a new optional argument to ‘decode-time’.  Also, the augmented
format now puts the subsecond info in the SECONDS element, so
the total number of elements is unchanged; this is more
compatible with code that expects the traditional 9 elements,
such as ‘(pcase decoded-time (`(,SEC ,MIN ,HOUR ,DAY ,MON
,YEAR ,DOW ,DST ,ZONE) ...) ...)’.
* doc/lispref/os.texi, doc/misc/emacs-mime.texi, etc/NEWS:
* lisp/net/soap-client.el (soap-decode-date-time):
* lisp/simple.el (decoded-time):
Document the new behavior.
* lisp/calendar/icalendar.el (icalendar--decode-isodatetime):
* lisp/calendar/iso8601.el (iso8601-parse)
(iso8601-parse-time, iso8601-parse-duration)
(iso8601--decoded-time):
* lisp/calendar/parse-time.el (parse-time-string):
* lisp/calendar/time-date.el (decoded-time-add)
(decoded-time--alter-second):
* lisp/org/org.el (org-parse-time-string):
* lisp/simple.el (decoded-time):
* src/timefns.c (Fdecode_time, Fencode_time):
* test/lisp/calendar/icalendar-tests.el:
(icalendar--decode-isodatetime):
* test/lisp/calendar/iso8601-tests.el (test-iso8601-date-years)
(test-iso8601-date-dates, test-iso8601-date-obsolete)
(test-iso8601-date-weeks, test-iso8601-date-ordinals)
(test-iso8601-time, test-iso8601-combined)
(test-iso8601-duration, test-iso8601-intervals)
(standard-test-dates, standard-test-time-of-day-fractions)
(standard-test-time-of-day-beginning-of-day)
(standard-test-time-of-day-utc)
(standard-test-time-of-day-zone)
(standard-test-date-and-time-of-day, standard-test-interval):
* test/lisp/calendar/parse-time-tests.el (parse-time-tests):
* test/src/timefns-tests.el (format-time-string-with-zone)
(encode-time-dst-numeric-zone):
Revert recent changes that added a SUBSECS member to
calendrical timestamps, since that component is no longer
present (the info, if any, is now in the SECONDS member).
* lisp/calendar/time-date.el (decoded-time-add)
(decoded-time--alter-second):
Support fractional seconds in the new form.  Simplify.
* src/timefns.c (Fdecode_time): Support new arg FORM.
(Fencode_time): Support subsecond resolution.
* test/src/timefns-tests.el (format-time-string-with-zone)
(decode-then-encode-time): Test subsecond calendrical timestamps.
2019-08-16 23:25:07 -07:00
Paul Eggert
f6dd46cba8 Subtracting “now” from “now” should yield zero
* src/timefns.c (time_arith): Arrange for (time-subtract nil
nil) to yield 0, to be consistent with (time-equal-p nil nil).
* test/lisp/calendar/time-date-tests.el (test-time-since): New test.
2019-08-16 18:12:24 -07:00
Paul Eggert
f9fd12a30b Fix time-add rounding bug
Without this fix, time arithmetic yielded results that were not
mathematically accurate, even though the exact results were
representable; for example, (time-add 0 1e-13) yielded a timestamp
equal to 0 instead of to 1e-13.
* lisp/timezone.el (timezone-time-from-absolute):
Let time-add do its thing rather than using floating point
internally, which has rounding errors.  We now have bignums and so
don’t need floating point to avoid overflow issues.
* src/timefns.c (timeform_sub_ps_p): New function.
(time_arith): If either argument is a float, represent the
result exactly instead of discarding sub-ps info.
* test/lisp/timezone-tests.el (timezone-tests-time-from-absolute):
Don’t assume (HI LO US PS) timestamp format.
* test/src/emacs-module-tests.el (mod-test-add-nanosecond/valid):
Don’t assume that time-add discards sub-ns info.
* test/src/timefns-tests.el (time-rounding-tests):
Add regression test to detect time-add rounding bug.
2019-08-16 16:27:27 -07:00
Lars Ingebrigtsen
ab8a96977f Reimplement the `fill-flowed' function to respect space stuffing
* lisp/mail/flow-fill.el (fill-flowed): Reimplement the function
to respect space-stuffing (bug#17190).

* test/lisp/mail/flow-fill-tests.el
(fill-flow-tests-fill-flowed-stuffed): New test.
(fill-flow-tests-fill-flowed-decode): Rename the test so that it
actually runs.
2019-08-15 18:00:16 -07:00
Paul Eggert
af82a6248c Fix rounding errors with float timestamps
When converting from float to (TICKS . HZ) form, do the
conversion exactly.  When converting from (TICKS . HZ) form to
float, round to even precisely.  This way, successfully
converting a float to (TICKS . HZ) and back yields a value
numerically equal to the original.
* src/timefns.c (flt_radix_power_size): New constant.
(flt_radix_power): New static var.
(decode_float_time): Convert the exact numeric value rather
than guessing TIMESPEC_HZ resolution.
(s_ns_to_double): Remove; no longer needed.
(frac_to_double): New function.
(decode_ticks_hz): It is now the caller’s responsibility to
pass a valid TICKS and HZ.  All callers changed.
Use frac_to_double to round (TICKS . HZ) precisely.
(decode_time_components): When decoding nil, use
decode_ticks_hz since it rounds precisely.
(syms_of_timefns): Initialize flt_radix_power.
* test/src/timefns-tests.el (float-time-precision): New test.
2019-08-15 10:41:40 -07:00
Michael Albinus
f6ae51c71d Give auto-revert-test02-auto-revert-deleted-file a chance on hydra
* test/lisp/autorevert-tests.el
(auto-revert-test02-auto-revert-deleted-file): Don't skip on hydra.
2019-08-15 16:40:53 +02:00
Paul Eggert
311fcab8f8 Port mod-test-nanoseconds to 32-bit Emacs
* test/src/emacs-module-tests.el (mod-test-nanoseconds):
Don’t assume -1000000000 is a fixnum.
2019-08-15 02:06:34 -07:00
Óscar Fuentes
dbae38efc2 * lisp/password-cache.el: adapt test to change in password-in-cache-p 2019-08-12 16:22:34 +02:00
Michael Albinus
95552e08db Retrieve start time from remote machine, use compat attrib functions
* lisp/net/tramp-compat.el (tramp-compat-file-attribute-access-time)
(tramp-compat-file-attribute-status-change-time): New defaliases.

* test/lisp/net/tramp-tests.el (tramp--test-start-time): New defvar.
(tramp--test-file-attributes-equal-p)
(tramp-test19-directory-files-and-attributes): Use it.
(tramp-test18-file-attributes)
(tramp--test-file-attributes-equal-p, tramp-test20-file-modes)
(tramp-test22-file-times, tramp--test-check-files):
Use `tramp-compat-file-attribute-*' functions.
2019-08-11 12:06:57 +02:00
Michael Albinus
2c5dd68018 Use a time offset when comparing times of local and remote machines
* test/lisp/net/tramp-tests.el (tramp--test-file-attributes-equal-p):
Use a time offset in order to compensate different times on local
and remote machines.
2019-08-10 11:34:13 +02:00
Michael Albinus
78ddf6ba96 Improve time arithmetic in tramp--test-file-attributes-equal-p
* test/lisp/net/tramp-tests.el (tramp--test-file-attributes-equal-p):
Improve time arithmetic.
2019-08-08 15:42:45 +02:00
Stefan Kangas
2c0f6c3540 Suppress interactive-only warnings in undo-tests.el (Bug#36565)
* test/src/undo-tests.el (undo-test-region-deletion)
(undo-test-region-example, undo-test-marker-adjustment-nominal)
(undo-test-region-t-marker, undo-test-marker-adjustment-moved)
(undo-test-region-mark-adjustment): Suppress interactive-only warnings
by using funcall-interactively.
2019-08-08 08:26:31 -04:00
Glenn Morris
d5622eb6ff Tests need to be moved when source files are
* test/lisp/obsolete/cl-tests.el: Move from test/lisp/emacs-lisp.
2019-08-07 09:24:15 -07:00
Michael Albinus
2a82b55426 ; Still working on tramp--test-file-attributes-equal-p 2019-08-07 16:36:00 +02:00
Michael Albinus
2b6932b440 ; Instrument tramp--test-file-attributes-equal-p 2019-08-07 14:59:19 +02:00
Michael Albinus
25baa7d20c Continue to work on Bug#36940
* test/lisp/net/tramp-tests.el (tramp--test-file-attributes-equal-p):
Make the check more precise.  (Bug#36940)
2019-08-07 14:12:14 +02:00
Robert Pluim
bc1cf28da5 Change nsm-should-check to look at local subnets
* lisp/net/nsm.el (nsm-network-same-subnet): New function.  Checks
if an ip address is in the same subnet as another one.
(nsm-should-check): Use nsm-network-same-subnet to see if we're
connecting to a local subnet machine.  Remove checks for RFC1918 addresses.

* test/lisp/net/nsm-tests.el: New file.  Test nsm-should-check functionality.
2019-08-07 14:07:07 +02:00
Michael Albinus
998f3612f7 Fix Bug#36940
* test/lisp/net/tramp-tests.el (tramp--test-file-attributes-equal-p):
Make the check more precise.  (Bug#36940)
(tramp-test19-directory-files-and-attributes): Move some checks to
`tramp--test-file-attributes-equal-p'.
2019-08-06 21:47:57 +02:00
Mattias Engdegård
4ce9c6d0b5 Fix various Calc date conversions (bug#36822)
* lisp/calc/calc-forms.el (math-absolute-from-gregorian-dt):
Rewrite in a way that I understand, and that actually seems to work.
(math-absolute-from-julian-dt): Use Julian, not Gregorian, leap year
rules for counting days within a year.
(math-julian-date-beginning, math-julian-date-beginning-int):
Change constants to be consistent with their doc strings and the code:
use Rata Die epoch at Dec 31, 1 BC Gregorian proleptic, not Julian.
* doc/misc/calc.texi (Date Forms): Correct difference between Julian
Day and Rata Die.
* test/lisp/calc/calc-tests.el (calc-test-calendar): New test.
2019-08-06 13:59:28 +02:00
Mattias Engdegård
c676444a43 Add conditional operator xor to subr.el
Suggested by Oleh Krehel and implemented by Basil Contovounesios in
the following thread:
https://lists.gnu.org/archive/html/emacs-devel/2019-07/msg00547.html

* lisp/array.el (xor): Move unused function from here...
* lisp/subr.el: ...to here, and improve.
* lisp/gnus/spam.el (spam-xor):
* lisp/play/5x5.el (5x5-xor):
* lisp/proced.el (proced-xor):
* lisp/progmodes/idlwave.el (idlwave-xor):
* lisp/vc/diff-mode.el (diff-xor): Define as obsolete aliases of,
and replace all uses with, xor.
* lisp/jsonrpc.el: Remove unused dependency on array.el.
* lisp/org/org.el (org-xor): Move from here...
* lisp/org/org-compat.el (org-xor): ...to here, as a compatibility
shim for xor.
* lisp/progmodes/idlw-shell.el (idlwave-shell-enable-all-bp):
* lisp/simple.el (exchange-point-and-mark):
* lisp/windmove.el (windmove-display-in-direction): Use xor.
* lisp/strokes.el (strokes-xor): Remove commented-out xor
implementation.

* doc/lispref/control.texi (Control Structures): Extend menu entry
for new combining condition.
(Combining Conditions):
* etc/NEWS (Lisp Changes): Document xor.

* test/lisp/subr-tests.el (subr-test-xor): New test.
2019-08-06 13:38:47 +02:00
Paul Eggert
b06917a491 decode-time now returns subsec too
The list that decode-time returns now contains an extra
trailing component that counts the subseconds part of the
original timestamp (Bug#36549).
This builds on a suggestion by Lars Ingebrigtsen in:
https://lists.gnu.org/r/emacs-devel/2019-07/msg00734.html
* doc/lispref/os.texi (Time Conversion):
* doc/misc/emacs-mime.texi (time-date):
* etc/NEWS: Document this.
* lisp/calendar/icalendar.el (icalendar--decode-isodatetime):
* lisp/calendar/iso8601.el (iso8601-parse)
(iso8601-parse-time, iso8601-parse-duration)
(iso8601--decoded-time):
* lisp/calendar/parse-time.el (parse-time-string):
* lisp/calendar/time-date.el (make-decoded-time)
(decoded-time-set-defaults):
* lisp/org/org.el (org-fix-decoded-time)
(org-parse-time-string):
* src/timefns.c (Fdecode_time):
Generate subsec member for decoded time.
* lisp/calendar/time-date.el (decoded-time-add)
Add the decoded subsec too.
* lisp/simple.el (decoded-time): New subsec member.
* src/data.c (Frem): Simplify zero-check to match that of new Fmod.
(integer_mod): New function, with most of the guts of the old Fmod.
Remove redundant zero-check.
(Fmod): Use it.
* src/timefns.c (Fencode_time): Handle new subsec member
or (with the obsolescent calling convention) subsec arg.
It defaults to 0.
* test/lisp/calendar/icalendar-tests.el:
(icalendar--decode-isodatetime):
* test/lisp/calendar/iso8601-tests.el (test-iso8601-date-years)
(test-iso8601-date-dates, test-iso8601-date-obsolete)
(test-iso8601-date-weeks, test-iso8601-date-ordinals)
(test-iso8601-time, test-iso8601-combined)
(test-iso8601-duration, test-iso8601-intervals)
(standard-test-dates, standard-test-time-of-day-fractions)
(standard-test-time-of-day-beginning-of-day)
(standard-test-time-of-day-utc)
(standard-test-time-of-day-zone)
(standard-test-date-and-time-of-day, standard-test-interval):
* test/lisp/calendar/parse-time-tests.el (parse-time-tests):
* test/src/timefns-tests.el (format-time-string-with-zone)
(encode-time-dst-numeric-zone):
Adjust to match new behavior.
2019-08-05 18:37:29 -07:00
Paul Eggert
89c63b3522 New function time-convert
This replaces the awkward reuse of encode-time to both convert
calendrical timestamps to Lisp timestamps, and to convert Lisp
timestamps to other forms.  Now, encode-time does just the
former and the new function does just the latter.
The new function builds on a suggestion by Lars Ingebrigtsen in:
https://lists.gnu.org/r/emacs-devel/2019-07/msg00801.html
and refined by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2019-07/msg00803.html
* doc/lispref/os.texi (Time of Day, Time Conversion):
* doc/misc/emacs-mime.texi (time-date):
* etc/NEWS: Update documentation.
* lisp/calendar/cal-dst.el (calendar-next-time-zone-transition):
* lisp/calendar/time-date.el (seconds-to-time, days-to-time):
* lisp/calendar/timeclock.el (timeclock-seconds-to-time):
* lisp/cedet/ede/detect.el (ede-detect-qtest):
* lisp/completion.el (cmpl-hours-since-origin):
* lisp/ecomplete.el (ecomplete-add-item):
* lisp/emacs-lisp/cl-extra.el (cl--random-time):
* lisp/emacs-lisp/timer.el (timer--time-setter)
(timer-next-integral-multiple-of-time):
* lisp/find-lisp.el (find-lisp-format-time):
* lisp/gnus/gnus-diary.el (gnus-user-format-function-d):
* lisp/gnus/gnus-group.el (gnus-group-set-timestamp):
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-show-org-agenda):
* lisp/gnus/nnrss.el (nnrss-normalize-date):
* lisp/gnus/nnspool.el (nnspool-request-newgroups):
* lisp/net/ntlm.el (ntlm-compute-timestamp):
* lisp/net/pop3.el (pop3-uidl-dele):
* lisp/obsolete/vc-arch.el (vc-arch-add-tagline):
* lisp/org/org-clock.el (org-clock-get-clocked-time)
(org-clock-resolve, org-resolve-clocks, org-clock-in)
(org-clock-out, org-clock-sum):
* lisp/org/org-id.el (org-id-uuid, org-id-time-to-b36):
* lisp/org/ox-publish.el (org-publish-cache-ctime-of-src):
* lisp/proced.el (proced-format-time):
* lisp/progmodes/cc-cmds.el (c-progress-init)
(c-progress-update):
* lisp/progmodes/cperl-mode.el (cperl-time-fontification):
* lisp/progmodes/flymake.el (flymake--schedule-timer-maybe):
* lisp/progmodes/vhdl-mode.el (vhdl-update-progress-info)
(vhdl-fix-case-region-1):
* lisp/tar-mode.el (tar-octal-time):
* lisp/time.el (emacs-uptime):
* lisp/url/url-auth.el (url-digest-auth-make-cnonce):
* lisp/url/url-util.el (url-lazy-message):
* lisp/vc/vc-cvs.el (vc-cvs-parse-entry):
* lisp/vc/vc-hg.el (vc-hg-state-fast):
* lisp/xt-mouse.el (xterm-mouse-event):
* test/lisp/emacs-lisp/timer-tests.el:
(timer-next-integral-multiple-of-time-2):
Use time-convert, not encode-time.
* lisp/calendar/icalendar.el (icalendar--decode-isodatetime):
Don’t use now-removed FORM argument for encode-time.
It wasn’t crucial anyway.
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Add time-convert.
* lisp/emacs-lisp/elint.el (elint-unknown-builtin-args):
Update encode-time signature to match current arg set.
* lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time):
Use timer-convert with t rather than doing it by hand.
* src/timefns.c (time_hz_ticks, time_form_stamp, lisp_time_form_stamp):
Remove; no longer needed.
(decode_lisp_time): Rturn the form instead of having a *PFORM arg.
All uses changed.
(time_arith): Just return TICKS if HZ is 1.
(Fencode_time): Remove argument FORM.  All callers changed.
Do not attempt to encode time values; just encode
decoded (calendrical) times.
Unless CURRENT_TIME_LIST, just return VALUE since HZ is 1.
(Ftime_convert): New function, which does the time value
conversion that bleeding-edge encode-time formerly did.
Return TIME if it is easy to see that it is already
of the correct form.
(Fcurrent_time): Mention in doc that the form is planned to change.
* test/src/timefns-tests.el (decode-then-encode-time):
Don’t use (encode-time nil).
2019-08-05 18:37:29 -07:00
Michael Albinus
6c1d0d53b3 Improve Tramp's caching
* lisp/net/tramp.el (tramp-handle-add-name-to-file)
(tramp-handle-write-region):
* lisp/net/tramp-adb.el (tramp-adb-handle-make-directory)
(tramp-adb-handle-delete-directory)
(tramp-adb-handle-delete-file, tramp-adb-handle-write-region)
(tramp-adb-handle-set-file-modes)
(tramp-adb-handle-set-file-times, tramp-adb-handle-copy-file)
(tramp-adb-handle-rename-file):
* lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file)
(tramp-gvfs-handle-delete-directory)
(tramp-gvfs-handle-delete-file)
(tramp-gvfs-handle-make-directory)
(tramp-gvfs-handle-set-file-modes)
(tramp-gvfs-handle-set-file-times, tramp-gvfs-set-file-uid-gid):
* lisp/net/tramp-rclone.el (tramp-rclone-do-copy-or-rename-file)
(tramp-rclone-handle-delete-directory)
(tramp-rclone-handle-delete-file):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link)
(tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times)
(tramp-sh-handle-add-name-to-file)
(tramp-sh-handle-copy-directory, tramp-do-copy-or-rename-file)
(tramp-sh-handle-delete-directory, tramp-sh-handle-delete-file)
(tramp-sh-handle-write-region):
* lisp/net/tramp-smb.el (tramp-smb-handle-add-name-to-file)
(tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file)
(tramp-smb-handle-delete-directory)
(tramp-smb-handle-delete-file)
(tramp-smb-handle-make-directory-internal)
(tramp-smb-handle-make-symbolic-link)
(tramp-smb-handle-rename-file, tramp-smb-handle-write-region):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-add-name-to-file)
(tramp-sudoedit-do-copy-or-rename-file)
(tramp-sudoedit-handle-delete-directory)
(tramp-sudoedit-handle-delete-file)
(tramp-sudoedit-handle-set-file-modes)
(tramp-sudoedit-handle-set-file-times)
(tramp-sudoedit-handle-make-symbolic-link): Do not flush all file
properties of upper directory.

* lisp/net/tramp-cache.el (tramp-flush-file-upper-properties):
New defun.
(tramp-flush-file-properties, tramp-flush-directory-properties):
Use it.

* test/lisp/net/tramp-tests.el (tramp-time-diff): Declare.
(tramp--test-file-attributes-equal-p): Handle also modification
and status change time.
2019-08-05 13:09:26 +02:00
Michael Albinus
2abcca2391 Implement set-file-* functions for tramp-gvfs.el
* lisp/net/tramp-gvfs.el (tramp-gvfs-gio-mapping):
Add "gvfs-set-attribute".
(tramp-gvfs-file-name-handler-alist):
Add `tramp-gvfs-handle-set-file-modes',
`tramp-gvfs-handle-set-file-times' and
`tramp-gvfs-handle-set-file-uid-gid'.
(tramp-gvfs-handle-set-file-modes)
(tramp-gvfs-handle-set-file-times)
(tramp-sh-handle-set-file-uid-gid): New defuns.

* lisp/net/tramp.el (tramp-handle-write-region): Set file modes.

* test/lisp/net/tramp-tests.el (tramp-test20-file-modes)
(tramp-test22-file-times): Do not skip for tramp-gvfs.el.
2019-08-04 12:47:43 +02:00
Noam Postavsky
01661f33c1 Improved ChangeLog generation for vc log (Bug#16301)
* lisp/vc/diff-mode.el (diff-find-source-location): Fix docstring.

* lisp/vc/add-log.el (change-log-unindented-file-names-re)
(change-log-read-entries, change-log-read-defuns)
(change-log-insert-entries):
* lisp/vc/diff-mode.el (diff-add-log-current-defuns):
* lisp/vc/log-edit.el (log-edit--insert-filled-defuns)
(log-edit-fill-entry): New functions.
(log-edit-mode): Set `log-edit-fill-entry' as
`fill-paragraph-function'.
(log-edit-generate-changelog-from-diff): New command.
(log-edit-mode-map): Bind it to C-c C-w.
* doc/emacs/maintaining.texi (Types of Log File, Log Buffer):
* CONTRIBUTE: Document it.
* etc/NEWS: Announce it.
* test/lisp/vc/log-edit-tests.el (log-edit-fill-entry)
(log-edit-fill-entry-joining): New tests.
2019-08-03 20:14:52 -04:00
Michael Albinus
a6a0e857d4 ; Fix typo in filenotify-tests.el 2019-08-02 20:13:44 +02:00
Basil L. Contovounesios
eddf4664d7 Make gravatar.el more configurable
For discussion, see the following thread:
https://lists.gnu.org/archive/html/emacs-devel/2019-07/msg00528.html

* etc/NEWS: Announce changes in gravatar.el user options.

* lisp/image/gravatar.el (gravatar-cache-ttl): Change :type to
number of seconds without changing the default value and while still
accepting other timestamp formats.
(gravatar-rating): Restrict :type to ratings recognized by Gravatar.
(gravatar-size): Allow nil as a value, in which case Gravatar's
default size is used.
(gravatar-default-image, gravatar-force-default): New user options
controlling the Gravatar query parameters 'default' and
'forcedefault', respectively.
(gravatar-base-url): Use HTTPS.
(gravatar--query-string): New helper function to facilitate testing.
(gravatar-build-url): Use it.

* test/lisp/image/gravatar-tests.el (gravatar-size)
(gravatar-default-image, gravatar-force-default)
(gravatar-build-url): New tests.
2019-08-02 16:33:30 +03:00
Basil L. Contovounesios
b4b1eda7fb Fix some minor gravatar.el issues
For discussion, see the following thread:
https://lists.gnu.org/archive/html/emacs-devel/2019-07/msg00528.html
* lisp/image/gravatar.el (gravatar-hash): Trim leading and trailing
whitespace in given address, as per the Gravatar docs.
(gravatar-retrieve-synchronously): Silence call to
url-retrieve-synchronously for consistency with gravatar-retrieve.
(gravatar-retrieved): Only cache buffer on successful retrieval.
* test/lisp/image/gravatar-tests.el: New file.
2019-08-02 16:33:30 +03:00
Mattias Engdegård
408e75e819 Clean up file-size-function
It is now called `byte-count-to-string-function', and used instead of
calling `file-size-human-readable' directly where appropriate.

* lisp/files.el (file-size-human-readable-iec): New.
(file-size-function): Rename to byte-count-to-string-function.  Better
default value.  Eliminate lambda.  Better default for custom choice.
Put in group `files'.  More descriptive doc string.  Move.
(out-of-memory-warning-percentage, warn-maybe-out-of-memory)
(get-free-disk-space):
* lisp/dired.el (dired-number-of-marked-files):
* lisp/url/url-http.el (url-http-simple-after-change-function)
(url-http-content-length-after-change-function):
Use byte-count-to-string-function.
* test/lisp/files-test.el (files-test-file-size-human-readable):
Test file-size-human-readable-iec.
2019-08-02 12:38:44 +02:00
Paul Eggert
24b60b75ea Port standard-test-interval to Los Angeles
* test/lisp/calendar/iso8601-tests.el (standard-test-interval):
Use UTC to avoid DST glitches in the test.
2019-08-01 15:47:15 -07:00
Basil L. Contovounesios
2267110b6f Fix usage of remove-text-properties
* lisp/allout-widgets.el (allout-decorate-item-icon):
* lisp/emacs-lisp/chart.el (chart-goto-xy):
* lisp/forms.el (forms--make-format)
(forms--make-format-elt-using-text-properties):
* lisp/htmlfontify.el (hfy-unmark-trailing-whitespace):
* lisp/net/newst-plainview.el (newsticker-hide-entry)
(newsticker-show-entry):
* lisp/nxml/nxml-mode.el (nxml-cleanup):
* lisp/obsolete/longlines.el (longlines-unshow-hard-newlines)
(longlines-encode-region):
* lisp/org/ob-exp.el (org-babel-exp-process-buffer):
* lisp/org/org-agenda.el (org-agenda-show-new-time):
* lisp/progmodes/cc-defs.el
(c-clear-char-property-with-value-function)
(c-clear-char-property-with-value-on-char-function):
* lisp/progmodes/ebrowse.el (ebrowse--hide):
* lisp/progmodes/gdb-mi.el (gdb-send):
* lisp/progmodes/idlw-shell.el
(idlwave-retrieve-expression-from-level):
* lisp/progmodes/make-mode.el (makefile-fill-paragraph):
* lisp/progmodes/prog-mode.el (prettify-symbols--post-command-hook):
* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize):
* lisp/tmm.el (tmm-remove-inactive-mouse-face):
Always pass an explicit plist to remove-text-properties.

* lisp/dired.el (dired--unhide):
* lisp/facemenu.el (facemenu-add-face):
* lisp/htmlfontify.el (hfy-fontify-buffer):
* lisp/iimage.el (iimage-mode-buffer):
* lisp/image-file.el (image-file-yank-handler):
* lisp/progmodes/prog-mode.el (prettify-symbols--compose-symbol):
* lisp/textmodes/tex-mode.el (latex-env-before-change):
* test/src/undo-tests.el (undo-test0):
Use remove-list-of-text-properties in place of
remove-text-properties where appropriate.
2019-08-01 17:04:53 +03:00
Paul Eggert
f8f1c8c33a format-time-string subsumes time-zone-format
* lisp/calendar/time-date.el (time-zone-format):
* test/lisp/calendar/time-date-tests.el (test-time-zone-format):
Remove.
* lisp/gnus/nnrss.el (nnrss-normalize-date):
Use format-time-string instead of time-zone-format.
2019-07-31 19:24:13 -07:00
Lars Ingebrigtsen
a79e96f0f9 Add more icalendar tests (for the isodatetime parser)
* test/lisp/calendar/icalendar-tests.el
(icalendar-tests--decode-isodatetime): Test
`icalendar--decode-isodatetime'.
2019-07-31 21:47:29 +02:00
Lars Ingebrigtsen
6a87416d61 Use iso8601-parse in nnrss
* lisp/gnus/nnrss.el (nnrss-normalize-date): Use iso8601-parse
instead of hand-rolled parser.

* test/lisp/gnus/nnrss-tests.el: New file.
2019-07-31 21:47:29 +02:00
Lars Ingebrigtsen
46df7bbe12 Add new function time-zone-format
* lisp/calendar/time-date.el (time-zone-format): New function.
2019-07-31 21:47:29 +02:00
Michael Albinus
794f8f25b5 Call file notification actions properly in filenotify-tests.el
* test/lisp/filenotify-tests.el (file-notify--test-wait-for-events):
Rename from `file-notify--wait-for-events'.  Adapt all callees.
(file-notify--test-cleanup): Reset also `file-notify--test-event'
and `file-notify--test-file nil'.
(file-notify--test-event-desc, file-notify--test-event-action):
New accessor functions.
(file-notify-test02-rm-watch, file-notify--test-event-test)
(file-notify--test-with-actions-check)
(file-notify--test-with-actions-explainer): Use them.
(file-notify--test-with-actions-check)
(file-notify--test-with-actions-explainer)
(file-notify--test-with-actions): Rename them from *-events-*.
Rename also internal variables accordingly.  Adapt all callees.
2019-07-31 21:22:48 +02:00
Glenn Morris
1ac0cfa264 Merge from origin/emacs-26
8fbe462 (origin/emacs-26) ; * doc/lispref/positions.texi (List Motion...
1d9efc0 Add index for "\( in strings" (Bug#25195)
304e96f Fix doc-string of 'fit-window-to-buffer' (Bug#36848)
d4c4987 Update view-mode docstring
d6ca1fc ; * lisp/term.el: Add missing / to esc seq commentary.
b3e2073 Fix subproc listening when setting filter to non-t (Bug#36591)
f671950 * etc/NEWS.25: Belatedly announce rcirc-reconnect-delay.
7f42277 Mention term.el's \032 dir tracking in commentary (Bug#19524)
16a529e Remove upload functionality of package-x from the elisp manual
78e6c2a * etc/AUTHORS: Update.
086a56e Clarify Gravatar docs
0592467 * doc/lispref/display.texi (Defining Faces): Say a face can't...

# Conflicts:
#	doc/emacs/programs.texi
#	etc/AUTHORS
#	lisp/term.el
2019-07-30 21:42:34 -07:00
Dmitry Gutov
4fe88791df ; Re-enable all Flymake tests on Hydra
To see if the recent improvements fixed something
2019-07-30 16:59:59 +03:00
Dmitry Gutov
56db1e84a0 Guard against flymake-no-changes-timeout being nil
* test/lisp/progmodes/flymake-tests.el
(flymake-tests--wait-for-backends): Guard against
flymake-no-changes-timeout being nil (in personal configurations)
to help when running tests interactively.
2019-07-30 16:59:59 +03:00
Lars Ingebrigtsen
e18a4a08e4 Adjust time-date tests to tweaked format 2019-07-30 11:56:03 +02:00
Lars Ingebrigtsen
fa04c8b87e Add an ISO 8601 parsing library
* doc/lispref/os.texi (Time Parsing): Document it.

* lisp/calendar/iso8601.el: New file.

* test/lisp/calendar/iso8601-tests.el: Test ISO8601 parsing functions.
2019-07-29 14:22:38 +02:00
Lars Ingebrigtsen
6cfda69d72 Add support for dealing with decoded time structures
* doc/lispref/os.texi (Time Conversion): Document the new
functions that work on decoded time.
(Time Calculations): Document new date/time functions.

* lisp/simple.el (decoded-time-second, decoded-time-minute)
(decoded-time-hour, decoded-time-day, decoded-time-month)
(decoded-time-year, decoded-time-weekday, decoded-time-dst)
(decoded-time-zone): New accessor functions for decoded time values.

* lisp/calendar/time-date.el (date-days-in-month)
(date-ordinal-to-time): New functions.
(decoded-time--alter-month, decoded-time--alter-day)
(decoded-time--alter-second, make-decoded-time): New functions
added to manipulate decoded time structures.

* src/timefns.c (Fdecode_time): Mention the new accessors.

* test/lisp/calendar/time-date-tests.el: New file to test the
decoded time functions and the other new functions.
2019-07-29 14:22:38 +02:00
Juri Linkov
8f4faf7aa1 * lisp/char-fold.el: Rename char-fold-make-table to char-fold--make-table. 2019-07-29 01:55:34 +03:00
Juri Linkov
be16c204d6 Move some uncontroversial char-folding pairs from test data to default values
* lisp/char-fold.el (char-fold--default-include)
(char-fold--default-exclude): Add some default values.

* test/lisp/char-fold-tests.el (char-fold--test-without-customization)
(char-fold--test-with-customization): Move some test data to
default values.  Add more data for tests to pass.   (Bug#35689)
2019-07-29 01:45:36 +03:00
Lars Ingebrigtsen
d7665ae8df Make let-alist work with vectors
* lisp/emacs-lisp/let-alist.el (let-alist--deep-dot-search):
Descend into vectors, too, looking for dotted variables (bug#23244).

Test case:

(let-alist '((a . 1) (b . 2))
  `[,(+ .a) ,(+ .a .b .b)])
2019-07-28 23:28:24 +02:00
Lars Ingebrigtsen
348a6de118 `unknown' test case now works 2019-07-28 11:40:30 +02:00
Eli Zaretskii
51443b9a83 Move tty-colors-tests.el to its proper directory. 2019-07-27 14:10:20 +03:00
Paul Eggert
e3575ee4b2 Fix recently-introduced file-name-absolute-p typo
Fix a bug introduced in 2019-07-24T21:28:13!eggert@cs.ucla.edu.
* src/fileio.c (file_name_absolute_p):
~/foo is also absolute (Bug#36809).
* test/src/fileio-tests.el (fileio-tests--file-name-absolute-p):
Rename from fileio-tests--no-such-user and add more tests.
2019-07-26 09:48:57 -07:00
Lars Ingebrigtsen
eb45cc9521 Add new macro `ignore-error'
* doc/lispref/control.texi (Handling Errors): Document
`ignore-error'.
* lisp/subr.el (ignore-error): New macro.

* lisp/progmodes/elisp-mode.el (elisp-completion-at-point):
Provide completion for `ignore-error'.
2019-07-26 09:58:53 +02:00
Noam Postavsky
b3e20737d8 Fix subproc listening when setting filter to non-t (Bug#36591)
* src/process.c (Fset_process_filter): Call add_process_read_fd
according to the state of process filter before it's updated.  This
restores the correct functioning as it was before 2016-02-16 "Allow
setting the filter masks later".  Inline the set_process_filter_masks
call instead of fixing it that function, because it is also called
from connect_network_socket, and we don't want to change the behavior
of that function so close to release.
* test/src/process-tests.el (set-process-filter-t): New test.
2019-07-25 18:36:03 -04:00
Nobuyoshi Nakada
0cbdbac2bb Strip trailing whitespaces at the end of converted do block
* lisp/progmodes/ruby-mode.el (ruby-brace-to-do-end):
Strip trailing whitespaces at the end of converted do block
(bug#36756).

https://bugs.ruby-lang.org/issues/16014
https://github.com/syl20bnr/spacemacs/issues/12548
2019-07-25 16:01:55 +03:00
Paul Eggert
a5063aa8b1 Do not treat ~nosuchuser as an absolute file name
Derived from Ken Brown’s patch (Bug#36502#97).
* doc/lispref/files.texi (Relative File Names):
* etc/NEWS: Document this.
* src/fileio.c (user_homedir): New function.
(Fexpand_file_name, file_name_absolute_p): Use it.
(search_embedded_absfilename): Simplify via file_name_absolute_p.
* test/src/fileio-tests.el (fileio-tests--no-such-user): New test.
2019-07-24 14:33:02 -07:00
Mattias Engdegård
3a76484865 Don't use internal filenotify function in test
* test/lisp/filenotify-tests.el
(file-notify--test-file, file-notify--test-add-watch): New.
(file-notify--test-event-test, file-notify--test-event-handler)
(file-notify-test02-rm-watch, file-notify-test03-events)
(file-notify-test05-file-validity, file-notify-test07-many-events)
(file-notify-test08-backup, file-notify-test09-watched-file-in-watched-dir):
Avoid using the internal `file-notify--event-watched-file' so that it
can be removed from filenotify.el.
Instead, pass the file name to the callback as an extra argument;
use `file-notify--test-add-watch' instead of `file-notify-add-watch'.
2019-07-24 11:52:44 +02:00
Mattias Engdegård
5cfd8c508e Local definitions of accessors only used in test
* test/lisp/filenotify-tests.el (file-notify--test-event-file)
(file-notify--test-event-file1, file-notify--test-event-test)
(file-notify--test-event-handler):
Define accessors locally, so that they can be removed from filenotify.el.
2019-07-24 11:52:33 +02:00
Juri Linkov
376f5df3cc Customizable char-fold with char-fold-symmetric, char-fold-include (bug#35689)
* doc/emacs/search.texi (Lax Search): Document
char-fold-symmetric, char-fold-include, char-fold-exclude.

* lisp/char-fold.el (char-fold--default-include)
(char-fold--default-exclude, char-fold--default-symmetric)
(char-fold--previous): New defconsts.
(char-fold-include, char-fold-exclude, char-fold-symmetric):
New defcustoms.
(char-fold-make-table): Use them.
(char-fold-update-table): New function called at top-level.

* test/lisp/char-fold-tests.el (char-fold--test-no-match-exactly)
(char-fold--permutation): New functions.
(char-fold--test-without-customization)
(char-fold--test-with-customization): New tests.
2019-07-23 23:27:28 +03:00
Paul Eggert
dfb0ba79b5 Support "%x" etc. formats on more floats
* doc/lispref/strings.texi (Formatting Strings): Document this.
* src/editfns.c (styled_format): Support %o, %x, and %X on
finite floats less than zero or greater than UINTMAX_MAX.
* test/src/editfns-tests.el (format-%x-large-float)
(read-large-integer, format-%o-negative-float):
Adjust tests to match extended behavior.
Rename the latter test from format-%o-invalid-float,
since the float is no longer invalid.

* test/src/editfns-tests.el (format-%x-large-float)
(read-large-integer): Test this.
2019-07-23 01:46:41 -07:00
Stefan Monnier
87ad8a1143 * lisp/progmodes/opascal.el: Allow inline var decl in for (bug#36348)
(opascal-enclosing-indent-of): Ignore decls "neutered" by delimiter.
2019-07-22 13:10:35 -04:00
Mattias Engdegård
d0eeb62c43 Make tramp test regexp more robust
* test/lisp/net/tramp-tests.el (tramp-test17-insert-directory):
Match a greater variety of human-readable size values.
2019-07-22 16:38:02 +02:00
Ken Brown
8b13ec1d70 Fix expand-file-name for names starting with '~'
* src/fileio.c: (file_name_absolute_no_tilde_p):
New static function.
(Fexpand_file_name): If the current buffer's default-directory
starts with "~user" where "user" is not a valid user name, don't
give the '~' a special meaning.  Just treat the value of
default-directory as a relative name.  (Bug#36502)
* test/src/fileio-tests.el
(fileio-tests--relative-default-directory): Add a test.
2019-07-21 10:40:54 -04:00
Paul Eggert
515afc9c15 Fix crash if user test munges hash table
* src/fns.c (restore_mutability)
(hash_table_user_defined_call): New functions.
(cmpfn_user_defined, hashfn_user_defined): Use them.
(make_hash_table, copy_hash_table):
Mark new hash table as mutable.
(check_mutable_hash_table): New function.
(Fclrhash, Fputhash, Fremhash): Use it instead of CHECK_IMPURE.
* src/lisp.h (struct hash_table_test): User-defined functions
now take pointers to struct Lisp_Hash_Table, not to struct
hash_table_test.  All uses changed.
(struct Lisp_Hash_Table): New member ‘mutable’.
* src/pdumper.c (dump_hash_table): Copy it.
* test/src/fns-tests.el (test-hash-function-that-mutates-hash-table):
New test, which tests for the bug.
2019-07-20 20:13:46 -07:00
Noam Postavsky
6490269bec Merge from emacs-26
150bdfe43a Handle completely undecoded input in term (Bug#29918)
021f32cca1 * doc/misc/forms.texi (Control File Format): Fix a doc error.
76538d09b7 Fix typo in package-alist docstring
b2fde4b5e8 * doc/lispref/text.texi (Mode-Specific Indent): Fix a typo...
7e62778548 ; Another minor change in 'bidi-display-reordering's doc s...
4455ddbe56 Improve doc string of 'bidi-display-reordering'
34ee26dd93 Add warning to bidi-display-reordering doc string

# Conflicts:
#	lisp/term.el
#	test/lisp/term-tests.el
2019-07-20 22:02:36 -04:00
Noam Postavsky
150bdfe43a Handle completely undecoded input in term (Bug#29918)
* lisp/term.el (term-emulate-terminal): Avoid errors if the whole
decoded string is eight-bit characters.  Don't attempt to save the
string for next iteration in that case.
* test/lisp/term-tests.el (term-decode-partial)
(term-undecodable-input): New tests.
2019-07-20 21:35:21 -04:00
Stefan Monnier
189296bfcc * test/manual/indent/octave.m (spmd): Add test for last change 2019-07-20 12:19:57 -04:00
Basil L. Contovounesios
b728620a75 Allow counter-clockwise rotations in image-rotate
* lisp/image.el (image-rotate): Extend with an optional argument
specifying the rotation in degrees (bug#35421).
* doc/lispref/display.texi (Showing Images):
* etc/NEWS: Document the change.
* test/lisp/image-tests.el (image-rotate): New test.
2019-07-20 16:00:31 +01:00
Benjamin Riefenstahl
e6bfc6753c Make REs in magic-(fallback-)mode-alist case-sensitive.
These variables are used for well-defined file formats where relaxed
case matching is not wanted usually.

* lisp/files.el (magic-mode-alist, magic-fallback-mode-alist): Update
the doc string.
(set-auto-mode): Make looking-at for elements of magic-mode-alist and
magic-fallback-mode-alist use case-fold-search == nil.
* lisp/files.el (files-test-magic-mode-alist-re-baseline)
(files-test-magic-mode-alist-re-no-match)
(files-test-magic-mode-alist-re-case-diff): Add.
2019-07-20 12:27:19 +03:00
Stefan Kangas
daf5c4309f Use lexical-binding in help-fns-tests.el (Bug#36585)
* test/lisp/help-fns-tests.el: Use lexical-binding.  Doc fix.
2019-07-18 20:06:27 -04:00
Simen Heggestøyl
b4eaa7eace Use lexical-binding in asm-mode.el and add tests
* lisp/progmodes/asm-mode.el: Use lexical-binding.
(asm-comment-char): Remove redundant :group arg.
(asm-mode): Use `setq-local'.
(asm-calculate-indentation): Remove moot `or'.

* test/lisp/progmodes/asm-mode-tests.el: New file with tests for
asm-mode.el.
2019-07-18 20:41:47 +02:00
Glenn Morris
decfdb091a Update a tramp test for get-free-disk-space change
* test/lisp/net/tramp-tests.el (tramp-test17-insert-directory):
Handle optional unit suffix in free space.
2019-07-18 08:03:36 -07:00
Nick Drozd
b8bf7255f3 * test/lisp/progmodes/cc-mode-tests.el: Add a test with /***/ in #define lines 2019-07-17 14:07:26 +00:00
Glenn Morris
7e70c78867 An electric test is now passing
* test/lisp/electric-tests.el
(electric-pair-whitespace-chomping-2-at-point-4-in-c++-mode-in-strings):
Seems to pass since today's cc-mode changes.
2019-07-16 16:04:54 -07:00
Basil L. Contovounesios
d2758820cd Fix failing secrets-test03-items
* test/lisp/net/secrets-tests.el: Use lexical-binding.
(secrets-test03-items): Do not assume :xdg:schema attribute is
silently added to the front of the collection (bug#36694).
(secrets-test04-search, secrets-test-all): Quote function symbols as
such.
2019-07-16 18:29:52 +01:00
Mattias Engdegård
a87840fffb Fix calc number formatting with digit grouping (bug#36689)
The functions math-format-hex and math-format-octal were not
implemented, yet called, leading to a crash when using hex or octal
radix with digit grouping.

* test/lisp/calc/calc-tests.el (calc-test-format-radix): New test.
* lisp/calc/calc-ext.el: Don't declare non-existing functions.
(math--format-integer-fancy): Don't call non-existing functions.
* lisp/calc/calc-bin.el (math-format-binary, math-binary-digits):
Simplify, fixing 0-padding bug.
2019-07-16 17:37:46 +02:00
Glenn Morris
c3da6fd707 Stop wdired tests leaving behind symlink /tmp/emacs1000
* test/lisp/wdired-tests.el (server-socket-dir): Make effective.
2019-07-14 15:18:22 -07:00
Glenn Morris
fe2141d157 Update a ffap test
* test/lisp/ffap-tests.el (ffap-other-window--bug-25352):
Update for incompatible ffap-other-window change.
2019-07-14 13:28:54 -07:00
Stefan Kangas
7c30ad184f Restore focus to Bookmark List after editing annotation
There are two entry points to bookmark-edit-annotation-mode: the first
when we add a bookmark and bookmark-use-annotations is non-nil; the
second when bookmark-bmenu-edit-annotation is run from the bookmark
list.  When editing is concluded, in the first case, we should just
quit window.  In the second case, we should instead return to the
bookmark list.

* lisp/bookmark.el (text-property-search): Require.
(bookmark-annotation-name): Make buffer-local and improve doc string.
(bookmark--annotation-from-bookmark-list): New buffer-local variable.
(bookmark-edit-annotation): New argument from-bookmark-list sets
bookmark--annotation-from-bookmark-list.
(bookmark-bmenu-edit-annotation): Call bookmark-edit-annotation with
argument from-bookmark-list set to t.
(bookmark-send-edited-annotation): When editing originated in the
bookmark list, restore focus to bookmark list and move point back to
edited bookmark. (Bug#20150)

(bookmark-edit-annotation-mode): Fix typo.
(bookmark-bmenu-buffer): New variable.
(bookmark-bmenu-surreptitiously-rebuild-list)
(bookmark-bmenu-list): Use it.

* test/lisp/bookmark-tests.el (with-bookmark-bmenu-test): New macro.
(bookmark-tests-set/bookmark-use-annotations-t)
(bookmark-bmenu-edit-annotation/show-annotation)
(bookmark-bmenu-send-edited-annotation)
(bookmark-bmenu-send-edited-annotation/restore-focus): New test cases.
2019-07-14 09:26:42 +03:00
Marco Wahl
352530ee0a New function for scroll-lock-mode to almost always scroll
* lisp/scroll-lock.el (scroll-lock-next-line-always-scroll): New
function.  Opposed to scroll-lock-next-line it does not switch to
forward-line at eob.  S-down is the default key binding for this
function.  (Bug#36494)
* test/lisp/scroll-lock-tests.el: A few tests for
scroll-lock-next-line-always-scroll.
* etc/NEWS: Announce the new command.
2019-07-14 09:23:20 +03:00
Michael Albinus
40743cbb73 ; Some precisements in test/README 2019-07-13 13:30:28 +02:00
Phil Sainty
c1b4368809 Add tests for so-long.el 2019-07-13 18:51:55 +12:00
Lars Ingebrigtsen
936d074d7c Document format-spec and expand the modifiers it supports
* doc/lispref/text.texi (Interpolated Strings): New section.
* lisp/format-spec.el (format-spec--parse-modifiers)
(format-spec--pad): New functions.
(format-spec): Support more format modifiers (bug#32931).
2019-07-13 03:50:50 +02:00
Juri Linkov
38e420af45 * test/lisp/replace-tests.el (replace-tests-with-undo): Override
replace-highlight to emulate clobbering match-data (bug#36328).
2019-07-12 22:00:56 +03:00
Juri Linkov
391e8e530a * lisp/progmodes/compile.el (compilation-filter): `compilation--ensure-parse'
is used instead of `font-lock-ensure' (bug#36564).

* test/lisp/progmodes/compile-tests.el (compile-test-error-regexps)
(compile-test-grep-regexps): Check the number of errors.
2019-07-12 21:57:18 +03:00
Lars Ingebrigtsen
4c4ff9d90a Fix breaking of rfc2047 headers with long words
* lisp/mail/rfc2047.el (rfc2047-fold-region): Don't break lines
right after the Header: field, but wait until the next
whitespace.  (This only makes a difference for words that are very
long (i.e., longer than, say, 60 characters, depending on the
header name length.)
2019-07-12 15:59:27 +02:00
Lars Ingebrigtsen
4438459eaa Refactor rfc2047-fold-region slightly and add a couple of tests
* lisp/mail/rfc2047.el (rfc2047--break-line): Refactor out to
avoid code repetition...
(rfc2047-fold-region): ... from this function.
2019-07-12 15:48:34 +02:00
Michael Albinus
955db22005 Check directory in Tramp's {copy,rename}-file
* lisp/net/tramp-adb.el (tramp-adb-handle-copy-file)
(tramp-adb-handle-rename-file):
* lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file):
* lisp/net/tramp-rclone.el (tramp-rclone-do-copy-or-rename-file):
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file):
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-file)
(tramp-smb-handle-rename-file):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-do-copy-or-rename-file):
Check, that NEWNAME is not a directory given as file name.

* test/lisp/net/tramp-tests.el (tramp-test11-copy-file)
(tramp-test12-rename-file): Extend tests.
2019-07-12 15:10:57 +02:00
Michael Albinus
37cb129979 * test/lisp/format-spec-tests.el (test-format-unknown): Use `should-error'. 2019-07-11 20:01:57 +02:00
Lars Ingebrigtsen
b44f0c4579 Allow passing unknown specs to format-spec
* lisp/format-spec.el (format-spec): Allow passing through format
strings that have no specs (to be able to act as a filter).  Also
add an example.
* test/lisp/format-spec-tests.el (test-format-spec): Add tests for
the new functionality.
2019-07-11 18:44:30 +02:00
Lars Ingebrigtsen
b41ddb7a8b Add tests for format-spec 2019-07-11 18:37:55 +02:00
Lars Ingebrigtsen
50e7e8101a Add test to time-stamp.el 2019-07-11 18:27:12 +02:00
Mattias Engdegård
83ed722c8d Fix trig simplification crash (bug#33052)
* lisp/calc/calc-alg.el (calcFunc-sec, calcFunc-csc, calcFunc-cot):
Check that `math-known-sin' and `math-known-tan' succeeded before
using their value in arithmetic.
* test/lisp/calc/calc-tests.el (calc-test-trig): Add regression tests.
2019-07-10 19:28:35 +02:00
Stefan Kangas
c198ecda9f Fix warnings in todo-mode-tests.el (Bug#36569)
* test/lisp/calendar/todo-mode-tests.el (todo-test--insert-item):
Fix "Unused lexical argument" warnings.
2019-07-10 11:26:18 +01:00
Stefan Kangas
faedbe4665 Fix warning in electric-tests.el (Bug#36570)
* test/lisp/electric-tests.el (plainer-c-mode): Remove duplicate
definition.
2019-07-10 11:11:39 +01:00
Stefan Monnier
fec111c9ee * src/fileio.c: Fix bug#36431
(decide_coding_unwind): Re-introduce.  Move text back to the gap.
Return the new `inserted` via the unwind_data.
(Finsert_file_contents): Use it.
Make sure `inserted` is always 0 when we jump straight to `notfound`.
Don't insert the text in the buffer until we know it's properly decoded
for the byteness of the buffer.

* test/src/fileio-tests.el (fileio-tests--insert-file-interrupt):
Allow insert-file-contents to return an empty buffer in case of
non-local exit in set-auto-coding-function.
2019-07-09 17:04:24 -04:00
Paul Eggert
ce59b41a28 Port image-type-from-file-header-test to non-SVG Emacs
Problem reported privately by Michael Albinus.
* test/lisp/image-tests.el (image-type-from-file-header-test):
Don’t assume svg is a supported image type.
2019-07-09 13:03:07 -07:00
Glenn Morris
95dce77c5e Conditionalize result of a bytecomp test
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--switch-duplicates):
Apparently the result depends on byte-compile-cond-use-jump-table.
2019-07-09 03:27:26 -07:00
Ken Brown
0528a7c872 Ensure that expand-file-name returns an absolute file name
* src/fileio.c (Fexpand_file_name): Don't directly use the current
buffer's default-directory if it is relative.  Instead replace it
by its expansion relative to invocation-directory.  (Bug#36502)
* test/src/fileio-tests.el
(fileio-tests--relative-default-directory): New test.
2019-07-08 18:37:33 -04:00
Glenn Morris
bb856d12dc Merge from origin/emacs-26
e97c043 Fix python.el docstring (Bug#36458)
e660801 ; Add thing-at-point-looking-at test (Bug#35708)
f5b4846 ; Fix typo, insure -> ensure in ChangeLogs
cb8fb59 * lisp/hi-lock.el (hi-lock-line-face-buffer): Doc fix.  (Bug3...
2019-07-06 12:51:30 -07:00
Glenn Morris
16a8a7695f Merge from origin/emacs-26
316f5a3 Fix typo in doc string of file-exists-p (bug#36408)
bfc7c6e * test/lisp/url/url-file-tests.el (url-file): Fix for POSIX f...
13b95e1 Fix typo in windows.texi
8b775c3 Clarify & update (elisp) Writing Emacs Primitives
7648c12 Clarify a subtle issue in the Internals chapter of lispref
2019-07-06 12:51:30 -07:00
Stefan Kangas
cfcaf06fe5 Add tests for text-property-search to check prop-match-value
* test/lisp/emacs-lisp/text-property-search-tests.el
(with-match-test): New macro.
(text-property-search-forward-prop-match-match-face-nil-nil)
(text-property-search-forward-prop-match-match-face-bold-t)
(text-property-search-forward-prop-match-match-face-bold-nil)
(text-property-search-backward-prop-match-match-face-nil-nil)
(text-property-search-backward-prop-match-match-face-italic-t)
(text-property-search-backward-prop-match-match-face-italic-nil):
Add test cases to also verify the value of prop-match-value
(bug#36486).
2019-07-06 16:27:05 +02:00
Konstantin Kharlamov
dfc322d77f Replace manually crafted hex regexes with [:xdigit:]
* admin/charsets/mapconv:
* build-aux/gitlog-to-changelog (parse_amend_file, git_dir_option):
* lisp/progmodes/verilog-mode.el (verilog-delay-re):
(verilog-type-font-keywords, verilog-read-always-signals-recurse):
(verilog-is-number):
* lisp/progmodes/vera-mode.el (vera-font-lock-keywords):
* test/src/emacs-module-tests.el (mod-test-sum-test):
* lisp/xml.el: (xml--entity-replacement-text):
* lisp/version.el (emacs-repository-version-git):
* lisp/textmodes/sgml-mode.el (sgml-quote):
* lisp/textmodes/css-mode.el (css-escapes-re)
(css--colors-regexp):
* lisp/progmodes/prolog.el (prolog-syntax-propertize-function):
* lisp/progmodes/hideif.el (hif-token-regexp, hif-tokenize):
* lisp/progmodes/ebnf-dtd.el: (ebnf-dtd-attlistdecl)
(ebnf-dtd-entitydecl, ebnf-dtd-lex):
* lisp/progmodes/ebnf-ebx.el (ebnf-ebx-hex-character):
* lisp/progmodes/ebnf-abn.el (ebnf-abn-character):
* lisp/progmodes/cperl-mode.el (cperl-highlight-charclass)
(cperl-find-pods-heres):
* lisp/progmodes/cc-mode.el (c-maybe-quoted-number-head)
(c-maybe-quoted-number, c-parse-quotes-before-change)
(c-parse-quotes-after-change, c-quoted-number-head-before-point)
(c-quoted-number-straddling-point):
* lisp/progmodes/ada-mode.el (featurep, ada-in-numeric-literal-p)
(ada-font-lock-keywords):
* lisp/org/org-mobile.el (org-mobile-copy-agenda-files)
* lisp/org/org-table.el (org-table-number-regexp):
(org-mobile-update-checksum-for-capture-file):
* lisp/nxml/xsd-regexp.el (xsdre-gen-categories):
* lisp/nxml/xmltok.el (let*):
* lisp/nxml/rng-xsd.el (rng-xsd-convert-hex-binary)
(rng-xsd-convert-any-uri):
* lisp/nxml/rng-uri.el (rng-uri-file-name-1)
(rng-uri-unescape-multibyte, rng-uri-unescape-unibyte)
(rng-uri-unescape-unibyte-match)
(rng-uri-unescape-unibyte-replace):
* lisp/nxml/rng-cmpct.el (rng-c-process-escapes):
* lisp/nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* lisp/net/shr-color.el (shr-color->hexadecimal):
* lisp/mail/rfc2231.el (rfc2231-decode-encoded-string):
* lisp/international/mule-cmds.el (read-char-by-name):
* lisp/htmlfontify.el (hfy-hex-regex):
* lisp/gnus/nneething.el (nneething-decode-file-name):
* lisp/gnus/mml-sec.el (mml-secure-find-usable-keys):
* lisp/gnus/gnus-art.el (gnus-button-mid-or-mail-heuristic-alist):
* lisp/faces.el (read-color):
* lisp/epg.el (epg--status-ERRSIG, epg--status-VALIDSIG)
(epg--status-SIG_CREATED, epg--decode-percent-escape)
(epg--decode-hexstring, epg--decode-quotedstring)
(epg-dn-from-string):
* lisp/emulation/cua-rect.el (cua-incr-rectangle):
* lisp/dnd.el (dnd-unescape-uri):
* lisp/cedet/semantic/lex.el (semantic-lex-number-expression):
* lisp/cedet/semantic/java.el (semantic-java-number-regexp):
* lisp/calc/calc-lang.el (pascal):
* lisp/calc/calc-ext.el (math-read-number-fancy):
* lisp/calc/calc-aent.el (math-read-token):
Replace various combinations of [0-9a-fA-F] with [[:xdigit:]].
(Bug#36167)
2019-07-06 10:54:25 +03:00
Noam Postavsky
e6608010d7 ; Add thing-at-point-looking-at test (Bug#35708)
* test/lisp/thingatpt-tests.el (thing-at-point-looking-at): New test.
2019-07-05 21:50:37 -04:00
Juri Linkov
19b1cefa3b * lisp/char-fold.el (char-fold-to-regexp): Implement arg LAX (bug#36398).
* test/lisp/char-fold-tests.el (char-fold--test-multi-lax): New test.
2019-07-04 23:49:33 +03:00
Mattias Engdegård
3fd7491512 Optimise more inputs to `regexp-opt' (bug#36444)
Use a more precise test to determine whether the input to `regexp-opt'
is safe to optimise when KEEP-ORDER is non-nil, permitting more inputs
to be optimised than before.  For example, ("good" "goal" "go") is now
accepted.

* lisp/emacs-lisp/regexp-opt.el (regexp-opt):
More precise test for whether the list is safe w.r.t. KEEP-ORDER.
(regexp-opt--contains-prefix): Remove.

* test/lisp/emacs-lisp/regexp-opt-tests.el: Use lexical-binding.
(regexp-opt-test--permutation, regexp-opt-test--factorial)
(regexp-opt-test--permutations, regexp-opt-test--match-all)
(regexp-opt-test--check-perm, regexp-opt-test--explain-perm)
(regexp-opt-keep-order): Test KEEP-ORDER.
2019-07-04 17:18:15 +02:00
Stefan Kangas
22760ab357 Add tests for bookmark.el (Bug#36452)
* test/lisp/bookmark-resources/example.txt:
* test/lisp/bookmark-resources/test.bmk:
* test/lisp/bookmark-tests.el: New files.
* lisp/bookmark.el: Minor cleanups.
(bookmark-insert-annotation): Signal error on invalid bookmark.
(bookmark-write-file): Add newline at end of file.
2019-07-03 14:49:38 +03:00
Michael Albinus
14563dc10a Change expected result of a flymake test on emba
* test/lisp/progmodes/flymake-tests.el (different-diagnostic-types):
Test is now passing on emba.gnu.org, too.
2019-07-03 09:00:26 +02:00
Glenn Morris
20c1406cd0 Change expected result of a flymake test on hydra
* test/lisp/progmodes/flymake-tests.el (different-diagnostic-types):
Test is now passing on hydra.nixos.org, since today.
2019-07-02 16:46:25 -07:00
Stefan Monnier
fe3676fe18 (Finsert_file_contents): Keep buffer consistent in non-local exit
* src/fileio.c (decide_coding_unwind): Delete function.
(Finsert_file_contents): Don't let invalid multibyte byte sequences
escape when we exit non-locally.

* test/src/fileio-tests.el (fileio-tests--insert-file-interrupt): New test.
2019-07-02 18:02:51 -04:00
Stefan Monnier
a2c56a90f9 * test/src/editfns-tests.el (test-group-name): Accept nil group-name. 2019-07-02 15:11:16 -04:00
João Távora
5e88b50d54 Correctly reindent previous line in electric-indent-mode
Fixes: bug#35254

Do this even when electric-indent-inhibit is t, except when the
newline insertion is being performed by electric-layout-mode.

* lisp/electric.el (electric-indent-post-self-insert-function):
Reindent previous line unless operating under
electric-layout-mode.
(electric-layout-post-self-insert-function-1): Bind
electric-indent-inhibit to 'electric-layout-mode.

* test/lisp/electric-tests.el
(electric-layout-control-reindentation): New test.
2019-07-02 16:10:45 +01:00
Michael Albinus
10af8c5863 Release Tramp 2.4.2
* lisp/net/tramp.el: Bump version.

* test/lisp/net/tramp-tests.el (tramp--test-instrument-test-case):
Add `add-name-to-file' error message.
(tramp--test-ignore-add-name-to-file-error): Make error handler
more explicit about the error.
2019-06-30 11:23:06 +02:00
Eli Zaretskii
74a5a332fe Support native image transforms on MS-Windows
This changeset also rearranges native image transform code
for other platforms to make it cleaner, and also removes
the support for native cropping.  For the discussions, see
https://lists.gnu.org/archive/html/emacs-devel/2019-06/msg00242.html

* src/w32term.c (w32_image_rotations_p, transform): New functions.
(w32_draw_image_foreground): If image rotation is requested
and supported, call PlgBlt to transform the image.
(w32_initialize): Populate the PlgBlt function pointer if it
is supported.
* src/w32term.h (w32_image_rotations_p): Add prototype.
* src/dispextern.h (struct image) [HAVE_NTGUI]: New member xform.
* src/image.c (compute_image_rotation): Renamed from
image_set_rotation.  Only compute and returns the rotation
angle; leave the matrix calculation for later.  Log an error
message if the :rotation parameter is not a number.
(image_set_crop): Function deleted.  We no longer support
native cropping, as one can display an image slice instead.
(image_set_transform): Compute the transform matrix in its
entirety here, in two variants: one for XRender and Cairo, the
other for NS and MS-Windows.  call compute_image_size and
compute_image_rotation internally.
(lookup_image) [HAVE_NATIVE_TRANSFORMS]: Call only
image_set_transform.  No need to pass the transform matrix to
image_set_transform.
(Fimage_transforms_p): Return a list of transform capabilities
rather than a simple boolean.  Support TTY frames as well.
* src/nsimage.m (setTransform:): Don't invert the matrix, as
it is already inverted in image.c.

* test/manual/image-transforms-tests.el (test-cropping): State
in the text that only ImageMagick supports cropping.

* doc/lispref/display.texi (Image Descriptors): Update the
documentation of native image transforms.
(ImageMagick Images): Move the description of ':crop' here.

* etc/NEWS: Minor copyedits of the feature announcement.
2019-06-29 14:51:41 +03:00
Mattias Engdegård
f1d414b98f Allow empty argument to `regexp-opt-charset'
* test/lisp/emacs-lisp/regexp-opt-tests.el (regexp-opt-charset):
Handle nil argument, and use regexp-quote for singletons.
* lisp/emacs-lisp/regexp-opt.el (regexp-opt-charset): Expand tests.
2019-06-29 11:12:27 +02:00
Andreas Schwab
c113d6f3c1 * test/src/json-tests.el (json-serialize/object): Fix spacing. 2019-06-29 07:41:52 +02:00
Pip Cet
bc87ee925d Fix json-serialize/object test failure
* test/src/json-tests.el (json-serialize/object):
Accept failure with different code.
2019-06-28 22:02:02 -07:00
Mattias Engdegård
a1f76adfb0 Correct regexp matching of raw bytes
Make regexp matching of raw bytes work in all combination of unibyte
and multibyte patterns and targets, as exact strings and in character
alternatives (bug#3687).

* src/regex-emacs.c (analyze_first):
Include raw byte in fastmap when pattern is a multibyte exact string.
Include leading byte in fastmap for raw bytes in character alternatives.
(re_match_2_internal):
Decrement the byte count by the number of bytes in the pattern character,
not 1.
* test/src/regex-emacs-tests.el (regexp-unibyte-unibyte)
(regexp-multibyte-unibyte, regexp-unibyte-mutibyte)
(regexp-multibyte-multibyte): New tests.
2019-06-28 17:30:18 +02:00
Michael Albinus
aae5bf4438 Tramp requires Emacs 24.4
* doc/misc/tramp.texi (Frequently Asked Questions):
Use `with-eval-after-load'. in example.

* doc/misc/trampver.texi: Set variable emacsver.

* lisp/net/tramp.el (tramp-send-string, tramp-call-process)
(tramp-call-process-region, tramp-process-lines):
* lisp/net/tramp-adb.el (tramp-adb-handle-file-truename)
(tramp-adb-sh-fix-ls-output, tramp-adb-maybe-open-connection):
* lisp/net/tramp-gvfs.el (tramp-gvfs-get-directory-attributes)
(tramp-gvfs-handle-file-notify-add-watch)
* lisp/net/tramp-sh.el (tramp-sh-handle-file-truename)
(tramp-do-copy-or-rename-file-out-of-band)
(tramp-sh-handle-file-notify-add-watch, tramp-find-executable)
(tramp-set-remote-path)
(tramp-open-connection-setup-interactive-shell)
(tramp-maybe-open-connection, tramp-send-command):
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory)
(tramp-smb-handle-file-acl, tramp-smb-handle-process-file)
(tramp-smb-handle-set-file-acl)
(tramp-smb-handle-start-file-process)
(tramp-smb-maybe-open-connection):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-set-file-acl):
(tramp-sudoedit-send-command): Use `string-join' and `string-empty-p'.

* lisp/net/tramp-adb.el:
* lisp/net/tramp-archive.el:
* lisp/net/tramp-integration.el:
* lisp/net/tramp-ftp.el: Use `with-eval-after-load'.

* lisp/net/tramp-cmds.el (tramp-cleanup-connection)
(tramp-cleanup-all-connections): Cancel timer.

* lisp/net/tramp-compat.el (subr-x): Require.
(default-toplevel-value): Don't make it a defalias.

* lisp/net/tramp-gvfs.el: Use `dbus-event-error-functions'.  Do
not special handle `split-string'.

* lisp/net/tramp.el: Require Emacs 24.4.
(tramp-password-prompt-regexp): Use `password-word-equivalents'.
(tramp-user-error): Use `user-error'.
(tramp-replace-environment-variables): Use `substitute-env-vars'.
(tramp-wait-for-regexp): Rearrange `with-current-buffer' call.
(tramp-get-local-gid): Use `group-gid'.

* lisp/net/trampver.el: Check for Emacs 24.4.

* test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect)
(tramp-test02-file-name-dissect-simplified)
(tramp-test02-file-name-dissect-separate)
(tramp-test03-file-name-host-rules)
(tramp-test03-file-name-method-rules): Don't check for `user-error'.
2019-06-28 16:32:12 +02:00
Juanma Barranquero
bfc7c6e0d3 * test/lisp/url/url-file-tests.el (url-file): Fix for POSIX filenames. 2019-06-28 15:22:00 +02:00
Stefan Monnier
0b4e003766 Revert "* lisp/calc/calc-ext.el (math-scalarp): Fix typo"
This reverts commit 698ff554ac.
2019-06-26 10:24:59 -04:00
Stefan Monnier
4e302630ae * test/lisp/calc/calc-tests.el (test-math-bignum, test-calc-23889): Disable
Not applicable any more with native bignums.
2019-06-26 10:04:52 -04:00
Stefan Monnier
698ff554ac * lisp/calc/calc-ext.el (math-scalarp): Fix typo 2019-06-26 10:03:48 -04:00
Noam Postavsky
9233865b70 Fix (rx-to-string (and (literal STR) (regexp STR)) regression
* lisp/emacs-lisp/rx.el (rx-regexp, rx-literal): Check the cadr of the
form for stringness, not the form itself.
* test/lisp/emacs-lisp/rx-tests.el (rx-to-string-lisp-forms): New test.
2019-06-26 08:50:27 -04:00
Noam Postavsky
9552ee4df7 Merge from emacs-26
e62ad04963 Fix sgml-mode handling of quotes within parens (Bug#36347)
06b35b2f92 ; * lisp/frame.el: Enhance add-variable-watcher commentary.
572e34bb6f Rename 'make-symbolic-link' argument NEWNAME to LINKNAME
04477adedc Check that length of data returned by sysctl is non-zero
81535eeadb * test/lisp/progmodes/python-tests.el (python-virt-bin): D...
9d48979ca8 Fix Python tests depending on system-type
fcf6cc3177 Fix problem with wdired test when symlinks cannot be created.
4701e0663e Improve wording of documentation of click events

# Conflicts:
#	lisp/textmodes/sgml-mode.el
#	test/lisp/textmodes/sgml-mode-tests.el
2019-06-25 22:04:13 -04:00
Noam Postavsky
648fdbbcec Don't bind search-spaces-regexp around possible autoload (Bug#35802)
* lisp/isearch.el (isearch-search-fun-default): Move possible autoload
trigger outside let-binding of search-spaces-regexp.
* lisp/char-fold.el (char-fold-make-table): Remove no longer needed
workaround.

* lisp/info.el (Info-search-whitespace-regexp):
* lisp/isearch.el (search-whitespace-regexp):
* src/search.c (syms_of_search) <search-spaces-regexp>: Add warning
about adding capturing groups to the value.

* test/lisp/char-fold-tests.el: Remove, binding search-spaces-regexp
to a different should be considered a bug.
2019-06-25 22:00:03 -04:00
Noam Postavsky
b59ffd2290 Support (rx (and (regexp EXPR) (literal EXPR))) (Bug#36237)
* lisp/emacs-lisp/rx.el (rx-regexp): Allow non-string forms.
(rx-constituents): Add literal constituent, which is like a plain
STRING form, but allows arbitrary lisp expressions.
(rx-literal): New function.
(rx-compile-to-lisp): New variable.
(rx--subforms): New helper function for handling subforms, including
non-constant case.
(rx-group-if, rx-and, rx-or, rx-=, rx->=, rx-repeat, rx-submatch)
(rx-submatch-n, rx-kleene, rx-atomic-p): Use it to handle non-constant
subforms.
(rx): Document new form, wrap non-constant forms with concat call.
* test/lisp/emacs-lisp/rx-tests.el (rx-tests--match): New macro.
(rx-nonstring-expr, rx-nonstring-expr-non-greedy): New tests.
* etc/NEWS: Announce changes.
2019-06-25 22:00:03 -04:00
Noam Postavsky
e62ad04963 Fix sgml-mode handling of quotes within parens (Bug#36347)
* lisp/textmodes/sgml-mode.el (sgml-syntax-propertize): Use
syntax-ppss-table if set.  This is only needed on the release branch,
on master the caller (syntax-propertize) already does this.
(sgml-mode): Set syntax-ppss-table to sgml-tag-syntax-table.  This
correctly classifies parens as punctuation, so they won't confuse the
parser.
* test/lisp/textmodes/sgml-mode-tests.el (sgml-tests--quotes-syntax):
New test copied from master, with two cases added for this bug.
2019-06-25 18:58:23 -04:00
Glenn Morris
bc780a4691 * test/lisp/progmodes/flymake-tests.el (ruby-backend): Skip on hydra.
Another unstable test.
2019-06-25 13:23:15 -07:00
Stefan Monnier
0ef3163959 * lisp/textmodes/tex-mode.el (latex-noindent-commands): New custom var
(latex-find-indent): Obey it.
(latex-noindent-environments): Make it into a defcustom as well.
2019-06-24 19:21:07 -04:00
Michael Albinus
18a7e5414c Improve error handling in Tramp
* lisp/net/tramp-compat.el (ls-lisp): Require.

* lisp/net/tramp.el (ls-lisp-use-insert-directory-program):
Don't declare.
(tramp-current-connection): Adapt docstring.
(tramp-debug-message): Adapt function names.
(tramp-error, tramp-run-real-handler): Let-bind `signal-hook-function'.
(tramp-signal-hook-function): New defun.
(tramp-debug-on-error, tramp-condition-case-unless-debug): Remove.
(tramp-file-name-handler): Handle `tramp-current-connection'.
Let-bind `signal-hook-function'.  Use `unwind-protect' instead of
`tramp-condition-case-unless-debug'.
(tramp-handle-insert-directory): Don't require ls-lisp.
(tramp-process-actions): Check, that
`tramp-password-save-function' is non-nil.
(tramp-equal-remote): Handle the case both files are local.

* test/lisp/net/tramp-tests.el (tramp--test-instrument-test-case):
Do not bind `tramp-debug-on-error'.
(tramp--test-ignore-make-symbolic-link-error): Make error handler
more explicit about the error.
2019-06-24 17:36:00 +02:00
Damien Cassou
7022e3fde6
Refactoring of auth-source-pass
* lisp/auth-source-pass.el (auth-source-pass--find-match): Refactor by
moving some code to auth-source-pass--disambiguate.
(auth-source-pass--disambiguate)
(auth-source-pass--entries-matching-suffix): New function.
(auth-source-pass--find-match-unambiguous)
(auth-source-pass--select-from-entries)
(auth-source-pass--entry-reducer): Refactor to simplify and improve
logging.
(auth-source-pass--matching-entries)
(auth-source-pass--accumulate-matches): Remove.
* test/lisp/auth-source-pass-tests.el: Complete rewrite to facilitate
maintenance.
(auth-source-pass--have-message-containing): Remove.
(auth-source-pass--have-message-matching)
(auth-source-pass--explain--have-message-matching)
(auth-source-pass--explain-match-entry-p)
(auth-source-pass--includes-sorted-entries)
(auth-source-pass--explain-includes-sorted-entries)
(auth-source-pass--explain-match-any-entry-p)
(auth-source-pass--matching-entries)
(auth-source-pass-match-entry-p)
(auth-source-pass-match-any-entry-p): New function.
2019-06-24 09:15:41 +02:00
Keith Amidon
0a580c187d
Minimize entry parsing in auth-source-pass
Prior to this commit, while searching for the most applicable entry
password-store entries were decrypted and parsed to ensure they were
valid.  The entries were parsed in the order they were found on the
filesystem and all applicable entries would be decrypted and parsed,
which varied based on the contents of the password-store and the entry
to be found.

This is fine when the GPG key is cached and each entry can be
decrypted without user interaction.  However, for security some people
have their GPG on a hardware token like a Yubikey setup so that they
have to touch a sensor on the toke for every cryptographic operation,
in which case it becomes inconvenient as each attempt to find an entry
requires a variable number of touches of the hardware token.

The implementation already assumes that names which contain more of
the information in the search key should be preferred so there is an
ordering of preference of applicable entries.  If the decrypt and
parsing is removed from the initial identification of applicable
entries in the store then in most cases a single decrypt and parse of
the most preferred entry will suffice, improving the experience for
hardware token users that require interaction with the token.

This commit implements that strategy.  It is in spirit a refactor of
the existing code.

* lisp/auth-source-pass.el (auth-source-pass--matching-entries): New
function, generate an ordered list of regular expression matchers for
all possible names that could be in the password-store for the entry
to be found and then makes a pass over the password-store entry names
accumulating the matching entries in a list after the regexp that
matched.  This implementation ensures the password-store entry list
still only has to be scanned once.
(auth-source-pass--find-match-unambiguous): Use it to obtain candidate
entries and then parse them one by one until an entry containing the
desired information is located.  When complete, return the parsed data
of the entry instead of the entry name so that the information can be
used directly to construct the auth-source response.
(auth-source-pass--build-result): Update accordingly.
(auth-source-pass--find-match): Update docstring accordingly.
(auth-source-pass--select-one-entry)
(auth-source-pass--entry-valid-p)
(auth-source-pass--find-all-by-entry-name)
(auth-source-pass--find-one-by-entry-name): Remove.
(auth-source-pass--select-from-entries)
(auth-source-pass--accumulate-matches)
(auth-source-pass--entry-reducer)
(auth-source-pass--generate-entry-suffixes)
(auth-source-pass--domains)
(auth-source-pass--name-port-user-suffixes): New functions.

* test/lisp/auth-source-pass-tests.el: One test case was added to the
test suite to verify that only the minimal number of entries are
parsed in common cases.  The
auth-source-pass-only-return-entries-that-can-be-open test case had to
be re-implemented because the function it was used eliminated as the
functionality is provided elsewhere.  All the other fairly substantial
changes to the test suite are the result of mechanical changes that
were required to adapt to auth-source-pass--find-match returning the
data from a parsed password-store entry instead of the entry name.
2019-06-24 09:15:40 +02:00
Keith Amidon
94c9eb81b8
Fix auth-source-pass to search for hostname:port/username
auth-source-pass supports entries with username either prefixed to the
hostname with an @ as separator or in a subdirectory under the
hostname.  This was true when there was no port or service included in
the name, but got broken with the introduction of
auth-source-pass-port-separator.

* lisp/auth-source-pass.el (auth-source-pass--find-match-unambiguous): Fix
to match hostname:port/username.
* test/lisp/auth-source-pass-tests.el: Add corresponding tests.
2019-06-24 09:15:40 +02:00
Iku Iwasa
2a0a05789d
Add auth-source-pass-port-separator option
* lisp/auth-source-pass.el (auth-source-pass-port-separator): New
option to specify separator between host and port, default to
colon (":").
(auth-source-pass--find-match-unambiguous): Adapt to make use of the
new variable.
* test/lisp/auth-source-pass-tests.el: Add corresponding tests.
2019-06-24 09:15:40 +02:00
Magnus Henoch
527efaf798
Fix auth-source-pass to return nil if no entry found
* lisp/auth-source-pass.el (auth-source-pass-search): If there is no
matching entry, auth-source-pass-search should return nil, not (nil).
This lets auth-source fall back to other backends in the auth-sources
list.
* test/lisp/auth-source-pass-tests.el: Add corresponding test.

Copyright-paperwork-exempt: yes
2019-06-24 09:15:39 +02:00
Mattias Engdegård
866f527ddf Optional space and unit in `file-size-human-readable' (bug#35756)
To improve readability of strings produced by
`file-size-human-readable', add two optional arguments:

- SPACE, to provide a string (typically a space or non-breaking space)
to put between the number and unit.  For compatibility, the default is
an empty string.

- UNIT, a string to use as unit.  For compatibility, the default is
"B" in `iec' mode and the empty string otherwise.

Also fix a glitch with small numbers in `iec' mode which caused a
stray "i" in the result.

* lisp/files.el (file-size-human-readable):
Add optional SPACE and UNIT arguments and handle small numbers correctly.
(files--ask-user-about-large-file, warn-maybe-out-of-memory):
Call with `iec' and space.
* test/lisp/files-tests.el (files-test-file-size-human-readable): New test.
* lisp/url/url-http.el (url-http-simple-after-change-function)
(url-http-content-length-after-change-function): Call with `iec' and space.
* etc/NEWS (Lisp Changes): Mention the change.
2019-06-23 20:30:50 +02:00
Simen Heggestøyl
abf7d0d802 Split up and add tests for two page.el functions
* lisp/textmodes/page.el (page--count-lines-page): New function
extracted from `count-lines-page'.
(count-lines-page): Extract main logic into `page--count-lines-page'.
(page--what-page); New function extracted from `what-page'.
(what-page): Extract main logic into `page--what-page'.

* test/lisp/textmodes/page-tests.el (page-tests-count-lines-page)
(page-tests-what-page): New tests for `page--count-lines-page' and
`page--what-page'.  (Bug#36009)
2019-06-23 07:27:19 +02:00
Allen Li
2db75262c7 Fix defining inverse abbrevs on previous words (Bug#36243)
* lisp/abbrev.el (inverse-add-abbrev): Skip trailing nonword
characters when defining abbrev.

* test/lisp/abbrev-tests.el (abbrev-edit-save-to-file-test): Add
regression tests.
2019-06-22 19:25:44 -04:00
Noam Postavsky
0f01a58c39 Fix python docstring auto-fill (Bug#36056)
* lisp/progmodes/python.el (python-mode): Set
fill-indent-according-to-mode locally to t.  This lets auto-fill do
the right thing when auto-filling inside a docstring.  The default was
to nil on 2001-11-25 "(fill-indent-according-to-mode): Default to nil"
with the comment that it "screws up CC-mode's filling tricks".  But
presumably it shouldn't be a problem for python-mode.
* test/lisp/progmodes/python-tests.el (python-auto-fill-docstring):
New test.
2019-06-22 19:25:44 -04:00
Noam Postavsky
f46b16b9fb Make rcirc parsing more RFC2812 compliant (Bug#36233)
Do continue to allow multiple spaces between arguments, even though
that is technically not allowed by the RFC.
* lisp/net/rcirc.el (rcirc-process-server-response-1): Fix parsing of
arguments which contain colons.
* test/lisp/net/rcirc-tests.el: New test.
2019-06-22 19:25:44 -04:00
Stefan Kangas
5a96936520 Add tests for mail/flow-fill.el
* test/lisp/mail/flow-fill-tests.el: New file.
* lisp/mail/flow-fill.el (fill-flowed-encode-tests)
(fill-flowed-test): Make obsolete.  (Bug#36174)
2019-06-22 12:15:40 +03:00
Lars Ingebrigtsen
31b1e4cbdc Throughout cedet, don't use semantic-overlay-* compat aliases 2019-06-20 12:51:39 +02:00
Mattias Engdegård
d3a7f3e6cd Compile any subsequence of `cond' clauses to switch (bug#36139)
A single `cond' form can how be compiled to any number of switch ops,
optionally interspersed with non-switch conditions.
Previously, switch ops would only be used for whole `cond' forms
containing no other tests.

* lisp/emacs-lisp/bytecomp.el (byte-compile--cond-vars):
Rename from `byte-compile-cond-vars'.
(byte-compile--default-val): Remove.
(byte-compile--cond-switch-prefix):
Replace `byte-compile-cond-jump-table-info'; now also returns
trailing non-switch clauses.
(byte-compile-cond-jump-table): New arguments; no longer compiles
the default case.
(byte-compile-cond): Look for and compile switches at any place in the
list of clauses.
* test/lisp/emacs-lisp/bytecomp-tests.el (byte-opt-testsuite-arith-data):
Add test expression.
2019-06-19 11:22:21 +02:00
Mattias Engdegård
14a81524c2 Compile cond with heterogeneous tests into switch (bug#36139)
Allow any mixture of `eq', `eql' and `equal', `memq', `memql' and
`member' in a switch-like `cond' to be compiled into a single switch.

* lisp/emacs-lisp/bytecomp.el (byte-compile--common-test): New.
(byte-compile-cond-jump-table-info): Use most specific common test.
* test/lisp/emacs-lisp/bytecomp-tests.el (byte-opt-testsuite-arith-data):
Add test cases for multi-value clause cond forms.
2019-06-19 11:20:59 +02:00
Mattias Engdegård
b8c74742c0 Tighter pcase or-pattern member function selection (bug#36139)
* lisp/emacs-lisp/pcase.el (pcase--u1):
Use the most specific of `memq', `memql' and `member' in or-patterns
with constant cases.  This improves performance and may help the byte-code
compiler generate a switch.
* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-member):
Add mixed-type or-pattern test cases.
2019-06-19 11:20:58 +02:00
Juanma Barranquero
81535eeadb * test/lisp/progmodes/python-tests.el (python-virt-bin): Doc fix. 2019-06-17 03:12:45 +02:00
Juanma Barranquero
9d48979ca8 Fix Python tests depending on system-type
* test/lisp/progmodes/python-tests.el (python-virt-bin): New function.
(python-shell-calculate-exec-path-2)
(python-shell-calculate-exec-path-3)
(python-shell-calculate-exec-path-4)
(python-shell-with-environment-1, python-shell-with-environment-2):
Use it.
2019-06-17 02:48:21 +02:00
Glenn Morris
78a609d454 Disable filling of warnings in a bytecomp test
* test/lisp/emacs-lisp/bytecomp-tests.el (test-suppression):
Disable filling rather than working around it.
2019-06-16 17:37:21 -07:00
Juanma Barranquero
fcf6cc3177 Fix problem with wdired test when symlinks cannot be created.
* test/lisp/wdired-tests.el (wdired-test-symlink-name):
Skip test if 'make-symbolic-link' fails for whatever reason;
that's not what's being tested.
2019-06-16 21:57:44 +02:00
Alan Third
beb572a7dd Revert "Simplify image transforms"
This reverts commit cf3081d208.

; Pushed in error.
2019-06-16 20:46:42 +01:00
Alan Third
cf3081d208 Simplify image transforms
* src/image.c: (image_set_rotation, image_set_size,
image_set_transform): Combine into image_set_transform.
(image_set_crop): Remove function.
(lookup_image): Remove calls to removed functions and remove
transform_matrix.
* test/manual/image-transforms-tests.el (test-cropping): Remove
function.
(test-transforms): Remove reference to test-cropping.
2019-06-16 20:24:53 +01:00
Alan Third
11b0e33462 Document image transforms
* doc/lispref/display.texi (Image Descriptors): Document :crop and
update :rotation.
* src/image.c: Describe the image transform matrix layout.
* test/manual/image-transforms-tests.el: New file.
2019-06-16 20:24:53 +01:00
Michael Albinus
f87a9e359e Fix accidential change in tramp-tests; do not merge with master
* lisp/net/trampver.el: Change version to "2.3.5.26.3".
(customize-package-emacs-version-alist): Add Tramp version
integrated in Emacs 26.3.

* test/lisp/net/tramp-tests.el (tramp-test42-auto-load):
Add skip for w32.
2019-06-15 21:38:11 +02:00
Glenn Morris
30e3e58c1b Merge from origin/emacs-26
7a8f22b * test/lisp/url/url-file-tests.el (url-file): Use file:///, n...
0c5f6c6 Fix doc of srecompile-compile-split-code (Bug#36200)
2019-06-15 09:50:33 -07:00
Lars Ingebrigtsen
fcb3821ad5 Also test unpacking 2019-06-15 16:10:28 +02:00
Lars Ingebrigtsen
f03343747e Refactor for reuse 2019-06-15 16:06:38 +02:00
Lars Ingebrigtsen
60a6992ae3 New file to test bindat functions 2019-06-15 15:57:01 +02:00
Michael Albinus
38a86a4c49 Some changes in process output read of Tramp
* lisp/net/tramp.el (tramp-handle-file-notify-rm-watch):
Read pending output.

* test/lisp/net/tramp-tests.el (tramp-test31-interrupt-process):
Use a timeout when reading process output.
2019-06-15 11:33:16 +02:00
Michael Albinus
7d71d0b13d Tag remote autorevert tests as unstable
* test/lisp/autorevert-tests.el (auto-revert--timeout):
Derive value from `auto-revert-interval'.
(auto-revert--deftest-remote): Tag it as `:unstable'.
(auto-revert-test05-global-notify, auto-revert-test06-write-file):
Suppress final newline.  Use `auto-revert--timeout'.
2019-06-15 11:08:05 +02:00
Juanma Barranquero
200f63cfa5 tramp-test42-auto-load: Add expected-result.
* test/lisp/net/tramp-tests.el (tramp-test42-auto-load):
Expect a failed result if remote file access is not enabled,
as it happens while doing the test on Windows.
2019-06-15 07:23:25 +02:00
Juanma Barranquero
7a8f22b004 * test/lisp/url/url-file-tests.el (url-file): Use file:///, not file://. 2019-06-15 05:29:03 +02:00
Michael Albinus
0518e3ca98 Fix problem in remote file notification
* lisp/net/tramp-sh.el (tramp-sh-gio-monitor-process-filter)
(tramp-sh-gvfs-monitor-dir-process-filter)
(tramp-sh-inotifywait-process-filter): Do not kill the process.
Let `file-notify-rm-watch' do the job.

* test/lisp/filenotify-tests.el (file-notify-test03-events)
(file-notify-test05-file-validity)
(file-notify-test09-watched-file-in-watched-dir): Do not
special-case remote files.
2019-06-14 19:45:00 +02:00
Eli Zaretskii
746d42f52b Remove failing test erroneously added in backport
* test/src/thread-tests.el (threads-test-bug33073): Remove
test which cannot work on the emacs-26 branch.  Do not merge
to master.  Reported by Juanma Barranquero <lekktu@gmail.com>.
2019-06-14 09:40:40 +03:00
Glenn Morris
5e09ace074 Stop a tramp test leaving a file behind
* test/lisp/net/tramp-tests.el
(tramp-test10-write-region-file-precious-flag):
Avoid leaving a backup file after we are done.
2019-06-13 20:24:41 -04:00
Glenn Morris
4c3e78a9f4 Allow for line breaks in a bytecomp test
* test/lisp/emacs-lisp/bytecomp-tests.el (test-suppression):
Warnings from the byte compiler may be filled.
2019-06-12 19:31:00 -07:00
Lars Ingebrigtsen
c25e3754ed Add more ps-mode octal tests
* test/lisp/progmodes/ps-mode-tests.el
(ps-mode-test-octal-region-multibyte): New test.
2019-06-13 03:03:26 +02:00
Lars Ingebrigtsen
5b7ec43c61 Add ps-mode-tests.el and remove a compilation warning
* lisp/progmodes/ps-mode.el (ps-mode-octal-region): Remove a
string-make-unibyte that apparently had no effect here.
* test/lisp/progmodes/ps-mode-tests.el: New file.
2019-06-13 02:48:41 +02:00
Lars Ingebrigtsen
73ab8f4b8c New file rfc2104-tests.el
* test/lisp/net/rfc2104-tests.el: New file to test rfc2104 hashes.
2019-06-13 01:53:58 +02:00
Glenn Morris
e2e63dc3f0 Give more information in a bytecomp test failure
* test/lisp/emacs-lisp/bytecomp-tests.el (test-suppression):
More informative failure messages.
2019-06-12 16:49:06 -07:00
Lars Ingebrigtsen
f2071b6de4 Add the new macro with-suppressed-warnings
* lisp/emacs-lisp/byte-run.el (with-suppressed-warnings): New macro.

* doc/lispref/compile.texi (Compiler Errors): Document
with-suppressed-warnings and deemphasise with-no-warnings
slightly.

* lisp/emacs-lisp/bytecomp.el (byte-compile--suppressed-warnings):
New internal variable.
(byte-compile-warning-enabled-p): Heed
byte-compile--suppressed-warnings, bound via with-suppressed-warnings.
(byte-compile-initial-macro-environment): Provide a macro
expansion of with-suppressed-warnings.
(byte-compile-file-form-with-suppressed-warnings): New byte hunk
handler for the suppressed symbol machinery.
(byte-compile-suppressed-warnings): Ditto for the byteop.
(byte-compile-file-form-defmumble): Ditto.
(byte-compile-form, byte-compile-normal-call)
(byte-compile-normal-call, byte-compile-variable-ref)
(byte-compile-set-default, byte-compile-variable-set)
(byte-compile-function-form, byte-compile-set-default)
(byte-compile-warn-obsolete, byte-compile--declare-var): Pass the
symbol being warned in to byte-compile-warning-enabled-p.

* test/lisp/emacs-lisp/bytecomp-tests.el (test-suppression): New
function.
(bytecomp-test--with-suppressed-warnings): Tests.
2019-06-12 15:59:19 +02:00
Mattias Engdegård
e92dac3434 Keep auto-revert-mode working when changing buffer file name (bug#36159)
* lisp/autorevert.el (after-set-visited-file-name-hook):
Add unconditionally.
(global-auto-revert-mode): Don't use
`after-set-visited-file-name-hook' here.
(auto-revert-set-visited-file-name): Rename from
`auto-revert--global-set-visited-file-name' and generalise.
* test/lisp/autorevert-tests.el (auto-revert-test06-write-file): New.
2019-06-11 22:15:38 +02:00
Michael Albinus
2b8f9ded06 Minor fixes on tramp-tests.el for w32
* test/lisp/net/tramp-tests.el (tramp-test32-shell-command):
Ignore absence of tput.
(tramp-test43-asynchronous-requests): Don't start watchdog on w32.
2019-06-11 20:28:31 +02:00
Noam Postavsky
0026d0bf9f Don't keep warning about unescaped literals (Bug#36068)
* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Restore lost
let-binding of lread--unescaped-character-literals, so that unescaped
literals warning will only apply to the form just read.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--unescaped-char-literals): Expand test to check that
we don't keep warning about old unescaped literals.
2019-06-10 18:27:22 -04:00
Michael Albinus
03b66d23a8 Make tramp-test43-asynchronous-requests working, again
* test/lisp/net/tramp-tests.el (tramp-list-tramp-buffers):
Declare `tramp-list-tramp-buffers'.
(tramp--test-ignore-make-symbolic-link-error)
(tramp--test-ignore-add-name-to-file-error): Improve declaration.
(tramp--test-with-proper-process-name-and-buffer): New macro.
(tramp-test43-asynchronous-requests): Use the macro for timer,
process filter and process sentinel.  Comment the remote file
operation in the timer.  Remove further async events.  Accept
output from all processes.
2019-06-10 17:53:15 +02:00
Eli Zaretskii
fdd1b3e020 Avoid assertion violation when comparing with main-thread
* src/thread.c (unmark_main_thread): New function.
* src/lisp.h (unmark_main_thread): Prototype it.
* src/alloc.c (garbage_collect_1): Call it after sweeping.
(Bug#33073)

* test/src/thread-tests.el (threads-test-bug33073): New test.
2019-06-10 12:52:31 +02:00
Mattias Engdegård
f2e4c34de6 Fix copy-paste error in autorevert-test
* test/lisp/autorevert-tests.el: Use correct name to define a remote test.
2019-06-10 12:44:26 +02:00
Stefan Kangas
4503310cac Add tests for mail/uudecode.el
* lisp/mail/uudecode.el: Remove redundant :group usage.
* test/lisp/mail/uudecode-resources/uudecoded.txt,
test/lisp/mail/uudecode-resources/uuencoded.txt,
test/lisp/mail/uudecode-tests.el: New files.
2019-06-09 17:07:09 -07:00
Stefan Kangas
1af27a1784 Use lexical-binding in password-cache.el and add tests
* lisp/password-cache.el: Use lexical-binding.
* test/lisp/password-cache-tests.el: New file.
2019-06-09 10:08:36 -07:00
Stefan Kangas
b7e26952f0 Fix TODO to convert defvar with leading '*' to defcustom
* etc/TODO: Remove done TODO to remove '*' from defvar.
* doc/misc/gnus.texi: Remove leading '*' from defvar example.
* lisp/kermit.el (kermit-esc-char): Convert to defcustom.
* lisp/desktop.el (desktop-header):
* lisp/obsolete/cc-compat.el (c-indent-level)
(c-brace-imaginary-offset, c-brace-offset, c-argdecl-indent)
(c-label-offset, c-continued-statement-offset)
(c-continued-brace-offset): Remove leading '*' from docstring.
* lisp/progmodes/dcl-mode.el: Remove leading '*' from docstring in
comment.
* test/manual/cedet/tests/test.el: Add comment asking if example of
defvar with leading '*' should be removed.
(Bug#35994)  (The previous commit is also for the same bug.)
2019-06-09 10:08:33 +03:00
Stefan Kangas
e40f1c68b5 Use lexical-binding in underline.el and add tests
* lisp/textmodes/underline.el: Use lexical-binding.
* test/lisp/textmodes/underline-tests.el: New file.
(Bug#36063)
2019-06-09 09:56:03 +03:00
Pierre Téchoueyres
7541b06872 Add support for base64url variant of base-64 encoding/decoding
Implement the RFC4648 variant of base64 encoding used by URLs.
* doc/lispref/text.texi (base64url-encode-region,
base64url-encode-string): Document new functions.
(base64-decode-region, base64-decode-string): Document new optional
parameter 'base64url' used to use url variant when decoding data.

* src/fns.c (base64url-encode-region, base64url-encode-region): New
functions to manage url variant.
(base64-decode-region, base64-decode-string): Add optional
parameter to indicate use of url-variant.
(base64_encode_region_1, base64_encode_string_1): Internal functions
with extracted code from 'base64_encode_region' and
'base64_encode_string' and optional parameters to manage padding and
url variant.
(base64-encode-region, base64-encode-string) : Use
base64_encode_region_1 and base64_encode_string_1.
(base64-encode-1): Add parameters to manage padding and url variant.
(base64-decode-1): Add parameter to manage url variant.

* test/src/fns-tests.el (fns-tests--with-region): New helper macro to
test region variant of base64 encode / decode functions.
(fns-tests--string-repeat): Helper function used in base64 tests.
(fns-tests-base64-encode-region, fns-tests-base64-encode-string):
Tests for standard base64 function.
(fns-test-base64url-encode-region,
fns-test-base64url-encode-string): Tests for url variant.
(fns-tests-base64-decode-string): Tests for decoding part.
2019-06-08 10:49:35 +03:00
Eli Zaretskii
e5bc9a32b6 Fix failures of term-tests on MS-Widows
* test/lisp/term-tests.el (term-simple-lines)
(term-carriage-return, term-line-wrap, term-cursor-movement)
(term-scrolling-region, term-set-directory)
(term-line-wrapping-then-motion, term-to-margin): Skip tests
on MS-Windows and MS-DOS.
2019-06-07 12:01:11 +03:00
Noam Postavsky
a14eb43215 Add "pin" to password-word-equivalents (Bug#35523)
* lisp/international/mule-conf.el (password-word-equivalents): Add "pin".
* test/lisp/comint-tests.el (comint-testsuite-password-strings): Add
test case.
2019-06-06 19:29:42 -04:00