emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r109563: Merge from emacs-24; up to 1


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109563: Merge from emacs-24; up to 108099
Date: Sat, 11 Aug 2012 10:13:55 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109563 [merge]
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2012-08-11 10:13:55 +0800
message:
  Merge from emacs-24; up to 108099
added:
  test/automated/files.el
modified:
  admin/ChangeLog
  admin/bzrmerge.el
  lisp/ChangeLog
  lisp/emacs-lisp/autoload.el
  lisp/emacs-lisp/copyright.el
  lisp/files.el
  lisp/tutorial.el
  src/ChangeLog
  src/unexmacosx.c
  test/ChangeLog
  test/automated/Makefile.in
=== modified file 'admin/ChangeLog'
--- a/admin/ChangeLog   2012-08-07 13:37:21 +0000
+++ b/admin/ChangeLog   2012-08-11 02:12:12 +0000
@@ -1,3 +1,7 @@
+2012-08-10  Glenn Morris  <address@hidden>
+
+       * bzrmerge.el (bzrmerge-resolve): Disable local eval:.
+
 2012-08-07  Dmitry Antipov  <address@hidden>
 
        * coccinelle/overlay.cocci, coccinelle/symbol.cocci: Remove.

=== modified file 'admin/bzrmerge.el'
--- a/admin/bzrmerge.el 2012-07-17 11:52:00 +0000
+++ b/admin/bzrmerge.el 2012-08-11 02:12:12 +0000
@@ -160,7 +160,8 @@
   (unless (file-exists-p file) (error "Bzrmerge-resolve: Can't find %s" file))
   (with-demoted-errors
     (let ((exists (find-buffer-visiting file)))
-      (with-current-buffer (let ((enable-local-variables :safe))
+      (with-current-buffer (let ((enable-local-variables :safe)
+                                 (enable-local-eval nil))
                              (find-file-noselect file))
         (if (buffer-modified-p)
             (error "Unsaved changes in %s" (current-buffer)))

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-08-10 21:03:10 +0000
+++ b/lisp/ChangeLog    2012-08-11 02:12:12 +0000
@@ -1,3 +1,18 @@
+2012-08-10  Glenn Morris  <address@hidden>
+
+       * emacs-lisp/copyright.el (copyright-update-directory): Logic fix.
+
+       * tutorial.el (help-with-tutorial):
+       * emacs-lisp/copyright.el (copyright-update-directory):
+       * emacs-lisp/autoload.el (autoload-find-generated-file)
+       (autoload-find-file): Disable local eval: (for insurance).
+
+2012-08-07  Glenn Morris  <address@hidden>
+
+       * files.el (hack-local-variables-filter): If an eval: form is not
+       known to be safe, and enable-local-variables is :safe, then ignore
+       the form totally, as is done for non-eval forms.  (Bug#12155)
+
 2012-08-10  Stefan Monnier  <address@hidden>
 
        * emacs-lisp/rx.el (rx-constituents): Don't define as constant.

=== modified file 'lisp/emacs-lisp/autoload.el'
--- a/lisp/emacs-lisp/autoload.el       2012-07-26 01:27:33 +0000
+++ b/lisp/emacs-lisp/autoload.el       2012-08-11 02:12:12 +0000
@@ -228,7 +228,8 @@
 (defun autoload-find-generated-file ()
   "Visit the autoload file for the current buffer, and return its buffer.
 If a buffer is visiting the desired autoload file, return it."
-  (let ((enable-local-variables :safe))
+  (let ((enable-local-variables :safe)
+       (enable-local-eval nil))
     ;; We used to use `raw-text' to read this file, but this causes
     ;; problems when the file contains non-ASCII characters.
     (find-file-noselect
@@ -382,7 +383,8 @@
     (emacs-lisp-mode)
     (setq default-directory (file-name-directory file))
     (insert-file-contents file nil)
-    (let ((enable-local-variables :safe))
+    (let ((enable-local-variables :safe)
+         (enable-local-eval nil))
       (hack-local-variables))
     (current-buffer)))
 

=== modified file 'lisp/emacs-lisp/copyright.el'
--- a/lisp/emacs-lisp/copyright.el      2012-05-04 06:13:18 +0000
+++ b/lisp/emacs-lisp/copyright.el      2012-08-11 02:12:12 +0000
@@ -362,10 +362,11 @@
   (dolist (file (directory-files directory t match nil))
     (unless (file-directory-p file)
       (message "Updating file `%s'" file)
-      (find-file file)
-      (let ((inhibit-read-only t)
-           (enable-local-variables :safe)
-           copyright-query)
+      ;; FIXME we should not use find-file+save+kill.
+      (let ((enable-local-variables :safe)
+           (enable-local-eval nil))
+       (find-file file))
+      (let ((inhibit-read-only t))
        (if fix
            (copyright-fix-years)
          (copyright-update)))

=== modified file 'lisp/files.el'
--- a/lisp/files.el     2012-08-08 08:17:13 +0000
+++ b/lisp/files.el     2012-08-11 02:12:12 +0000
@@ -3102,11 +3102,16 @@
              ;; Obey `enable-local-eval'.
              ((eq var 'eval)
               (when enable-local-eval
-                (push elt all-vars)
-                (or (eq enable-local-eval t)
-                    (hack-one-local-variable-eval-safep (eval (quote val)))
-                    (safe-local-variable-p var val)
-                    (push elt unsafe-vars))))
+                (let ((safe (or (hack-one-local-variable-eval-safep
+                                 (eval (quote val)))
+                                ;; In case previously marked safe (bug#5636).
+                                (safe-local-variable-p var val))))
+                  ;; If not safe and e-l-v = :safe, ignore totally.
+                  (when (or safe (not (eq enable-local-variables :safe)))
+                    (push elt all-vars)
+                    (or (eq enable-local-eval t)
+                        safe
+                        (push elt unsafe-vars))))))
              ;; Ignore duplicates (except `mode') in the present list.
              ((and (assq var all-vars) (not (eq var 'mode))) nil)
              ;; Accept known-safe variables.

=== modified file 'lisp/tutorial.el'
--- a/lisp/tutorial.el  2012-04-19 17:20:26 +0000
+++ b/lisp/tutorial.el  2012-08-11 02:12:12 +0000
@@ -829,7 +829,8 @@
         (if old-tut-file
             (progn
               (insert-file-contents (tutorial--saved-file))
-             (let ((enable-local-variables :safe))
+             (let ((enable-local-variables :safe)
+                    (enable-local-eval nil))
                (hack-local-variables))
               ;; FIXME?  What we actually want is to ignore dir-locals (?).
               (setq buffer-read-only nil) ; bug#11118
@@ -848,7 +849,8 @@
               (goto-char tutorial--point-before-chkeys)
               (setq tutorial--point-before-chkeys (point-marker)))
           (insert-file-contents (expand-file-name filename tutorial-directory))
-         (let ((enable-local-variables :safe))
+         (let ((enable-local-variables :safe)
+                (enable-local-eval nil))
            (hack-local-variables))
           ;; FIXME?  What we actually want is to ignore dir-locals (?).
           (setq buffer-read-only nil) ; bug#11118

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-08-10 18:23:45 +0000
+++ b/src/ChangeLog     2012-08-11 02:13:55 +0000
@@ -1,3 +1,14 @@
+2012-08-08  YAMAMOTO Mitsuharu  <address@hidden>
+
+       * unexmacosx.c (copy_data_segment): Copy initialized data in
+       statically linked libraries from input file rather than memory.
+
+2012-08-07  YAMAMOTO Mitsuharu  <address@hidden>
+
+       * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
+       LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
+       (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
+
 2012-08-10  Glenn Morris  <address@hidden>
 
        * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.

=== modified file 'src/unexmacosx.c'
--- a/src/unexmacosx.c  2012-07-05 18:35:48 +0000
+++ b/src/unexmacosx.c  2012-08-11 02:12:12 +0000
@@ -607,6 +607,21 @@
       printf ("LC_FUNCTION_STARTS");
       break;
 #endif
+#ifdef LC_MAIN
+    case LC_MAIN:
+      printf ("LC_MAIN          ");
+      break;
+#endif
+#ifdef LC_SOURCE_VERSION
+    case LC_SOURCE_VERSION:
+      printf ("LC_SOURCE_VERSION");
+      break;
+#endif
+#ifdef LC_DYLIB_CODE_SIGN_DRS
+    case LC_DYLIB_CODE_SIGN_DRS:
+      printf ("LC_DYLIB_CODE_SIGN_DRS");
+      break;
+#endif
     default:
       printf ("unknown          ");
     }
@@ -798,8 +813,24 @@
         file.  */
       if (strncmp (sectp->sectname, SECT_DATA, 16) == 0)
        {
-         if (!unexec_write (sectp->offset, (void *) sectp->addr, sectp->size))
+         extern char my_edata[];
+         unsigned long my_size;
+
+         /* The __data section is basically dumped from memory.  But
+            initialized data in statically linked libraries are
+            copied from the input file.  In particular,
+            add_image_hook.names and add_image_hook.pointers stored
+            by libarclite_macosx.a, are restored so that they will be
+            reinitialized when the dumped binary is executed.  */
+         my_size = (unsigned long)my_edata - sectp->addr;
+         if (!(sectp->addr <= (unsigned long)my_edata
+               && my_size <= sectp->size))
+           unexec_error ("my_edata is not in section %s", SECT_DATA);
+         if (!unexec_write (sectp->offset, (void *) sectp->addr, my_size))
            unexec_error ("cannot write section %s", SECT_DATA);
+         if (!unexec_copy (sectp->offset + my_size, old_file_offset + my_size,
+                           sectp->size - my_size))
+           unexec_error ("cannot copy section %s", SECT_DATA);
          if (!unexec_write (header_offset, sectp, sizeof (struct section)))
            unexec_error ("cannot write section %s's header", SECT_DATA);
        }
@@ -1147,8 +1178,9 @@
 #endif
 
 #ifdef LC_FUNCTION_STARTS
-/* Copy a LC_FUNCTION_STARTS load command from the input file to the
-   output file, adjusting the data offset field.  */
+/* Copy a LC_FUNCTION_STARTS/LC_DYLIB_CODE_SIGN_DRS load command from
+   the input file to the output file, adjusting the data offset
+   field.  */
 static void
 copy_linkedit_data (struct load_command *lc, long delta)
 {
@@ -1242,6 +1274,9 @@
 #endif
 #ifdef LC_FUNCTION_STARTS
       case LC_FUNCTION_STARTS:
+#ifdef LC_DYLIB_CODE_SIGN_DRS
+      case LC_DYLIB_CODE_SIGN_DRS:
+#endif
        copy_linkedit_data (lca[i], linkedit_delta);
        break;
 #endif

=== modified file 'test/ChangeLog'
--- a/test/ChangeLog    2012-08-10 20:25:43 +0000
+++ b/test/ChangeLog    2012-08-11 02:12:12 +0000
@@ -1,3 +1,15 @@
+2012-08-10  Glenn Morris  <address@hidden>
+
+       * automated/files.el (files-test-disable-local-variables): New test.
+
+2012-08-08  Glenn Morris  <address@hidden>
+
+       * automated/files.el: New file.
+
+2012-08-07  Glenn Morris  <address@hidden>
+
+       * automated/Makefile.in (all): Fix typo.
+
 2012-08-10  Dmitry Gutov  <address@hidden>
 
        * automated/ruby-mode-tests.el (ruby-should-indent):

=== modified file 'test/automated/Makefile.in'
--- a/test/automated/Makefile.in        2012-05-21 00:44:34 +0000
+++ b/test/automated/Makefile.in        2012-08-11 02:12:12 +0000
@@ -55,7 +55,7 @@
           esac; \
         done
 
-all: test
+all: check
 
 doit:
 

=== added file 'test/automated/files.el'
--- a/test/automated/files.el   1970-01-01 00:00:00 +0000
+++ b/test/automated/files.el   2012-08-10 07:13:06 +0000
@@ -0,0 +1,52 @@
+;;; files.el --- tests for file handling.
+
+;; Copyright (C) 2012 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'ert)
+
+(defvar files-test-var1 nil)
+
+(defun files-test-fun1 ()
+  (setq files-test-var1 t))
+
+(ert-deftest files-test-bug12155 ()
+  "Test for http://debbugs.gnu.org/12155 ."
+  (with-temp-buffer
+    (insert "text\n"
+            ";; Local Variables:\n"
+            ";; eval: (files-test-fun1)\n"
+            ";; End:\n")
+    (let ((enable-local-variables :safe)
+          (enable-local-eval 'maybe))
+      (hack-local-variables)
+      (should (eq files-test-var1 nil)))))
+
+(ert-deftest files-test-disable-local-variables ()
+  "Test that setting enable-local-variables to nil works."
+  (with-temp-buffer
+    (insert "text\n"
+            ";; Local Variables:\n"
+            ";; files-test-var1: t\n"
+            ";; End:\n")
+    (let ((enable-local-variables nil))
+      (hack-local-variables)
+      (should (eq files-test-var1 nil)))))
+
+;;; files.el ends here


reply via email to

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