Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
1bbda2d6
Commit
1bbda2d6
authored
Mar 28, 1993
by
Noah Friedman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed to env.el; changed setenv to putenv.
parent
1a2f456b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
lisp/env.el
lisp/env.el
+13
-7
No files found.
lisp/env.el
View file @
1bbda2d6
;;;
set
env.el --- functions to manipulate environment variables.
;;; env.el --- functions to manipulate environment variables.
;;; Copyright Free Software Foundation 1991
...
...
@@ -31,24 +31,30 @@
;;; Code:
;;;###autoload
(
defun
setenv
(
variable
value
)
(
defun
putenv
(
variable
&optional
value
)
"Set the value of the environment variable named VARIABLE to VALUE.
VARIABLE and VALUE should both be strings.
VARIABLE should be a string. VALUE is optional; if not provided or is
`nil', the environment variable VARIABLE will be removed.
This function works by modifying `process-environment'."
(
interactive
"sSet environment variable: \nsSet %s to value: "
)
(
if
(
string-match
"="
variable
)
(
error
"Environment variable name
contains `='"
)
(
error
"Environment variable name
`%s' contains `='"
variable
)
(
let
((
pattern
(
concat
"\\`"
(
regexp-quote
(
concat
variable
"="
))))
(
scan
process-environment
))
(
while
scan
(
cond
((
string-match
pattern
(
car
scan
))
(
setcar
scan
(
concat
variable
"="
value
))
(
if
(
eq
nil
value
)
(
setq
process-environment
(
delq
(
car
scan
)
process-environment
))
(
setcar
scan
(
concat
variable
"="
value
)))
(
setq
scan
nil
))
((
null
(
setq
scan
(
cdr
scan
)))
(
setq
process-environment
(
cons
(
concat
variable
"="
value
)
process-environment
))))))))
(
provide
'setenv
)
;; Provide backward-contemptibility.
(
fset
'setenv
'putenv
)
;;; setenv.el ends here
(
provide
'env
)
;;; env.el ends here
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment