* lisp/hilit-chg.el (hilit-chg-set-face-on-change): Don't burp in
[bpt/emacs.git] / src / editfns.c
index fc6465a..8122ffd 100644 (file)
@@ -819,9 +819,13 @@ save_excursion_save (void)
 {
   bool visible = (XBUFFER (XWINDOW (selected_window)->buffer)
                  == current_buffer);
+  /* Do not copy the mark if it points to nowhere.  */
+  Lisp_Object mark = (XMARKER (BVAR (current_buffer, mark))->buffer
+                     ? Fcopy_marker (BVAR (current_buffer, mark), Qnil)
+                     : Qnil);
 
   return Fcons (Fpoint_marker (),
-               Fcons (Fcopy_marker (BVAR (current_buffer, mark), Qnil),
+               Fcons (mark,
                       Fcons (visible ? Qt : Qnil,
                              Fcons (BVAR (current_buffer, mark_active),
                                     selected_window))));
@@ -856,9 +860,14 @@ save_excursion_restore (Lisp_Object info)
   info = XCDR (info);
   tem = XCAR (info);
   omark = Fmarker_position (BVAR (current_buffer, mark));
-  Fset_marker (BVAR (current_buffer, mark), tem, Fcurrent_buffer ());
-  nmark = Fmarker_position (tem);
-  unchain_marker (XMARKER (tem));
+  if (NILP (tem))
+    unchain_marker (XMARKER (BVAR (current_buffer, mark)));
+  else
+    {
+      Fset_marker (BVAR (current_buffer, mark), tem, Fcurrent_buffer ());
+      nmark = Fmarker_position (tem);
+      unchain_marker (XMARKER (tem));
+    }
 
   /* visible */
   info = XCDR (info);
@@ -1330,15 +1339,6 @@ DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0,
   return Vsystem_name;
 }
 
-const char *
-get_system_name (void)
-{
-  if (STRINGP (Vsystem_name))
-    return SSDATA (Vsystem_name);
-  else
-    return "";
-}
-
 DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0,
        doc: /* Return the process ID of Emacs, as a number.  */)
   (void)
@@ -3434,8 +3434,8 @@ static ptrdiff_t message_length;
 
 DEFUN ("message", Fmessage, Smessage, 1, MANY, 0,
        doc: /* Display a message at the bottom of the screen.
-The message also goes into the `*Messages*' buffer.
-\(In keyboard macros, that's all it does.)
+The message also goes into the `*Messages*' buffer, if `message-log-max'
+is non-nil.  (In keyboard macros, that's all it does.)
 Return the message.
 
 The first argument is a format control string, and the rest are data