diff options
| author | Stefan Monnier | 2007-10-10 19:57:08 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-10-10 19:57:08 +0000 |
| commit | ef651d13148228be6071da2eb49397ceac5a15d4 (patch) | |
| tree | 1af6730ed4dd3b9198f2830006945f3883ac2199 | |
| parent | 5b5afd508a5ca3643e1cd435fa60d197b7c2f9f7 (diff) | |
| download | emacs-ef651d13148228be6071da2eb49397ceac5a15d4.tar.gz emacs-ef651d13148228be6071da2eb49397ceac5a15d4.zip | |
(let-environment): Remove. Unused.
(read-envvar-name): Simplify.
(setenv): Remove unused arg `frame'.
| -rw-r--r-- | lisp/ChangeLog | 64 | ||||
| -rw-r--r-- | lisp/env.el | 79 | ||||
| -rw-r--r-- | lisp/font-lock.el | 2 |
3 files changed, 45 insertions, 100 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d8c31c8139a..0cf312e3871 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2007-10-10 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2007-10-10 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * font-lock.el (lisp-font-lock-keywords-2): Remove let-environment. | ||
| 4 | |||
| 5 | * env.el (let-environment): Remove. Unused. | ||
| 6 | (read-envvar-name): Simplify. | ||
| 7 | (setenv): Remove unused arg `frame'. | ||
| 8 | |||
| 3 | * help-fns.el (describe-variable): Add missing " " for multiline | 9 | * help-fns.el (describe-variable): Add missing " " for multiline |
| 4 | obsolescence info and missing EOL after global value. | 10 | obsolescence info and missing EOL after global value. |
| 5 | 11 | ||
| @@ -37,54 +43,46 @@ | |||
| 37 | 43 | ||
| 38 | 2007-10-10 Eric S. Raymond <esr@snark.thyrsus.com> | 44 | 2007-10-10 Eric S. Raymond <esr@snark.thyrsus.com> |
| 39 | 45 | ||
| 40 | * vc.el (vc-next-action): Completely rewritten; this principal | 46 | * vc.el (vc-next-action): Rewrite completely; this principal |
| 41 | entry point now operates on a current fileset selected either | 47 | entry point now operates on a current fileset selected either |
| 42 | explicitly via VC-Dired or implicitly by visiting a file buffer, | 48 | explicitly via VC-Dired or implicitly by visiting a file buffer, |
| 43 | rather than always operating on the file of the current buffer as | 49 | rather than always operating on the file of the current buffer as |
| 44 | in older versions. The rest of the mode has been rewritten to | 50 | in older versions. Rewrite the rest of the mode to match. |
| 45 | match. | 51 | (with-vc-properties): Rewrite to operate on a file list. |
| 46 | (with-vc-properties): Rewritten to operate on a file list. | ||
| 47 | (with-vc-file): vc-checkin takes a file list argument now. | 52 | (with-vc-file): vc-checkin takes a file list argument now. |
| 48 | (vc-post-command-functions): This hook now receives a file list. | 53 | (vc-post-command-functions): This hook now receives a file list. |
| 49 | (vc-do-command): Now takes a either a file or a file list as | 54 | (vc-do-command): Take a either a file or a file list as argument. |
| 50 | argument. | ||
| 51 | (vc-deduce-fileset): New function for deducing a file list to | 55 | (vc-deduce-fileset): New function for deducing a file list to |
| 52 | operate on. | 56 | operate on. |
| 53 | (vc-next-action-on-file): This function is gone, it is merged into | 57 | (vc-next-action-on-file, vc-next-action-dired): Remove. |
| 54 | vc-next-action. | 58 | Merge into vc-next-action. |
| 55 | (vc-next-action-dired): This function is gone, it is merged into | 59 | (vc-register): Adapt to the fact that vc-start-entry now takes a |
| 56 | vc-next-action. | ||
| 57 | (vc-register): Adapted to the fact that vc-start-entry now takes a | ||
| 58 | file list. | 60 | file list. |
| 59 | (vc-register-with): New function. | 61 | (vc-register-with): New function. |
| 60 | (vc-start-entry): Now takes a file list argument rather than a | 62 | (vc-start-entry): Take a file list argument rather than a |
| 61 | file argument. | 63 | file argument. |
| 62 | (vc-checkout): Modified to cope with vc-start-entry taking a file | 64 | (vc-checkout): Cope with vc-start-entry taking a file list. |
| 63 | list. | 65 | (vc-steal-lock): Cope with with-vc-properties taking a |
| 64 | (vc-steal-lock): Modified to cope with with-vc-properties taking a | ||
| 65 | file list. | 66 | file list. |
| 66 | (vc-checkin): Now takes a file list argument rather than a file | 67 | (vc-checkin): Take a file list argument rather than a file argument. |
| 67 | argument. | ||
| 68 | (vc-finish-logentry): Use the filelist passed by vc-start-entry. | 68 | (vc-finish-logentry): Use the filelist passed by vc-start-entry. |
| 69 | (vc-diff-internal): Completely rewritten for filesets. | 69 | (vc-diff-internal): Rewrite for filesets. |
| 70 | (vc-diff-sentinel): New function, tests whether changes were | 70 | (vc-diff-sentinel): New function, tests whether changes were |
| 71 | written into a diff buffer. | 71 | written into a diff buffer. |
| 72 | (vc-diff): Completely rewritten for filesets. | 72 | (vc-diff): Rewrite for filesets. |
| 73 | (vc-version-diff): Completely rewritten for filesets. | 73 | (vc-version-diff): Rewrite for filesets. |
| 74 | (vc-print-log): Now takes a fileset argument. | 74 | (vc-print-log): Take a fileset argument. |
| 75 | (vc-revert): Now reverts the entire selected fileset, not just the | 75 | (vc-revert): Revert the entire selected fileset, not just the |
| 76 | current buffer. | 76 | current buffer. |
| 77 | (vc-rollback): Now rolls back the entire selected fileset, if | 77 | (vc-rollback): Roll back the entire selected fileset, if |
| 78 | possible. No longer accepts a prefix argument. | 78 | possible. No longer accepts a prefix argument. |
| 79 | (vc-update): Now merges new changes for the entire selected | 79 | (vc-update): Merge new changes for the entire selected |
| 80 | fileset, not just the current buffer. | 80 | fileset, not just the current buffer. |
| 81 | (vc-revert-file): Modified to cope with with-vc-properties taking | 81 | (vc-revert-file): Cope with with-vc-properties taking a file list. |
| 82 | a file list. | ||
| 83 | (vc-default-dired-state-info): Add + status suffix if the file is | 82 | (vc-default-dired-state-info): Add + status suffix if the file is |
| 84 | modified. | 83 | modified. |
| 85 | (vc-annotate-warp-version): Use the new diff machinery. | 84 | (vc-annotate-warp-version): Use the new diff machinery. |
| 86 | (vc-log-edit): Now takes a file list argument rather than a file | 85 | (vc-log-edit): Take a file list argument rather than a file argument. |
| 87 | argument. | ||
| 88 | 86 | ||
| 89 | 2007-10-10 Michael Albinus <michael.albinus@gmx.de> | 87 | 2007-10-10 Michael Albinus <michael.albinus@gmx.de> |
| 90 | 88 | ||
| @@ -108,7 +106,7 @@ | |||
| 108 | (handle-select-window): When autoselecting window set input | 106 | (handle-select-window): When autoselecting window set input |
| 109 | focus. Restructure. | 107 | focus. Restructure. |
| 110 | 108 | ||
| 111 | * frame.el (focus-follows-mouse): Moved to frame.c. | 109 | * frame.el (focus-follows-mouse): Move to frame.c. |
| 112 | * cus-start.el (all): Add focus-follows-mouse. | 110 | * cus-start.el (all): Add focus-follows-mouse. |
| 113 | 111 | ||
| 114 | 2007-10-08 Juanma Barranquero <lekktu@gmail.com> | 112 | 2007-10-08 Juanma Barranquero <lekktu@gmail.com> |
| @@ -307,10 +305,10 @@ | |||
| 307 | 305 | ||
| 308 | 2007-10-08 Stefan Monnier <monnier@iro.umontreal.ca> | 306 | 2007-10-08 Stefan Monnier <monnier@iro.umontreal.ca> |
| 309 | 307 | ||
| 310 | * pcvs.el (cvs-mode-add-change-log-entry-other-window): Use | 308 | * pcvs.el (cvs-mode-add-change-log-entry-other-window): |
| 311 | add-log-buffer-file-name-function rather than bind buffer-file-name, | 309 | Use add-log-buffer-file-name-function rather than binding |
| 312 | so we dont end up calling change-log-mode in *cvs* when `fi' is the | 310 | buffer-file-name, so we don't end up calling change-log-mode in *cvs* |
| 313 | ChangeLog file itself. | 311 | when `fi' is the ChangeLog file itself. |
| 314 | 312 | ||
| 315 | * outline.el (outline-flag-region): Use front-advance. | 313 | * outline.el (outline-flag-region): Use front-advance. |
| 316 | 314 | ||
diff --git a/lisp/env.el b/lisp/env.el index 128228be3db..90d576dc71d 100644 --- a/lisp/env.el +++ b/lisp/env.el | |||
| @@ -47,15 +47,14 @@ Optional second arg MUSTMATCH, if non-nil, means require existing envvar name. | |||
| 47 | If it is also not t, RET does not exit if it does non-null completion." | 47 | If it is also not t, RET does not exit if it does non-null completion." |
| 48 | (completing-read prompt | 48 | (completing-read prompt |
| 49 | (mapcar (lambda (enventry) | 49 | (mapcar (lambda (enventry) |
| 50 | (list (if enable-multibyte-characters | 50 | (let ((str (substring enventry 0 |
| 51 | (decode-coding-string | 51 | (string-match "=" enventry)))) |
| 52 | (substring enventry 0 | 52 | (if (multibyte-string-p str) |
| 53 | (string-match "=" enventry)) | 53 | (decode-coding-string |
| 54 | locale-coding-system t) | 54 | str locale-coding-system t) |
| 55 | (substring enventry 0 | 55 | str))) |
| 56 | (string-match "=" enventry))))) | ||
| 57 | (append process-environment | 56 | (append process-environment |
| 58 | nil ;;(frame-parameter (frame-with-environment) 'environment) | 57 | ;;(frame-environment) |
| 59 | )) | 58 | )) |
| 60 | nil mustmatch nil 'read-envvar-name-history)) | 59 | nil mustmatch nil 'read-envvar-name-history)) |
| 61 | 60 | ||
| @@ -128,7 +127,7 @@ Changes ENV by side-effect, and returns its new value." | |||
| 128 | 127 | ||
| 129 | ;; Fixme: Should the environment be recoded if LC_CTYPE &c is set? | 128 | ;; Fixme: Should the environment be recoded if LC_CTYPE &c is set? |
| 130 | 129 | ||
| 131 | (defun setenv (variable &optional value substitute-env-vars frame) | 130 | (defun setenv (variable &optional value substitute-env-vars) |
| 132 | "Set the value of the environment variable named VARIABLE to VALUE. | 131 | "Set the value of the environment variable named VARIABLE to VALUE. |
| 133 | VARIABLE should be a string. VALUE is optional; if not provided or | 132 | VARIABLE should be a string. VALUE is optional; if not provided or |
| 134 | nil, the environment variable VARIABLE will be removed. | 133 | nil, the environment variable VARIABLE will be removed. |
| @@ -143,19 +142,11 @@ SUBSTITUTE-ENV-VARS, if non-nil, means to substitute environment | |||
| 143 | variables in VALUE with `substitute-env-vars', which see. | 142 | variables in VALUE with `substitute-env-vars', which see. |
| 144 | This is normally used only for interactive calls. | 143 | This is normally used only for interactive calls. |
| 145 | 144 | ||
| 146 | If optional parameter FRAME is non-nil, this function modifies | ||
| 147 | only the frame-local value of VARIABLE on FRAME, ignoring | ||
| 148 | `process-environment'. Note that frames on the same terminal | ||
| 149 | device usually share their environment, so calling `setenv' on | ||
| 150 | one of them affects the others as well. | ||
| 151 | |||
| 152 | If FRAME is nil, `setenv' changes the global value of VARIABLE by | ||
| 153 | modifying `process-environment'. Note that the global value | ||
| 154 | overrides any frame-local values. | ||
| 155 | |||
| 156 | The return value is the new value of VARIABLE, or nil if | 145 | The return value is the new value of VARIABLE, or nil if |
| 157 | it was removed from the environment. | 146 | it was removed from the environment. |
| 158 | 147 | ||
| 148 | This function works by modifying `process-environment'. | ||
| 149 | |||
| 159 | As a special case, setting variable `TZ' calls `set-time-zone-rule' as | 150 | As a special case, setting variable `TZ' calls `set-time-zone-rule' as |
| 160 | a side-effect." | 151 | a side-effect." |
| 161 | (interactive | 152 | (interactive |
| @@ -188,12 +179,8 @@ a side-effect." | |||
| 188 | (error "Environment variable name `%s' contains `='" variable)) | 179 | (error "Environment variable name `%s' contains `='" variable)) |
| 189 | (if (string-equal "TZ" variable) | 180 | (if (string-equal "TZ" variable) |
| 190 | (set-time-zone-rule value)) | 181 | (set-time-zone-rule value)) |
| 191 | (if (null frame) | 182 | (setq process-environment (setenv-internal process-environment |
| 192 | (setq process-environment (setenv-internal process-environment | 183 | variable value t)) |
| 193 | variable value t)) | ||
| 194 | (setq frame (frame-with-environment frame)) | ||
| 195 | (setq process-environment (setenv-internal process-environment | ||
| 196 | variable value nil))) | ||
| 197 | value) | 184 | value) |
| 198 | 185 | ||
| 199 | (defun getenv (variable &optional frame) | 186 | (defun getenv (variable &optional frame) |
| @@ -238,8 +225,7 @@ Non-ASCII characters are encoded according to the initial value of | |||
| 238 | `locale-coding-system', i.e. the elements must normally be decoded for use. | 225 | `locale-coding-system', i.e. the elements must normally be decoded for use. |
| 239 | See `setenv' and `getenv'." | 226 | See `setenv' and `getenv'." |
| 240 | (let* ((env (append process-environment | 227 | (let* ((env (append process-environment |
| 241 | ;; (frame-parameter (frame-with-environment frame) | 228 | ;; (frame-environment frame) |
| 242 | ;; 'environment) | ||
| 243 | nil)) | 229 | nil)) |
| 244 | (scan env) | 230 | (scan env) |
| 245 | prev seen) | 231 | prev seen) |
| @@ -269,45 +255,6 @@ See `setenv' and `getenv'." | |||
| 269 | scan (cdr scan)))) | 255 | scan (cdr scan)))) |
| 270 | env)) | 256 | env)) |
| 271 | 257 | ||
| 272 | (defmacro let-environment (varlist &rest body) | ||
| 273 | "Evaluate BODY with environment variables set according to VARLIST. | ||
| 274 | The environment variables are then restored to their previous | ||
| 275 | values. | ||
| 276 | The value of the last form in BODY is returned. | ||
| 277 | |||
| 278 | Each element of VARLIST is either a string (which variable is | ||
| 279 | then removed from the environment), or a list (NAME | ||
| 280 | VALUEFORM) (which sets NAME to the value of VALUEFORM, a string). | ||
| 281 | All the VALUEFORMs are evaluated before any variables are set." | ||
| 282 | (declare (indent 2)) | ||
| 283 | (let ((old-env (make-symbol "old-env")) | ||
| 284 | (name (make-symbol "name")) | ||
| 285 | (value (make-symbol "value")) | ||
| 286 | (entry (make-symbol "entry")) | ||
| 287 | (frame (make-symbol "frame"))) | ||
| 288 | `(let ((,frame (selected-frame)) | ||
| 289 | ,old-env) | ||
| 290 | ;; Evaluate VALUEFORMs and replace them in VARLIST with their values. | ||
| 291 | (dolist (,entry ,varlist) | ||
| 292 | (unless (stringp ,entry) | ||
| 293 | (if (cdr (cdr ,entry)) | ||
| 294 | (error "`let-environment' bindings can have only one value-form")) | ||
| 295 | (setcdr ,entry (eval (cadr ,entry))))) | ||
| 296 | ;; Set the variables. | ||
| 297 | (dolist (,entry ,varlist) | ||
| 298 | (let ((,name (if (stringp ,entry) ,entry (car ,entry))) | ||
| 299 | (,value (if (consp ,entry) (cdr ,entry)))) | ||
| 300 | (setq ,old-env (cons (cons ,name (getenv ,name)) ,old-env)) | ||
| 301 | (setenv ,name ,value))) | ||
| 302 | (unwind-protect | ||
| 303 | (progn ,@body) | ||
| 304 | ;; Restore old values. | ||
| 305 | (with-selected-frame (if (frame-live-p ,frame) | ||
| 306 | ,frame | ||
| 307 | (selected-frame)) | ||
| 308 | (dolist (,entry ,old-env) | ||
| 309 | (setenv (car ,entry) (cdr ,entry)))))))) | ||
| 310 | |||
| 311 | (provide 'env) | 258 | (provide 'env) |
| 312 | 259 | ||
| 313 | ;; arch-tag: b7d6a8f7-bc81-46db-8e39-8d721d4ed0b8 | 260 | ;; arch-tag: b7d6a8f7-bc81-46db-8e39-8d721d4ed0b8 |
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index be234f607b5..16f9730b1d1 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -2227,7 +2227,7 @@ other modes in which C preprocessor directives are used. e.g. `asm-mode' and | |||
| 2227 | `(;; Control structures. Emacs Lisp forms. | 2227 | `(;; Control structures. Emacs Lisp forms. |
| 2228 | (,(concat | 2228 | (,(concat |
| 2229 | "(" (regexp-opt | 2229 | "(" (regexp-opt |
| 2230 | '("cond" "if" "while" "while-no-input" "let" "let*" "let-environment" | 2230 | '("cond" "if" "while" "while-no-input" "let" "let*" |
| 2231 | "prog" "progn" "progv" "prog1" "prog2" "prog*" | 2231 | "prog" "progn" "progv" "prog1" "prog2" "prog*" |
| 2232 | "inline" "lambda" "save-restriction" "save-excursion" | 2232 | "inline" "lambda" "save-restriction" "save-excursion" |
| 2233 | "save-window-excursion" "save-selected-window" | 2233 | "save-window-excursion" "save-selected-window" |