changeset 722:0a2391511b46

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Tue, 23 Jun 1992 21:48:27 +0000
parents 6ef7049ea916
children a898ba10b49c
files lisp/files.el src/window.c
diffstat 2 files changed, 29 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Tue Jun 23 20:44:54 1992 +0000
+++ b/lisp/files.el	Tue Jun 23 21:48:27 1992 +0000
@@ -171,11 +171,14 @@
 The command \\[normal-mode] always obeys local-variables lists
 and ignores this variable.")
 
-(defconst ignore-local-eval nil
-  "*Non-nil means ignore the \"variable\" `eval' in a file's local variables.
-This applies when the local-variables list is scanned automatically
-after you find a file.  If you explicitly request such a scan with
-\\[normal-mode], there is no query, regardless of this variable.")
+(defconst enable-local-eval nil
+  "*Control processing of the \"variable\" `eval' in a file's local variables.
+The value can be t, nil or something else.
+A value of t means obey `eval' variables;
+nil means ignore them; anything else means query.
+
+The command \\[normal-mode] always obeys local-variables lists
+and ignores this variable.")
 
 ;; Avoid losing in versions where CLASH_DETECTION is disabled.
 (or (fboundp 'lock-buffer)
@@ -644,10 +647,18 @@
 		       (funcall (intern (concat (downcase (symbol-name val))
 						"-mode"))))
 		      ((eq var 'eval)
-		       (if (or ignore-local-eval
-			       (string= (user-login-name) "root"))
-			   (message "Ignoring `eval:' in file's local variables")
-			 (save-excursion (eval val))))
+		       (if (and (not (string= (user-login-name) "root"))
+				(or (eq enable-local-eval t)
+				    (and enable-local-eval
+					 (save-window-excursion
+					   (switch-to-buffer (current-buffer))
+					   (save-excursion
+					     (beginning-of-line)
+					     (set-window-start (selected-window) (point)))
+					   (y-or-n-p (format "Process `eval' local variable in file %s? "
+							     (file-name-nondirectory buffer-file-name)))))))
+			   (save-excursion (eval val))
+			 (message "Ignoring `eval:' in file's local variables")))
 		      (t (make-local-variable var)
 			 (set var val))))))))))
 
--- a/src/window.c	Tue Jun 23 20:44:54 1992 +0000
+++ b/src/window.c	Tue Jun 23 21:48:27 1992 +0000
@@ -540,12 +540,13 @@
   return decode_window (window)->dedicated;
 }
 
-DEFUN ("set-window-buffer-dedicated", Fset_window_buffer_dedicated,
-       Sset_window_buffer_dedicated, 2, 2, 0,
-  "Make WINDOW display BUFFER and be dedicated to that buffer.\n\
-Then Emacs will not automatically change which buffer appears in WINDOW.\n\
-If BUFFER is nil, make WINDOW not be dedicated (but don't change which\n\
-buffer appears in it currently).")
+DEFUN ("set-window-dedicated-p", Fset_window_dedicated_p,
+       Sset_window_dedicated_p, 2, 2, 0,
+  "Control whether WINDOW is dedicated to the buffer it displays.\n\
+If it is dedicated, Emacs will not automatically change\n\
+which buffer appears in it.\n\
+The second argument is the new value for the dedication flag;\n\
+non-nil means yes.")
   (window, arg)
        Lisp_Object window, arg;
 {
@@ -554,10 +555,7 @@
   if (NILP (arg))
     w->dedicated = Qnil;
   else
-    {
-      Fset_window_buffer (window, Fget_buffer_create (arg));
-      w->dedicated = Qt;
-    }
+    w->dedicated = Qt;
 
   return w->dedicated;
 }
@@ -2752,7 +2750,7 @@
   defsubr (&Sset_window_point);
   defsubr (&Sset_window_start);
   defsubr (&Swindow_dedicated_p);
-  defsubr (&Sset_window_buffer_dedicated);
+  defsubr (&Sset_window_dedicated_p);
   defsubr (&Swindow_display_table);
   defsubr (&Sset_window_display_table);
   defsubr (&Snext_window);