emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r117146: * src/xdisp.c: Bind inhibit-quit during


From: Stefan Monnier
Subject: [Emacs-diffs] emacs-24 r117146: * src/xdisp.c: Bind inhibit-quit during pre-redisplay-function.
Date: Sat, 24 May 2014 15:50:16 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117146
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17577
committer: Stefan Monnier <address@hidden>
branch nick: emacs-24
timestamp: Sat 2014-05-24 11:50:05 -0400
message:
  * src/xdisp.c: Bind inhibit-quit during pre-redisplay-function.
  (safe__call, safe__call1, safe__eval): New functions.
  (safe_call): Use it.
  (prepare_menu_bars): Use it for pre-redisplay-function.
  (display_mode_element): Same for `:eval'.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/xdisp.c                    xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-05-22 05:00:39 +0000
+++ b/src/ChangeLog     2014-05-24 15:50:05 +0000
@@ -1,3 +1,11 @@
+2014-05-24  Stefan Monnier  <address@hidden>
+
+       * xdisp.c: Bind inhibit-quit during pre-redisplay-function.
+       (safe__call, safe__call1, safe__eval): New functions.
+       (safe_call): Use it.
+       (prepare_menu_bars): Use it for pre-redisplay-function (bug#17577).
+       (display_mode_element): Same for `:eval'.
+
 2014-05-22  Paul Eggert  <address@hidden>
 
        Fix port to 32-bit AIX (Bug#17540).

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2014-05-21 15:03:18 +0000
+++ b/src/xdisp.c       2014-05-24 15:50:05 +0000
@@ -2591,8 +2591,8 @@
    following.  Return the result, or nil if something went
    wrong.  Prevent redisplay during the evaluation.  */
 
-Lisp_Object
-safe_call (ptrdiff_t nargs, Lisp_Object func, ...)
+static Lisp_Object
+safe__call (bool inhibit_quit, ptrdiff_t nargs, Lisp_Object func, ...)
 {
   Lisp_Object val;
 
@@ -2615,6 +2615,8 @@
       GCPRO1 (args[0]);
       gcpro1.nvars = nargs;
       specbind (Qinhibit_redisplay, Qt);
+      if (inhibit_quit)
+       specbind (Qinhibit_quit, Qt);
       /* Use Qt to ensure debugger does not run,
         so there is no possibility of wanting to redisplay.  */
       val = internal_condition_case_n (Ffuncall, nargs, args, Qt,
@@ -2626,6 +2628,11 @@
   return val;
 }
 
+Lisp_Object
+safe_call (ptrdiff_t nargs, Lisp_Object func, ...)
+{
+  return safe__call (false, nargs, func);
+}
 
 /* Call function FN with one argument ARG.
    Return the result, or nil if something went wrong.  */
@@ -2633,7 +2640,13 @@
 Lisp_Object
 safe_call1 (Lisp_Object fn, Lisp_Object arg)
 {
-  return safe_call (2, fn, arg);
+  return safe__call (false, 2, fn, arg);
+}
+
+Lisp_Object
+safe__call1 (bool inhibit_quit, Lisp_Object fn, Lisp_Object arg)
+{
+  return safe__call (inhibit_quit, 2, fn, arg);
 }
 
 static Lisp_Object Qeval;
@@ -2641,7 +2654,13 @@
 Lisp_Object
 safe_eval (Lisp_Object sexpr)
 {
-  return safe_call1 (Qeval, sexpr);
+  return safe__call1 (false, Qeval, sexpr);
+}
+
+Lisp_Object
+safe__eval (bool inhibit_quit, Lisp_Object sexpr)
+{
+  return safe__call1 (inhibit_quit, Qeval, sexpr);
 }
 
 /* Call function FN with two arguments ARG1 and ARG2.
@@ -11549,7 +11568,7 @@
                }
            }
        }
-      safe_call1 (Vpre_redisplay_function, windows);
+      safe__call1 (true, Vpre_redisplay_function, windows);
     }
 
   /* Update all frame titles based on their buffer names, etc.  We do
@@ -21863,7 +21882,7 @@
            if (CONSP (XCDR (elt)))
              {
                Lisp_Object spec;
-               spec = safe_eval (XCAR (XCDR (elt)));
+               spec = safe__eval (true, XCAR (XCDR (elt)));
                n += display_mode_element (it, depth, field_width - n,
                                           precision - n, spec, props,
                                           risky);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]