(Info-fontify-node): Add mouse-face properties.
[bpt/emacs.git] / src / editfns.c
index aa97aee..e3863c5 100644 (file)
@@ -43,7 +43,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 Lisp_Object Vsystem_name;
 Lisp_Object Vuser_real_name;   /* login name of current user ID */
 Lisp_Object Vuser_full_name;   /* full name of current user */
-Lisp_Object Vuser_name;                /* user name from USER or LOGNAME.  */
+Lisp_Object Vuser_name;                /* user name from LOGNAME or USER */
 
 void
 init_editfns ()
@@ -76,9 +76,9 @@ init_editfns ()
 
   /* Get the effective user name, by consulting environment variables,
      or the effective uid if those are unset.  */
-  user_name = (char *) getenv ("USER");
+  user_name = (char *) getenv ("LOGNAME");
   if (!user_name)
-    user_name = (char *) getenv ("LOGNAME");
+    user_name = (char *) getenv ("USER");
   if (!user_name)
     {
       pw = (struct passwd *) getpwuid (geteuid ());
@@ -324,10 +324,13 @@ save_excursion_restore (info)
 
   tem1 = current_buffer->mark_active;
   current_buffer->mark_active = Fcdr (tem);
-  if (! NILP (current_buffer->mark_active))
-    call1 (Vrun_hooks, intern ("activate-mark-hook"));
-  else if (! NILP (tem1))
-    call1 (Vrun_hooks, intern ("deactivate-mark-hook"));
+  if (!NILP (Vrun_hooks))
+    {
+      if (! NILP (current_buffer->mark_active))
+       call1 (Vrun_hooks, intern ("activate-mark-hook"));
+      else if (! NILP (tem1))
+       call1 (Vrun_hooks, intern ("deactivate-mark-hook"));
+    }
   return Qnil;
 }
 
@@ -483,7 +486,7 @@ If POS is out of range, the value is nil.")
 DEFUN ("user-login-name", Fuser_login_name, Suser_login_name, 0, 0, 0,
   "Return the name under which the user logged in, as a string.\n\
 This is based on the effective uid, not the real uid.\n\
-Also, if the environment variable USER or LOGNAME is set,\n\
+Also, if the environment variable LOGNAME or USER is set,\n\
 that determines the value of this function.")
   ()
 {
@@ -493,7 +496,8 @@ that determines the value of this function.")
 DEFUN ("user-real-login-name", Fuser_real_login_name, Suser_real_login_name,
   0, 0, 0,
   "Return the name of the user's real uid, as a string.\n\
-Differs from `user-login-name' when running under `su'.")
+This ignores the environment variables LOGNAME and USER, so it differs from
+`user-login-name' when running under `su'.")
   ()
 {
   return Vuser_real_name;
@@ -1459,7 +1463,7 @@ Use %% to put a single % into the output.")
        if (*format == '%')
          format++;
        else if (++n >= nargs)
-         ;
+         error ("format string wants too many arguments");
        else if (*format == 'S')
          {
            /* For `S', prin1 the argument and then treat like a string.  */
@@ -1476,6 +1480,8 @@ Use %% to put a single % into the output.")
        else if (XTYPE (args[n]) == Lisp_String)
          {
          string:
+           if (*format != 's' && *format != 'S')
+             error ("format specifier doesn't match argument type");
            total += XSTRING (args[n])->size;
          }
        /* Would get MPV otherwise, since Lisp_Int's `point' to low memory.  */