diff options
author | Glenn Morris <rgm@gnu.org> | 2020-02-16 07:50:36 -0800 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2020-02-16 07:50:36 -0800 |
commit | f633e014aca727b9ccecaf8e6d69386f93c5073f (patch) | |
tree | 8db3ca5c8726fe382033559ec6a3bdf2cf28b74a /src | |
parent | 3480071dfab30eaca7f1d014600b864d2ea22f62 (diff) | |
parent | 7ceb45f61f91d99c045966d8463c8ae30add8930 (diff) | |
download | emacs-f633e014aca727b9ccecaf8e6d69386f93c5073f.tar.gz |
Merge from origin/emacs-27
7ceb45f61f (origin/emacs-27) Reformulate c-end-of-macro, handling mul...
888ffd960c Fix unexec failure on macOS 10.15.4
b392c9f365 Fix 'reverse-region' when less than one line is in region
7448834f73 Correct default regexp in 'package-menu-hide-package'
faada7ca42 Remove obsolete menu entry "Redisplay buffer"
78d76cd93c Remove redundant 'msft' compilation error rule (bug#39595)
75a9eee8b8 ; * src/editfns.c (Fbuffer_size): Tiny clarification.
4d8d25d641 * doc/lispref/variables.texi (special-variable-p): Clarify...
9f6a4bbcc9 Remove the optional KEEP-ORDER argument to regexp-opt
d1e8ce8bb6 Make after-change-functions called from call-process get t...
# Conflicts:
# etc/NEWS
Diffstat (limited to 'src')
-rw-r--r-- | src/callproc.c | 5 | ||||
-rw-r--r-- | src/editfns.c | 2 | ||||
-rw-r--r-- | src/unexmacosx.c | 47 |
3 files changed, 28 insertions, 26 deletions
diff --git a/src/callproc.c b/src/callproc.c index 07dcc4c3ae4..8883415f3f5 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -811,7 +811,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, && ! CODING_MAY_REQUIRE_DECODING (&process_coding)) { insert_1_both (buf, nread, nread, 0, 0, 0); - signal_after_change (PT, 0, nread); + signal_after_change (PT - nread, 0, nread); } else { /* We have to decode the input. */ @@ -854,7 +854,8 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, TEMP_SET_PT_BOTH (PT + process_coding.produced_char, PT_BYTE + process_coding.produced); - signal_after_change (PT, 0, process_coding.produced_char); + signal_after_change (PT - process_coding.produced_char, + 0, process_coding.produced_char); carryover = process_coding.carryover_bytes; if (carryover > 0) memcpy (buf, process_coding.carryover, diff --git a/src/editfns.c b/src/editfns.c index 05ad3925813..ddf190b1752 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -863,7 +863,7 @@ instead. This does not take narrowing into account; to count the number of characters in the accessible portion of the current buffer, use `(- (point-max) (point-min))', and to count the number of characters -in some other BUFFER, use +in the accessible portion of some other BUFFER, use `(with-current-buffer BUFFER (- (point-max) (point-min)))'. */) (Lisp_Object buffer) { diff --git a/src/unexmacosx.c b/src/unexmacosx.c index 8d132417e89..59cbe3c18b9 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c @@ -503,22 +503,34 @@ unexec_regions_sort_compare (const void *a, const void *b) static void unexec_regions_merge (void) { - int i, n; - unexec_region_info r; - vm_size_t padsize; - qsort (unexec_regions, num_unexec_regions, sizeof (unexec_regions[0]), &unexec_regions_sort_compare); - n = 0; - r = unexec_regions[0]; - padsize = r.range.address & (pagesize - 1); - if (padsize) + + /* Align each region start address to a page boundary. */ + for (unexec_region_info *cur = unexec_regions; + cur < unexec_regions + num_unexec_regions; cur++) { - r.range.address -= padsize; - r.range.size += padsize; - r.filesize += padsize; + vm_size_t padsize = cur->range.address & (pagesize - 1); + if (padsize) + { + cur->range.address -= padsize; + cur->range.size += padsize; + cur->filesize += padsize; + + unexec_region_info *prev = cur == unexec_regions ? NULL : cur - 1; + if (prev + && prev->range.address + prev->range.size > cur->range.address) + { + prev->range.size = cur->range.address - prev->range.address; + if (prev->filesize > prev->range.size) + prev->filesize = prev->range.size; + } + } } - for (i = 1; i < num_unexec_regions; i++) + + int n = 0; + unexec_region_info r = unexec_regions[0]; + for (int i = 1; i < num_unexec_regions; i++) { if (r.range.address + r.range.size == unexec_regions[i].range.address && r.range.size - r.filesize < 2 * pagesize) @@ -530,17 +542,6 @@ unexec_regions_merge (void) { unexec_regions[n++] = r; r = unexec_regions[i]; - padsize = r.range.address & (pagesize - 1); - if (padsize) - { - if ((unexec_regions[n-1].range.address - + unexec_regions[n-1].range.size) == r.range.address) - unexec_regions[n-1].range.size -= padsize; - - r.range.address -= padsize; - r.range.size += padsize; - r.filesize += padsize; - } } } unexec_regions[n++] = r; |