diff options
| author | Glenn Morris | 2014-05-11 23:59:30 -0700 |
|---|---|---|
| committer | Glenn Morris | 2014-05-11 23:59:30 -0700 |
| commit | bbbabffe06d4c763534d5be92844c48a3f8746e2 (patch) | |
| tree | a6fffb13638948223f3142e5209cbce57282fbbd /lisp | |
| parent | ffd6d9c4d321e93e301f9cafd1fe054389898978 (diff) | |
| parent | 96b894717caa773aa6d98ff57385f1c7537e8972 (diff) | |
| download | emacs-bbbabffe06d4c763534d5be92844c48a3f8746e2.tar.gz emacs-bbbabffe06d4c763534d5be92844c48a3f8746e2.zip | |
Merge from emacs-24; up to 2014-05-12T06:15:47Z!rgm@gnu.org
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 53 | ||||
| -rw-r--r-- | lisp/calendar/todo-mode.el | 2 | ||||
| -rw-r--r-- | lisp/electric.el | 45 | ||||
| -rw-r--r-- | lisp/emacs-lisp/find-gc.el | 149 | ||||
| -rw-r--r-- | lisp/emacs-lisp/nadvice.el | 43 | ||||
| -rw-r--r-- | lisp/files.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/ChangeLog | 1 | ||||
| -rw-r--r-- | lisp/net/browse-url.el | 41 | ||||
| -rw-r--r-- | lisp/org/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/org/ob-screen.el | 4 | ||||
| -rw-r--r-- | lisp/printing.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/compile.el | 13 | ||||
| -rw-r--r-- | lisp/ps-print.el | 2 | ||||
| -rw-r--r-- | lisp/url/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/url/url-handlers.el | 53 | ||||
| -rw-r--r-- | lisp/vc/vc-hg.el | 9 |
16 files changed, 179 insertions, 253 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 52c1f0c164a..0de3533c6c4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,54 @@ | |||
| 1 | 2014-05-12 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emacs-lisp/nadvice.el (advice--interactive-form): Don't get fooled | ||
| 4 | into autoloading just because of a silly indirection. | ||
| 5 | |||
| 6 | 2014-05-12 Santiago PayĆ i Miralta <santiagopim@gmail.com> (tiny change) | ||
| 7 | |||
| 8 | * vc/vc-hg.el (vc-hg-unregister): New function. (Bug#17454) | ||
| 9 | |||
| 10 | 2014-05-12 Glenn Morris <rgm@gnu.org> | ||
| 11 | |||
| 12 | * emacs-lisp/find-gc.el: Move to ../admin. | ||
| 13 | |||
| 14 | * printing.el (pr-version): | ||
| 15 | * ps-print.el (ps-print-version): Also mention bug-gnu-emacs. | ||
| 16 | |||
| 17 | * net/browse-url.el (browse-url-mosaic): | ||
| 18 | Create /tmp/Mosaic.PID as a private file. | ||
| 19 | |||
| 20 | 2014-05-12 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 21 | |||
| 22 | * emacs-lisp/nadvice.el: Support adding a given function multiple times. | ||
| 23 | (advice--member-p): If name is given, only compare the name. | ||
| 24 | (advice--remove-function): Don't stop at the first match. | ||
| 25 | (advice--normalize-place): New function. | ||
| 26 | (add-function, remove-function): Use it. | ||
| 27 | (advice--add-function): Pass the name, if any, to | ||
| 28 | advice--remove-function. | ||
| 29 | |||
| 30 | 2014-05-12 Philipp Rumpf <prumpf@gmail.com> (tiny change) | ||
| 31 | |||
| 32 | * electric.el (electric-indent-post-self-insert-function): Don't use | ||
| 33 | `pos' after modifying the buffer (bug#17449). | ||
| 34 | |||
| 35 | 2014-05-12 Stephen Berman <stephen.berman@gmx.net> | ||
| 36 | |||
| 37 | * calendar/todo-mode.el (todo-insert-item-from-calendar): | ||
| 38 | Correct argument list to conform to todo-insert-item--basic. | ||
| 39 | |||
| 40 | 2014-05-12 Glenn Morris <rgm@gnu.org> | ||
| 41 | |||
| 42 | * files.el (cd-absolute): Test if directory is accessible | ||
| 43 | rather than executable. (Bug#17330) | ||
| 44 | |||
| 45 | * progmodes/compile.el (recompile): | ||
| 46 | Handle C-u M-x recompile from a non-compilation buffer. (Bug#17444) | ||
| 47 | |||
| 48 | * net/browse-url.el (browse-url-mosaic): | ||
| 49 | Be careful when writing /tmp/Mosaic.PID. (Bug#17428) | ||
| 50 | This is CVE-2014-3423. | ||
| 51 | |||
| 1 | 2014-05-11 Stefan Monnier <monnier@iro.umontreal.ca> | 52 | 2014-05-11 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 53 | ||
| 3 | * mouse.el: Use the normal toplevel loop while dragging. | 54 | * mouse.el: Use the normal toplevel loop while dragging. |
| @@ -89,6 +140,7 @@ | |||
| 89 | (tramp-remote-coding-commands): Enhance docstring. | 140 | (tramp-remote-coding-commands): Enhance docstring. |
| 90 | (tramp-find-inline-encoding): Replace "%t" by a temporary file | 141 | (tramp-find-inline-encoding): Replace "%t" by a temporary file |
| 91 | name. (Bug#17415) | 142 | name. (Bug#17415) |
| 143 | This is CVE-2014-3424. | ||
| 92 | 144 | ||
| 93 | 2014-05-08 Glenn Morris <rgm@gnu.org> | 145 | 2014-05-08 Glenn Morris <rgm@gnu.org> |
| 94 | 146 | ||
| @@ -96,6 +148,7 @@ | |||
| 96 | (find-gc-source-files): Update some names. | 148 | (find-gc-source-files): Update some names. |
| 97 | (trace-call-tree): Simplify and update. | 149 | (trace-call-tree): Simplify and update. |
| 98 | Avoid predictable temp-file names. (http://bugs.debian.org/747100) | 150 | Avoid predictable temp-file names. (http://bugs.debian.org/747100) |
| 151 | This is CVE-2014-3422. | ||
| 99 | 152 | ||
| 100 | 2014-05-08 Stefan Monnier <monnier@iro.umontreal.ca> | 153 | 2014-05-08 Stefan Monnier <monnier@iro.umontreal.ca> |
| 101 | 154 | ||
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index 4f4aefa6317..f7f2b1d1539 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el | |||
| @@ -1984,7 +1984,7 @@ prompt for a todo file and then for a category in it." | |||
| 1984 | (setq todo-date-from-calendar | 1984 | (setq todo-date-from-calendar |
| 1985 | (calendar-date-string (calendar-cursor-to-date t) t t)) | 1985 | (calendar-date-string (calendar-cursor-to-date t) t t)) |
| 1986 | (calendar-exit) | 1986 | (calendar-exit) |
| 1987 | (todo-insert-item--basic arg nil nil todo-date-from-calendar)) | 1987 | (todo-insert-item--basic arg nil todo-date-from-calendar)) |
| 1988 | 1988 | ||
| 1989 | (define-key calendar-mode-map "it" 'todo-insert-item-from-calendar) | 1989 | (define-key calendar-mode-map "it" 'todo-insert-item-from-calendar) |
| 1990 | 1990 | ||
diff --git a/lisp/electric.el b/lisp/electric.el index e8ceaa6406c..bf73dbb256f 100644 --- a/lisp/electric.el +++ b/lisp/electric.el | |||
| @@ -259,29 +259,30 @@ or comment." | |||
| 259 | (unless (eq act 'do-indent) (nth 8 (syntax-ppss)))))))) | 259 | (unless (eq act 'do-indent) (nth 8 (syntax-ppss)))))))) |
| 260 | ;; For newline, we want to reindent both lines and basically behave like | 260 | ;; For newline, we want to reindent both lines and basically behave like |
| 261 | ;; reindent-then-newline-and-indent (whose code we hence copied). | 261 | ;; reindent-then-newline-and-indent (whose code we hence copied). |
| 262 | (when (<= pos (line-beginning-position)) | 262 | (let ((at-newline (<= pos (line-beginning-position)))) |
| 263 | (let ((before (copy-marker (1- pos) t))) | 263 | (when at-newline |
| 264 | (save-excursion | 264 | (let ((before (copy-marker (1- pos) t))) |
| 265 | (unless (or (memq indent-line-function | 265 | (save-excursion |
| 266 | electric-indent-functions-without-reindent) | 266 | (unless (or (memq indent-line-function |
| 267 | electric-indent-inhibit) | 267 | electric-indent-functions-without-reindent) |
| 268 | ;; Don't reindent the previous line if the indentation function | 268 | electric-indent-inhibit) |
| 269 | ;; is not a real one. | 269 | ;; Don't reindent the previous line if the indentation function |
| 270 | ;; is not a real one. | ||
| 271 | (goto-char before) | ||
| 272 | (indent-according-to-mode)) | ||
| 273 | ;; We are at EOL before the call to indent-according-to-mode, and | ||
| 274 | ;; after it we usually are as well, but not always. We tried to | ||
| 275 | ;; address it with `save-excursion' but that uses a normal marker | ||
| 276 | ;; whereas we need `move after insertion', so we do the | ||
| 277 | ;; save/restore by hand. | ||
| 270 | (goto-char before) | 278 | (goto-char before) |
| 271 | (indent-according-to-mode)) | 279 | (when (eolp) |
| 272 | ;; We are at EOL before the call to indent-according-to-mode, and | 280 | ;; Remove the trailing whitespace after indentation because |
| 273 | ;; after it we usually are as well, but not always. We tried to | 281 | ;; indentation may (re)introduce the whitespace. |
| 274 | ;; address it with `save-excursion' but that uses a normal marker | 282 | (delete-horizontal-space t))))) |
| 275 | ;; whereas we need `move after insertion', so we do the | 283 | (unless (and electric-indent-inhibit |
| 276 | ;; save/restore by hand. | 284 | (not at-newline)) |
| 277 | (goto-char before) | 285 | (indent-according-to-mode)))))) |
| 278 | (when (eolp) | ||
| 279 | ;; Remove the trailing whitespace after indentation because | ||
| 280 | ;; indentation may (re)introduce the whitespace. | ||
| 281 | (delete-horizontal-space t))))) | ||
| 282 | (unless (and electric-indent-inhibit | ||
| 283 | (> pos (line-beginning-position))) | ||
| 284 | (indent-according-to-mode))))) | ||
| 285 | 286 | ||
| 286 | (put 'electric-indent-post-self-insert-function 'priority 60) | 287 | (put 'electric-indent-post-self-insert-function 'priority 60) |
| 287 | 288 | ||
diff --git a/lisp/emacs-lisp/find-gc.el b/lisp/emacs-lisp/find-gc.el deleted file mode 100644 index 83eb26e86d7..00000000000 --- a/lisp/emacs-lisp/find-gc.el +++ /dev/null | |||
| @@ -1,149 +0,0 @@ | |||
| 1 | ;;; find-gc.el --- detect functions that call the garbage collector | ||
| 2 | |||
| 3 | ;; Copyright (C) 1992, 2001-2014 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Maintainer: emacs-devel@gnu.org | ||
| 6 | |||
| 7 | ;; This file is part of GNU Emacs. | ||
| 8 | |||
| 9 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 10 | ;; it under the terms of the GNU General Public License as published by | ||
| 11 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 12 | ;; (at your option) any later version. | ||
| 13 | |||
| 14 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 15 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | ;; GNU General Public License for more details. | ||
| 18 | |||
| 19 | ;; You should have received a copy of the GNU General Public License | ||
| 20 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 21 | |||
| 22 | ;;; Commentary: | ||
| 23 | |||
| 24 | ;; Produce in find-gc-unsafe-list the set of all functions that may invoke GC. | ||
| 25 | ;; This expects the Emacs sources to live in find-gc-source-directory. | ||
| 26 | |||
| 27 | ;;; Code: | ||
| 28 | |||
| 29 | (defvar find-gc-unsafe-list nil | ||
| 30 | "The list of unsafe functions is placed here by `find-gc-unsafe'.") | ||
| 31 | |||
| 32 | (defvar find-gc-source-directory | ||
| 33 | (file-name-as-directory (expand-file-name "src" source-directory)) | ||
| 34 | "Directory containing Emacs C sources.") | ||
| 35 | |||
| 36 | (defvar find-gc-subrs-callers nil | ||
| 37 | "Alist of users of subrs, from GC testing. | ||
| 38 | Each entry has the form (FUNCTION . FUNCTIONS-THAT-CALL-IT).") | ||
| 39 | |||
| 40 | (defvar find-gc-subrs-called nil | ||
| 41 | "Alist of subrs called, in GC testing. | ||
| 42 | Each entry has the form (FUNCTION . FUNCTIONS-IT-CALLS).") | ||
| 43 | |||
| 44 | |||
| 45 | ;;; Functions on this list are safe, even if they appear to be able | ||
| 46 | ;;; to call the target. | ||
| 47 | |||
| 48 | (defvar find-gc-noreturn-list '(Fsignal Fthrow wrong_type_argument)) | ||
| 49 | |||
| 50 | ;;; This was originally generated directory-files, but there were | ||
| 51 | ;;; too many files there that were not actually compiled. The | ||
| 52 | ;;; list below was created for a HP-UX 7.0 system. | ||
| 53 | |||
| 54 | (defvar find-gc-source-files | ||
| 55 | '("dispnew.c" "scroll.c" "xdisp.c" "window.c" | ||
| 56 | "term.c" "cm.c" "emacs.c" "keyboard.c" "macros.c" | ||
| 57 | "keymap.c" "sysdep.c" "buffer.c" "filelock.c" | ||
| 58 | "insdel.c" "marker.c" "minibuf.c" "fileio.c" | ||
| 59 | "dired.c" "cmds.c" "casefiddle.c" | ||
| 60 | "indent.c" "search.c" "regex.c" "undo.c" | ||
| 61 | "alloc.c" "data.c" "doc.c" "editfns.c" | ||
| 62 | "callint.c" "eval.c" "fns.c" "print.c" "lread.c" | ||
| 63 | "syntax.c" "unexcoff.c" | ||
| 64 | "bytecode.c" "process.c" "callproc.c" "doprnt.c" | ||
| 65 | "xterm.c" "xfns.c")) | ||
| 66 | |||
| 67 | |||
| 68 | (defun find-gc-unsafe () | ||
| 69 | "Return a list of unsafe functions--that is, which can call GC. | ||
| 70 | Also store it in `find-gc-unsafe-list'." | ||
| 71 | (trace-call-tree nil) | ||
| 72 | (trace-use-tree) | ||
| 73 | (find-unsafe-funcs 'Fgarbage_collect) | ||
| 74 | (setq find-gc-unsafe-list | ||
| 75 | (sort find-gc-unsafe-list | ||
| 76 | (function (lambda (x y) | ||
| 77 | (string-lessp (car x) (car y))))))) | ||
| 78 | |||
| 79 | ;;; This does a depth-first search to find all functions that can | ||
| 80 | ;;; ultimately call the function "target". The result is an a-list | ||
| 81 | ;;; in find-gc-unsafe-list; the cars are the unsafe functions, and the cdrs | ||
| 82 | ;;; are (one of) the unsafe functions that these functions directly | ||
| 83 | ;;; call. | ||
| 84 | |||
| 85 | (defun find-unsafe-funcs (target) | ||
| 86 | (setq find-gc-unsafe-list (list (list target))) | ||
| 87 | (trace-unsafe target)) | ||
| 88 | |||
| 89 | (defun trace-unsafe (func) | ||
| 90 | (let ((used (assq func find-gc-subrs-callers))) | ||
| 91 | (or used | ||
| 92 | (error "No find-gc-subrs-callers for %s" (car find-gc-unsafe-list))) | ||
| 93 | (while (setq used (cdr used)) | ||
| 94 | (or (assq (car used) find-gc-unsafe-list) | ||
| 95 | (memq (car used) find-gc-noreturn-list) | ||
| 96 | (progn | ||
| 97 | (push (cons (car used) func) find-gc-unsafe-list) | ||
| 98 | (trace-unsafe (car used))))))) | ||
| 99 | |||
| 100 | |||
| 101 | |||
| 102 | |||
| 103 | (defun trace-call-tree (&optional ignored) | ||
| 104 | (message "Setting up directories...") | ||
| 105 | (setq find-gc-subrs-called nil) | ||
| 106 | (let ((case-fold-search nil) | ||
| 107 | (default-directory find-gc-source-directory) | ||
| 108 | (files find-gc-source-files) | ||
| 109 | name entry rtlfile) | ||
| 110 | (dolist (file files) | ||
| 111 | (message "Compiling %s..." file) | ||
| 112 | (call-process "gcc" nil nil nil "-I" "." "-I" "../lib" | ||
| 113 | "-fdump-rtl-expand" "-o" null-device "-c" file) | ||
| 114 | (setq rtlfile | ||
| 115 | (file-expand-wildcards (format "%s.*.expand" file) t)) | ||
| 116 | (if (/= 1 (length rtlfile)) | ||
| 117 | (message "Error compiling `%s'?" file) | ||
| 118 | (with-temp-buffer | ||
| 119 | (insert-file-contents (setq rtlfile (car rtlfile))) | ||
| 120 | (delete-file rtlfile) | ||
| 121 | (while (re-search-forward ";; Function \\|(call_insn " nil t) | ||
| 122 | (if (= (char-after (- (point) 3)) ?o) | ||
| 123 | (progn | ||
| 124 | (looking-at "[a-zA-Z0-9_]+") | ||
| 125 | (setq name (intern (match-string 0))) | ||
| 126 | (message "%s : %s" (car files) name) | ||
| 127 | (setq entry (list name) | ||
| 128 | find-gc-subrs-called | ||
| 129 | (cons entry find-gc-subrs-called))) | ||
| 130 | (if (looking-at ".*\n?.*\"\\([A-Za-z0-9_]+\\)\"") | ||
| 131 | (progn | ||
| 132 | (setq name (intern (match-string 1))) | ||
| 133 | (or (memq name (cdr entry)) | ||
| 134 | (setcdr entry (cons name (cdr entry))))))))))))) | ||
| 135 | |||
| 136 | (defun trace-use-tree () | ||
| 137 | (setq find-gc-subrs-callers (mapcar 'list (mapcar 'car find-gc-subrs-called))) | ||
| 138 | (let ((ptr find-gc-subrs-called) | ||
| 139 | p2 found) | ||
| 140 | (while ptr | ||
| 141 | (setq p2 (car ptr)) | ||
| 142 | (while (setq p2 (cdr p2)) | ||
| 143 | (if (setq found (assq (car p2) find-gc-subrs-callers)) | ||
| 144 | (setcdr found (cons (car (car ptr)) (cdr found))))) | ||
| 145 | (setq ptr (cdr ptr))))) | ||
| 146 | |||
| 147 | (provide 'find-gc) | ||
| 148 | |||
| 149 | ;;; find-gc.el ends here | ||
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index 0e2536f8179..01027c43148 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el | |||
| @@ -134,7 +134,7 @@ Each element has the form (WHERE BYTECODE STACK) where: | |||
| 134 | (defun advice--interactive-form (function) | 134 | (defun advice--interactive-form (function) |
| 135 | ;; Like `interactive-form' but tries to avoid autoloading functions. | 135 | ;; Like `interactive-form' but tries to avoid autoloading functions. |
| 136 | (when (commandp function) | 136 | (when (commandp function) |
| 137 | (if (not (and (symbolp function) (autoloadp (symbol-function function)))) | 137 | (if (not (and (symbolp function) (autoloadp (indirect-function function)))) |
| 138 | (interactive-form function) | 138 | (interactive-form function) |
| 139 | `(interactive (advice-eval-interactive-spec | 139 | `(interactive (advice-eval-interactive-spec |
| 140 | (cadr (interactive-form ',function))))))) | 140 | (cadr (interactive-form ',function))))))) |
| @@ -183,9 +183,9 @@ WHERE is a symbol to select an entry in `advice--where-alist'." | |||
| 183 | (defun advice--member-p (function name definition) | 183 | (defun advice--member-p (function name definition) |
| 184 | (let ((found nil)) | 184 | (let ((found nil)) |
| 185 | (while (and (not found) (advice--p definition)) | 185 | (while (and (not found) (advice--p definition)) |
| 186 | (if (or (equal function (advice--car definition)) | 186 | (if (if name |
| 187 | (when name | 187 | (equal name (cdr (assq 'name (advice--props definition)))) |
| 188 | (equal name (cdr (assq 'name (advice--props definition)))))) | 188 | (equal function (advice--car definition))) |
| 189 | (setq found definition) | 189 | (setq found definition) |
| 190 | (setq definition (advice--cdr definition)))) | 190 | (setq definition (advice--cdr definition)))) |
| 191 | found)) | 191 | found)) |
| @@ -209,8 +209,8 @@ WHERE is a symbol to select an entry in `advice--where-alist'." | |||
| 209 | (lambda (first rest props) | 209 | (lambda (first rest props) |
| 210 | (cond ((not first) rest) | 210 | (cond ((not first) rest) |
| 211 | ((or (equal function first) | 211 | ((or (equal function first) |
| 212 | (equal function (cdr (assq 'name props)))) | 212 | (equal function (cdr (assq 'name props)))) |
| 213 | (list rest)))))) | 213 | (list (advice--remove-function rest function))))))) |
| 214 | 214 | ||
| 215 | (defvar advice--buffer-local-function-sample nil | 215 | (defvar advice--buffer-local-function-sample nil |
| 216 | "keeps an example of the special \"run the default value\" functions. | 216 | "keeps an example of the special \"run the default value\" functions. |
| @@ -232,6 +232,12 @@ different, but `function-equal' will hopefully ignore those differences.") | |||
| 232 | ;; This function acts like the t special value in buffer-local hooks. | 232 | ;; This function acts like the t special value in buffer-local hooks. |
| 233 | (lambda (&rest args) (apply (default-value var) args))))) | 233 | (lambda (&rest args) (apply (default-value var) args))))) |
| 234 | 234 | ||
| 235 | (defun advice--normalize-place (place) | ||
| 236 | (cond ((eq 'local (car-safe place)) `(advice--buffer-local ,@(cdr place))) | ||
| 237 | ((eq 'var (car-safe place)) (nth 1 place)) | ||
| 238 | ((symbolp place) `(default-value ',place)) | ||
| 239 | (t place))) | ||
| 240 | |||
| 235 | ;;;###autoload | 241 | ;;;###autoload |
| 236 | (defmacro add-function (where place function &optional props) | 242 | (defmacro add-function (where place function &optional props) |
| 237 | ;; TODO: | 243 | ;; TODO: |
| @@ -267,8 +273,9 @@ a special meaning: | |||
| 267 | the advice should be innermost (i.e. at the end of the list), | 273 | the advice should be innermost (i.e. at the end of the list), |
| 268 | whereas a depth of -100 means that the advice should be outermost. | 274 | whereas a depth of -100 means that the advice should be outermost. |
| 269 | 275 | ||
| 270 | If PLACE is a simple variable, only its global value will be affected. | 276 | If PLACE is a symbol, its `default-value' will be affected. |
| 271 | Use (local 'VAR) if you want to apply FUNCTION to VAR buffer-locally. | 277 | Use (local 'SYMBOL) if you want to apply FUNCTION to SYMBOL buffer-locally. |
| 278 | Use (var VAR) if you want to apply FUNCTION to the (lexical) VAR. | ||
| 272 | 279 | ||
| 273 | If one of FUNCTION or OLDFUN is interactive, then the resulting function | 280 | If one of FUNCTION or OLDFUN is interactive, then the resulting function |
| 274 | is also interactive. There are 3 cases: | 281 | is also interactive. There are 3 cases: |
| @@ -278,20 +285,18 @@ is also interactive. There are 3 cases: | |||
| 278 | `advice-eval-interactive-spec') and return the list of arguments to use. | 285 | `advice-eval-interactive-spec') and return the list of arguments to use. |
| 279 | - Else, use the interactive spec of FUNCTION and ignore the one of OLDFUN." | 286 | - Else, use the interactive spec of FUNCTION and ignore the one of OLDFUN." |
| 280 | (declare (debug t)) ;;(indent 2) | 287 | (declare (debug t)) ;;(indent 2) |
| 281 | (cond ((eq 'local (car-safe place)) | 288 | `(advice--add-function ,where (gv-ref ,(advice--normalize-place place)) |
| 282 | (setq place `(advice--buffer-local ,@(cdr place)))) | 289 | ,function ,props)) |
| 283 | ((symbolp place) | ||
| 284 | (setq place `(default-value ',place)))) | ||
| 285 | `(advice--add-function ,where (gv-ref ,place) ,function ,props)) | ||
| 286 | 290 | ||
| 287 | ;;;###autoload | 291 | ;;;###autoload |
| 288 | (defun advice--add-function (where ref function props) | 292 | (defun advice--add-function (where ref function props) |
| 289 | (let ((a (advice--member-p function (cdr (assq 'name props)) | 293 | (let* ((name (cdr (assq 'name props))) |
| 290 | (gv-deref ref)))) | 294 | (a (advice--member-p function name (gv-deref ref)))) |
| 291 | (when a | 295 | (when a |
| 292 | ;; The advice is already present. Remove the old one, first. | 296 | ;; The advice is already present. Remove the old one, first. |
| 293 | (setf (gv-deref ref) | 297 | (setf (gv-deref ref) |
| 294 | (advice--remove-function (gv-deref ref) (advice--car a)))) | 298 | (advice--remove-function (gv-deref ref) |
| 299 | (or name (advice--car a))))) | ||
| 295 | (setf (gv-deref ref) | 300 | (setf (gv-deref ref) |
| 296 | (advice--make where function (gv-deref ref) props)))) | 301 | (advice--make where function (gv-deref ref) props)))) |
| 297 | 302 | ||
| @@ -302,11 +307,7 @@ If FUNCTION was not added to PLACE, do nothing. | |||
| 302 | Instead of FUNCTION being the actual function, it can also be the `name' | 307 | Instead of FUNCTION being the actual function, it can also be the `name' |
| 303 | of the piece of advice." | 308 | of the piece of advice." |
| 304 | (declare (debug t)) | 309 | (declare (debug t)) |
| 305 | (cond ((eq 'local (car-safe place)) | 310 | (gv-letplace (getter setter) (advice--normalize-place place) |
| 306 | (setq place `(advice--buffer-local ,@(cdr place)))) | ||
| 307 | ((symbolp place) | ||
| 308 | (setq place `(default-value ',place)))) | ||
| 309 | (gv-letplace (getter setter) place | ||
| 310 | (macroexp-let2 nil new `(advice--remove-function ,getter ,function) | 311 | (macroexp-let2 nil new `(advice--remove-function ,getter ,function) |
| 311 | `(unless (eq ,new ,getter) ,(funcall setter new))))) | 312 | `(unless (eq ,new ,getter) ,(funcall setter new))))) |
| 312 | 313 | ||
diff --git a/lisp/files.el b/lisp/files.el index 5487e27198a..cd2feb69610 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -685,7 +685,7 @@ nil (meaning `default-directory') as the associated list element." | |||
| 685 | (if (file-exists-p dir) | 685 | (if (file-exists-p dir) |
| 686 | (error "%s is not a directory" dir) | 686 | (error "%s is not a directory" dir) |
| 687 | (error "%s: no such directory" dir)) | 687 | (error "%s: no such directory" dir)) |
| 688 | (unless (file-executable-p dir) | 688 | (unless (file-accessible-directory-p dir) |
| 689 | (error "Cannot cd to %s: Permission denied" dir)) | 689 | (error "Cannot cd to %s: Permission denied" dir)) |
| 690 | (setq default-directory dir) | 690 | (setq default-directory dir) |
| 691 | (setq list-buffers-directory dir))) | 691 | (setq list-buffers-directory dir))) |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index c97ad7fc0a2..dad0444fcb2 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | * gnus-fun.el (gnus-grab-cam-face): | 16 | * gnus-fun.el (gnus-grab-cam-face): |
| 17 | Do not use predictable temp-file name. (http://bugs.debian.org/747100) | 17 | Do not use predictable temp-file name. (http://bugs.debian.org/747100) |
| 18 | This is CVE-2014-3421. | ||
| 18 | 19 | ||
| 19 | 2014-05-04 Glenn Morris <rgm@gnu.org> | 20 | 2014-05-04 Glenn Morris <rgm@gnu.org> |
| 20 | 21 | ||
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 4364490f431..33f4eda9604 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el | |||
| @@ -1333,31 +1333,32 @@ used instead of `browse-url-new-window-flag'." | |||
| 1333 | (let ((pidfile (expand-file-name browse-url-mosaic-pidfile)) | 1333 | (let ((pidfile (expand-file-name browse-url-mosaic-pidfile)) |
| 1334 | pid) | 1334 | pid) |
| 1335 | (if (file-readable-p pidfile) | 1335 | (if (file-readable-p pidfile) |
| 1336 | (save-excursion | 1336 | (with-temp-buffer |
| 1337 | (find-file pidfile) | 1337 | (insert-file-contents pidfile) |
| 1338 | (goto-char (point-min)) | 1338 | (setq pid (read (current-buffer))))) |
| 1339 | (setq pid (read (current-buffer))) | 1339 | (if (and (integerp pid) (zerop (signal-process pid 0))) ; Mosaic running |
| 1340 | (kill-buffer nil))) | 1340 | (progn |
| 1341 | (if (and pid (zerop (signal-process pid 0))) ; Mosaic running | 1341 | (with-temp-buffer |
| 1342 | (save-excursion | 1342 | (insert (if (browse-url-maybe-new-window new-window) |
| 1343 | ;; This is a predictable temp-file name, which is bad, | 1343 | "newwin\n" |
| 1344 | ;; but it is what Mosaic uses/used. | 1344 | "goto\n") |
| 1345 | ;; So it's not Emacs's problem. http://bugs.debian.org/747100 | 1345 | url "\n") |
| 1346 | (find-file (format "/tmp/Mosaic.%d" pid)) | 1346 | (let ((umask (default-file-modes))) |
| 1347 | (erase-buffer) | 1347 | (unwind-protect |
| 1348 | (insert (if (browse-url-maybe-new-window new-window) | 1348 | (progn |
| 1349 | "newwin\n" | 1349 | (set-default-file-modes ?\700) |
| 1350 | "goto\n") | 1350 | (if (file-exists-p |
| 1351 | url "\n") | 1351 | (setq pidfile (format "/tmp/Mosaic.%d" pid))) |
| 1352 | (save-buffer) | 1352 | (delete-file pidfile)) |
| 1353 | (kill-buffer nil) | 1353 | ;; http://debbugs.gnu.org/17428. Use O_EXCL. |
| 1354 | (write-region nil nil pidfile nil 'silent nil 'excl)) | ||
| 1355 | (set-default-file-modes umask)))) | ||
| 1354 | ;; Send signal SIGUSR to Mosaic | 1356 | ;; Send signal SIGUSR to Mosaic |
| 1355 | (message "Signaling Mosaic...") | 1357 | (message "Signaling Mosaic...") |
| 1356 | (signal-process pid 'SIGUSR1) | 1358 | (signal-process pid 'SIGUSR1) |
| 1357 | ;; Or you could try: | 1359 | ;; Or you could try: |
| 1358 | ;; (call-process "kill" nil 0 nil "-USR1" (int-to-string pid)) | 1360 | ;; (call-process "kill" nil 0 nil "-USR1" (int-to-string pid)) |
| 1359 | (message "Signaling Mosaic...done") | 1361 | (message "Signaling Mosaic...done")) |
| 1360 | ) | ||
| 1361 | ;; Mosaic not running - start it | 1362 | ;; Mosaic not running - start it |
| 1362 | (message "Starting %s..." browse-url-mosaic-program) | 1363 | (message "Starting %s..." browse-url-mosaic-program) |
| 1363 | (apply 'start-process "xmosaic" nil browse-url-mosaic-program | 1364 | (apply 'start-process "xmosaic" nil browse-url-mosaic-program |
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog index c1e3c9998d0..a74388b7d71 100644 --- a/lisp/org/ChangeLog +++ b/lisp/org/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-05-12 Eric Schulte <eric.schulte@gmx.com> | ||
| 2 | |||
| 3 | * ob-screen.el (org-babel-screen-session-write-temp-file) | ||
| 4 | (org-babel-screen-test): | ||
| 5 | Use unpredictable names for temporary files. (Bug#17416) | ||
| 6 | |||
| 1 | 2014-04-22 Aaron Ecay <aaronecay@gmail.com> | 7 | 2014-04-22 Aaron Ecay <aaronecay@gmail.com> |
| 2 | 8 | ||
| 3 | * org-src.el (org-edit-src-exit): Place an undo boundary before | 9 | * org-src.el (org-edit-src-exit): Place an undo boundary before |
| @@ -286,7 +292,7 @@ | |||
| 286 | 292 | ||
| 287 | 2014-04-22 Justin Gordon <justin.gordon@gmail.com> | 293 | 2014-04-22 Justin Gordon <justin.gordon@gmail.com> |
| 288 | 294 | ||
| 289 | * ox-md (org-md-separate-elements): Fix blank line insertion | 295 | * ox-md.el (org-md-separate-elements): Fix blank line insertion |
| 290 | between elements. | 296 | between elements. |
| 291 | 297 | ||
| 292 | * ox-md.el (org-md-inner-template): New function. | 298 | * ox-md.el (org-md-inner-template): New function. |
diff --git a/lisp/org/ob-screen.el b/lisp/org/ob-screen.el index 2acbbeb7182..1d4ccdddf85 100644 --- a/lisp/org/ob-screen.el +++ b/lisp/org/ob-screen.el | |||
| @@ -106,7 +106,7 @@ In case you want to use a different screen than one selected by your $PATH") | |||
| 106 | 106 | ||
| 107 | (defun org-babel-screen-session-write-temp-file (session body) | 107 | (defun org-babel-screen-session-write-temp-file (session body) |
| 108 | "Save BODY in a temp file that is named after SESSION." | 108 | "Save BODY in a temp file that is named after SESSION." |
| 109 | (let ((tmpfile (concat "/tmp/screen.org-babel-session-" session))) | 109 | (let ((tmpfile (org-babel-temp-file "screen-"))) |
| 110 | (with-temp-file tmpfile | 110 | (with-temp-file tmpfile |
| 111 | (insert body) | 111 | (insert body) |
| 112 | 112 | ||
| @@ -121,7 +121,7 @@ The terminal should shortly flicker." | |||
| 121 | (interactive) | 121 | (interactive) |
| 122 | (let* ((session "org-babel-testing") | 122 | (let* ((session "org-babel-testing") |
| 123 | (random-string (format "%s" (random 99999))) | 123 | (random-string (format "%s" (random 99999))) |
| 124 | (tmpfile "/tmp/org-babel-screen.test") | 124 | (tmpfile (org-babel-temp-file "ob-screen-test-")) |
| 125 | (body (concat "echo '" random-string "' > " tmpfile "\nexit\n")) | 125 | (body (concat "echo '" random-string "' > " tmpfile "\nexit\n")) |
| 126 | process tmp-string) | 126 | process tmp-string) |
| 127 | (org-babel-execute:screen body org-babel-default-header-args:screen) | 127 | (org-babel-execute:screen body org-babel-default-header-args:screen) |
diff --git a/lisp/printing.el b/lisp/printing.el index f24c0ab4297..0393746f8a5 100644 --- a/lisp/printing.el +++ b/lisp/printing.el | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | "printing.el, v 6.9.3 <2007/12/09 vinicius> | 12 | "printing.el, v 6.9.3 <2007/12/09 vinicius> |
| 13 | 13 | ||
| 14 | Please send all bug fixes and enhancements to | 14 | Please send all bug fixes and enhancements to |
| 15 | Vinicius Jose Latorre <viniciusjl@ig.com.br> | 15 | bug-gnu-emacs@gnu.org and Vinicius Jose Latorre <viniciusjl@ig.com.br> |
| 16 | ") | 16 | ") |
| 17 | 17 | ||
| 18 | ;; This file is part of GNU Emacs. | 18 | ;; This file is part of GNU Emacs. |
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 146b9f8cb71..dd1fb78c1a2 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -1460,7 +1460,7 @@ If optional second arg COMINT is t the buffer will be in Comint mode with | |||
| 1460 | `compilation-shell-minor-mode'. | 1460 | `compilation-shell-minor-mode'. |
| 1461 | 1461 | ||
| 1462 | Interactively, prompts for the command if the variable | 1462 | Interactively, prompts for the command if the variable |
| 1463 | `compilation-read-command' is non-nil; otherwise uses`compile-command'. | 1463 | `compilation-read-command' is non-nil; otherwise uses `compile-command'. |
| 1464 | With prefix arg, always prompts. | 1464 | With prefix arg, always prompts. |
| 1465 | Additionally, with universal prefix arg, compilation buffer will be in | 1465 | Additionally, with universal prefix arg, compilation buffer will be in |
| 1466 | comint mode, i.e. interactive. | 1466 | comint mode, i.e. interactive. |
| @@ -1499,12 +1499,13 @@ If the optional argument `edit-command' is non-nil, the command can be edited." | |||
| 1499 | (interactive "P") | 1499 | (interactive "P") |
| 1500 | (save-some-buffers (not compilation-ask-about-save) | 1500 | (save-some-buffers (not compilation-ask-about-save) |
| 1501 | compilation-save-buffers-predicate) | 1501 | compilation-save-buffers-predicate) |
| 1502 | (let ((default-directory (or compilation-directory default-directory))) | 1502 | (let ((default-directory (or compilation-directory default-directory)) |
| 1503 | (command (eval compile-command))) | ||
| 1503 | (when edit-command | 1504 | (when edit-command |
| 1504 | (setcar compilation-arguments | 1505 | (setq command (compilation-read-command (or (car compilation-arguments) |
| 1505 | (compilation-read-command (car compilation-arguments)))) | 1506 | command))) |
| 1506 | (apply 'compilation-start (or compilation-arguments | 1507 | (if compilation-arguments (setcar compilation-arguments command))) |
| 1507 | `(,(eval compile-command)))))) | 1508 | (apply 'compilation-start (or compilation-arguments (list command))))) |
| 1508 | 1509 | ||
| 1509 | (defcustom compilation-scroll-output nil | 1510 | (defcustom compilation-scroll-output nil |
| 1510 | "Non-nil to scroll the *compilation* buffer window as output appears. | 1511 | "Non-nil to scroll the *compilation* buffer window as output appears. |
diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 004bdce1f6a..83f2cde4010 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el | |||
| @@ -20,7 +20,7 @@ Emacs without changes to the version number. When reporting bugs, please also | |||
| 20 | report the version of Emacs, if any, that ps-print was distributed with. | 20 | report the version of Emacs, if any, that ps-print was distributed with. |
| 21 | 21 | ||
| 22 | Please send all bug fixes and enhancements to | 22 | Please send all bug fixes and enhancements to |
| 23 | Vinicius Jose Latorre <viniciusjl@ig.com.br>.") | 23 | bug-gnu-emacs@gnu.org and Vinicius Jose Latorre <viniciusjl@ig.com.br>.") |
| 24 | 24 | ||
| 25 | ;; This file is part of GNU Emacs. | 25 | ;; This file is part of GNU Emacs. |
| 26 | 26 | ||
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index f3426656038..aba4a2c53e8 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-05-12 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * url-handlers.el (url-file-handler-load-in-progress): New defvar. | ||
| 4 | (url-file-handler): Use it, in order to avoid recursive load. | ||
| 5 | |||
| 1 | 2014-05-04 Glenn Morris <rgm@gnu.org> | 6 | 2014-05-04 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * url-parse.el (url-generic-parse-url): Doc fix (replace `iff'). | 8 | * url-parse.el (url-generic-parse-url): Doc fix (replace `iff'). |
diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el index 9a05746ebff..c86acb680d0 100644 --- a/lisp/url/url-handlers.el +++ b/lisp/url/url-handlers.el | |||
| @@ -138,34 +138,41 @@ like URLs \(Gnus is particularly bad at this\)." | |||
| 138 | (inhibit-file-name-operation operation)) | 138 | (inhibit-file-name-operation operation)) |
| 139 | (apply operation args))) | 139 | (apply operation args))) |
| 140 | 140 | ||
| 141 | (defvar url-file-handler-load-in-progress nil | ||
| 142 | "Check for recursive load.") | ||
| 143 | |||
| 141 | ;;;###autoload | 144 | ;;;###autoload |
| 142 | (defun url-file-handler (operation &rest args) | 145 | (defun url-file-handler (operation &rest args) |
| 143 | "Function called from the `file-name-handler-alist' routines. | 146 | "Function called from the `file-name-handler-alist' routines. |
| 144 | OPERATION is what needs to be done (`file-exists-p', etc). ARGS are | 147 | OPERATION is what needs to be done (`file-exists-p', etc). ARGS are |
| 145 | the arguments that would have been passed to OPERATION." | 148 | the arguments that would have been passed to OPERATION." |
| 146 | ;; Check, whether there are arguments we want pass to Tramp. | 149 | ;; Avoid recursive load. |
| 147 | (if (catch :do | 150 | (if (and load-in-progress url-file-handler-load-in-progress) |
| 148 | (dolist (url (cons default-directory args)) | 151 | (url-run-real-handler operation args) |
| 149 | (and (member | 152 | (let ((url-file-handler-load-in-progress load-in-progress)) |
| 150 | (url-type (url-generic-parse-url (and (stringp url) url))) | 153 | ;; Check, whether there are arguments we want pass to Tramp. |
| 151 | url-tramp-protocols) | 154 | (if (catch :do |
| 152 | (throw :do t)))) | 155 | (dolist (url (cons default-directory args)) |
| 153 | (apply 'url-tramp-file-handler operation args) | 156 | (and (member |
| 154 | ;; Otherwise, let's do the job. | 157 | (url-type (url-generic-parse-url (and (stringp url) url))) |
| 155 | (let ((fn (get operation 'url-file-handlers)) | 158 | url-tramp-protocols) |
| 156 | (val nil) | 159 | (throw :do t)))) |
| 157 | (hooked nil)) | 160 | (apply 'url-tramp-file-handler operation args) |
| 158 | (if (and (not fn) (intern-soft (format "url-%s" operation)) | 161 | ;; Otherwise, let's do the job. |
| 159 | (fboundp (intern-soft (format "url-%s" operation)))) | 162 | (let ((fn (get operation 'url-file-handlers)) |
| 160 | (error "Missing URL handler mapping for %s" operation)) | 163 | (val nil) |
| 161 | (if fn | 164 | (hooked nil)) |
| 162 | (setq hooked t | 165 | (if (and (not fn) (intern-soft (format "url-%s" operation)) |
| 163 | val (save-match-data (apply fn args))) | 166 | (fboundp (intern-soft (format "url-%s" operation)))) |
| 164 | (setq hooked nil | 167 | (error "Missing URL handler mapping for %s" operation)) |
| 165 | val (url-run-real-handler operation args))) | 168 | (if fn |
| 166 | (url-debug 'handlers "%s %S%S => %S" (if hooked "Hooked" "Real") | 169 | (setq hooked t |
| 167 | operation args val) | 170 | val (save-match-data (apply fn args))) |
| 168 | val))) | 171 | (setq hooked nil |
| 172 | val (url-run-real-handler operation args))) | ||
| 173 | (url-debug 'handlers "%s %S%S => %S" (if hooked "Hooked" "Real") | ||
| 174 | operation args val) | ||
| 175 | val))))) | ||
| 169 | 176 | ||
| 170 | (defun url-file-handler-identity (&rest args) | 177 | (defun url-file-handler-identity (&rest args) |
| 171 | ;; Identity function | 178 | ;; Identity function |
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index a53ed8758c4..05b53a3eeb6 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el | |||
| @@ -60,7 +60,7 @@ | |||
| 60 | ;; - responsible-p (file) OK | 60 | ;; - responsible-p (file) OK |
| 61 | ;; - could-register (file) OK | 61 | ;; - could-register (file) OK |
| 62 | ;; - receive-file (file rev) ?? PROBABLY NOT NEEDED | 62 | ;; - receive-file (file rev) ?? PROBABLY NOT NEEDED |
| 63 | ;; - unregister (file) COMMENTED OUT, MAY BE INCORRECT | 63 | ;; - unregister (file) OK |
| 64 | ;; * checkin (files rev comment) OK | 64 | ;; * checkin (files rev comment) OK |
| 65 | ;; * find-revision (file rev buffer) OK | 65 | ;; * find-revision (file rev buffer) OK |
| 66 | ;; * checkout (file &optional editable rev) OK | 66 | ;; * checkout (file &optional editable rev) OK |
| @@ -436,10 +436,9 @@ COMMENT is ignored." | |||
| 436 | ;; registered. | 436 | ;; registered. |
| 437 | (error)))) | 437 | (error)))) |
| 438 | 438 | ||
| 439 | ;; FIXME: This would remove the file. Is that correct? | 439 | (defun vc-hg-unregister (file) |
| 440 | ;; (defun vc-hg-unregister (file) | 440 | "Unregister FILE from hg." |
| 441 | ;; "Unregister FILE from hg." | 441 | (vc-hg-command nil 0 file "forget")) |
| 442 | ;; (vc-hg-command nil nil file "remove")) | ||
| 443 | 442 | ||
| 444 | (declare-function log-edit-extract-headers "log-edit" (headers string)) | 443 | (declare-function log-edit-extract-headers "log-edit" (headers string)) |
| 445 | 444 | ||