summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2018-07-28 07:50:36 -0700
committerGlenn Morris <rgm@gnu.org>2018-07-28 07:50:36 -0700
commit4713f5d7423f0a8f2a2dd147cec70982145562d6 (patch)
treeb052f21a286e65e2030119246b9ddf8fa8a716cf /src
parent1bcf5d02da96784a04034b4c0aba8fdfa1413c4e (diff)
parentbd52f37cae3fbc25e576f9b0a1ba42596790965f (diff)
downloademacs-4713f5d7423f0a8f2a2dd147cec70982145562d6.tar.gz
emacs-4713f5d7423f0a8f2a2dd147cec70982145562d6.tar.bz2
emacs-4713f5d7423f0a8f2a2dd147cec70982145562d6.zip
Merge from origin/emacs-26
bd52f37 (origin/emacs-26) ; Fix last change: only MinGW runtime 5.0.2... 024d20f Fix compilation with mingw.org's MinGW 5.x headers 38b6748 Update the list of special forms in the ELisp manual 8579105 Don't fail to indent-sexp before a full sexp (Bug#31984) d24c5f2 Fix calls to modifications hooks in replace-buffer-contents 71a9151 * src/character.c (char_width): Support glyphs with faces. (... 0feb673 Display raw bytes as belonging to 'eight-bit' charset 2e2f00f ; * doc/emacs/mule.texi (International Chars): Fix last change. 00561b5 Fix inaccurate text in the user manual 5cfb7a3 Copyedits in tramp.texi, improved example with bash's readline 6f8f358 Minor Tramp doc update 2585fcb File Shadowing is not available on MS Windows 39da592 ; Minor markup change in indent.texi 2f00ffe ; bookmark-jump: Add comment about last change.
Diffstat (limited to 'src')
-rw-r--r--src/character.c15
-rw-r--r--src/editfns.c19
2 files changed, 12 insertions, 22 deletions
diff --git a/src/character.c b/src/character.c
index 6a689808043..b17f44b1422 100644
--- a/src/character.c
+++ b/src/character.c
@@ -34,6 +34,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include "lisp.h"
#include "character.h"
#include "buffer.h"
+#include "dispextern.h"
#include "composite.h"
#include "disptab.h"
@@ -288,13 +289,15 @@ char_width (int c, struct Lisp_Char_Table *dp)
if (VECTORP (disp))
for (i = 0, width = 0; i < ASIZE (disp); i++)
{
+ int c;
ch = AREF (disp, i);
- if (CHARACTERP (ch))
- {
- int w = CHARACTER_WIDTH (XFASTINT (ch));
- if (INT_ADD_WRAPV (width, w, &width))
- string_overflow ();
- }
+ if (GLYPH_CODE_P (ch))
+ c = GLYPH_CODE_CHAR (ch);
+ else if (CHARACTERP (ch))
+ c = XFASTINT (ch);
+ int w = CHARACTER_WIDTH (c);
+ if (INT_ADD_WRAPV (width, w, &width))
+ string_overflow ();
}
}
return width;
diff --git a/src/editfns.c b/src/editfns.c
index 522cb5dcef2..0fbc5aad8c3 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3256,21 +3256,9 @@ differences between the two buffers. */)
Instead, we announce a single modification for the entire
modified region. But don't do that if the caller inhibited
modification hooks, because then they don't want that. */
- ptrdiff_t from, to;
if (!inhibit_modification_hooks)
{
- ptrdiff_t k, l;
-
- /* Find the first character position to be changed. */
- for (k = 0; k < size_a && !bit_is_set (ctx.deletions, k); k++)
- ;
- from = BEGV + k;
-
- /* Find the last character position to be changed. */
- for (l = size_a; l > k && !bit_is_set (ctx.deletions, l - 1); l--)
- ;
- to = BEGV + l;
- prepare_to_modify_buffer (from, to, NULL);
+ prepare_to_modify_buffer (BEGV, ZV, NULL);
specbind (Qinhibit_modification_hooks, Qt);
modification_hooks_inhibited = true;
}
@@ -3322,9 +3310,8 @@ differences between the two buffers. */)
if (modification_hooks_inhibited)
{
- ptrdiff_t updated_to = to + ZV - BEGV - size_a;
- signal_after_change (from, to - from, updated_to - from);
- update_compositions (from, updated_to, CHECK_INSIDE);
+ signal_after_change (BEGV, size_a, ZV - BEGV);
+ update_compositions (BEGV, ZV, CHECK_INSIDE);
}
return Qnil;