In case someone else runs into this, I had enabled TeX-auto-save, which saves settings to an auto/ directory and loads them when a file is revisited.
The short answer is no.
Once you declare a class, Emacs will define a function with the name of that class as a creation function, thereby replacing your old function definition. In Emacs, eieio.el has a macro for defclass that goes like so:
(defmacro defclass (name superclasses slots &rest options-and-doc)
;; A lot of stuff here...
Text properties are not globally defined for the string but for each character in the string. Therefore, text properties cannot be transposed literally if strings are different.
Although different objects may have similar characteristics, the properties are intrinsic to each object. The text properties are defined specifically for each object, whatever its ...
setq is doing like expected, the thing here is, that (1 2 3 4) is not a value, so it is not what you think it is.
a Place is a location in memory.
x and y are Symbols.
a Symbol merely points to a place. So x points to (the first cons of) your list.
(1 2 3 4) is a List of conses (aka a "chain" of conses).
(1 2 3 4) is not a value, but multiple chained ...
You can use RESULTS for the first session to write out the results, and :var in the second session to import results.
#+begin_src bash :session *one* :results output
_gpg_tmpdir="$( mktemp -d )"
If I propertize a string and save it to a variable, how can I change the string within that variable without altering its text properties?
AFAIK, this isn't possible (or practical) in the most general case, since different strings can differ in length, and so their respective text property intervals may not match, as mentioned by Fólkvangr. If you know ...
I think you can do this:
(setq myvar (apply #'propertize "mystring" (text-properties-at 0 myvar)))
I didn't find any way to use setf or some similar kind of thing to just modify the string contents while preserving the properties.
Update: You can redefine the setf capability of substring to add properties from the original string to the new string. This ...
For numeric calculation there is a parallel universe within Elisp: Calc.
The division operator / within defmath works with the floating numbers of Calc.
Nevertheless, the interface of Calc with the Elisp world is a bit complicated.
You need to convert floating point numbers to strings. These strings are then converted by Calc to their Calc-internal ...
The following Elisp code demonstrates how you can define your own wrapper macro with-float/
that treats all explicit occurences of / in its body as division of floats.
Division operators that are used in functions called within the body of with-float/ are the original operators.
(defmacro with-float/ (&rest body)
"Evaluate BODY with / for float ...
I know that major modes should usually define the variable -mode, i.e., org-mode should be a defined variable.
Not quite: a major mode should set the variable mode-name to the "pretty name" for the mode (i.e., the one that will appear in the modeline), and the variable major-mode to the major mode's command symbol (i.e., org-mode in this case). You can test ...
In addition to what @cyberbisson has said (no, you cannot) ...
First, in this:
(setq foo 2)
(let ((foo 3))
;; can I access the original value here?
there is nothing that says that the (setq foo 2) sets the "global value" or the "original" value.
It depends on whether foo in that context is a special variable (aka dynamically scoped or global ...
The problem is that \\3 does not correspond to \\(\\]\\)?
Gives you the following regexp:
You can set it after counsel is loaded with:
(setq ivy-initial-inputs-alist nil))
See (elisp) Hooks for Loading.
You can achieve the same thing with use-package as follows:
(setq ivy-initial-inputs-alist nil))
funcall takes a function as its first argument, so you need
if to return a function symbol. You can do that by
sharp-quoting its return value:
(defun a-plus-abs-b (a b)
(funcall (if (> b 0) #'+ #'-) a b))
(a-plus-abs-b 9 4) ; => 13
Elisp is a Lisp-2, which means each symbol can have a function
value and a variable value. When ...
That's not what I see. They both return 0, for me, starting with emacs -Q (no init file).
If you haven't already, try starting Emacs with emacs -Q. If that works then bisect your init file to find the problem.
Updated after your update (which really poses a separate question -- you should pose only one question per post).
You can evaluate a defvar by ...
It seems it's intended:
(setq helm-debug nil)
thus whenever a helm session ends, helm-debug will be reset to nil. I guess it's because the log buffer can grow too quickly.
Instead of changing helm-debug directly, according to helm's own help (you can get it by type C-h m within any helm session, I have ...
The short answer is "no", there's really no means of escaping to a different scope like you might do in a language like C++.
There may be a very hacky way of getting to the variable if you use dynamic binding, although you should definitely not try it (I have not). From Dynamic Binding - GNU Emacs Lisp Reference Manual:
Dynamic binding is implemented in ...