Now on revision 106826. ------------------------------------------------------------ revno: 106826 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-01-09 15:58:46 +0800 message: Add missing ChangeLog entry for last change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-01-08 12:49:44 +0000 +++ lisp/ChangeLog 2012-01-09 07:58:46 +0000 @@ -1,3 +1,7 @@ +2012-01-09 Chong Yidong + + * custom.el (custom-safe-themes): Use SHA-256 for hashing. + 2012-01-08 Alan Mackenzie Optimise font locking in long enum definitions. ------------------------------------------------------------ revno: 106825 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-01-09 15:48:51 +0800 message: * lisp/custom.el (custom-safe-themes): Use SHA-256 for hashing. * doc/emacs/custom.texi (Custom Themes): Switched custom-safe-themes to use SHA-256. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2012-01-07 08:55:43 +0000 +++ doc/emacs/ChangeLog 2012-01-09 07:48:51 +0000 @@ -1,3 +1,8 @@ +2012-01-09 Chong Yidong + + * custom.texi (Custom Themes): Switched custom-safe-themes to use + SHA-256. + 2012-01-07 Chong Yidong * display.texi (Useless Whitespace): Add Whitespace mode. === modified file 'doc/emacs/custom.texi' --- doc/emacs/custom.texi 2012-01-07 08:12:27 +0000 +++ doc/emacs/custom.texi 2012-01-09 07:48:51 +0000 @@ -598,7 +598,7 @@ loading a Custom theme can execute arbitrary Lisp code, you should only say yes if you know that the theme is safe; in that case, Emacs offers to remember in the future that the theme is safe (this is done -by saving the theme file's SHA1 hash to the variable +by saving the theme file's SHA-256 hash to the variable @code{custom-safe-themes}; if you want to treat all themes as safe, change its value to @code{t}). Themes that come with Emacs (in the @file{etc/themes} directory) are exempt from this check, and are === modified file 'lisp/custom.el' --- lisp/custom.el 2012-01-05 11:12:11 +0000 +++ lisp/custom.el 2012-01-09 07:48:51 +0000 @@ -1105,7 +1105,7 @@ (defcustom custom-safe-themes '(default) "Themes that are considered safe to load. -If the value is a list, each element should be either the `sha1' +If the value is a list, each element should be either the SHA-256 hash of a safe theme file, or the symbol `default', which stands for any theme in the built-in Emacs theme directory (a directory named \"themes\" in `data-directory'). @@ -1161,7 +1161,7 @@ (error "Unable to find theme file for `%s'" theme)) (with-temp-buffer (insert-file-contents fn) - (setq hash (sha1 (current-buffer))) + (setq hash (secure-hash 'sha256 (current-buffer))) ;; Check file safety with `custom-safe-themes', prompting the ;; user if necessary. (when (or no-confirm ------------------------------------------------------------ revno: 106824 [merge] committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-01-09 13:48:13 +0800 message: Merge changes from emacs-23 branch diff: ------------------------------------------------------------ revno: 106823 [merge] committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-01-09 13:29:45 +0800 message: Merge changes from emacs-23 branch diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-01-07 05:48:06 +0000 +++ doc/lispref/ChangeLog 2012-01-09 05:29:45 +0000 @@ -1,3 +1,8 @@ +2011-12-27 Stefan Monnier + + * variables.texi (Creating Buffer-Local): Warn against misuses of + make-variable-buffer-local (bug#10258). + 2012-01-07 Lars Magne Ingebrigtsen * macros.texi (Defining Macros): Document `doc-string' (bug#9668). === modified file 'doc/lispref/variables.texi' --- doc/lispref/variables.texi 2012-01-06 10:53:41 +0000 +++ doc/lispref/variables.texi 2012-01-09 05:29:45 +0000 @@ -1351,7 +1351,10 @@ @deffn Command make-variable-buffer-local variable This function marks @var{variable} (a symbol) automatically buffer-local, so that any subsequent attempt to set it will make it -local to the current buffer at the time. +local to the current buffer at the time. Unlike +@code{make-local-variable}, with which it is often confused, this +cannot be undone, and affects the behavior of the variable in all +buffers. A peculiar wrinkle of this feature is that binding the variable (with @code{let} or other binding constructs) does not create a buffer-local ------------------------------------------------------------ revno: 106822 committer: Alan Mackenzie branch nick: trunk timestamp: Sun 2012-01-08 12:49:44 +0000 message: Optimise font locking in long enum definitions. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-01-07 20:00:56 +0000 +++ lisp/ChangeLog 2012-01-08 12:49:44 +0000 @@ -1,3 +1,12 @@ +2012-01-08 Alan Mackenzie + + Optimise font locking in long enum definitions. + + * progmodes/cc-fonts.el (c-font-lock-declarations): Add an extra + arm to a cond form to handle enums. + * progmodes/cc-langs.el (c-enums-contain-decls): New lang variable. + * progmodes/cc-mode.el (c-font-lock-fontify-region): Correct a typo. + 2012-01-07 Paul Eggert * files.el (move-file-to-trash): Preserve default file modes on error. === modified file 'lisp/progmodes/cc-fonts.el' --- lisp/progmodes/cc-fonts.el 2012-01-05 09:46:05 +0000 +++ lisp/progmodes/cc-fonts.el 2012-01-08 12:49:44 +0000 @@ -1428,6 +1428,21 @@ (c-fontify-recorded-types-and-refs) nil) + ((and (not c-enums-contain-decls) + ;; An optimisation quickly to eliminate scans of long enum + ;; declarations in the next cond arm. + (let ((paren-state (c-parse-state))) + (and + (numberp (car paren-state)) + (save-excursion + (goto-char (car paren-state)) + (c-backward-token-2) + (or (looking-at c-brace-list-key) + (progn + (c-backward-token-2) + (looking-at c-brace-list-key))))))) + t) + (t ;; Are we at a declarator? Try to go back to the declaration ;; to check this. If we get there, check whether a "typedef" === modified file 'lisp/progmodes/cc-langs.el' --- lisp/progmodes/cc-langs.el 2012-01-05 09:46:05 +0000 +++ lisp/progmodes/cc-langs.el 2012-01-08 12:49:44 +0000 @@ -2938,6 +2938,12 @@ (consp (c-lang-const c-<>-arglist-kwds)))) (c-lang-defvar c-recognize-<>-arglists (c-lang-const c-recognize-<>-arglists)) +(c-lang-defconst c-enums-contain-decls + "Non-nil means that an enum structure can contain declarations." + t nil + java t) +(c-lang-defvar c-enums-contain-decls (c-lang-const c-enums-contain-decls)) + (c-lang-defconst c-recognize-paren-inits "Non-nil means that parenthesis style initializers exist, i.e. constructs like === modified file 'lisp/progmodes/cc-mode.el' --- lisp/progmodes/cc-mode.el 2012-01-05 09:46:05 +0000 +++ lisp/progmodes/cc-mode.el 2012-01-08 12:49:44 +0000 @@ -1158,7 +1158,7 @@ ;; Effectively advice around `font-lock-fontify-region' which extends the ;; region (BEG END), for example, to avoid context fontification chopping ;; off the start of the context. Do not do anything if it's already been - ;; done (i.e. from and after-change fontification. An example (C++) where + ;; done (i.e. from an after-change fontification. An example (C++) where ;; this used to happen is this: ;; ;; template ------------------------------------------------------------ revno: 106821 [merge] fixes bug(s): http://debbugs.gnu.org/10400 http://debbugs.gnu.org/10401 committer: Paul Eggert branch nick: trunk timestamp: Sat 2012-01-07 12:03:28 -0800 message: Fix two security races with file permissions. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-01-07 06:00:56 +0000 +++ lisp/ChangeLog 2012-01-07 20:00:56 +0000 @@ -1,3 +1,8 @@ +2012-01-07 Paul Eggert + + * files.el (move-file-to-trash): Preserve default file modes on error. + (Bug#10401) + 2012-01-07 Lars Magne Ingebrigtsen * faces.el (set-face-attribute): Clarify the meaning of the nil === modified file 'lisp/files.el' --- lisp/files.el 2012-01-06 10:53:41 +0000 +++ lisp/files.el 2012-01-07 19:51:13 +0000 @@ -6461,12 +6461,14 @@ ;; Ensure that the trash directory exists; otherwise, create it. (let ((saved-default-file-modes (default-file-modes))) - (set-default-file-modes ?\700) - (unless (file-exists-p trash-files-dir) - (make-directory trash-files-dir t)) - (unless (file-exists-p trash-info-dir) - (make-directory trash-info-dir t)) - (set-default-file-modes saved-default-file-modes)) + (unwind-protect + (progn + (set-default-file-modes #o700) + (unless (file-exists-p trash-files-dir) + (make-directory trash-files-dir t)) + (unless (file-exists-p trash-info-dir) + (make-directory trash-info-dir t))) + (set-default-file-modes saved-default-file-modes))) ;; Try to move to trash with .trashinfo undo information (save-excursion === modified file 'src/ChangeLog' --- src/ChangeLog 2012-01-07 11:57:48 +0000 +++ src/ChangeLog 2012-01-07 19:51:13 +0000 @@ -1,3 +1,15 @@ +2012-01-07 Paul Eggert + + emacs: fix an auto-save permissions race condition (Bug#10400) + * fileio.c (auto_saving_dir_umask): New static var. + (Fmake_directory_internal): Use it. + (do_auto_save_make_dir): Set it, instead of invoking chmod after + creating the directory. The old code temporarily assigns + too-generous permissions to the directory. + (do_auto_save_eh): Clear it. + (Fdo_auto_save): Catch all errors, not just file errors, so + that the var is always cleared. + 2012-01-07 Eli Zaretskii * search.c (scan_buffer): Pass character positions to === modified file 'src/fileio.c' --- src/fileio.c 2012-01-05 09:46:05 +0000 +++ src/fileio.c 2012-01-07 19:51:13 +0000 @@ -90,6 +90,9 @@ /* Nonzero during writing of auto-save files */ static int auto_saving; +/* Nonzero umask during creation of auto-save directories */ +static int auto_saving_dir_umask; + /* Set by auto_save_1 to mode of original file so Fwrite_region will create a new file with the same mode as the original */ static int auto_save_mode_bits; @@ -2062,7 +2065,7 @@ #ifdef WINDOWSNT if (mkdir (dir) != 0) #else - if (mkdir (dir, 0777) != 0) + if (mkdir (dir, 0777 & ~auto_saving_dir_umask) != 0) #endif report_file_error ("Creating directory", list1 (directory)); @@ -5205,16 +5208,18 @@ static Lisp_Object do_auto_save_make_dir (Lisp_Object dir) { - Lisp_Object mode; + Lisp_Object result; - call2 (Qmake_directory, dir, Qt); - XSETFASTINT (mode, 0700); - return Fset_file_modes (dir, mode); + auto_saving_dir_umask = 077; + result = call2 (Qmake_directory, dir, Qt); + auto_saving_dir_umask = 0; + return result; } static Lisp_Object do_auto_save_eh (Lisp_Object ignore) { + auto_saving_dir_umask = 0; return Qnil; } @@ -5282,7 +5287,7 @@ dir = Ffile_name_directory (listfile); if (NILP (Ffile_directory_p (dir))) internal_condition_case_1 (do_auto_save_make_dir, - dir, Fcons (Fcons (Qfile_error, Qnil), Qnil), + dir, Qt, do_auto_save_eh); UNGCPRO; } ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.