]> git.eshelyaron.com Git - emacs.git/commitdiff
(adjust_after_replace_noundo): New function.
authorRichard M. Stallman <rms@gnu.org>
Fri, 11 Jan 2002 21:29:13 +0000 (21:29 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 11 Jan 2002 21:29:13 +0000 (21:29 +0000)
lisp/ChangeLog
src/insdel.c

index 08cb1f1f94d66ed87abad8957d9bef25711112d2..27913f5d60d8402a91a1217eb2058394e2e91f42 100644 (file)
@@ -1,3 +1,11 @@
+2002-01-11  Richard M. Stallman  <rms@gnu.org>
+
+       * mail/rmail.el (rmail-decode-babyl-format): Disable undo
+       around the decode-coding-region call.
+
+       * emacs-lisp/lisp.el (lisp-complete-symbol): Repeating the command
+       after displaying a completion list scrolls the list.
+
 2002-01-11  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * version.el (emacs-version): Bump to 21.2.50.
index a71afb7258dd1729276c4a6f76686237fab2265c..486875d2b91dc7d9b69e72a7ba21769387a08a8b 100644 (file)
@@ -1391,6 +1391,56 @@ adjust_after_replace (from, from_byte, prev_text, len, len_byte)
   MODIFF++;
 }
 
+/* Like adjust_after_replace, but doesn't require PREV_TEXT.
+   This is for use when undo is not enabled in the current buffer.  */
+
+void
+adjust_after_replace_noundo (from, from_byte, nchars_del, nbytes_del, len, len_byte)
+     int from, from_byte, nchars_del, nbytes_del, len, len_byte;
+{
+#ifdef BYTE_COMBINING_DEBUG
+  if (count_combining_before (GPT_ADDR, len_byte, from, from_byte)
+      || count_combining_after (GPT_ADDR, len_byte, from, from_byte))
+    abort ();
+#endif
+
+  /* Update various buffer positions for the new text.  */
+  GAP_SIZE -= len_byte;
+  ZV += len; Z+= len;
+  ZV_BYTE += len_byte; Z_BYTE += len_byte;
+  GPT += len; GPT_BYTE += len_byte;
+  if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */
+
+  if (nchars_del > 0)
+    adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del,
+                               len, len_byte);
+  else
+    adjust_markers_for_insert (from, from_byte,
+                              from + len, from_byte + len_byte, 0);
+
+  if (len > nchars_del)
+    adjust_overlays_for_insert (from, len - nchars_del);
+  else if (len < nchars_del)
+    adjust_overlays_for_delete (from, nchars_del - len);
+  if (BUF_INTERVALS (current_buffer) != 0)
+    {
+      offset_intervals (current_buffer, from, len - nchars_del);
+    }
+
+  if (from < PT)
+    adjust_point (len - nchars_del, len_byte - nbytes_del);
+
+  /* As byte combining will decrease Z, we must check this again. */
+  if (Z - GPT < END_UNCHANGED)
+    END_UNCHANGED = Z - GPT;
+
+  CHECK_MARKERS ();
+
+  if (len == 0)
+    evaporate_overlays (from);
+  MODIFF++;
+}
+
 /* Record undo information, adjust markers and position keepers for an
    insertion of a text from FROM (FROM_BYTE) to TO (TO_BYTE).  The
    text already exists in the current buffer but character length (TO