| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
test/src/editfns-tests.el (editfns-tests--insert-via-replace): New test
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Swap the role of `replace-region-contents` and `replace-buffer-contents`,
so `replace-region-contents` is the main function, implemented in C,
and `replace-buffer-contents` is a mere wrapper (marked as obsolete).
Also remove the need to rely on narrowing and on describing the
new text as a function.
Finally, allow MAX-SECS==0 to require a cheap replacement, and
add an INHERIT argument.
* src/editfns.c: Include `coding.h`.
(Freplace_region_contents): Rename from `Freplace_buffer_contents`.
Change calling convention to that of `replace-region-contents`.
Add more options for the SOURCE argument. Add INHERIT argument.
Skip the costly algorithm if MAX-SECS is 0.
* src/insdel.c (replace_range): Allow NEW to be a buffer.
* lisp/subr.el (replace-buffer-contents): New implementation.
* lisp/emacs-lisp/subr-x.el (replace-region-contents): Delete.
* doc/lispref/text.texi (Replacing): Document new API for
`replace-region-contents`. Remove documentation of
`replace-buffer-contents`.
* test/src/editfns-tests.el (replace-buffer-contents-1)
(replace-buffer-contents-2, replace-buffer-contents-bug31837):
Use `replace-region-contents`.
(editfns--replace-region): Delete.
(editfns-tests--replace-region): Use `replace-region-contents`.
Adds tests for new types of SOURCE args.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use `replace_range` rather than `delete+insert`.
* src/insdel.c (replace_range): Allow NEW to specify a chunk
of buffer text.
* src/editfns.c (Freplace_buffer_contents): Use it.
* test/src/editfns-tests.el (replace-buffer-contents-1): Remove
incorrect check which happened to succeed because point was not
preserved carefully enough. Make the replacement text share a bit
more content to make the test a bit more strict.
(editfns-tests--replace-region): Doesn't fail any more.
|
|
|
|
|
| |
This test fails, sadly, because `replace-buffer-contents` is not
careful enough to something like `replace_range`.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When `len1_byte == len2_byte`, the code presumed that len1==len2
as well in its handling of text-properties. Fix that case.
While at it, try and reduce code duplication by hoisting common
code out of `if`s, and throw away the optimization for `len_mid == 0`
which only saved 3 trivial function calls.
* src/editfns.c (Ftranspose_regions): Shuffle the code a bit.
* test/src/editfns-tests.el (editfns-tests--transpose-equal-but-not):
New test.
|
| |
|
| |
|
|
|
|
|
| |
This reverts commit c941b94e51f4e5996718416ac908249cb71da1d9.
It was pushed by mistake.
|
| |
|
|
|
|
| |
Run "TZ=UTC0 admin/update-copyright".
|
|
|
|
|
| |
* test/src/editfns-tests.el
(editfns-tests--before/after-change-functions): Fix whitespace.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For `en/decode-coding-string/region`, `after-change-functions`
were either not run at all, or run only after deleting the text
but not after inserting it.
* src/coding.c (decode_coding_object, encode_coding_object): Run the
after-change-functions after inserting the result.
* test/src/editfns-tests.el (sanity-check-change-functions-with-op):
New macro.
(sanity-check-change-functions-errors): New function.
(editfns-tests--before/after-change-functions): Use them to add
cases for `en/decode-coding-string/region`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/search.c (Freplace_match): For ordering of *-change-functions.
* test/src/editfns-tests.el
(editfns-tests--before/after-change-functions): New test.
(sanity-check--message, sanity-check-change-functions-error)
(sanity-check-change-functions-check-size)
(sanity-check-change-functions-before)
(sanity-check-change-functions-after): New functions.
(sanity-check--verbose, sanity-check-change-functions-beg)
(sanity-check-change-functions-end)
(sanity-check-change-functions-buffer-size)
(sanity-check-change-functions-errors): New vars.
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65 ; Minor fixes related to copyright years
23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5 ; Add 2022 to copyright years.
# Conflicts:
# etc/NEWS
# etc/refcards/ru-refcard.tex
# lib/cdefs.h
# lisp/erc/erc-dcc.el
# lisp/erc/erc-imenu.el
# lisp/erc/erc-replace.el
# lisp/image-dired.el
# lisp/progmodes/xref.el
# m4/alloca.m4
# m4/byteswap.m4
# m4/errno_h.m4
# m4/getopt.m4
# m4/gnulib-common.m4
# m4/inttypes.m4
# m4/stddef_h.m4
# m4/stdint.m4
# m4/sys_socket_h.m4
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/ert.el (ert-equal-including-properties): Make
into obsolete function alias for 'equal-including-properties'.
* test/src/editfns-tests.el (format-properties):
* test/lisp/emacs-lisp/ert-x-tests.el (ert-propertized-string)
(ert-test-run-tests-interactively-2): Don't use above obsolete
name.
(ert--explain-equal-including-properties-rec): New function.
(ert--explain-equal-including-properties): Use as an explainer for
'equal-including-properties' now that Bug#6581 is fixed.
* test/lisp/emacs-lisp/ert-tests.el
(ert-test-explain-equal-string-properties): Expand test.
(ert-test-equal-including-properties): Merge test into above
expanded test.
|
| |
|
|
|
|
|
|
|
| |
* src/editfns.c (Fpropertize): Improve error message.
(syms_of_editfns) <Qpropertize>: New DEFSYM.
* test/src/editfns-tests.el
(propertize/error-wrong-number-of-args): New test.
|
|
|
|
|
|
|
|
| |
* src/editfns.c (styled_format): Fix accounting for text
properties that come from the format string. (Bug#46317)
* test/src/editfns-tests.el (format-properties): Add new tests for
bug#46317.
|
|
|
|
| |
Run "TZ=UTC0 admin/update-copyright".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* test/lib-src/emacsclient-tests.el:
* test/lisp/emacs-lisp/hierarchy-tests.el:
* test/lisp/eshell/eshell-tests.el:
* test/lisp/gnus/gnus-util-tests.el:
* test/lisp/progmodes/js-tests.el:
* test/lisp/textmodes/bibtex-tests.el:
* test/src/editfns-tests.el:
* test/src/fns-tests.el: Use lexical-binding.
* test/lisp/emacs-lisp/hierarchy-tests.el
(hierarchy-leafs-includes-lonely-roots):
* test/src/editfns-tests.el (transpose-test-get-byte-positions):
* test/src/fns-tests.el (fns-tests-func-arity):
Adjust for lexical-binding.
|
| |
|
|
|
|
| |
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
|
|
|
|
|
|
|
| |
Problem reported by Paul Pogonyshev (Bug#38191).
* src/editfns.c (styled_format): When checking for adjacent
%-sequences, use byte position rather than character position.
* test/src/editfns-tests.el (format-properties): Test for fix.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
| |
(python-tests--python-nav-end-of-statement--infloop): Disable.
|
|
|
|
|
|
|
|
|
|
| |
* etc/NEWS:
* src/editfns.c (Fformat, binary_as_unsigned):
Update now that we always have bignums.
(syms_of_editfns) [!defined lisp_h_FIXNUMP]: Remove now-obsolete
code, since lisp_h_FIXNUMP is always defined now.
* test/src/editfns-tests.el (read-large-integer): Simplify,
now that we can assume binary-as-unsigned defaults to nil.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also, clean up the code a bit.
Actually I discovered the bug while cleaning up the code.
* src/editfns.c (Fsubst_char_in_region)
(Ftranslate_region_internal): Use bool for booleans.
(Ftranslate_region_internal): Fix off-by-1 bug when a
translation table translates the maximum char. Assume C99
decl-after-statement, similar minor cleanups.
* test/src/editfns-tests.el (test-translate-region-internal):
New test.
|
|\
| |
| |
| |
| |
| | |
2fcf2df Fix copyright years by hand
26bed8b Update copyright year to 2019
2814292 Fix value of default frame height. (Bug#33921)
|
| |
| |
| |
| | |
Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
|
| | |
|
| |
| |
| |
| | |
Make more portable and hopefully more robust using getent. (Bug#33195)
|
| |
| |
| |
| | |
Do not assume user 1000 has group name = user name.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* src/editfns.c (Fgroup_name): Fix the doc string. Move
closer to the "group" functions.
* src/w32.c (getgrgid): Return NULL if GID is not the group ID
of the user of this Emacs session
* test/src/editfns-tests.el (test-group-name): Rename from
'group-name'. Add tests for non-Posix hosts. Test error when
the argument to group-name is invalid.
* etc/NEWS: Fix wording of last added entry.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This does not change behavior; it’s just long-overdue
refactoring (Bug#32902).
* src/emacs.c (main): Call init_timefns, syms_of_timefns.
* src/timefns.c: New file, containing timestamp-related stuff
from editfns.c and sysdep.c.
* src/Makefile.in (base_obj): Add timefns.o.
* src/editfns.c: Simplify by moving a big chunk to timefns.c.
Do not include systime.h, sys/resource.h, sys/param.h,
strftime.h, coding.h.
(HAVE_TZALLOC_BUG, TM_YEAR_BASE, HAVE_TM_GMTOFF, tzeqlen)
(local_tz, utc_tz, emacs_localtime_rz, emacs_mktime_z)
(invalid_time_zone_specification, xtzfree, tzlookup)
(TIME_T_MIN, TIME_T_MAX, time_overflow, invalid_time)
(check_time_validity, hi_time, lo_time, Fcurrent_time)
(time_add, time_subtract, time_arith, Ftime_add)
(Ftime_subtract, Ftime_less_p, Fget_internal_run_time)
(make_lisp_time, disassemble_lisp_time, decode_float_time)
(lisp_to_timespec, lisp_time_struct, lisp_time_argument)
(lisp_seconds_argument, Ffloat_time, emacs_nmemftime)
(Fformat_time_string, format_time_string, Fdecode_time)
(check_tm_member, Fencode_time, Fcurrent_time_string)
(tm_gmtoff, Fcurrent_time_zone, Fset_time_zone_rule)
(emacs_getenv_TZ, emacs_setenv_TZ): Move to timefns.c.
* src/emacs.c (main): Adjust to initialization changes.
* src/sysdep.c: Include <sys/resource.h> if it's present.
Regularize includes a bit.
(Fget_internal_run_time): Move here from editfns.c.
(init_timefns, syms_of_timefns): New functions.
* src/w32.h (w32_get_internal_run_time): Move decl here
so that it need not be cloned.
* test/src/editfns-tests.el:
* test/src/editfns-tests.el (format-time-string-with-zone)
(format-time-string-with-outlandish-zone)
(editfns-tests--have-leap-seconds)
(format-time-string-with-bignum-on-32-bit):
Move to ...
* test/src/timefns-tests.el: ... this new file.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The problem can occur on 32-bit platforms with current timestamps.
* src/editfns.c (disassemble_lisp_time, decode_time_components):
Support seconds counts that are bignums.
* test/src/editfns-tests.el (editfns-tests--have-leap-seconds):
New function.
(format-time-string-with-bignum-on-32-bit): New test.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* src/bignum.c: Include stdlib.h, for abs.
(bignum_bufsize, bignum_to_c_string): New functions.
* src/bignum.c (bignum_to_string):
* src/print.c (print_vectorlike): Use them.
* src/editfns.c (styled_format): Instead of having a separate
buffer for sprintf (which does not work for bignums), just append
to the main buffer. When formatting bignums, add support for the
standard integer flags -, #, 0, + and space. Fix some comments.
Capitalize properly when formatting bignums with %X. Use
functions like c_isdigit rather than reinventing the wheel.
Simplify computation of excess precision.
* src/print.c: Do not include bignum.h; no longer needed.
(print_vectorlike): Avoid recalculating string length.
* test/src/editfns-tests.el (format-bignum):
Test some of the above fixes.
|
|\ \ |
|
| |\ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* src/editfns.c (styled_format): Handle bignums.
* test/src/editfns-tests.el (read-large-integer): Update.
(format-bignum): New test.
|
|\ \ \ \
| |_|/ /
|/| | /
| | |/
| |/|
| | |
| | |
| | |
| | | |
71c92d8 Fix copying text properties by 'format'
96be6b6 Improve error messages regarding initial-buffer-choice (Bug#2...
00fb127 * test/lisp/wdired-tests.el (wdired-test-unfinished-edit-01):...
Conflicts:
lisp/startup.el
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* src/editfns.c (styled_format): Add the spec beginning index
to the info recorded for each format spec, and use it to
detect the case that a format spec and its text property end
where the next spec with another property begins. (Bug#32404)
* test/src/editfns-tests.el (format-properties): Add tests for
bug#32404.
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Optionally treat integers as signed numbers with %o
and %x format specifiers, instead of treating them as
a machine-dependent two’s complement representation.
This option is more machine-independent, allows formats
like "#x%x" to be useful for reading later, and is
better-insulated for future changes involving bignums.
Setting the new variable ‘binary-as-unsigned’ to nil
enables the new behavior (Bug#32252).
This is a simplified version of the change proposed in:
https://lists.gnu.org/r/emacs-devel/2018-07/msg00763.html
I simplified that proposal by omitting bitwidth modifiers, as
I could not find an any example uses in the Emacs source code
that needed them and doing them correctly would have been
quite a bit more work for apparently little benefit.
* doc/lispref/strings.texi (Formatting Strings):
Document that %x and %o format negative integers in a
platform-dependent way. Also, document how to format
numbers so that the same values can be read back in.
* etc/NEWS: Document the change.
* src/editfns.c (styled_format): Treat integers as signed
numbers even with %o and %x, if binary-as-unsigned is nil.
Support the + and space flags with %o and %x, since they’re
about signs.
(syms_of_editfns): New variable binary-as-unsigned.
* test/src/editfns-tests.el (read-large-integer):
Test that maximal integers can be read after printing
with all integer formats, if binary-as-unsigned is nil.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem reported by Paul Pogonyshev (Bug#31938).
* src/editfns.c: Include math.h, for trunc.
(styled_format): For %d, truncate floating-point numbers and
convert -0 to 0, going back to how Emacs 26 did things.
* doc/lispref/strings.texi (Formatting Strings):
Document behavior of %o, %d, %x, %X on floating-point numbers.
* src/floatfns.c (trunc) [!HAVE_TRUNC]: Rename from emacs_trunc
and make it an extern function, so that editfns.c can use it.
All callers changed.
* test/src/editfns-tests.el (format-%d-float): New test.
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
63ba73a Fix documentation of ':propertize' in mode-line-format
22aa665 Reject invalid 5-byte sequences when detecting UTF-8 encoding
0d3c358 Fix 'replace-buffer-contents' in multibyte buffers
c79a627 Update etc/NEWS for mail-source-movemail-program change
63f1dc4 Improve movemail default
0b1a2ae Delete description of deleted Customize functions
fcd66d0 Keep vc-print-log from putting point at buffer end (Bug#31764)
Conflicts:
etc/NEWS
|