* data.c (Findirect_function): Add NOERROR arg. All callers changed
authorKim F. Storm <storm@cua.dk>
Fri, 10 Feb 2006 00:00:31 +0000 (00:00 +0000)
committerKim F. Storm <storm@cua.dk>
Fri, 10 Feb 2006 00:00:31 +0000 (00:00 +0000)
to pass Qnil for NOERROR.

* keymap.c (current_minor_maps_error): Remove.
(current_minor_maps): Pass Qt for NOERROR to Findirect_function
instead of using internal_condition_case_1+current_minor_maps_error.

src/ChangeLog
src/data.c
src/doc.c
src/eval.c
src/keyboard.c
src/keymap.c
src/lisp.h

index b7124f3..fd2c46e 100644 (file)
@@ -1,3 +1,12 @@
+2006-02-10  Kim F. Storm  <storm@cua.dk>
+
+       * data.c (Findirect_function): Add NOERROR arg.  All callers changed
+       to pass Qnil for NOERROR.
+
+       * keymap.c (current_minor_maps_error): Remove.
+       (current_minor_maps): Pass Qt for NOERROR to Findirect_function
+       instead of using internal_condition_case_1+current_minor_maps_error.
+
 2006-02-09  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
 
        * xterm.c (handle_one_xevent): Must note mouse movement even for nil
index 278105b..7919021 100644 (file)
@@ -1927,15 +1927,16 @@ indirect_function (object)
   return hare;
 }
 
-DEFUN ("indirect-function", Findirect_function, Sindirect_function, 1, 1, 0,
+DEFUN ("indirect-function", Findirect_function, Sindirect_function, 1, 2, 0,
        doc: /* Return the function at the end of OBJECT's function chain.
 If OBJECT is a symbol, follow all function indirections and return the final
 function binding.
 If OBJECT is not a symbol, just return it.
-Signal a void-function error if the final symbol is unbound.
+If optional arg NOERROR is nil, signal a void-function error if
+the final symbol is unbound.  Otherwise, just return nil is unbound.
 Signal a cyclic-function-indirection error if there is a loop in the
 function chain of symbols.  */)
-     (object)
+(object, noerror)
      register Lisp_Object object;
 {
   Lisp_Object result;
@@ -1943,7 +1944,9 @@ function chain of symbols.  */)
   result = indirect_function (object);
 
   if (EQ (result, Qunbound))
-    return Fsignal (Qvoid_function, Fcons (object, Qnil));
+    return (NILP (noerror)
+           ? Fsignal (Qvoid_function, Fcons (object, Qnil))
+           : Qnil);
   return result;
 }
 \f
index 5c4c8b4..0e1042b 100644 (file)
--- a/src/doc.c
+++ b/src/doc.c
@@ -386,7 +386,7 @@ string is passed through `substitute-command-keys'.  */)
          !NILP (tem)))
     return Fdocumentation_property (function, Qfunction_documentation, raw);
 
-  fun = Findirect_function (function);
+  fun = Findirect_function (function, Qnil);
   if (SUBRP (fun))
     {
       if (XSUBR (fun)->doc == 0)
index 2f89e51..eff2848 100644 (file)
@@ -618,7 +618,7 @@ interactive_p (exclude_subrs_p)
 
   /* If this isn't a byte-compiled function, there may be a frame at
      the top for Finteractive_p.  If so, skip it.  */
-  fun = Findirect_function (*btp->function);
+  fun = Findirect_function (*btp->function, Qnil);
   if (SUBRP (fun) && (XSUBR (fun) == &Sinteractive_p
                      || XSUBR (fun) == &Scalled_interactively_p))
     btp = btp->next;
@@ -639,7 +639,7 @@ interactive_p (exclude_subrs_p)
      a special form, ignoring frames for Finteractive_p and/or
      Fbytecode at the top.  If this frame is for a built-in function
      (such as load or eval-region) return nil.  */
-  fun = Findirect_function (*btp->function);
+  fun = Findirect_function (*btp->function, Qnil);
   if (exclude_subrs_p && SUBRP (fun))
     return 0;
 
@@ -2079,7 +2079,7 @@ do_autoload (fundef, funname)
   Vautoload_queue = Qt;
   unbind_to (count, Qnil);
 
-  fun = Findirect_function (fun);
+  fun = Findirect_function (fun, Qnil);
 
   if (!NILP (Fequal (fun, fundef)))
     error ("Autoloading failed to define function %s",
@@ -2142,7 +2142,7 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0,
   /* At this point, only original_fun and original_args
      have values that will be used below */
  retry:
-  fun = Findirect_function (original_fun);
+  fun = Findirect_function (original_fun, Qnil);
 
   if (SUBRP (fun))
     {
@@ -2841,7 +2841,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS)  */)
 
   fun = args[0];
 
-  fun = Findirect_function (fun);
+  fun = Findirect_function (fun, Qnil);
 
   if (SUBRP (fun))
     {
index 21bd130..d5c5f18 100644 (file)
@@ -9700,7 +9700,7 @@ a special event, so ignore the prefix argument and don't clear it.  */)
 
   while (1)
     {
-      final = Findirect_function (cmd);
+      final = Findirect_function (cmd, Qnil);
 
       if (CONSP (final) && (tem = Fcar (final), EQ (tem, Qautoload)))
        {
index 94cc892..03b36d5 100644 (file)
@@ -68,7 +68,7 @@ Lisp_Object Vminibuffer_local_completion_map;
 /* keymap used for minibuffers when doing completion in filenames */
 Lisp_Object Vminibuffer_local_filename_completion_map;
 
-/* keymap used for minibuffers when doing completion in filenames 
+/* keymap used for minibuffers when doing completion in filenames
    with require-match*/
 Lisp_Object Vminibuffer_local_must_match_filename_map;
 
@@ -1370,13 +1370,6 @@ silly_event_symbol_error (c)
 static Lisp_Object *cmm_modes = NULL, *cmm_maps = NULL;
 static int cmm_size = 0;
 
-/* Error handler used in current_minor_maps.  */
-static Lisp_Object
-current_minor_maps_error ()
-{
-  return Qnil;
-}
-
 /* Store a pointer to an array of the keymaps of the currently active
    minor modes in *buf, and return the number of maps it contains.
 
@@ -1478,9 +1471,7 @@ current_minor_maps (modeptr, mapptr)
              }
 
            /* Get the keymap definition--or nil if it is not defined.  */
-           temp = internal_condition_case_1 (Findirect_function,
-                                             XCDR (assoc),
-                                             Qerror, current_minor_maps_error);
+           temp = Findirect_function (XCDR (assoc), Qt);
            if (!NILP (temp))
              {
                cmm_modes[i] = var;
@@ -3882,11 +3873,11 @@ don't alter it yourself.  */);
   Vminibuffer_local_completion_map = Fmake_sparse_keymap (Qnil);
   Fset_keymap_parent (Vminibuffer_local_completion_map, Vminibuffer_local_map);
 
-  DEFVAR_LISP ("minibuffer-local-filename-completion-map", 
+  DEFVAR_LISP ("minibuffer-local-filename-completion-map",
               &Vminibuffer_local_filename_completion_map,
               doc: /* Local keymap for minibuffer input with completion for filenames.  */);
   Vminibuffer_local_filename_completion_map = Fmake_sparse_keymap (Qnil);
-  Fset_keymap_parent (Vminibuffer_local_filename_completion_map, 
+  Fset_keymap_parent (Vminibuffer_local_filename_completion_map,
                      Vminibuffer_local_completion_map);
 
 
@@ -3896,11 +3887,11 @@ don't alter it yourself.  */);
   Fset_keymap_parent (Vminibuffer_local_must_match_map,
                      Vminibuffer_local_completion_map);
 
-  DEFVAR_LISP ("minibuffer-local-must-match-filename-map", 
+  DEFVAR_LISP ("minibuffer-local-must-match-filename-map",
               &Vminibuffer_local_must_match_filename_map,
               doc: /* Local keymap for minibuffer input with completion for filenames with exact match.  */);
   Vminibuffer_local_must_match_filename_map = Fmake_sparse_keymap (Qnil);
-  Fset_keymap_parent (Vminibuffer_local_must_match_filename_map, 
+  Fset_keymap_parent (Vminibuffer_local_must_match_filename_map,
                      Vminibuffer_local_must_match_map);
 
   DEFVAR_LISP ("minor-mode-map-alist", &Vminor_mode_map_alist,
index 09f6f38..992c052 100644 (file)
@@ -2179,7 +2179,7 @@ EXFUN (Fsymbol_function, 1);
 EXFUN (Fsymbol_plist, 1);
 EXFUN (Fsymbol_name, 1);
 extern Lisp_Object indirect_function P_ ((Lisp_Object));
-EXFUN (Findirect_function, 1);
+EXFUN (Findirect_function, 2);
 EXFUN (Ffset, 2);
 EXFUN (Fsetplist, 2);
 EXFUN (Fsymbol_value, 1);