[gnu.emacs.bug] Requesting 3 changes.

jbw%bucsf.BU.EDU@BU-CS.BU.EDU (Joe Wells) (03/19/89)

I would like to request that the following fixes/changes be considered
for future versions of GNU Emacs, if that would be possible.  There
are three patches.  The first makes the cmd_error routine in
src/keyboard.c available to be called from lisp.  The second uses this
routine to make more useful error messages for errors in loading the
.emacs file.  For example, instead of "Error in init file", it might
print "Illegal syntax: # (error in init file)".  The third change
makes the temp_minibuf_message routine in src/minibuf.c available to
lisp, for use in minibuffer completion routines.

Thanks for your consideration!

--
Joe Wells
INTERNET: jbw%bucsf.bu.edu@bu-it.bu.edu    IP: [128.197.2.9]
UUCP: ...!harvard!bu-cs!bucsf!jbw
----------------------------------------------------------------------
*** /usr14/gnu/dist-18.52/src/keyboard.c	Mon Aug 22 20:10:17 1988
--- ./keyboard.c	Sat Mar 18 21:59:35 1989
***************
*** 313,320 ****
    return Qnil;
  }
  
! Lisp_Object
! cmd_error (data)
       Lisp_Object data;
  {
    Lisp_Object errmsg, tail, errname, file_error;
--- 313,324 ----
    return Qnil;
  }
  
! DEFUN ("cmd-error", cmd_error, Scmd_error, 1, 1, 0,
!   "Prints the error specified by DATA using the minibuffer message.\n\
! The format of DATA is discussed in signal and condition-case.\n\
! Discards input and terminates macros.  If noninteractive, calls\n\
! kill-emacs.  Sets standard-input and standard-output to t.")
!   (data)
       Lisp_Object data;
  {
    Lisp_Object errmsg, tail, errname, file_error;
***************
*** 1905,1910 ****
--- 1909,1915 ----
    defsubr (&Sopen_dribble_file);
    defsubr (&Sset_input_mode);
    defsubr (&Sexecute_extended_command);
+   defsubr (&Scmd_error);
  
    DEFVAR_LISP ("disabled-command-hook", &Vdisabled_command_hook,
      "Value is called instead of any command that is disabled\n\
----------------------------------------------------------------------
*** /usr14/gnu/dist-18.52/lisp/startup.el	Sun Jul 10 14:43:37 1988
--- ./startup.el	Sat Mar 18 22:02:24 1989
***************
*** 119,125 ****
  			 ;; Don't you dare turn this off for anyone
  			 ;; except yourself.
  			 (load "default" t t)))))
!       (error (message "Error in init file")))
      (if (get-buffer "*scratch*")
  	(save-excursion
  	  (set-buffer "*scratch*")
--- 119,127 ----
  			 ;; Don't you dare turn this off for anyone
  			 ;; except yourself.
  			 (load "default" t t)))))
!       (error (cmd-error error)
! 	     (princ " (error in init file)")
! 	     (sit-for 0)))
      (if (get-buffer "*scratch*")
  	(save-excursion
  	  (set-buffer "*scratch*")
----------------------------------------------------------------------
*** /usr14/gnu/dist-18.52/src/minibuf.c	Mon May 23 15:04:25 1988
--- ./minibuf.c	Sat Mar 18 21:59:35 1989
***************
*** 651,656 ****
--- 651,657 ----
    InsStr (m);
    SetPoint (osize);
    Vinhibit_quit = Qt;
+   minibuf_message = 0;
    Fsit_for (make_number (2), Qnil);
    del_range (point, NumCharacters + 1);
    if (!NULL (Vquit_flag))
***************
*** 661,666 ****
--- 662,679 ----
    Vinhibit_quit = oinhibit;
  }
  
+ DEFUN ("temp-minibuf-message", Ftemp_minibuf_message, Stemp_minibuf_message, 1, 1, 0,
+   "Prints string MESSAGE in the current buffer to the right of all\n\
+ text in the buffer.  It is used mainly for putting messages in the\n\
+ minibuffer while also showing the minibuffer text.")
+   (s)
+      Lisp_Object s;
+ {
+   CHECK_STRING (s, 0);
+   temp_minibuf_message (XSTRING(s)->data);
+   return Qnil;
+ }
+ 
  Lisp_Object Fminibuffer_completion_help ();
  
  /* returns:
***************
*** 1064,1069 ****
--- 1077,1083 ----
    defsubr (&Stry_completion);
    defsubr (&Sall_completions);
    defsubr (&Scompleting_read);
+   defsubr (&Stemp_minibuf_message);
    defsubr (&Sminibuffer_complete);
    defsubr (&Sminibuffer_complete_word);
    defsubr (&Sminibuffer_complete_and_exit);