New answers tagged

3

Just use let. Write something like this: (let ((foo 323)) …) Where the ellipsis is, place whatever code you wanted to run with foo set to 323. Once that code finishes, foo will go back to having whatever old value it had; there is no need to manually save it and restore it. This is called “lexical scope”. Python actually has lexically–scoped variables as ...


0

Yes, in Emacs Lisp, as in Common Lisp and most other Lisps, arguments are evaluated before evaluating the body of the function. This is called "applicative" order evaluation. The opposite (passing the args unevaluated to the body, which evaluates them only as needed) is called "normal" order evaluation. (Well, there are actually multiple ...


1

aaa is right. You might try setting $BASEDIR in ~/.profile. That file is read when you log in to Gnome, while ~/.bashrc is read when you open up a terminal, basically. (Note that Bash as a login shell doesn't parse ~/.profile if either ~/.bash_profile or ~/.bash_login exists.) Alternatively you could try is using (shell-command-to-string "$SHELL --login ...


3

The form (defvar bootstrap-version) doesn't set the value of bootstrap-version, and will not over-write the value of bootstrap-version if it was already set. It is also not necessary to make the variable "available" to straight.el or any of the files it includes. The only thing the defvar accomplishes here is to declare bootstrap-version as "...


Top 50 recent answers are included