diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 109 | ||||
| -rw-r--r-- | lisp/cedet/ChangeLog | 17 | ||||
| -rw-r--r-- | lisp/cedet/ede.el | 215 | ||||
| -rw-r--r-- | lisp/cedet/ede/auto.el | 28 | ||||
| -rw-r--r-- | lisp/cedet/ede/simple.el | 3 | ||||
| -rw-r--r-- | lisp/dired.el | 21 | ||||
| -rw-r--r-- | lisp/epg.el | 7 | ||||
| -rw-r--r-- | lisp/find-dired.el | 18 | ||||
| -rw-r--r-- | lisp/info.el | 2 | ||||
| -rw-r--r-- | lisp/mail/sendmail.el | 1 | ||||
| -rw-r--r-- | lisp/minibuffer.el | 4 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 1 | ||||
| -rw-r--r-- | lisp/startup.el | 4 | ||||
| -rw-r--r-- | lisp/textmodes/fill.el | 1 | ||||
| -rw-r--r-- | lisp/url/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/url/url-auth.el | 2 | ||||
| -rw-r--r-- | lisp/window.el | 64 |
17 files changed, 380 insertions, 123 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f8d8ab379fa..2813d80d9ff 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,47 @@ | |||
| 1 | 2012-01-16 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * minibuffer.el (completion--replace): Strip properties (bug#10062). | ||
| 4 | |||
| 5 | 2012-01-16 Martin Rudalics <rudalics@gmx.at> | ||
| 6 | |||
| 7 | * window.el (window-state-ignored-parameters): Remove variable. | ||
| 8 | (window--state-get-1): Rename argument MARKERS to IGNORE. | ||
| 9 | Handle persistent window parameters. Make copy of clone-of | ||
| 10 | parameter only if requested. (Bug#10348) | ||
| 11 | (window--state-put-2): Install a window parameter only if it has | ||
| 12 | a non-nil value or an existing parameter shall be overwritten. | ||
| 13 | |||
| 14 | 2012-01-15 Michael Albinus <michael.albinus@gmx.de> | ||
| 15 | |||
| 16 | * net/tramp-sh.el (tramp-remote-path): Set tramp-autoload cookie. | ||
| 17 | |||
| 18 | 2012-01-14 Eli Zaretskii <eliz@gnu.org> | ||
| 19 | |||
| 20 | * info.el (Info-toc-build): If the Info file has no "Up" pointer, | ||
| 21 | don't pass the (nil) value of `upnode' to string-match. | ||
| 22 | |||
| 23 | 2012-01-14 Chong Yidong <cyd@gnu.org> | ||
| 24 | |||
| 25 | * startup.el (command-line): Fix X resource class for cursorColor. | ||
| 26 | Fix values recognized by the cursorBlink resource. | ||
| 27 | |||
| 28 | 2012-01-14 Paul Eggert <eggert@cs.ucla.edu> | ||
| 29 | |||
| 30 | * epg.el (epg--make-temp-file): Avoid permission race condition | ||
| 31 | when running on old Emacs versions (bug#10403). | ||
| 32 | |||
| 33 | 2012-01-14 Glenn Morris <rgm@gnu.org> | ||
| 34 | |||
| 35 | * dired.el (dired-get-filename): Fix 'verbatim case of previous change. | ||
| 36 | |||
| 37 | 2012-01-13 Glenn Morris <rgm@gnu.org> | ||
| 38 | |||
| 39 | * dired.el (dired-switches-escape-p): New function. | ||
| 40 | (dired-insert-directory): Use dired-switches-escape-p. | ||
| 41 | (dired-get-filename): Undo "\ " quoting if needed. (Bug#10469) | ||
| 42 | |||
| 43 | * find-dired.el (find-ls-option): Doc fix. (Bug#10262) | ||
| 44 | |||
| 1 | 2012-01-12 Glenn Morris <rgm@gnu.org> | 45 | 2012-01-12 Glenn Morris <rgm@gnu.org> |
| 2 | 46 | ||
| 3 | * mail/sendmail.el (mail-mode): Update paragraph-separate for | 47 | * mail/sendmail.el (mail-mode): Update paragraph-separate for |
| @@ -7,7 +51,7 @@ | |||
| 7 | 51 | ||
| 8 | Fix Emacs bug #10463 - put `widen's around the critical spots. | 52 | Fix Emacs bug #10463 - put `widen's around the critical spots. |
| 9 | 53 | ||
| 10 | * progmodes/cc-engine.el (c-in-literal, c-literal-limits): put a | 54 | * progmodes/cc-engine.el (c-in-literal, c-literal-limits): Put a |
| 11 | widen around each invocation of c-state-pp-to-literal. Remove an | 55 | widen around each invocation of c-state-pp-to-literal. Remove an |
| 12 | unused let variable. | 56 | unused let variable. |
| 13 | 57 | ||
| @@ -18,8 +62,8 @@ | |||
| 18 | 62 | ||
| 19 | 2012-01-10 Chong Yidong <cyd@gnu.org> | 63 | 2012-01-10 Chong Yidong <cyd@gnu.org> |
| 20 | 64 | ||
| 21 | * net/network-stream.el (network-stream-open-starttls): Avoid | 65 | * net/network-stream.el (network-stream-open-starttls): |
| 22 | emitting a confusing error message when the server gives a bad | 66 | Avoid emitting a confusing error message when the server gives a bad |
| 23 | response to the capability command. | 67 | response to the capability command. |
| 24 | 68 | ||
| 25 | 2012-01-10 Glenn Morris <rgm@gnu.org> | 69 | 2012-01-10 Glenn Morris <rgm@gnu.org> |
| @@ -112,8 +156,8 @@ | |||
| 112 | 156 | ||
| 113 | * custom.el (enable-theme): Don't set custom-safe-themes. | 157 | * custom.el (enable-theme): Don't set custom-safe-themes. |
| 114 | 158 | ||
| 115 | * cus-theme.el (custom-theme-merge-theme): Ignore | 159 | * cus-theme.el (custom-theme-merge-theme): |
| 116 | custom-enabled-themes and custom-safe-themes. | 160 | Ignore custom-enabled-themes and custom-safe-themes. |
| 117 | 161 | ||
| 118 | 2012-01-05 Michael R. Mauger <mmaug@yahoo.com> | 162 | 2012-01-05 Michael R. Mauger <mmaug@yahoo.com> |
| 119 | 163 | ||
| @@ -136,8 +180,8 @@ | |||
| 136 | 180 | ||
| 137 | 2012-01-03 Chong Yidong <cyd@gnu.org> | 181 | 2012-01-03 Chong Yidong <cyd@gnu.org> |
| 138 | 182 | ||
| 139 | * shell.el (shell-dynamic-complete-functions): Put | 183 | * shell.el (shell-dynamic-complete-functions): |
| 140 | pcomplete-completions-at-point, so as to try | 184 | Put pcomplete-completions-at-point, so as to try |
| 141 | comint-filename-completion first (Bug#10417). | 185 | comint-filename-completion first (Bug#10417). |
| 142 | 186 | ||
| 143 | 2012-01-02 Richard Stallman <rms@gnu.org> | 187 | 2012-01-02 Richard Stallman <rms@gnu.org> |
| @@ -162,8 +206,8 @@ | |||
| 162 | 206 | ||
| 163 | 2012-01-01 Eli Zaretskii <eliz@gnu.org> | 207 | 2012-01-01 Eli Zaretskii <eliz@gnu.org> |
| 164 | 208 | ||
| 165 | * term/w32-win.el (dynamic-library-alist) <gnutls>: Load | 209 | * term/w32-win.el (dynamic-library-alist) <gnutls>: |
| 166 | libgnutls-28.dll, from GnuTLS version 3.x, in preference to | 210 | Load libgnutls-28.dll, from GnuTLS version 3.x, in preference to |
| 167 | libgnutls-26.dll. | 211 | libgnutls-26.dll. |
| 168 | 212 | ||
| 169 | 2011-12-31 Andreas Schwab <schwab@linux-m68k.org> | 213 | 2011-12-31 Andreas Schwab <schwab@linux-m68k.org> |
| @@ -215,11 +259,10 @@ | |||
| 215 | 2011-12-24 Alan Mackenzie <acm@muc.de> | 259 | 2011-12-24 Alan Mackenzie <acm@muc.de> |
| 216 | 260 | ||
| 217 | Introduce a mechanism to widen the region used in context font | 261 | Introduce a mechanism to widen the region used in context font |
| 218 | locking. Use this to protect declarations from losing their | 262 | locking. Use this to protect declarations from losing their contexts. |
| 219 | contexts. | ||
| 220 | 263 | ||
| 221 | * progmodes/cc-langs.el (c-before-font-lock-functions): Replace | 264 | * progmodes/cc-langs.el (c-before-font-lock-functions): |
| 222 | c-set-fl-decl-start with c-change-set-fl-decl-start (Renaming). | 265 | Replace c-set-fl-decl-start with c-change-set-fl-decl-start (Renaming). |
| 223 | (c-before-context-fontification-functions): New defvar, a list of | 266 | (c-before-context-fontification-functions): New defvar, a list of |
| 224 | functions to be run just before context (etc.) font locking. | 267 | functions to be run just before context (etc.) font locking. |
| 225 | 268 | ||
| @@ -371,22 +414,19 @@ | |||
| 371 | 414 | ||
| 372 | * progmodes/cc-langs (c-label-kwds): Let AWK take the same | 415 | * progmodes/cc-langs (c-label-kwds): Let AWK take the same |
| 373 | expression as the rest. | 416 | expression as the rest. |
| 374 | (c-nonlabel-token-key): Allow string literals for AWK. Refactor | 417 | (c-nonlabel-token-key): Allow string literals for AWK. |
| 375 | for the other modes. | 418 | Refactor for the other modes. |
| 376 | 419 | ||
| 377 | Large brace-block initialisation makes CC Mode slow: Fix. | 420 | Large brace-block initialisation makes CC Mode slow: Fix. |
| 378 | Tidy up and accelerate c-in-literal, etc. by using the | 421 | Tidy up and accelerate c-in-literal, etc. by using the c-parse-state |
| 379 | c-parse-state | ||
| 380 | routines. Limit backward searching in c-font-lock-enclosing.decl. | 422 | routines. Limit backward searching in c-font-lock-enclosing.decl. |
| 381 | 423 | ||
| 382 | * progmodes/cc-engine.el (c-state-pp-to-literal): Return the | 424 | * progmodes/cc-engine.el (c-state-pp-to-literal): Return the |
| 383 | pp-state and literal type in addition to the limits. | 425 | pp-state and literal type in addition to the limits. |
| 384 | (c-state-safe-place): New defun, extracted from | 426 | (c-state-safe-place): New defun, extracted from c-state-literal-at. |
| 385 | c-state-literal-at. | ||
| 386 | (c-state-literal-at): Use the above new defun. | 427 | (c-state-literal-at): Use the above new defun. |
| 387 | (c-slow-in-literal, c-fast-in-literal): Removed. | 428 | (c-slow-in-literal, c-fast-in-literal): Remove. |
| 388 | (c-in-literal, c-literal-limits): Amended to use | 429 | (c-in-literal, c-literal-limits): Amend to use c-state-pp-to-literal. |
| 389 | c-state-pp-to-literal. | ||
| 390 | 430 | ||
| 391 | * progmodes/cc-fonts.el (c-font-lock-enclosing-decls): Check for | 431 | * progmodes/cc-fonts.el (c-font-lock-enclosing-decls): Check for |
| 392 | being in a literal. Add a limit for backward searching. | 432 | being in a literal. Add a limit for backward searching. |
| @@ -460,8 +500,8 @@ | |||
| 460 | 2011-12-10 Eli Zaretskii <eliz@gnu.org> | 500 | 2011-12-10 Eli Zaretskii <eliz@gnu.org> |
| 461 | 501 | ||
| 462 | * mail/rmailsum.el (rmail-header-summary): RFC2047 decode the | 502 | * mail/rmailsum.el (rmail-header-summary): RFC2047 decode the |
| 463 | `from' or `to' address before taking its substring. Fixes | 503 | `from' or `to' address before taking its substring. |
| 464 | incorrect display in Rmail summary buffer whereby an RFC2047 | 504 | Fixes incorrect display in Rmail summary buffer whereby an RFC2047 |
| 465 | encoded name is chopped in the middle of the encoded string, and | 505 | encoded name is chopped in the middle of the encoded string, and |
| 466 | thus displayed encoded. | 506 | thus displayed encoded. |
| 467 | 507 | ||
| @@ -680,8 +720,8 @@ | |||
| 680 | (verilog-uvm-statement-re): Support UVM indentation and | 720 | (verilog-uvm-statement-re): Support UVM indentation and |
| 681 | highlighting, with old OVM keywords only. | 721 | highlighting, with old OVM keywords only. |
| 682 | (verilog-auto-tieoff, verilog-auto-tieoff-declaration): | 722 | (verilog-auto-tieoff, verilog-auto-tieoff-declaration): |
| 683 | Support AUTOTIEOFF creating non-wire data types. Suggested by Jonathan | 723 | Support AUTOTIEOFF creating non-wire data types. |
| 684 | Greenlaw. | 724 | Suggested by Jonathan Greenlaw. |
| 685 | (verilog-auto-insert-lisp, verilog-delete-to-paren) | 725 | (verilog-auto-insert-lisp, verilog-delete-to-paren) |
| 686 | (verilog-forward-sexp-cmt, verilog-forward-sexp-ign-cmt) | 726 | (verilog-forward-sexp-cmt, verilog-forward-sexp-ign-cmt) |
| 687 | (verilog-inject-sense, verilog-read-inst-pins) | 727 | (verilog-inject-sense, verilog-read-inst-pins) |
| @@ -767,11 +807,11 @@ | |||
| 767 | Andrew Drake. | 807 | Andrew Drake. |
| 768 | (verilog-auto-star-safe, verilog-delete-auto-star-implicit) | 808 | (verilog-auto-star-safe, verilog-delete-auto-star-implicit) |
| 769 | (verilog-inst-comment-re): Fix not deleting Interfaced comment | 809 | (verilog-inst-comment-re): Fix not deleting Interfaced comment |
| 770 | when expanding .* in interfaces, bug320. Reported by Pierre-David | 810 | when expanding .* in interfaces, bug320. |
| 771 | Pfister. | 811 | Reported by Pierre-David Pfister. |
| 772 | (verilog-read-module-name): Fix import statements between module | 812 | (verilog-read-module-name): Fix import statements between module |
| 773 | name and open parenthesis, bug317. Reported by Pierre-David | 813 | name and open parenthesis, bug317. |
| 774 | Pfister. | 814 | Reported by Pierre-David Pfister. |
| 775 | (verilog-simplify-range-expression): Fix simplification of | 815 | (verilog-simplify-range-expression): Fix simplification of |
| 776 | multiplications inside AUTOWIRE connections, bug303. | 816 | multiplications inside AUTOWIRE connections, bug303. |
| 777 | (verilog-auto-inst-port): Support parameter expansion in | 817 | (verilog-auto-inst-port): Support parameter expansion in |
| @@ -1025,8 +1065,7 @@ | |||
| 1025 | 1065 | ||
| 1026 | 2011-11-19 Andreas Schwab <schwab@linux-m68k.org> | 1066 | 2011-11-19 Andreas Schwab <schwab@linux-m68k.org> |
| 1027 | 1067 | ||
| 1028 | * progmodes/sh-script.el (sh-assignment-regexp): Add entry for | 1068 | * progmodes/sh-script.el (sh-assignment-regexp): Add entry for bash. |
| 1029 | bash. | ||
| 1030 | 1069 | ||
| 1031 | 2011-11-19 Juri Linkov <juri@jurta.org> | 1070 | 2011-11-19 Juri Linkov <juri@jurta.org> |
| 1032 | 1071 | ||
| @@ -1151,8 +1190,7 @@ | |||
| 1151 | 1190 | ||
| 1152 | * window.el (window-resize, delete-window, split-window): | 1191 | * window.el (window-resize, delete-window, split-window): |
| 1153 | Replace window-splits by window-combination-resize. | 1192 | Replace window-splits by window-combination-resize. |
| 1154 | * cus-start.el (window-splits): Replace by | 1193 | * cus-start.el (window-splits): Replace by window-combination-resize. |
| 1155 | window-combination-resize. | ||
| 1156 | 1194 | ||
| 1157 | 2011-11-17 Glenn Morris <rgm@gnu.org> | 1195 | 2011-11-17 Glenn Morris <rgm@gnu.org> |
| 1158 | 1196 | ||
| @@ -1217,8 +1255,7 @@ | |||
| 1217 | * window.el (split-window, window-state-get-1) | 1255 | * window.el (split-window, window-state-get-1) |
| 1218 | (window-state-put-1, window-state-put-2): Rename occurrences of | 1256 | (window-state-put-1, window-state-put-2): Rename occurrences of |
| 1219 | window-nest to window-combination-limit. | 1257 | window-nest to window-combination-limit. |
| 1220 | * cus-start.el (window-nest): Rename to | 1258 | * cus-start.el (window-nest): Rename to window-combination-limit. |
| 1221 | window-combination-limit. | ||
| 1222 | 1259 | ||
| 1223 | 2011-11-16 Chong Yidong <cyd@gnu.org> | 1260 | 2011-11-16 Chong Yidong <cyd@gnu.org> |
| 1224 | 1261 | ||
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog index 7d6f9f570ec..f9a546ec894 100644 --- a/lisp/cedet/ChangeLog +++ b/lisp/cedet/ChangeLog | |||
| @@ -1,3 +1,20 @@ | |||
| 1 | 2012-01-09 Eric Ludlam <zappo@gnu.org> | ||
| 2 | |||
| 3 | * ede.el (ede-project-directories): New option. | ||
| 4 | (ede-directory-safe-p): Check it. | ||
| 5 | (ede-initialize-state-current-buffer, ede, ede-new) | ||
| 6 | (ede-check-project-directory, ede-rescan-toplevel) | ||
| 7 | (ede-load-project-file, ede-parent-project, ede-current-project): | ||
| 8 | (ede-target-parent): Avoid loading in a project unless it is safe, | ||
| 9 | since it may involve malicious code. This security flaw was | ||
| 10 | pointed out by Hiroshi Oota. | ||
| 11 | |||
| 12 | * ede/auto.el (ede-project-autoload): Add safe-p slot. | ||
| 13 | (ede-project-class-files): Projects using Project.ede are unsafe. | ||
| 14 | (ede-auto-load-project): New method. | ||
| 15 | |||
| 16 | * ede/simple.el (ede-project-class-files): Mark as unsafe. | ||
| 17 | |||
| 1 | 2011-12-19 Sam Steingold <sds@gnu.org> | 18 | 2011-12-19 Sam Steingold <sds@gnu.org> |
| 2 | 19 | ||
| 3 | * semantic/edit.el (semantic-edits-incremental-parser): Add the | 20 | * semantic/edit.el (semantic-edits-incremental-parser): Add the |
diff --git a/lisp/cedet/ede.el b/lisp/cedet/ede.el index 5f336df5514..cc8b6f53242 100644 --- a/lisp/cedet/ede.el +++ b/lisp/cedet/ede.el | |||
| @@ -94,6 +94,42 @@ target willing to take the file. 'never means never perform the check." | |||
| 94 | :group 'ede | 94 | :group 'ede |
| 95 | :type 'sexp) ; make this be a list of options some day | 95 | :type 'sexp) ; make this be a list of options some day |
| 96 | 96 | ||
| 97 | (defcustom ede-project-directories nil | ||
| 98 | "Directories in which EDE may search for project files. | ||
| 99 | If the value is t, EDE may search in any directory. | ||
| 100 | |||
| 101 | If the value is a function, EDE calls that function with one | ||
| 102 | argument, the directory name; the function should return t iff | ||
| 103 | EDE should look for project files in the directory. | ||
| 104 | |||
| 105 | Otherwise, the value should be a list of fully-expanded directory | ||
| 106 | names. EDE searches for project files only in those directories. | ||
| 107 | If you invoke the commands \\[ede] or \\[ede-new] on a directory | ||
| 108 | that is not listed, Emacs will offer to add it to the list. | ||
| 109 | |||
| 110 | Any other value disables searching for EDE project files." | ||
| 111 | :group 'ede | ||
| 112 | :type '(choice (const :tag "Any directory" t) | ||
| 113 | (repeat :tag "List of directories" | ||
| 114 | (directory)) | ||
| 115 | (function :tag "Predicate")) | ||
| 116 | :version "23.4" | ||
| 117 | :risky t) | ||
| 118 | |||
| 119 | (defun ede-directory-safe-p (dir) | ||
| 120 | "Return non-nil if DIR is a safe directory to load projects from. | ||
| 121 | Projects that do not load a project definition as Emacs Lisp code | ||
| 122 | are safe, and can be loaded automatically. Other project types, | ||
| 123 | such as those created with Project.ede files, are safe only if | ||
| 124 | specified by `ede-project-directories'." | ||
| 125 | (setq dir (directory-file-name (expand-file-name dir))) | ||
| 126 | ;; Load only if allowed by `ede-project-directories'. | ||
| 127 | (or (eq ede-project-directories t) | ||
| 128 | (and (functionp ede-project-directories) | ||
| 129 | (funcall ede-project-directories dir)) | ||
| 130 | (and (listp ede-project-directories) | ||
| 131 | (member dir ede-project-directories)))) | ||
| 132 | |||
| 97 | 133 | ||
| 98 | ;;; Management variables | 134 | ;;; Management variables |
| 99 | 135 | ||
| @@ -420,24 +456,42 @@ provided `global-ede-mode' is enabled." | |||
| 420 | Sets buffer local variables for EDE." | 456 | Sets buffer local variables for EDE." |
| 421 | (let* ((ROOT nil) | 457 | (let* ((ROOT nil) |
| 422 | (proj (ede-directory-get-open-project default-directory | 458 | (proj (ede-directory-get-open-project default-directory |
| 423 | 'ROOT))) | 459 | 'ROOT)) |
| 460 | (projauto nil)) | ||
| 461 | |||
| 424 | (when (or proj ROOT | 462 | (when (or proj ROOT |
| 425 | (ede-directory-project-p default-directory t)) | 463 | ;; If there is no open project, look up the project |
| 464 | ;; autoloader to see if we should initialize. | ||
| 465 | (setq projauto (ede-directory-project-p default-directory t))) | ||
| 466 | |||
| 467 | (when (and (not proj) projauto) | ||
| 468 | |||
| 469 | ;; No project was loaded, but we have a project description | ||
| 470 | ;; object. This means that we can check if it is a safe | ||
| 471 | ;; project to load before requesting it to be loaded. | ||
| 426 | 472 | ||
| 427 | (when (not proj) | 473 | (when (or (oref projauto safe-p) |
| 428 | ;; @todo - this could be wasteful. | 474 | ;; The project style is not safe, so check if it is |
| 429 | (setq proj (ede-load-project-file default-directory 'ROOT))) | 475 | ;; in `ede-project-directories'. |
| 476 | (let ((top (ede-toplevel-project default-directory))) | ||
| 477 | (ede-directory-safe-p top))) | ||
| 430 | 478 | ||
| 431 | (setq ede-object (ede-buffer-object (current-buffer) | 479 | ;; The project is safe, so load it in. |
| 480 | (setq proj (ede-load-project-file default-directory 'ROOT)))) | ||
| 481 | |||
| 482 | ;; Only initialize EDE state in this buffer if we found a project. | ||
| 483 | (when proj | ||
| 484 | |||
| 485 | (setq ede-object (ede-buffer-object (current-buffer) | ||
| 432 | 'ede-object-project)) | 486 | 'ede-object-project)) |
| 433 | 487 | ||
| 434 | (setq ede-object-root-project | 488 | (setq ede-object-root-project |
| 435 | (or ROOT (ede-project-root ede-object-project))) | 489 | (or ROOT (ede-project-root ede-object-project))) |
| 436 | 490 | ||
| 437 | (if (and (not ede-object) ede-object-project) | 491 | (if (and (not ede-object) ede-object-project) |
| 438 | (ede-auto-add-to-target)) | 492 | (ede-auto-add-to-target)) |
| 439 | 493 | ||
| 440 | (ede-apply-target-options)))) | 494 | (ede-apply-target-options))))) |
| 441 | 495 | ||
| 442 | (defun ede-reset-all-buffers (onoff) | 496 | (defun ede-reset-all-buffers (onoff) |
| 443 | "Reset all the buffers due to change in EDE. | 497 | "Reset all the buffers due to change in EDE. |
| @@ -557,13 +611,73 @@ of objects with the `ede-want-file-p' method." | |||
| 557 | 611 | ||
| 558 | ;;; Interactive method invocations | 612 | ;;; Interactive method invocations |
| 559 | ;; | 613 | ;; |
| 560 | (defun ede (file) | 614 | (defun ede (dir) |
| 561 | "Start up EDE on something. | 615 | "Start up EDE for directory DIR. |
| 562 | Argument FILE is the file or directory to load a project from." | 616 | If DIR has an existing project file, load it. |
| 563 | (interactive "fProject File: ") | 617 | Otherwise, create a new project for DIR." |
| 564 | (if (not (file-exists-p file)) | 618 | (interactive |
| 565 | (ede-new file) | 619 | ;; When choosing a directory to turn on, and we see some directory here, |
| 566 | (ede-load-project-file (file-name-directory file)))) | 620 | ;; provide that as the default. |
| 621 | (let* ((top (ede-toplevel-project default-directory)) | ||
| 622 | (promptdflt (or top default-directory))) | ||
| 623 | (list (read-directory-name "Project directory: " | ||
| 624 | promptdflt promptdflt t)))) | ||
| 625 | (unless (file-directory-p dir) | ||
| 626 | (error "%s is not a directory" dir)) | ||
| 627 | (when (ede-directory-get-open-project dir) | ||
| 628 | (error "%s already has an open project associated with it" dir)) | ||
| 629 | |||
| 630 | ;; Check if the directory has been added to the list of safe | ||
| 631 | ;; directories. It can also add the directory to the safe list if | ||
| 632 | ;; the user chooses. | ||
| 633 | (if (ede-check-project-directory dir) | ||
| 634 | (progn | ||
| 635 | ;; If there is a project in DIR, load it, otherwise do | ||
| 636 | ;; nothing. | ||
| 637 | (ede-load-project-file dir) | ||
| 638 | |||
| 639 | ;; Check if we loaded anything on the previous line. | ||
| 640 | (if (ede-current-project dir) | ||
| 641 | |||
| 642 | ;; We successfully opened an existing project. Some open | ||
| 643 | ;; buffers may also be referring to this project. | ||
| 644 | ;; Resetting all the buffers will get them to also point | ||
| 645 | ;; at this new open project. | ||
| 646 | (ede-reset-all-buffers 1) | ||
| 647 | |||
| 648 | ;; ELSE | ||
| 649 | ;; There was no project, so switch to `ede-new' which is how | ||
| 650 | ;; a user can select a new kind of project to create. | ||
| 651 | (let ((default-directory (expand-file-name dir))) | ||
| 652 | (call-interactively 'ede-new)))) | ||
| 653 | |||
| 654 | ;; If the proposed directory isn't safe, then say so. | ||
| 655 | (error "%s is not an allowed project directory in `ede-project-directories'" | ||
| 656 | dir))) | ||
| 657 | |||
| 658 | (defun ede-check-project-directory (dir) | ||
| 659 | "Check if DIR should be in `ede-project-directories'. | ||
| 660 | If it is not, try asking the user if it should be added; if so, | ||
| 661 | add it and save `ede-project-directories' via Customize. | ||
| 662 | Return nil iff DIR should not be in `ede-project-directories'." | ||
| 663 | (setq dir (directory-file-name (expand-file-name dir))) ; strip trailing / | ||
| 664 | (or (eq ede-project-directories t) | ||
| 665 | (and (functionp ede-project-directories) | ||
| 666 | (funcall ede-project-directories dir)) | ||
| 667 | ;; If `ede-project-directories' is a list, maybe add it. | ||
| 668 | (when (listp ede-project-directories) | ||
| 669 | (or (member dir ede-project-directories) | ||
| 670 | (when (y-or-n-p (format "`%s' is not listed in `ede-project-directories'. | ||
| 671 | Add it to the list of allowed project directories? " | ||
| 672 | dir)) | ||
| 673 | (push dir ede-project-directories) | ||
| 674 | ;; If possible, save `ede-project-directories'. | ||
| 675 | (if (or custom-file user-init-file) | ||
| 676 | (let ((coding-system-for-read nil)) | ||
| 677 | (customize-save-variable | ||
| 678 | 'ede-project-directories | ||
| 679 | ede-project-directories))) | ||
| 680 | t))))) | ||
| 567 | 681 | ||
| 568 | (defun ede-new (type &optional name) | 682 | (defun ede-new (type &optional name) |
| 569 | "Create a new project starting from project type TYPE. | 683 | "Create a new project starting from project type TYPE. |
| @@ -598,6 +712,11 @@ Optional argument NAME is the name to give this project." | |||
| 598 | (error "Cannot create project in non-existent directory %s" default-directory)) | 712 | (error "Cannot create project in non-existent directory %s" default-directory)) |
| 599 | (when (not (file-writable-p default-directory)) | 713 | (when (not (file-writable-p default-directory)) |
| 600 | (error "No write permissions for %s" default-directory)) | 714 | (error "No write permissions for %s" default-directory)) |
| 715 | (unless (ede-check-project-directory default-directory) | ||
| 716 | (error "%s is not an allowed project directory in `ede-project-directories'" | ||
| 717 | default-directory)) | ||
| 718 | ;; Make sure the project directory is loadable in the future. | ||
| 719 | (ede-check-project-directory default-directory) | ||
| 601 | ;; Create the project | 720 | ;; Create the project |
| 602 | (let* ((obj (object-assoc type 'name ede-project-class-files)) | 721 | (let* ((obj (object-assoc type 'name ede-project-class-files)) |
| 603 | (nobj (let ((f (oref obj file)) | 722 | (nobj (let ((f (oref obj file)) |
| @@ -631,6 +750,10 @@ Optional argument NAME is the name to give this project." | |||
| 631 | (ede-add-subproject pp nobj) | 750 | (ede-add-subproject pp nobj) |
| 632 | (ede-commit-project pp))) | 751 | (ede-commit-project pp))) |
| 633 | (ede-commit-project nobj)) | 752 | (ede-commit-project nobj)) |
| 753 | ;; Once the project is created, load it again. This used to happen | ||
| 754 | ;; lazily, but with project loading occurring less often and with | ||
| 755 | ;; security in mind, this is now the safe time to reload. | ||
| 756 | (ede-load-project-file default-directory) | ||
| 634 | ;; Have the menu appear | 757 | ;; Have the menu appear |
| 635 | (setq ede-minor-mode t) | 758 | (setq ede-minor-mode t) |
| 636 | ;; Allert the user | 759 | ;; Allert the user |
| @@ -653,11 +776,16 @@ ARGS are additional arguments to pass to method SYM." | |||
| 653 | (defun ede-rescan-toplevel () | 776 | (defun ede-rescan-toplevel () |
| 654 | "Rescan all project files." | 777 | "Rescan all project files." |
| 655 | (interactive) | 778 | (interactive) |
| 656 | (let ((toppath (ede-toplevel-project default-directory)) | 779 | (if (not (ede-directory-get-open-project default-directory)) |
| 657 | (ede-deep-rescan t)) | 780 | ;; This directory isn't open. Can't rescan. |
| 658 | (project-rescan (ede-load-project-file toppath)) | 781 | (error "Attempt to rescan a project that isn't open") |
| 659 | (ede-reset-all-buffers 1) | 782 | |
| 660 | )) | 783 | ;; Continue |
| 784 | (let ((toppath (ede-toplevel-project default-directory)) | ||
| 785 | (ede-deep-rescan t)) | ||
| 786 | |||
| 787 | (project-rescan (ede-load-project-file toppath)) | ||
| 788 | (ede-reset-all-buffers 1)))) | ||
| 661 | 789 | ||
| 662 | (defun ede-new-target (&rest args) | 790 | (defun ede-new-target (&rest args) |
| 663 | "Create a new target specific to this type of project file. | 791 | "Create a new target specific to this type of project file. |
| @@ -893,7 +1021,7 @@ Optional ROOTRETURN will return the root project for DIR." | |||
| 893 | ;; Do the load | 1021 | ;; Do the load |
| 894 | ;;(message "EDE LOAD : %S" file) | 1022 | ;;(message "EDE LOAD : %S" file) |
| 895 | (let* ((file dir) | 1023 | (let* ((file dir) |
| 896 | (path (expand-file-name (file-name-directory file))) | 1024 | (path (file-name-as-directory (expand-file-name dir))) |
| 897 | (pfc (ede-directory-project-p path)) | 1025 | (pfc (ede-directory-project-p path)) |
| 898 | (toppath nil) | 1026 | (toppath nil) |
| 899 | (o nil)) | 1027 | (o nil)) |
| @@ -922,13 +1050,11 @@ Optional ROOTRETURN will return the root project for DIR." | |||
| 922 | ;; See if it's been loaded before | 1050 | ;; See if it's been loaded before |
| 923 | (setq o (object-assoc (ede-dir-to-projectfile pfc toppath) 'file | 1051 | (setq o (object-assoc (ede-dir-to-projectfile pfc toppath) 'file |
| 924 | ede-projects)) | 1052 | ede-projects)) |
| 925 | (if (not o) | 1053 | |
| 926 | ;; If not, get it now. | 1054 | ;; If not open yet, load it. |
| 927 | (let ((ede-constructing pfc)) | 1055 | (unless o |
| 928 | (setq o (funcall (oref pfc load-type) toppath)) | 1056 | (let ((ede-constructing pfc)) |
| 929 | (when (not o) | 1057 | (setq o (ede-auto-load-project pfc toppath)))) |
| 930 | (error "Project type error: :load-type failed to create a project")) | ||
| 931 | (ede-add-project-to-global-list o))) | ||
| 932 | 1058 | ||
| 933 | ;; Return the found root project. | 1059 | ;; Return the found root project. |
| 934 | (when rootreturn (set rootreturn o)) | 1060 | (when rootreturn (set rootreturn o)) |
| @@ -982,13 +1108,7 @@ Optional argument OBJ is an object to find the parent of." | |||
| 982 | (and root | 1108 | (and root |
| 983 | (ede-find-subproject-for-directory root updir)) | 1109 | (ede-find-subproject-for-directory root updir)) |
| 984 | ;; Try the all structure based search. | 1110 | ;; Try the all structure based search. |
| 985 | (ede-directory-get-open-project updir) | 1111 | (ede-directory-get-open-project updir)))))))) |
| 986 | ;; Load up the project file as a last resort. | ||
| 987 | ;; Last resort since it uses file-truename, and other | ||
| 988 | ;; slow features. | ||
| 989 | (and (ede-directory-project-p updir) | ||
| 990 | (ede-load-project-file | ||
| 991 | (file-name-as-directory updir)))))))))) | ||
| 992 | 1112 | ||
| 993 | (defun ede-current-project (&optional dir) | 1113 | (defun ede-current-project (&optional dir) |
| 994 | "Return the current project file. | 1114 | "Return the current project file. |
| @@ -1002,11 +1122,7 @@ If optional DIR is provided, get the project for DIR instead." | |||
| 1002 | ;; No current project. | 1122 | ;; No current project. |
| 1003 | (when (not ans) | 1123 | (when (not ans) |
| 1004 | (let* ((ldir (or dir default-directory))) | 1124 | (let* ((ldir (or dir default-directory))) |
| 1005 | (setq ans (ede-directory-get-open-project ldir)) | 1125 | (setq ans (ede-directory-get-open-project ldir)))) |
| 1006 | (or ans | ||
| 1007 | ;; No open project, if this dir pass project-p, then load. | ||
| 1008 | (when (ede-directory-project-p ldir) | ||
| 1009 | (setq ans (ede-load-project-file ldir)))))) | ||
| 1010 | ;; Return what we found. | 1126 | ;; Return what we found. |
| 1011 | ans)) | 1127 | ans)) |
| 1012 | 1128 | ||
| @@ -1061,12 +1177,13 @@ If TARGET belongs to a subproject, return that project file." | |||
| 1061 | "Return the project which is the parent of TARGET. | 1177 | "Return the project which is the parent of TARGET. |
| 1062 | It is recommended you track the project a different way as this function | 1178 | It is recommended you track the project a different way as this function |
| 1063 | could become slow in time." | 1179 | could become slow in time." |
| 1064 | ;; @todo - use ede-object-project as a starting point. | 1180 | (or ede-object-project |
| 1065 | (let ((ans nil) (projs ede-projects)) | 1181 | ;; If not cached, derive it from the current directory of the target. |
| 1066 | (while (and (not ans) projs) | 1182 | (let ((ans nil) (projs ede-projects)) |
| 1067 | (setq ans (ede-target-in-project-p (car projs) target) | 1183 | (while (and (not ans) projs) |
| 1068 | projs (cdr projs))) | 1184 | (setq ans (ede-target-in-project-p (car projs) target) |
| 1069 | ans)) | 1185 | projs (cdr projs))) |
| 1186 | ans))) | ||
| 1070 | 1187 | ||
| 1071 | (defmethod ede-find-target ((proj ede-project) buffer) | 1188 | (defmethod ede-find-target ((proj ede-project) buffer) |
| 1072 | "Fetch the target in PROJ belonging to BUFFER or nil." | 1189 | "Fetch the target in PROJ belonging to BUFFER or nil." |
diff --git a/lisp/cedet/ede/auto.el b/lisp/cedet/ede/auto.el index 7ff291d3675..b458cc246f0 100644 --- a/lisp/cedet/ede/auto.el +++ b/lisp/cedet/ede/auto.el | |||
| @@ -58,6 +58,13 @@ associated with a single object class, based on the initializers used.") | |||
| 58 | :initform t | 58 | :initform t |
| 59 | :documentation | 59 | :documentation |
| 60 | "Non-nil if this is an option when a user creates a project.") | 60 | "Non-nil if this is an option when a user creates a project.") |
| 61 | (safe-p :initarg :safe-p | ||
| 62 | :initform t | ||
| 63 | :documentation | ||
| 64 | "Non-nil if the project load files are \"safe\". | ||
| 65 | An unsafe project is one that loads project variables via Emacs | ||
| 66 | Lisp code. A safe project is one that loads project variables by | ||
| 67 | scanning files without loading Lisp code from them.") | ||
| 61 | ) | 68 | ) |
| 62 | "Class representing minimal knowledge set to run preliminary EDE functions. | 69 | "Class representing minimal knowledge set to run preliminary EDE functions. |
| 63 | When more advanced functionality is needed from a project type, that projects | 70 | When more advanced functionality is needed from a project type, that projects |
| @@ -69,13 +76,15 @@ type is required and the load function used.") | |||
| 69 | :name "Make" :file 'ede/proj | 76 | :name "Make" :file 'ede/proj |
| 70 | :proj-file "Project.ede" | 77 | :proj-file "Project.ede" |
| 71 | :load-type 'ede-proj-load | 78 | :load-type 'ede-proj-load |
| 72 | :class-sym 'ede-proj-project) | 79 | :class-sym 'ede-proj-project |
| 80 | :safe-p nil) | ||
| 73 | (ede-project-autoload "edeproject-automake" | 81 | (ede-project-autoload "edeproject-automake" |
| 74 | :name "Automake" :file 'ede/proj | 82 | :name "Automake" :file 'ede/proj |
| 75 | :proj-file "Project.ede" | 83 | :proj-file "Project.ede" |
| 76 | :initializers '(:makefile-type Makefile.am) | 84 | :initializers '(:makefile-type Makefile.am) |
| 77 | :load-type 'ede-proj-load | 85 | :load-type 'ede-proj-load |
| 78 | :class-sym 'ede-proj-project) | 86 | :class-sym 'ede-proj-project |
| 87 | :safe-p nil) | ||
| 79 | (ede-project-autoload "automake" | 88 | (ede-project-autoload "automake" |
| 80 | :name "automake" :file 'ede/project-am | 89 | :name "automake" :file 'ede/project-am |
| 81 | :proj-file "Makefile.am" | 90 | :proj-file "Makefile.am" |
| @@ -84,6 +93,8 @@ type is required and the load function used.") | |||
| 84 | :new-p nil)) | 93 | :new-p nil)) |
| 85 | "List of vectors defining how to determine what type of projects exist.") | 94 | "List of vectors defining how to determine what type of projects exist.") |
| 86 | 95 | ||
| 96 | (put 'ede-project-class-files 'risky-local-variable t) | ||
| 97 | |||
| 87 | ;;; EDE project-autoload methods | 98 | ;;; EDE project-autoload methods |
| 88 | ;; | 99 | ;; |
| 89 | (defmethod ede-project-root ((this ede-project-autoload)) | 100 | (defmethod ede-project-root ((this ede-project-autoload)) |
| @@ -122,6 +133,19 @@ Return nil if the project file does not exist." | |||
| 122 | (when (and f (file-exists-p f)) | 133 | (when (and f (file-exists-p f)) |
| 123 | f))) | 134 | f))) |
| 124 | 135 | ||
| 136 | (defmethod ede-auto-load-project ((this ede-project-autoload) dir) | ||
| 137 | "Load in the project associated with THIS project autoload description. | ||
| 138 | THIS project description should be valid for DIR, where the project will | ||
| 139 | be loaded." | ||
| 140 | ;; Last line of defense: don't load unsafe projects. | ||
| 141 | (when (not (or (oref this :safe-p) | ||
| 142 | (ede-directory-safe-p dir))) | ||
| 143 | (error "Attempt to load an unsafe project (bug elsewhere in EDE)")) | ||
| 144 | ;; Things are good - so load the project. | ||
| 145 | (let ((o (funcall (oref this load-type) dir))) | ||
| 146 | (when (not o) | ||
| 147 | (error "Project type error: :load-type failed to create a project")) | ||
| 148 | (ede-add-project-to-global-list o))) | ||
| 125 | 149 | ||
| 126 | (provide 'ede/auto) | 150 | (provide 'ede/auto) |
| 127 | 151 | ||
diff --git a/lisp/cedet/ede/simple.el b/lisp/cedet/ede/simple.el index 028c126e9e4..5cfa750c63f 100644 --- a/lisp/cedet/ede/simple.el +++ b/lisp/cedet/ede/simple.el | |||
| @@ -50,7 +50,8 @@ | |||
| 50 | :name "Simple" :file 'ede/simple | 50 | :name "Simple" :file 'ede/simple |
| 51 | :proj-file 'ede-simple-projectfile-for-dir | 51 | :proj-file 'ede-simple-projectfile-for-dir |
| 52 | :load-type 'ede-simple-load | 52 | :load-type 'ede-simple-load |
| 53 | :class-sym 'ede-simple-project) | 53 | :class-sym 'ede-simple-project |
| 54 | :safe-p nil) | ||
| 54 | t) | 55 | t) |
| 55 | 56 | ||
| 56 | (defcustom ede-simple-save-directory "~/.ede" | 57 | (defcustom ede-simple-save-directory "~/.ede" |
diff --git a/lisp/dired.el b/lisp/dired.el index 6f2ddbbc73d..f1a778ad05a 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -1111,6 +1111,11 @@ BEG..END is the line where the file info is located." | |||
| 1111 | 1111 | ||
| 1112 | (defvar ls-lisp-use-insert-directory-program) | 1112 | (defvar ls-lisp-use-insert-directory-program) |
| 1113 | 1113 | ||
| 1114 | (defun dired-switches-escape-p (switches) | ||
| 1115 | "Return non-nil if the string SWITCHES contains -b or --escape." | ||
| 1116 | ;; Do not match things like "--block-size" that happen to contain "b". | ||
| 1117 | (string-match "\\(\\`\\| \\)-[[:alnum:]]*b\\|--escape\\>" switches)) | ||
| 1118 | |||
| 1114 | (defun dired-insert-directory (dir switches &optional file-list wildcard hdr) | 1119 | (defun dired-insert-directory (dir switches &optional file-list wildcard hdr) |
| 1115 | "Insert a directory listing of DIR, Dired style. | 1120 | "Insert a directory listing of DIR, Dired style. |
| 1116 | Use SWITCHES to make the listings. | 1121 | Use SWITCHES to make the listings. |
| @@ -1152,7 +1157,7 @@ see `dired-use-ls-dired' for more details.") | |||
| 1152 | (dired-align-file beg (point)))) | 1157 | (dired-align-file beg (point)))) |
| 1153 | (insert-directory dir switches wildcard (not wildcard))) | 1158 | (insert-directory dir switches wildcard (not wildcard))) |
| 1154 | ;; Quote certain characters, unless ls quoted them for us. | 1159 | ;; Quote certain characters, unless ls quoted them for us. |
| 1155 | (if (not (string-match "b" dired-actual-switches)) | 1160 | (if (not (dired-switches-escape-p dired-actual-switches)) |
| 1156 | (save-excursion | 1161 | (save-excursion |
| 1157 | (setq end (point-marker)) | 1162 | (setq end (point-marker)) |
| 1158 | (goto-char opoint) | 1163 | (goto-char opoint) |
| @@ -2099,7 +2104,18 @@ Otherwise, an error occurs in these cases." | |||
| 2099 | ;; with quotation marks in their names. | 2104 | ;; with quotation marks in their names. |
| 2100 | (while (string-match "\\(?:[^\\]\\|\\`\\)\\(\"\\)" file) | 2105 | (while (string-match "\\(?:[^\\]\\|\\`\\)\\(\"\\)" file) |
| 2101 | (setq file (replace-match "\\\"" nil t file 1))) | 2106 | (setq file (replace-match "\\\"" nil t file 1))) |
| 2102 | 2107 | ;; Unescape any spaces escaped by ls -b (bug#10469). | |
| 2108 | ;; Other -b quotes, eg \t, \n, work transparently. | ||
| 2109 | (if (dired-switches-escape-p dired-actual-switches) | ||
| 2110 | (let ((start 0) | ||
| 2111 | (rep "") | ||
| 2112 | (shift -1)) | ||
| 2113 | (if (eq localp 'verbatim) | ||
| 2114 | (setq rep "\\\\" | ||
| 2115 | shift +1)) | ||
| 2116 | (while (string-match "\\(\\\\\\) " file start) | ||
| 2117 | (setq file (replace-match rep nil t file 1) | ||
| 2118 | start (+ shift (match-end 0)))))) | ||
| 2103 | (when (eq system-type 'windows-nt) | 2119 | (when (eq system-type 'windows-nt) |
| 2104 | (save-match-data | 2120 | (save-match-data |
| 2105 | (let ((start 0)) | 2121 | (let ((start 0)) |
| @@ -2107,6 +2123,7 @@ Otherwise, an error occurs in these cases." | |||
| 2107 | (aset file (match-beginning 0) ?/) | 2123 | (aset file (match-beginning 0) ?/) |
| 2108 | (setq start (match-end 0)))))) | 2124 | (setq start (match-end 0)))))) |
| 2109 | 2125 | ||
| 2126 | ;; Hence we don't need to worry about converting `\\' back to `\'. | ||
| 2110 | (setq file (read (concat "\"" file "\""))) | 2127 | (setq file (read (concat "\"" file "\""))) |
| 2111 | ;; The above `read' will return a unibyte string if FILE | 2128 | ;; The above `read' will return a unibyte string if FILE |
| 2112 | ;; contains eight-bit-control/graphic characters. | 2129 | ;; contains eight-bit-control/graphic characters. |
diff --git a/lisp/epg.el b/lisp/epg.el index 3505e183c1f..6529afb2d3c 100644 --- a/lisp/epg.el +++ b/lisp/epg.el | |||
| @@ -1951,7 +1951,8 @@ The returned file name (created by appending some random characters at the end | |||
| 1951 | of PREFIX, and expanding against `temporary-file-directory' if necessary), | 1951 | of PREFIX, and expanding against `temporary-file-directory' if necessary), |
| 1952 | is guaranteed to point to a newly created empty file. | 1952 | is guaranteed to point to a newly created empty file. |
| 1953 | You can then use `write-region' to write new data into the file." | 1953 | You can then use `write-region' to write new data into the file." |
| 1954 | (let (tempdir tempfile) | 1954 | (let ((orig-modes (default-file-modes)) |
| 1955 | tempdir tempfile) | ||
| 1955 | (setq prefix (expand-file-name prefix | 1956 | (setq prefix (expand-file-name prefix |
| 1956 | (if (featurep 'xemacs) | 1957 | (if (featurep 'xemacs) |
| 1957 | (temp-directory) | 1958 | (temp-directory) |
| @@ -1959,6 +1960,7 @@ You can then use `write-region' to write new data into the file." | |||
| 1959 | (unwind-protect | 1960 | (unwind-protect |
| 1960 | (let (file) | 1961 | (let (file) |
| 1961 | ;; First, create a temporary directory. | 1962 | ;; First, create a temporary directory. |
| 1963 | (set-default-file-modes #o700) | ||
| 1962 | (while (condition-case () | 1964 | (while (condition-case () |
| 1963 | (progn | 1965 | (progn |
| 1964 | (setq tempdir (make-temp-name | 1966 | (setq tempdir (make-temp-name |
| @@ -1969,14 +1971,12 @@ You can then use `write-region' to write new data into the file." | |||
| 1969 | (make-directory tempdir)) | 1971 | (make-directory tempdir)) |
| 1970 | ;; let's try again. | 1972 | ;; let's try again. |
| 1971 | (file-already-exists t))) | 1973 | (file-already-exists t))) |
| 1972 | (set-file-modes tempdir 448) | ||
| 1973 | ;; Second, create a temporary file in the tempdir. | 1974 | ;; Second, create a temporary file in the tempdir. |
| 1974 | ;; There *is* a race condition between `make-temp-name' | 1975 | ;; There *is* a race condition between `make-temp-name' |
| 1975 | ;; and `write-region', but we don't care it since we are | 1976 | ;; and `write-region', but we don't care it since we are |
| 1976 | ;; in a private directory now. | 1977 | ;; in a private directory now. |
| 1977 | (setq tempfile (make-temp-name (concat tempdir "/EMU"))) | 1978 | (setq tempfile (make-temp-name (concat tempdir "/EMU"))) |
| 1978 | (write-region "" nil tempfile nil 'silent) | 1979 | (write-region "" nil tempfile nil 'silent) |
| 1979 | (set-file-modes tempfile 384) | ||
| 1980 | ;; Finally, make a hard-link from the tempfile. | 1980 | ;; Finally, make a hard-link from the tempfile. |
| 1981 | (while (condition-case () | 1981 | (while (condition-case () |
| 1982 | (progn | 1982 | (progn |
| @@ -1986,6 +1986,7 @@ You can then use `write-region' to write new data into the file." | |||
| 1986 | ;; let's try again. | 1986 | ;; let's try again. |
| 1987 | (file-already-exists t))) | 1987 | (file-already-exists t))) |
| 1988 | file) | 1988 | file) |
| 1989 | (set-default-file-modes orig-modes) | ||
| 1989 | ;; Cleanup the tempfile. | 1990 | ;; Cleanup the tempfile. |
| 1990 | (and tempfile | 1991 | (and tempfile |
| 1991 | (file-exists-p tempfile) | 1992 | (file-exists-p tempfile) |
diff --git a/lisp/find-dired.el b/lisp/find-dired.el index 3fda2153e09..9c1c8eedffd 100644 --- a/lisp/find-dired.el +++ b/lisp/find-dired.el | |||
| @@ -63,10 +63,20 @@ than the latter." | |||
| 63 | (cons | 63 | (cons |
| 64 | (format "-exec ls -ld {} %s" find-exec-terminator) | 64 | (format "-exec ls -ld {} %s" find-exec-terminator) |
| 65 | "-ld")) | 65 | "-ld")) |
| 66 | "Description of the option to `find' to produce an `ls -l'-type listing. | 66 | "A pair of options to produce and parse an `ls -l'-type list from `find'. |
| 67 | This is a cons of two strings (FIND-OPTION . LS-SWITCHES). FIND-OPTION | 67 | This is a cons of two strings (FIND-OPTION . LS-SWITCHES). |
| 68 | gives the option (or options) to `find' that produce the desired output. | 68 | FIND-OPTION is the option (or options) passed to `find' to produce |
| 69 | LS-SWITCHES is a list of `ls' switches to tell dired how to parse the output." | 69 | a file listing in the desired format. LS-SWITCHES is a set of |
| 70 | `ls' switches that tell dired how to parse the output of `find'. | ||
| 71 | |||
| 72 | The two options must be set to compatible values. | ||
| 73 | For example, to use human-readable file sizes with GNU ls: | ||
| 74 | \(\"-exec ls -ldh {} +\" . \"-ldh\") | ||
| 75 | |||
| 76 | To use GNU find's inbuilt \"-ls\" option to list files: | ||
| 77 | \(\"-ls\" . \"-dilsb\") | ||
| 78 | since GNU find's output has the same format as using GNU ls with | ||
| 79 | the options \"-dilsb\"." | ||
| 70 | :version "24.1" ; add tests for -ls and -exec + support | 80 | :version "24.1" ; add tests for -ls and -exec + support |
| 71 | :type '(cons (string :tag "Find Option") | 81 | :type '(cons (string :tag "Find Option") |
| 72 | (string :tag "Ls Switches")) | 82 | (string :tag "Ls Switches")) |
diff --git a/lisp/info.el b/lisp/info.el index 94d29518995..a8cb141114c 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -2251,7 +2251,7 @@ Table of contents is created from the tree structure of menus." | |||
| 2251 | (match-string-no-properties 1))) | 2251 | (match-string-no-properties 1))) |
| 2252 | (section "Top") | 2252 | (section "Top") |
| 2253 | menu-items) | 2253 | menu-items) |
| 2254 | (when (string-match "(" upnode) (setq upnode nil)) | 2254 | (when (and upnode (string-match "(" upnode)) (setq upnode nil)) |
| 2255 | (when (and (not (Info-index-node nodename file)) | 2255 | (when (and (not (Info-index-node nodename file)) |
| 2256 | (re-search-forward "^\\* Menu:" bound t)) | 2256 | (re-search-forward "^\\* Menu:" bound t)) |
| 2257 | (forward-line 1) | 2257 | (forward-line 1) |
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 58a7a2c3729..18d928e4b90 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el | |||
| @@ -730,6 +730,7 @@ Turning on Mail mode runs the normal hooks `text-mode-hook' and | |||
| 730 | (set (make-local-variable 'comment-start-skip) | 730 | (set (make-local-variable 'comment-start-skip) |
| 731 | (concat "^" (regexp-quote mail-yank-prefix) "[ \t]*"))) | 731 | (concat "^" (regexp-quote mail-yank-prefix) "[ \t]*"))) |
| 732 | (make-local-variable 'adaptive-fill-regexp) | 732 | (make-local-variable 'adaptive-fill-regexp) |
| 733 | ;; Also update the paragraph-separate entry if you change this. | ||
| 733 | (setq adaptive-fill-regexp | 734 | (setq adaptive-fill-regexp |
| 734 | (concat "[ \t]*[-[:alnum:]]+>+[ \t]*\\|" | 735 | (concat "[ \t]*[-[:alnum:]]+>+[ \t]*\\|" |
| 735 | adaptive-fill-regexp)) | 736 | adaptive-fill-regexp)) |
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 756010160d2..3d9b30bcbb3 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el | |||
| @@ -571,6 +571,10 @@ in the last `cdr'." | |||
| 571 | (defun completion--replace (beg end newtext) | 571 | (defun completion--replace (beg end newtext) |
| 572 | "Replace the buffer text between BEG and END with NEWTEXT. | 572 | "Replace the buffer text between BEG and END with NEWTEXT. |
| 573 | Moves point to the end of the new text." | 573 | Moves point to the end of the new text." |
| 574 | ;; The properties on `newtext' include things like | ||
| 575 | ;; completions-first-difference, which we don't want to include | ||
| 576 | ;; upon insertion. | ||
| 577 | (set-text-properties 0 (length newtext) nil newtext) | ||
| 574 | ;; Maybe this should be in subr.el. | 578 | ;; Maybe this should be in subr.el. |
| 575 | ;; You'd think this is trivial to do, but details matter if you want | 579 | ;; You'd think this is trivial to do, but details matter if you want |
| 576 | ;; to keep markers "at the right place" and be robust in the face of | 580 | ;; to keep markers "at the right place" and be robust in the face of |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 02f933be367..2478253841f 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -512,6 +512,7 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 512 | ;; GNU/Linux (Debian, Suse): /bin:/usr/bin | 512 | ;; GNU/Linux (Debian, Suse): /bin:/usr/bin |
| 513 | ;; FreeBSD: /usr/bin:/bin:/usr/sbin:/sbin: - beware trailing ":"! | 513 | ;; FreeBSD: /usr/bin:/bin:/usr/sbin:/sbin: - beware trailing ":"! |
| 514 | ;; IRIX64: /usr/bin | 514 | ;; IRIX64: /usr/bin |
| 515 | ;;;###tramp-autoload | ||
| 515 | (defcustom tramp-remote-path | 516 | (defcustom tramp-remote-path |
| 516 | '(tramp-default-remote-path "/bin" "/usr/bin" "/usr/sbin" "/usr/local/bin" | 517 | '(tramp-default-remote-path "/bin" "/usr/bin" "/usr/sbin" "/usr/local/bin" |
| 517 | "/local/bin" "/local/freeware/bin" "/local/gnu/bin" | 518 | "/local/bin" "/local/freeware/bin" "/local/gnu/bin" |
diff --git a/lisp/startup.el b/lisp/startup.el index 1cbf2f74c14..41056f3907e 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -910,7 +910,7 @@ opening the first frame (e.g. open a connection to an X server).") | |||
| 910 | (setq no-blinking-cursor t))) | 910 | (setq no-blinking-cursor t))) |
| 911 | ;; If the cursorColor X resource exists, alter the `cursor' face | 911 | ;; If the cursorColor X resource exists, alter the `cursor' face |
| 912 | ;; spec, but mark it as changed outside of Customize. | 912 | ;; spec, but mark it as changed outside of Customize. |
| 913 | (let ((color (x-get-resource "cursorColor" "CursorColor"))) | 913 | (let ((color (x-get-resource "cursorColor" "Foreground"))) |
| 914 | (when color | 914 | (when color |
| 915 | (put 'cursor 'theme-face | 915 | (put 'cursor 'theme-face |
| 916 | `((changed ((t :background ,color))))) | 916 | `((changed ((t :background ,color))))) |
| @@ -929,7 +929,7 @@ opening the first frame (e.g. open a connection to an X server).") | |||
| 929 | emacs-basic-display | 929 | emacs-basic-display |
| 930 | (and (memq window-system '(x w32 ns)) | 930 | (and (memq window-system '(x w32 ns)) |
| 931 | (not (member (x-get-resource "cursorBlink" "CursorBlink") | 931 | (not (member (x-get-resource "cursorBlink" "CursorBlink") |
| 932 | '("off" "false"))))) | 932 | '("no" "off" "false" "0"))))) |
| 933 | (setq no-blinking-cursor t)) | 933 | (setq no-blinking-cursor t)) |
| 934 | 934 | ||
| 935 | ;; Re-evaluate predefined variables whose initial value depends on | 935 | ;; Re-evaluate predefined variables whose initial value depends on |
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index d3fa49491d4..08254c6f5f7 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el | |||
| @@ -93,6 +93,7 @@ reinserts the fill prefix in each resulting line." | |||
| 93 | ;; Added `!' for doxygen comments starting with `//!' or `/*!'. | 93 | ;; Added `!' for doxygen comments starting with `//!' or `/*!'. |
| 94 | ;; Added `%' for TeX comments. | 94 | ;; Added `%' for TeX comments. |
| 95 | ;; RMS: deleted the code to match `1.' and `(1)'. | 95 | ;; RMS: deleted the code to match `1.' and `(1)'. |
| 96 | ;; Update mail-mode's paragraph-separate if you change this. | ||
| 96 | (purecopy "[ \t]*\\([-–!|#%;>*·•‣⁃◦]+[ \t]*\\)*") | 97 | (purecopy "[ \t]*\\([-–!|#%;>*·•‣⁃◦]+[ \t]*\\)*") |
| 97 | "Regexp to match text at start of line that constitutes indentation. | 98 | "Regexp to match text at start of line that constitutes indentation. |
| 98 | If Adaptive Fill mode is enabled, a prefix matching this pattern | 99 | If Adaptive Fill mode is enabled, a prefix matching this pattern |
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 4c28ae3f1a9..f011a8d1dc0 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-01-12 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * url-auth.el (url-basic-auth, url-digest-auth): | ||
| 4 | Allow reading usernames etc when the minibuffer is already in use, | ||
| 5 | eg in url-handler-mode. (Bug#10298) | ||
| 6 | |||
| 1 | 2011-11-15 Juanma Barranquero <lekktu@gmail.com> | 7 | 2011-11-15 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 8 | ||
| 3 | * url-dav.el (url-dav-delete-file): Fix typo. | 9 | * url-dav.el (url-dav-delete-file): Fix typo. |
diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el index be307698575..f7e53eafb44 100644 --- a/lisp/url/url-auth.el +++ b/lisp/url/url-auth.el | |||
| @@ -69,6 +69,7 @@ instead of the filename inheritance method." | |||
| 69 | (file (url-filename href)) | 69 | (file (url-filename href)) |
| 70 | (user (url-user href)) | 70 | (user (url-user href)) |
| 71 | (pass (url-password href)) | 71 | (pass (url-password href)) |
| 72 | (enable-recursive-minibuffers t) ; for url-handler-mode (bug#10298) | ||
| 72 | byserv retval data) | 73 | byserv retval data) |
| 73 | (setq server (format "%s:%d" server port) | 74 | (setq server (format "%s:%d" server port) |
| 74 | file (cond | 75 | file (cond |
| @@ -163,6 +164,7 @@ instead of hostname:portnum." | |||
| 163 | (type (url-type href)) | 164 | (type (url-type href)) |
| 164 | (port (url-port href)) | 165 | (port (url-port href)) |
| 165 | (file (url-filename href)) | 166 | (file (url-filename href)) |
| 167 | (enable-recursive-minibuffers t) | ||
| 166 | user pass byserv retval data) | 168 | user pass byserv retval data) |
| 167 | (setq file (cond | 169 | (setq file (cond |
| 168 | (realm realm) | 170 | (realm realm) |
diff --git a/lisp/window.el b/lisp/window.el index 8eb0ac3575b..54e5ec9c74c 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -3568,10 +3568,7 @@ specific buffers." | |||
| 3568 | )) | 3568 | )) |
| 3569 | 3569 | ||
| 3570 | ;;; Window states, how to get them and how to put them in a window. | 3570 | ;;; Window states, how to get them and how to put them in a window. |
| 3571 | (defvar window-state-ignored-parameters '(quit-restore) | 3571 | (defun window--state-get-1 (window &optional ignore) |
| 3572 | "List of window parameters ignored by `window-state-get'.") | ||
| 3573 | |||
| 3574 | (defun window--state-get-1 (window &optional markers) | ||
| 3575 | "Helper function for `window-state-get'." | 3572 | "Helper function for `window-state-get'." |
| 3576 | (let* ((type | 3573 | (let* ((type |
| 3577 | (cond | 3574 | (cond |
| @@ -3589,12 +3586,27 @@ specific buffers." | |||
| 3589 | (normal-width . ,(window-normal-size window t)) | 3586 | (normal-width . ,(window-normal-size window t)) |
| 3590 | (combination-limit . ,(window-combination-limit window)) | 3587 | (combination-limit . ,(window-combination-limit window)) |
| 3591 | ,@(let (list) | 3588 | ,@(let (list) |
| 3592 | (dolist (parameter (window-parameters window)) | 3589 | ;; Make copies of persistent window parameters whose cdr |
| 3593 | (unless (memq (car parameter) | 3590 | ;; is either t or, when IGNORE is non-nil, is either nil |
| 3594 | window-state-ignored-parameters) | 3591 | ;; or `state'. |
| 3595 | (setq list (cons parameter list)))) | 3592 | (dolist (pers window-persistent-parameters) |
| 3596 | (unless (window-parameter window 'clone-of) | 3593 | (when (and (consp pers) |
| 3597 | ;; Make a clone-of parameter. | 3594 | (or (eq (cdr pers) t) |
| 3595 | (and (memq (cdr pers) '(state nil)) | ||
| 3596 | (not ignore)))) | ||
| 3597 | (let ((par (assq (car pers) (window-parameters window)))) | ||
| 3598 | (setq list (cons (cons (car pers) (when par (cdr par))) | ||
| 3599 | list))))) | ||
| 3600 | ;; Save `clone-of' parameter unless IGNORE or | ||
| 3601 | ;; `window-persistent-parameters' prevail. | ||
| 3602 | (when (and (not (assq 'clone-of (window-parameters window))) | ||
| 3603 | (let ((clone-of | ||
| 3604 | (assq 'clone-of | ||
| 3605 | window-persistent-parameters))) | ||
| 3606 | (when clone-of | ||
| 3607 | (if ignore | ||
| 3608 | (eq (cdr clone-of) t) | ||
| 3609 | (memq (cdr clone-of) '(state nil)))))) | ||
| 3598 | (setq list (cons (cons 'clone-of window) list))) | 3610 | (setq list (cons (cons 'clone-of window) list))) |
| 3599 | (when list | 3611 | (when list |
| 3600 | `((parameters . ,list)))) | 3612 | `((parameters . ,list)))) |
| @@ -3616,30 +3628,31 @@ specific buffers." | |||
| 3616 | (scroll-bars . ,(window-scroll-bars window)) | 3628 | (scroll-bars . ,(window-scroll-bars window)) |
| 3617 | (vscroll . ,(window-vscroll window)) | 3629 | (vscroll . ,(window-vscroll window)) |
| 3618 | (dedicated . ,(window-dedicated-p window)) | 3630 | (dedicated . ,(window-dedicated-p window)) |
| 3619 | (point . ,(if markers (copy-marker point) point)) | 3631 | (point . ,(if ignore point (copy-marker point))) |
| 3620 | (start . ,(if markers (copy-marker start) start)) | 3632 | (start . ,(if ignore start (copy-marker start))) |
| 3621 | ,@(when mark | 3633 | ,@(when mark |
| 3622 | `((mark . ,(if markers | 3634 | `((mark . ,(if ignore |
| 3623 | (copy-marker mark) mark))))))))))) | 3635 | mark (copy-marker mark)))))))))))) |
| 3624 | (tail | 3636 | (tail |
| 3625 | (when (memq type '(vc hc)) | 3637 | (when (memq type '(vc hc)) |
| 3626 | (let (list) | 3638 | (let (list) |
| 3627 | (setq window (window-child window)) | 3639 | (setq window (window-child window)) |
| 3628 | (while window | 3640 | (while window |
| 3629 | (setq list (cons (window--state-get-1 window markers) list)) | 3641 | (setq list (cons (window--state-get-1 window ignore) list)) |
| 3630 | (setq window (window-right window))) | 3642 | (setq window (window-right window))) |
| 3631 | (nreverse list))))) | 3643 | (nreverse list))))) |
| 3632 | (append head tail))) | 3644 | (append head tail))) |
| 3633 | 3645 | ||
| 3634 | (defun window-state-get (&optional window markers) | 3646 | (defun window-state-get (&optional window ignore) |
| 3635 | "Return state of WINDOW as a Lisp object. | 3647 | "Return state of WINDOW as a Lisp object. |
| 3636 | WINDOW can be any window and defaults to the root window of the | 3648 | WINDOW can be any window and defaults to the root window of the |
| 3637 | selected frame. | 3649 | selected frame. |
| 3638 | 3650 | ||
| 3639 | Optional argument MARKERS non-nil means use markers for sampling | 3651 | Optional argument IGNORE non-nil means do not use markers for |
| 3640 | positions like `window-point' or `window-start'. MARKERS should | 3652 | sampling positions like `window-point' or `window-start' and do |
| 3641 | be non-nil only if the value is used for putting the state back | 3653 | not record parameters unless `window-persistent-parameters' |
| 3642 | in the same session (note that markers slow down processing). | 3654 | requests it. IGNORE should be non-nil when the return value |
| 3655 | shall be written to a file and read back in another session. | ||
| 3643 | 3656 | ||
| 3644 | The return value can be used as argument for `window-state-put' | 3657 | The return value can be used as argument for `window-state-put' |
| 3645 | to put the state recorded here into an arbitrary window. The | 3658 | to put the state recorded here into an arbitrary window. The |
| @@ -3665,7 +3678,7 @@ value can be also stored on disk and read back in a new session." | |||
| 3665 | ;; These are probably not needed. | 3678 | ;; These are probably not needed. |
| 3666 | ,@(when (window-size-fixed-p window) `((fixed-height . t))) | 3679 | ,@(when (window-size-fixed-p window) `((fixed-height . t))) |
| 3667 | ,@(when (window-size-fixed-p window t) `((fixed-width . t)))) | 3680 | ,@(when (window-size-fixed-p window t) `((fixed-width . t)))) |
| 3668 | (window--state-get-1 window markers))) | 3681 | (window--state-get-1 window ignore))) |
| 3669 | 3682 | ||
| 3670 | (defvar window-state-put-list nil | 3683 | (defvar window-state-put-list nil |
| 3671 | "Helper variable for `window-state-put'.") | 3684 | "Helper variable for `window-state-put'.") |
| @@ -3744,10 +3757,15 @@ value can be also stored on disk and read back in a new session." | |||
| 3744 | (state (cdr (assq 'buffer item)))) | 3757 | (state (cdr (assq 'buffer item)))) |
| 3745 | (when combination-limit | 3758 | (when combination-limit |
| 3746 | (set-window-combination-limit window combination-limit)) | 3759 | (set-window-combination-limit window combination-limit)) |
| 3747 | ;; Process parameters. | 3760 | ;; Assign saved window parameters. If a parameter's value is nil, |
| 3761 | ;; don't assign it unless the new window has it set already (which | ||
| 3762 | ;; shouldn't happen unless some `window-configuration-change-hook' | ||
| 3763 | ;; function installed it). | ||
| 3748 | (when parameters | 3764 | (when parameters |
| 3749 | (dolist (parameter parameters) | 3765 | (dolist (parameter parameters) |
| 3750 | (set-window-parameter window (car parameter) (cdr parameter)))) | 3766 | (when (or (cdr parameter) |
| 3767 | (window-parameter window (car parameter))) | ||
| 3768 | (set-window-parameter window (car parameter) (cdr parameter))))) | ||
| 3751 | ;; Process buffer related state. | 3769 | ;; Process buffer related state. |
| 3752 | (when state | 3770 | (when state |
| 3753 | ;; We don't want to raise an error here so we create a buffer if | 3771 | ;; We don't want to raise an error here so we create a buffer if |