aboutsummaryrefslogtreecommitdiffstats
path: root/src/editfns.c
diff options
context:
space:
mode:
authorGlenn Morris2018-08-10 11:37:11 -0700
committerGlenn Morris2018-08-10 11:37:11 -0700
commitbd6b6cdb62aac5be34a8bb367f43d8367fc341f8 (patch)
treeb5386b322b0b247ab44eefd12e1fa865844249f7 /src/editfns.c
parent506ea8a2f70d8c9d53a34ea9469d3edbe6655f0c (diff)
parent71c92d89137b7fdde6c2bd4bed9b8dfda5fa53dd (diff)
downloademacs-bd6b6cdb62aac5be34a8bb367f43d8367fc341f8.tar.gz
emacs-bd6b6cdb62aac5be34a8bb367f43d8367fc341f8.zip
Merge from origin/emacs-26
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
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 0fbc5aad8c3..a4cff595bd0 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -4268,6 +4268,9 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
4268 /* The start and end bytepos in the output string. */ 4268 /* The start and end bytepos in the output string. */
4269 ptrdiff_t start, end; 4269 ptrdiff_t start, end;
4270 4270
4271 /* The start of the spec in the format string. */
4272 ptrdiff_t fbeg;
4273
4271 /* Whether the argument is a string with intervals. */ 4274 /* Whether the argument is a string with intervals. */
4272 bool_bf intervals : 1; 4275 bool_bf intervals : 1;
4273 } *info; 4276 } *info;
@@ -4421,6 +4424,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
4421 char conversion = *format++; 4424 char conversion = *format++;
4422 memset (&discarded[format0 - format_start], 1, 4425 memset (&discarded[format0 - format_start], 1,
4423 format - format0 - (conversion == '%')); 4426 format - format0 - (conversion == '%'));
4427 info[ispec].fbeg = format0 - format_start;
4424 if (conversion == '%') 4428 if (conversion == '%')
4425 { 4429 {
4426 new_result = true; 4430 new_result = true;
@@ -5011,7 +5015,9 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
5011 else if (discarded[bytepos] == 1) 5015 else if (discarded[bytepos] == 1)
5012 { 5016 {
5013 position++; 5017 position++;
5014 if (fieldn < nspec && translated == info[fieldn].start) 5018 if (fieldn < nspec
5019 && position > info[fieldn].fbeg
5020 && translated == info[fieldn].start)
5015 { 5021 {
5016 translated += info[fieldn].end - info[fieldn].start; 5022 translated += info[fieldn].end - info[fieldn].start;
5017 fieldn++; 5023 fieldn++;
@@ -5031,7 +5037,9 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
5031 else if (discarded[bytepos] == 1) 5037 else if (discarded[bytepos] == 1)
5032 { 5038 {
5033 position++; 5039 position++;
5034 if (fieldn < nspec && translated == info[fieldn].start) 5040 if (fieldn < nspec
5041 && position > info[fieldn].fbeg
5042 && translated == info[fieldn].start)
5035 { 5043 {
5036 translated += info[fieldn].end - info[fieldn].start; 5044 translated += info[fieldn].end - info[fieldn].start;
5037 fieldn++; 5045 fieldn++;