Hot answers tagged

5

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


4

It's trivial to define your own: (gv-define-simple-setter plist-get plist-put) (let ((pl '(:what (one)))) (push 'two (plist-get pl :what)) pl) ; => (:what (two one)) You can find more examples in gv.el.


3

BTW, one way to think about why it can't work is to remember that lexical scoping enjoys the so-called "α-renaming" property: variable names do not matter, and you (or the compiler) can trivially (i.e. without having to understand what the code does) rename a variable (as long as the new name doesn't collide with some other local variable) without ...


2

((lambda ...) ...) is a special case, and IIRC the only such special case. Lots of elisp functions return functions, and apply-partially is no different to any of the others in this regard. source of the function shows that it actually returns a lambda Most functions are (ultimately) lambdas. See C-hig (elisp)What Is a Function for details. C-hig (...


1

Now there is a dedicated function for this (see org-time-stamp-inactive). For example: (defun my/timenow () (interactive) (let ((current-prefix-arg '(16))) (call-interactively 'org-time-stamp-inactive))) (define-key org-mode-map (kbd "<f1>") 'my/timenow) You can also skip the prompt with two universal prefix arguments: C-u C-u C-c !.


1

Listing lisp formatting tools here for completeness: Elisp-Autofmt uses strict 2 space indentation for parenthesis depth (not on melpa). ElispFormat produces idiomatic elisp, but seems to have right-shift problems - going over the fill column width (elisp-format on melpa). Grind no Emacs integration (not on melpa). Semantic Refactor (srefactor on melpa)


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