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 | |
| 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
| -rw-r--r-- | admin/ChangeLog | 8 | ||||
| -rw-r--r-- | admin/admin.el | 23 | ||||
| -rw-r--r-- | admin/find-gc.el (renamed from lisp/emacs-lisp/find-gc.el) | 0 | ||||
| -rw-r--r-- | doc/lispref/functions.texi | 3 | ||||
| -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/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 | ||||
| -rw-r--r-- | src/ChangeLog | 9 | ||||
| -rw-r--r-- | src/fileio.c | 4 | ||||
| -rw-r--r-- | src/xsettings.c | 22 | ||||
| -rw-r--r-- | test/automated/advice-tests.el | 23 | ||||
| -rw-r--r-- | test/automated/vc-bzr.el | 15 | ||||
| -rwxr-xr-x | test/indent/perl.perl | 11 | ||||
| -rw-r--r-- | test/indent/ruby.rb | 3 |
26 files changed, 279 insertions, 125 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog index 7af23b779ef..87da4f7e26b 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2014-05-12 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * find-gc.el: Move here from ../lisp/emacs-lisp. | ||
| 4 | |||
| 5 | * admin.el (set-version-in-file): Don't set identical version. | ||
| 6 | (set-version): Provide default version number. | ||
| 7 | (set-version, set-copyright): Give start/end messages. | ||
| 8 | |||
| 1 | 2014-04-18 Paul Eggert <eggert@cs.ucla.edu> | 9 | 2014-04-18 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 10 | ||
| 3 | * notes/bzr: Update instructions for merging from gnulib. | 11 | * notes/bzr: Update instructions for merging from gnulib. |
diff --git a/admin/admin.el b/admin/admin.el index 007cb06e592..7af9ffa4177 100644 --- a/admin/admin.el +++ b/admin/admin.el | |||
| @@ -65,17 +65,25 @@ Optional argument DATE is the release date, default today." | |||
| 65 | "Subroutine of `set-version' and `set-copyright'." | 65 | "Subroutine of `set-version' and `set-copyright'." |
| 66 | (find-file (expand-file-name file root)) | 66 | (find-file (expand-file-name file root)) |
| 67 | (goto-char (point-min)) | 67 | (goto-char (point-min)) |
| 68 | (setq version (format "%s" version)) | ||
| 68 | (unless (re-search-forward rx nil :noerror) | 69 | (unless (re-search-forward rx nil :noerror) |
| 69 | (user-error "Version not found in %s" file)) | 70 | (user-error "Version not found in %s" file)) |
| 70 | (replace-match (format "%s" version) nil nil nil 1)) | 71 | (if (not (equal version (match-string 1))) |
| 72 | (replace-match version nil nil nil 1) | ||
| 73 | (kill-buffer) | ||
| 74 | (message "No need to update `%s'" file))) | ||
| 71 | 75 | ||
| 72 | ;; TODO report the progress | ||
| 73 | (defun set-version (root version) | 76 | (defun set-version (root version) |
| 74 | "Set Emacs version to VERSION in relevant files under ROOT. | 77 | "Set Emacs version to VERSION in relevant files under ROOT. |
| 75 | Root must be the root of an Emacs source tree." | 78 | Root must be the root of an Emacs source tree." |
| 76 | (interactive "DEmacs root directory: \nsVersion number: ") | 79 | (interactive (list |
| 80 | (read-directory-name "Emacs root directory: " source-directory) | ||
| 81 | (read-string "Version number: " | ||
| 82 | (replace-regexp-in-string "\\.[0-9]+\\'" "" | ||
| 83 | emacs-version)))) | ||
| 77 | (unless (file-exists-p (expand-file-name "src/emacs.c" root)) | 84 | (unless (file-exists-p (expand-file-name "src/emacs.c" root)) |
| 78 | (user-error "%s doesn't seem to be the root of an Emacs source tree" root)) | 85 | (user-error "%s doesn't seem to be the root of an Emacs source tree" root)) |
| 86 | (message "Setting version numbers...") | ||
| 79 | ;; There's also a "version 3" (standing for GPLv3) at the end of | 87 | ;; There's also a "version 3" (standing for GPLv3) at the end of |
| 80 | ;; `README', but since `set-version-in-file' only replaces the first | 88 | ;; `README', but since `set-version-in-file' only replaces the first |
| 81 | ;; occurrence, it won't be replaced. | 89 | ;; occurrence, it won't be replaced. |
| @@ -158,11 +166,10 @@ Root must be the root of an Emacs source tree." | |||
| 158 | {\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs") | 166 | {\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs") |
| 159 | (set-version-in-file root "etc/refcards/emacsver.tex" version | 167 | (set-version-in-file root "etc/refcards/emacsver.tex" version |
| 160 | "\\\\def\\\\versionemacs\ | 168 | "\\\\def\\\\versionemacs\ |
| 161 | {\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs")))) | 169 | {\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs"))) |
| 162 | 170 | (message "Setting version numbers...done")) | |
| 163 | 171 | ||
| 164 | ;; Note this makes some assumptions about form of short copyright. | 172 | ;; Note this makes some assumptions about form of short copyright. |
| 165 | ;; TODO report the progress | ||
| 166 | (defun set-copyright (root copyright) | 173 | (defun set-copyright (root copyright) |
| 167 | "Set Emacs short copyright to COPYRIGHT in relevant files under ROOT. | 174 | "Set Emacs short copyright to COPYRIGHT in relevant files under ROOT. |
| 168 | Root must be the root of an Emacs source tree." | 175 | Root must be the root of an Emacs source tree." |
| @@ -174,6 +181,7 @@ Root must be the root of an Emacs source tree." | |||
| 174 | (format-time-string "%Y"))))) | 181 | (format-time-string "%Y"))))) |
| 175 | (unless (file-exists-p (expand-file-name "src/emacs.c" root)) | 182 | (unless (file-exists-p (expand-file-name "src/emacs.c" root)) |
| 176 | (user-error "%s doesn't seem to be the root of an Emacs source tree" root)) | 183 | (user-error "%s doesn't seem to be the root of an Emacs source tree" root)) |
| 184 | (message "Setting copyrights...") | ||
| 177 | (set-version-in-file root "configure.ac" copyright | 185 | (set-version-in-file root "configure.ac" copyright |
| 178 | (rx (and bol "copyright" (0+ (not (in ?\"))) | 186 | (rx (and bol "copyright" (0+ (not (in ?\"))) |
| 179 | ?\" (submatch (1+ (not (in ?\")))) ?\"))) | 187 | ?\" (submatch (1+ (not (in ?\")))) ?\"))) |
| @@ -195,7 +203,8 @@ Root must be the root of an Emacs source tree." | |||
| 195 | {\\([0-9]\\{4\\}\\)}.+%.+copyright year") | 203 | {\\([0-9]\\{4\\}\\)}.+%.+copyright year") |
| 196 | (set-version-in-file root "etc/refcards/emacsver.tex" copyright | 204 | (set-version-in-file root "etc/refcards/emacsver.tex" copyright |
| 197 | "\\\\def\\\\year\ | 205 | "\\\\def\\\\year\ |
| 198 | {\\([0-9]\\{4\\}\\)}.+%.+copyright year"))) | 206 | {\\([0-9]\\{4\\}\\)}.+%.+copyright year")) |
| 207 | (message "Setting copyrights...done")) | ||
| 199 | 208 | ||
| 200 | ;;; Various bits of magic for generating the web manuals | 209 | ;;; Various bits of magic for generating the web manuals |
| 201 | 210 | ||
diff --git a/lisp/emacs-lisp/find-gc.el b/admin/find-gc.el index 83eb26e86d7..83eb26e86d7 100644 --- a/lisp/emacs-lisp/find-gc.el +++ b/admin/find-gc.el | |||
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 778d0d700ee..52994a55854 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi | |||
| @@ -1240,7 +1240,8 @@ buffer: if @var{place} is just a symbol, then @var{function} is added to the | |||
| 1240 | global value of @var{place}. Whereas if @var{place} is of the form | 1240 | global value of @var{place}. Whereas if @var{place} is of the form |
| 1241 | @code{(local @var{symbol})}, where @var{symbol} is an expression which returns | 1241 | @code{(local @var{symbol})}, where @var{symbol} is an expression which returns |
| 1242 | the variable name, then @var{function} will only be added in the | 1242 | the variable name, then @var{function} will only be added in the |
| 1243 | current buffer. | 1243 | current buffer. Finally, if you want to modify a lexical variable, you will |
| 1244 | have to use @code{(var @var{VARIABLE})}. | ||
| 1244 | 1245 | ||
| 1245 | Every function added with @code{add-function} can be accompanied by an | 1246 | Every function added with @code{add-function} can be accompanied by an |
| 1246 | association list of properties @var{props}. Currently only two of those | 1247 | association list of properties @var{props}. Currently only two of those |
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/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 | ||
diff --git a/src/ChangeLog b/src/ChangeLog index 72e78724bab..5d06882cee7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2014-05-12 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * fileio.c (Ffile_executable_p): Doc tweak. | ||
| 4 | |||
| 5 | 2014-05-12 Jan Djärv <jan.h.d@swipnet.se> | ||
| 6 | |||
| 7 | * xsettings.c (init_gsettings): Use g_settings_schema_source_lookup | ||
| 8 | instead of deprecated g_settings_list_schemas if possible (Bug#17434). | ||
| 9 | |||
| 1 | 2014-05-08 Paul Eggert <eggert@cs.ucla.edu> | 10 | 2014-05-08 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 11 | ||
| 3 | * minibuf.c (read_minibuf): Avoid C99ism in previous patch (Bug#17430). | 12 | * minibuf.c (read_minibuf): Avoid C99ism in previous patch (Bug#17430). |
diff --git a/src/fileio.c b/src/fileio.c index 5659b6555d8..dcee70aa8b4 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -2546,7 +2546,9 @@ Use `file-symlink-p' to test for such links. */) | |||
| 2546 | 2546 | ||
| 2547 | DEFUN ("file-executable-p", Ffile_executable_p, Sfile_executable_p, 1, 1, 0, | 2547 | DEFUN ("file-executable-p", Ffile_executable_p, Sfile_executable_p, 1, 1, 0, |
| 2548 | doc: /* Return t if FILENAME can be executed by you. | 2548 | doc: /* Return t if FILENAME can be executed by you. |
| 2549 | For a directory, this means you can access files in that directory. */) | 2549 | For a directory, this means you can access files in that directory. |
| 2550 | \(It is generally better to use `file-accessible-directory-p' for that | ||
| 2551 | purpose, though.) */) | ||
| 2550 | (Lisp_Object filename) | 2552 | (Lisp_Object filename) |
| 2551 | { | 2553 | { |
| 2552 | Lisp_Object absname; | 2554 | Lisp_Object absname; |
diff --git a/src/xsettings.c b/src/xsettings.c index 844da19f638..5f4275df545 100644 --- a/src/xsettings.c +++ b/src/xsettings.c | |||
| @@ -795,17 +795,29 @@ init_gsettings (void) | |||
| 795 | { | 795 | { |
| 796 | #ifdef HAVE_GSETTINGS | 796 | #ifdef HAVE_GSETTINGS |
| 797 | GVariant *val; | 797 | GVariant *val; |
| 798 | const gchar *const *schemas; | ||
| 799 | int schema_found = 0; | 798 | int schema_found = 0; |
| 800 | 799 | ||
| 801 | #if ! GLIB_CHECK_VERSION (2, 36, 0) | 800 | #if ! GLIB_CHECK_VERSION (2, 36, 0) |
| 802 | g_type_init (); | 801 | g_type_init (); |
| 803 | #endif | 802 | #endif |
| 804 | 803 | ||
| 805 | schemas = g_settings_list_schemas (); | 804 | #if GLIB_CHECK_VERSION (2, 32, 0) |
| 806 | if (schemas == NULL) return; | 805 | { |
| 807 | while (! schema_found && *schemas != NULL) | 806 | GSettingsSchema *sc = g_settings_schema_source_lookup |
| 808 | schema_found = strcmp (*schemas++, GSETTINGS_SCHEMA) == 0; | 807 | (g_settings_schema_source_get_default (), |
| 808 | GSETTINGS_SCHEMA, | ||
| 809 | TRUE); | ||
| 810 | schema_found = sc != NULL; | ||
| 811 | if (sc) g_settings_schema_unref (sc); | ||
| 812 | } | ||
| 813 | #else | ||
| 814 | { | ||
| 815 | const gchar *const *schemas = g_settings_list_schemas (); | ||
| 816 | if (schemas == NULL) return; | ||
| 817 | while (! schema_found && *schemas != NULL) | ||
| 818 | schema_found = strcmp (*schemas++, GSETTINGS_SCHEMA) == 0; | ||
| 819 | } | ||
| 820 | #endif | ||
| 809 | if (!schema_found) return; | 821 | if (!schema_found) return; |
| 810 | 822 | ||
| 811 | gsettings_client = g_settings_new (GSETTINGS_SCHEMA); | 823 | gsettings_client = g_settings_new (GSETTINGS_SCHEMA); |
diff --git a/test/automated/advice-tests.el b/test/automated/advice-tests.el index f755e8defef..e0c3b40487e 100644 --- a/test/automated/advice-tests.el +++ b/test/automated/advice-tests.el | |||
| @@ -179,6 +179,29 @@ function being an around advice." | |||
| 179 | (interactive "P") nil) | 179 | (interactive "P") nil) |
| 180 | (should (equal (interactive-form 'sm-test9) '(interactive "P")))) | 180 | (should (equal (interactive-form 'sm-test9) '(interactive "P")))) |
| 181 | 181 | ||
| 182 | (ert-deftest advice-test-multiples () | ||
| 183 | (let ((sm-test10 (lambda (a) (+ a 10))) | ||
| 184 | (sm-advice (lambda (x) (if (consp x) (list (* 5 (car x))) (* 4 x))))) | ||
| 185 | (should (equal (funcall sm-test10 5) 15)) | ||
| 186 | (add-function :filter-args (var sm-test10) sm-advice) | ||
| 187 | (should (equal (funcall sm-test10 5) 35)) | ||
| 188 | (add-function :filter-return (var sm-test10) sm-advice) | ||
| 189 | (should (equal (funcall sm-test10 5) 60)) | ||
| 190 | ;; Make sure we can add multiple times the same function, under the | ||
| 191 | ;; condition that they have different `name' properties. | ||
| 192 | (add-function :filter-args (var sm-test10) sm-advice '((name . "args"))) | ||
| 193 | (should (equal (funcall sm-test10 5) 140)) | ||
| 194 | (remove-function (var sm-test10) "args") | ||
| 195 | (should (equal (funcall sm-test10 5) 60)) | ||
| 196 | (add-function :filter-args (var sm-test10) sm-advice '((name . "args"))) | ||
| 197 | (add-function :filter-return (var sm-test10) sm-advice '((name . "ret"))) | ||
| 198 | (should (equal (funcall sm-test10 5) 560)) | ||
| 199 | ;; Make sure that if we specify to remove a function that was added | ||
| 200 | ;; multiple times, they are all removed, rather than removing only some | ||
| 201 | ;; arbitrary subset of them. | ||
| 202 | (remove-function (var sm-test10) sm-advice) | ||
| 203 | (should (equal (funcall sm-test10 5) 15)))) | ||
| 204 | |||
| 182 | ;; Local Variables: | 205 | ;; Local Variables: |
| 183 | ;; no-byte-compile: t | 206 | ;; no-byte-compile: t |
| 184 | ;; End: | 207 | ;; End: |
diff --git a/test/automated/vc-bzr.el b/test/automated/vc-bzr.el index 07e821064ca..4c16465d54b 100644 --- a/test/automated/vc-bzr.el +++ b/test/automated/vc-bzr.el | |||
| @@ -33,17 +33,18 @@ | |||
| 33 | (skip-unless (executable-find vc-bzr-program)) | 33 | (skip-unless (executable-find vc-bzr-program)) |
| 34 | ;; Bzr wants to access HOME, e.g. to write ~/.bzr.log. | 34 | ;; Bzr wants to access HOME, e.g. to write ~/.bzr.log. |
| 35 | ;; This is a problem on hydra, where HOME is non-existent. | 35 | ;; This is a problem on hydra, where HOME is non-existent. |
| 36 | ;; You can disable logging with BZR_LOG=/dev/null, but then | 36 | ;; You can disable logging with BZR_LOG=/dev/null, but then some |
| 37 | ;; some commands (eg `bzr status') want to access ~/.bazaar, | 37 | ;; commands (eg `bzr status') want to access ~/.bazaar, and will |
| 38 | ;; and will abort if they cannot. I could not figure out how to | 38 | ;; abort if they cannot. I could not figure out how to stop bzr |
| 39 | ;; stop bzr doing that, so just set HOME to a tempir for the duration. | 39 | ;; doing that, so just give it a temporary homedir for the duration. |
| 40 | ;; http://bugs.launchpad.net/bzr/+bug/137407 ? | ||
| 40 | (let* ((homedir (make-temp-file "vc-bzr-test" t)) | 41 | (let* ((homedir (make-temp-file "vc-bzr-test" t)) |
| 41 | (bzrdir (expand-file-name "bzr" homedir)) | 42 | (bzrdir (expand-file-name "bzr" homedir)) |
| 42 | (ignored-dir (progn | 43 | (ignored-dir (progn |
| 43 | (make-directory bzrdir) | 44 | (make-directory bzrdir) |
| 44 | (expand-file-name "ignored-dir" bzrdir))) | 45 | (expand-file-name "ignored-dir" bzrdir))) |
| 45 | (default-directory (file-name-as-directory bzrdir)) | 46 | (default-directory (file-name-as-directory bzrdir)) |
| 46 | (process-environment (cons (format "HOME=%s" homedir) | 47 | (process-environment (cons (format "BZR_HOME=%s" homedir) |
| 47 | process-environment))) | 48 | process-environment))) |
| 48 | (unwind-protect | 49 | (unwind-protect |
| 49 | (progn | 50 | (progn |
| @@ -79,7 +80,7 @@ | |||
| 79 | (expand-file-name "subdir" bzrdir))) | 80 | (expand-file-name "subdir" bzrdir))) |
| 80 | (file (expand-file-name "file" bzrdir)) | 81 | (file (expand-file-name "file" bzrdir)) |
| 81 | (default-directory (file-name-as-directory bzrdir)) | 82 | (default-directory (file-name-as-directory bzrdir)) |
| 82 | (process-environment (cons (format "HOME=%s" homedir) | 83 | (process-environment (cons (format "BZR_HOME=%s" homedir) |
| 83 | process-environment))) | 84 | process-environment))) |
| 84 | (unwind-protect | 85 | (unwind-protect |
| 85 | (progn | 86 | (progn |
| @@ -120,7 +121,7 @@ | |||
| 120 | (expand-file-name "foo.el" bzrdir))) | 121 | (expand-file-name "foo.el" bzrdir))) |
| 121 | (default-directory (file-name-as-directory bzrdir)) | 122 | (default-directory (file-name-as-directory bzrdir)) |
| 122 | (generated-autoload-file (expand-file-name "loaddefs.el" bzrdir)) | 123 | (generated-autoload-file (expand-file-name "loaddefs.el" bzrdir)) |
| 123 | (process-environment (cons (format "HOME=%s" homedir) | 124 | (process-environment (cons (format "BZR_HOME=%s" homedir) |
| 124 | process-environment))) | 125 | process-environment))) |
| 125 | (unwind-protect | 126 | (unwind-protect |
| 126 | (progn | 127 | (progn |
diff --git a/test/indent/perl.perl b/test/indent/perl.perl index 0bfcc98356b..34cd4af1125 100755 --- a/test/indent/perl.perl +++ b/test/indent/perl.perl | |||
| @@ -1,6 +1,17 @@ | |||
| 1 | #!/usr/bin/perl | 1 | #!/usr/bin/perl |
| 2 | # -*- eval: (bug-reference-mode 1) -*- | 2 | # -*- eval: (bug-reference-mode 1) -*- |
| 3 | 3 | ||
| 4 | use v5.14; | ||
| 5 | |||
| 6 | my $str= <<END; | ||
| 7 | Hello | ||
| 8 | END | ||
| 9 | |||
| 10 | my $a = $'; | ||
| 11 | |||
| 12 | my $b=3; | ||
| 13 | |||
| 14 | print $str; | ||
| 4 | if ($c && /====/){xyz;} | 15 | if ($c && /====/){xyz;} |
| 5 | 16 | ||
| 6 | print "a" . <<EOF . s/he"llo/th'ere/; | 17 | print "a" . <<EOF . s/he"llo/th'ere/; |
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index fb341ee7ba6..7e778798996 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb | |||
| @@ -16,6 +16,9 @@ d = %(hello (nested) world) | |||
| 16 | # Don't propertize percent literals inside strings. | 16 | # Don't propertize percent literals inside strings. |
| 17 | "(%s, %s)" % [123, 456] | 17 | "(%s, %s)" % [123, 456] |
| 18 | 18 | ||
| 19 | "abc/#{def}ghi" | ||
| 20 | "abc\#{def}ghi" | ||
| 21 | |||
| 19 | # Or inside comments. | 22 | # Or inside comments. |
| 20 | x = # "tot %q/to"; = | 23 | x = # "tot %q/to"; = |
| 21 | y = 2 / 3 | 24 | y = 2 / 3 |