Questions tagged [scope]
7 questions
4
votes
2 answers
How to highlight the current scope with C family languages?
While it's possible to highlight a block using the character under the cursor, is there a way to highlight the scope of the current cursor?
I'm interested in something like QtCreator's block-highlight feature:
Are there existing packages that do…

ideasman42
- 8,375
- 1
- 28
- 105
3
votes
3 answers
How does scoping work in emacs lisp
A lot of emacs configurations shared publicly have this format:
;; 01-something.el
(provide 'something)
;; init.el
(require 'something)
Suppose I'm writing a defun named "s-join" inside 01-something.el
Suppose somewhere during init.el…

american-ninja-warrior
- 3,773
- 2
- 21
- 40
1
vote
1 answer
Are there other ways of introducing local variables other than `let`
I am new to Emacs-Lisp and I was surprised to learn a curious variable scoping rule in Emacs that any variables which are intended to be used locally must be explicitly declared with let. Otherwise variables set with setq get global scope. to be…

smilingbuddha
- 1,131
- 10
- 26
0
votes
1 answer
Bring setq variable into a (let ...) context of a elisp function?
I have written a function snippet that copies a paragraph to the kill-ring. I try to collect different point positions and corresponding line numbers:
bop - begin of paragraph
blnum - line umber of the paragraph begin
eop - end of paragraph
elnum -…

huckfinn
- 113
- 5
0
votes
2 answers
Any way to access a lexical let variable outside of the let?
I need to retrieve a local, lexical, runtime variable from a function, but I'm unable to modify the function to return it because it is from an external library. The variable I'm unable to reach is link-end.
(defun org-element-link-parser ()
(let…

sextrism
- 1
- 1
0
votes
1 answer
Why is my variable out of scope in org-roam-capture?
I would like to define an function using org-roam's capture system. However, I want to create a new function, not use the variable org-roam-capture-templates and the related function org-roam-capture.
I want to create a function that takes a string…

jrasband
- 73
- 6
0
votes
1 answer
How create custom function access only from ONE el file?
Emacs 26.1
In my file custom_functions.el
(defun increment-number-by-one-at-point()
(interactive)
(increment-number-at-point-private 1))
;; Increment number at point
(defun increment-number-at-point(number)
(interactive (list (read-number…

a_subscriber
- 3,854
- 1
- 17
- 47