Skip to main content

Questions tagged [macroexpansion]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers

Getting the source file line number of the currently executing init file expression (formerly: Malformed macro)

I wrote this macro for my .emacs file to trace its progress during loading: (defmacro checkpoint () `(message "Reached line %i" (1+ `,(current-line)))) So I placed (checkpoint) ...
William R. Greene -- 'Bill''s user avatar
0 votes
0 answers

Eager macro-expansion failure: (wrong-type-argument integer-or-marker-p nil)

I have this code: (defun make-search-sensitive-to-ifpmod-advice (orig-fun &rest args) "Temporary advice the search functions to make them sensitive to `isearch-filter-predicate'" (...
Gabriele's user avatar
  • 1,660
1 vote
0 answers

Setf not expanding

I'm trying to modify a member of lsp--client after registration. So I have something like the following in use-package. (message "%s %s" (symbol-function 'lsp--client-new-connection) (...
Todd's user avatar
  • 211
0 votes
1 answer

How to use the same variable name with let when calling defmacro?

This is only an example, I understand this can easily be achieved with a function. Don't Work This is what I've come up with based on the elisp manual and a couple of answers/articles that I have ...
Rick's user avatar
  • 25
3 votes
2 answers

Why does pp-macroexpand return nonsense for cl-loop?

Consider the following cl-loop: (cl-loop for x across "abc" for y across "123" concat (string x y)) This evaluates to "a1b2c3", i.e. it zips both ...
Zeta's user avatar
  • 1,103
1 vote
1 answer

Why are `defvars` in my macro ignored?

I want to use a macro to define variables. However, evaluating the macro does not define these vars. I seem to be missing something, but I can't find it. Here's the code: (defmacro delve--build-cmp (...
Public Image Ltd.'s user avatar
1 vote
0 answers

Navigating to a `defconst` variable defined by a Lisp macro

My goal is to define a const variable within a non-trivial macro that can be navigated to after calling describe-variable. The design goal of my macro works just fine if I define it like so: (...
John DeBord's user avatar
1 vote
1 answer

org-mode text expansion macro in src block

Is it possible to use an org-mode #+MACRO: in an org-babel block? I'm getting this in the #+RESULTS: block when I evaluate the src block with C-c C-c: #+MACRO: COMPILE_FLAGS -std=c99 -Wall -Werror ...
Alex Shroyer's user avatar
0 votes
1 answer

The call stack result of profile-report doesn't match the real function codes

I'm trying to figure out why my emacs was slow tonight and found: - command-execute 82796 87% - call-interactively ...
Chen Li's user avatar
  • 137
4 votes
1 answer

Why does `make-symbol` work in macro expansion, just as `gensym` works?

In the dash library I noticed the use of make-symbol to avoid symbol conflicts during macro expansion. (defmacro --filter (form list) "Anaphoric form of `-filter'. See also: `--remove'." (declare ...
Aquaactress's user avatar
  • 1,453