;;; env.el --- functions to manipulate environment variables
;; Copyright (C) 1991, 1994, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006 Free Software Foundation, Inc.
+;; 2005, 2006, 2007 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: processes, unix
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
(substring enventry 0
(string-match "=" enventry)))))
(append process-environment
- (frame-parameter (frame-with-environment) 'environment)))
+ nil ;;(frame-parameter (frame-with-environment) 'environment)
+ ))
nil mustmatch nil 'read-envvar-name-history))
;; History list for VALUE argument to setenv.
(setq process-environment (setenv-internal process-environment
variable value t))
(setq frame (frame-with-environment frame))
- (set-frame-parameter frame 'environment
- (setenv-internal (frame-parameter frame 'environment)
- variable value nil)))
+ (setq process-environment (setenv-internal process-environment
+ variable value nil)))
value)
(defun getenv (variable &optional frame)
(let ((value (getenv-internal (if (multibyte-string-p variable)
(encode-coding-string
variable locale-coding-system)
- variable))))
+ variable)
+ frame)))
(if (and enable-multibyte-characters value)
(setq value (decode-coding-string value locale-coding-system)))
(when (interactive-p)
(message "%s" (if value value "Not set")))
value))
-(defun environment ()
+(defun environment (&optional frame)
"Return a list of environment variables with their values.
Each entry in the list is a string of the form NAME=VALUE.
The returned list can not be used to change environment
variables, only read them. See `setenv' to do that.
+If optional parameter FRAME is non-nil, then it should be a
+frame. The function returns the environment of that frame.
+
The list is constructed by concatenating the elements of
`process-environment' and the 'environment parameter of the
selected frame, and removing duplicated and empty values.
`locale-coding-system', i.e. the elements must normally be decoded for use.
See `setenv' and `getenv'."
(let* ((env (append process-environment
- (frame-parameter (frame-with-environment)
- 'environment)
+;; (frame-parameter (frame-with-environment frame)
+;; 'environment)
nil))
(scan env)
prev seen)
(provide 'env)
-;;; arch-tag: b7d6a8f7-bc81-46db-8e39-8d721d4ed0b8
+;; arch-tag: b7d6a8f7-bc81-46db-8e39-8d721d4ed0b8
;;; env.el ends here