mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-24 07:20:37 +00:00
Merge from emacs-24; up to 2012-05-02T11:38:01Z!lekktu@gmail.com
This commit is contained in:
commit
5725bd2cc0
@ -1,3 +1,7 @@
|
||||
2012-08-10 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* bzrmerge.el (bzrmerge-resolve): Disable local eval:.
|
||||
|
||||
2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
|
||||
|
||||
* coccinelle/overlay.cocci, coccinelle/symbol.cocci: Remove.
|
||||
|
@ -160,7 +160,8 @@ Type `y' to skip this revision,
|
||||
(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)))
|
||||
|
@ -1,3 +1,18 @@
|
||||
2012-08-10 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* 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 <rgm@gnu.org>
|
||||
|
||||
* 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 <monnier@iro.umontreal.ca>
|
||||
|
||||
* emacs-lisp/rx.el (rx-constituents): Don't define as constant.
|
||||
|
@ -228,7 +228,8 @@ expression, in which case we want to handle forms differently."
|
||||
(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 @@ which lists the file name and which functions are in it, etc."
|
||||
(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)))
|
||||
|
||||
|
@ -362,10 +362,11 @@ If FIX is non-nil, run `copyright-fix-years' instead."
|
||||
(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)))
|
||||
|
@ -3102,11 +3102,16 @@ DIR-NAME is the name of the associated directory. Otherwise it is nil."
|
||||
;; 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.
|
||||
|
@ -829,7 +829,8 @@ Run the Viper tutorial? "))
|
||||
(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 @@ Run the Viper tutorial? "))
|
||||
(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
|
||||
|
@ -1,3 +1,14 @@
|
||||
2012-08-08 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
|
||||
|
||||
* unexmacosx.c (copy_data_segment): Copy initialized data in
|
||||
statically linked libraries from input file rather than memory.
|
||||
|
||||
2012-08-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
|
||||
|
||||
* 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 <rgm@gnu.org>
|
||||
|
||||
* conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
|
||||
|
@ -606,6 +606,21 @@ print_load_command_name (int lc)
|
||||
case LC_FUNCTION_STARTS:
|
||||
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 @@ copy_data_segment (struct load_command *lc)
|
||||
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 @@ copy_dyld_info (struct load_command *lc, long delta)
|
||||
#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 @@ dump_it (void)
|
||||
#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
|
||||
|
@ -1,3 +1,15 @@
|
||||
2012-08-10 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* automated/files.el (files-test-disable-local-variables): New test.
|
||||
|
||||
2012-08-08 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* automated/files.el: New file.
|
||||
|
||||
2012-08-07 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* automated/Makefile.in (all): Fix typo.
|
||||
|
||||
2012-08-10 Dmitry Gutov <dgutov@yandex.ru>
|
||||
|
||||
* automated/ruby-mode-tests.el (ruby-should-indent):
|
||||
|
@ -55,7 +55,7 @@ setwins=subdirs=`find . -type d -print`; \
|
||||
esac; \
|
||||
done
|
||||
|
||||
all: test
|
||||
all: check
|
||||
|
||||
doit:
|
||||
|
||||
|
52
test/automated/files.el
Normal file
52
test/automated/files.el
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user