X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/ecae6af979abcbb5b45c33ee05ceb297678ec9a0..fe41ae9e008dffa0e7a7c44dea558b57b3178d9c:/src/insdel.c diff --git a/src/insdel.c b/src/insdel.c index 884620d389..814d1571d3 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1,14 +1,14 @@ /* Buffer insertion/deletion and gap motion for GNU Emacs. Copyright (C) 1985, 1986, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2008 + 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GNU Emacs. -GNU Emacs is free software; you can redistribute it and/or modify +GNU Emacs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3, or (at your option) -any later version. +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -16,9 +16,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GNU Emacs. If not, see . */ #include @@ -657,8 +655,8 @@ copy_text (from_addr, to_addr, nbytes, { int thislen, c; c = STRING_CHAR_AND_LENGTH (from_addr, bytes_left, thislen); - if (!ASCII_CHAR_P (c)) - c = multibyte_char_to_unibyte (c, tbl); + if (! ASCII_CHAR_P (c)) + c &= 0xFF; *to_addr++ = c; from_addr += thislen; bytes_left -= thislen; @@ -2008,7 +2006,10 @@ del_range_2 (from, from_byte, to, to_byte, ret_string) Z -= nchars_del; GPT = from; GPT_BYTE = from_byte; - if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ + if (GAP_SIZE > 0 && !current_buffer->text->inhibit_shrinking) + /* Put an anchor, unless called from decode_coding_object which + needs to access the previous gap contents. */ + *(GPT_ADDR) = 0; if (GPT_BYTE < GPT) abort ();