8

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. https://www.gnu.org/software/auctex/manual/auctex/Parsing-Files.html


5

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... ;; Non-...


4

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 ...


4

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 ...


3

You can use RESULTS for the first session to write out the results, and :var in the second session to import results. #+name: make_temporary_directories #+begin_src bash :session *one* :results output _gpg_tmpdir="$( mktemp -d )" echo $_gpg_tmpdir #+end_src #+RESULTS: make_temporary_directories : /tmp/tmp.iAE5oSlwcC #+name: clean_temporary_directories #+...


3

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 ...


3

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 ...


3

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 ...


3

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 ...


3

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 ...


2

Elisp relies on cooperative concurrency, so yes, these are "atomic". But I suspect, like Tobias, that this answer won't help you very much because you're probably not asking the right question.


2

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 ...


2

The problem is that \\3 does not correspond to \\(\\]\\)? (concat "\\(\\[\\)?" ARXIV "\\(\\]\\)?") Gives you the following regexp: "\\(\\[\\)?\\(arXiv:\\([0-9]+\\)\\.\\([0-9]+\\)\\(v[0-9]+\\)?\\|\\(astro-ph\\|cond-mat\\|gr-qc\\|hep-ex\\|hep-lat\\|hep-ph\\|hep-th\\|math-ph\\|nlin\\|nucl-ex\\|nucl-th\\|physics\\|quant-ph\\|math\\|CoRR\\|q-...


1

You can set it after counsel is loaded with: (with-eval-after-load 'counsel (setq ivy-initial-inputs-alist nil)) See (elisp) Hooks for Loading. You can achieve the same thing with use-package as follows: (use-package counsel :defer t :config (setq ivy-initial-inputs-alist nil))


1

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 ...


1

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 ...


1

It seems it's intended: helm-internal calls helm-log-save-maybe calls (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 ...


1

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 ...


Only top voted, non community-wiki answers of a minimum length are eligible