All Questions
23,965
questions
0
votes
1
answer
26
views
How to hide "Local Variables:" specification at the end of a file or how to prevent "M->" from get into that region
In emacs, file local variables are put at the end of the file. On appending text to a file, the user has to navigate to the exact line before the Local Variables: line - you can't not just M-> and ...
0
votes
0
answers
28
views
Override usr-full-name with .dir-locals
I've been trying to override the user-full-name by setting it in .dir-locals
((org-mode . ((org-export-with-date . nil)
(user-full-name . "Fullname")
(org-export-with-...
1
vote
0
answers
31
views
Shell with unique buffer names
I use the following function to make a shell buffer, but the unique file name is not taking effect.
(defun galaxy-shell ()
"Make a uniquely named buffer for executing shell commands."
(...
0
votes
0
answers
20
views
Remove messages before and after `compile`
When compiling, how can I remove all output in the *compilation* buffer except output issued by my code itself?
i.e. remove everything except the line(s) marked *** below:
-*- mode: compilation; ...
0
votes
1
answer
29
views
`defface` and `custom-set-faces`
Noob here. In my .emacs.d/custom.el I have stuff like:
(defface delim-mismatch `((t (:foreground "red"))))
(custom-set-faces
'(show-paren-mismatch delim-mismatch)
...
)
But it throws ...
0
votes
1
answer
26
views
Projectile - "PATH is not a project"?
For some reason, Projectile has stopped allowing me to add new projects.
When I add the project, it seems to work. But when I select the project with C-c p p I get the following error:
Not sure how ...
0
votes
0
answers
11
views
How to offset RefTeX TOC numbering?
I decided that my LaTeX document starts with “Section 0”, and I would like that RefTeX's table of contents followed suit.
Is there any way to adjust section numbering by a fixed offset? Or simply to ...
0
votes
0
answers
33
views
Is it possible to search for multiple terms with rgrep?
Here is a minimal example:
File example.org has the following content:
Music and Poetry
After doing M-x rgrep, when prompted "search for", if I type: music and poetry, rgrep will find ...
0
votes
0
answers
18
views
`projectile-run-project` waits for compilation instead of running project
When I try to run my projectile project with projectile-run-project it prompts me for a run command. After running the command ./out.a it opens a *compilation* buffer and hangs because it's trying to ...
0
votes
0
answers
20
views
How do I create an exponentially recurrent item in org-mode
What I am trying to do is essentially this:
First, a TODO item should pop up in my agenda after a one day (/week)
Second, a TODO item should pop up in 2 days after that
... in 3 days after that...
...
0
votes
1
answer
29
views
Can't set indentation to 4 spaces because hook is not called
I'm trying to set the indentation in C++ files to be 4 spaces. To achieve this I have the following config:
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(defun init-c-cpp ()
(setq ...
0
votes
1
answer
17
views
org-agenda-sorting-strategy reset after restart
This variable always returns to default value. I tried to 'erase configuration' & remove it from myinit.el.
Have this in myinit.org:
(setq org-agenda-sorting-strategy (quote ((todo todo-state-up)))...
0
votes
0
answers
11
views
S-Tab to reverse indent inside src_block in org-mode
I'm writing Haskell in src blocks in org-mode. Tab lets me advance through possible indentations*, but often makes mistakes, so I want to unindent with S-Tab. That is already bound to cycling between ...
0
votes
1
answer
14
views
Emacs HTML Preamble in setup file
I have a project with a few org files that are exported as HTML to create a website. All org files that correspond to web pages have #+SETUPFILE: my-setup.org declared in it. And the my-setup.org file ...
1
vote
2
answers
48
views
emacs with auctex on win 10: Preview pdflatex fails
First of all, I'm a beginner to emacs, who has just begun the tutorial and reading the manuals. Therefore kindly bear with me if the given details may be somewhat lacking.
On win 10, I have installed ...
0
votes
0
answers
16
views
Installing minimap on vanilla Emacs gives "Invalid face attribute :foreground nil [xxx times]"
Installing minimap package-install [RET] minimap [RET]
Enabling the minimap-mode M-x minimap-mode
And opening ~/.emacs (or any file that enables minimap by default)
Results in the Messages buffer ...
0
votes
0
answers
23
views
Requiring minor-mode functionality from a separate file
I have a minor-mode defined below, which uses functionality defined in file conshine.el. Have included (require 'conshine) in the definition of the
rich-minor-mode. The minor-mode still seems to ...
0
votes
1
answer
31
views
Can't install code as package
I've recently started to look into the Blazor framework and noticed there is no available major-mode for editing .razor files, which are essentially a mix of C# and HTML. I then started creating a ...
0
votes
1
answer
22
views
Moving position of variable in a let clause
I have the following code and wonder whether I can define the variable brace-stxcode in the let* part rather than I currently do (make a new let).
(let* ( (last-ppss-pos (point))
(ppss (...
0
votes
1
answer
43
views
How can I open corresponding pdf of a tex file?
This question is the continuation of an earlier discussion here How can I run additonal linux commands after compiling a latex file.
I have a opened tex file called let's say filename.tex, which also ...
0
votes
1
answer
13
views
Ruby: Incorrect indentation for `indented_internal_methods`
Given a buffer with some Ruby code:
class Foo
protected
def respond_to_query query; end
end
When I mark it and run indent-region (C-x h, C-M-\) it stays as is and my rubocop complains:
Use 2 (...
0
votes
1
answer
47
views
Raw Syntax Descriptor for a char at POS. What is it?
What is the Raw Syntax Descriptor for a char at POS? Can I have some examples so I can understand what this thing is all about?
1
vote
1
answer
31
views
Parse-Partial-Sexp State at POS
What is Parse-Partial-Sexp State at POS? Because I have been looking at some elisp code calling syntax-ppss.
I have the variable ppss being set to either (syntax-ppss) or to (parse-partial-sexp last-...
1
vote
1
answer
24
views
Switch Cases's code block doesn't get indented in JavaScript mode
I'm having trouble with the indentation of the cases's code-blocks in my switch statements
it looks like this:
switch(var)
{
case "case1":
case's code line 1;
case's code line 2;
...
1
vote
1
answer
18
views
Changing style for global-whitespace-mode not taking effect
Have written this function to change the style for global-whitespace-mode. I describe the problem as follows. Suppose one calls (space-glow "tab-trail") followed by (space-glow "...
0
votes
1
answer
36
views
Is it possible to get the line number of the nearest regex match above the current cursor position?
I'd like to write an elisp function that tells me the line number of the closest regex match above my current cursor position.
For example, if my cursor is on line 9 of the following file and my regex ...
-4
votes
1
answer
63
views
eval-when-compile in terms of minor-mode development
I'd like to know when a developer should use eval-when-compile despite the fact that at first glance everything works without eval-when-compile.
When does not using eval-when-compile lead to ...
0
votes
1
answer
14
views
Setting of face using funcall
I am using funcall to set a typeface by calling a function select-typeface. I would like to remove select-typeface, calling (face (funcall level-typeface depth match).
Cannot simply do
(let ( (face (...
0
votes
1
answer
10
views
Resetting value when modulus computes to 0
Am doing the following computation where dmax is 8, whilst dcur start at 1 and increases bf increments of 1. I would like that when (mod dcur dmax) is 0, I use the value 8 rather than the value 0.
(...
0
votes
1
answer
16
views
(evil-scroll-up COUNT) not working in Spacemacs
I am trying to make this shortcut work:
(global-set-key (kbd "<s-C-M-S-return>") '(evil-scroll-up 8))
But it is not working.
If I remove the COUNT:
(global-set-key (kbd "<s-C-...
0
votes
3
answers
80
views
Can environments be easily wrapped with AUCTeX?
I want to quickly wrap certain environments my cursor is within with text.
In my specific situation, I want to wrap the frame environment with the text
\makeatletter
\gdef\beamer@currentmode{beamer}
\...
0
votes
2
answers
64
views
Can't find anything about spaces in the official Emacs docs [duplicate]
I want to match every string that cointains a year and a month name e.g. like that:
2022 Jul or 2022 Jul (and more spaces than 2) or even 2022Jul.
The regex I have so far is:
"\\([0-9]\\{4\\}\\)&...
1
vote
2
answers
159
views
After updating my packages, two packages are not working anymore. How to solve this? Downgrading it? Bug reporting to maintainers? Fixing?
This is my config file. As you can see, on line 351, there is:
;; Update my Emacs' packages every week
(use-package auto-package-update
:custom
(auto-package-update-interval 7)
(auto-...
0
votes
0
answers
18
views
Rewriting paths for bazel
The Bazel build tool has some features that interact poorly with emacs. When you build a C/C++ project for sandboxing purposes it makes a crazy hierarchy of symlinks, and uses them when invoking GCC. ...
0
votes
1
answer
34
views
Positive value of a number
Want to compute (- dcur dmax) and if negative, I want it changed to positive. Is that a function in elisp that gives the positive value of a number?
1
vote
0
answers
27
views
Does undo-tree-mode allow to undo a specific change?
I am using undo-tree-mode in spacemacs and it works fine to show the history of changes and to reset the buffer to a specific state.
But sometimes I'd like to undo a change or sequence of changes ...
0
votes
1
answer
28
views
How to set a specific background color for a certain string in text?
I would like to highlight each occurence of some word e.g. "covid" in a text when the file is loaded.
It will be in org files but even global scope for all files is not a problem. So, I can ...
-4
votes
0
answers
21
views
Enabling minor mode when initialisation error occurs
I am writing a minor-mode. But as I add more functionality to it, I frequently introduce some elisp mistake that makes my emacs configuration to stop working, with giving throwing me a Warnings ...
0
votes
0
answers
7
views
How to derive eldoc or company documentation from docstring in Clojure/script-mode?
For some reason, documentation support is very vague in Clojure/script-mode and CIDER. Cider-doc, eldoc, lsp, company, xref and similar offer solutions to automatically view documentation, through ...
0
votes
2
answers
42
views
Moving `*** b3` from `* b1 > ** b2 > *** b3` to `* a1 > ** a2 > *** b3` in Org mode
I am trying to move *** b3 from this state:
* a1
** a2
* b1
** b2
*** b3
to this state:
* a1
** a2
*** b3
* b1
** b2
But I can't do that with (org-refile), because it allows me to only target * a1
...
1
vote
1
answer
28
views
Org mode table range excludes empty cells
For me this problem occurs when using org-lookup-first. However, I think this might happen in a lot of other circumstances as well. When specifying a range of cells for example via @1$1..@>$1 it ...
1
vote
2
answers
67
views
Debugging a hook function
I have this code:
(add-hook
'org-mode-hook
(lambda ()
(when (string-match "notes\\.org$" buffer-file-name)
(face-remap-add-relative 'default :background "yellow"))))...
0
votes
2
answers
21
views
After establishing a SSH connectia via eshell, "dumb" terminal can't run Emacs. Also vi does not work properly. How to solve this with Emacs?
After running eshell, I was trying to establish a SSH connection and do some changes on the server:
ssh root@111.222.333.444
The connection was successfully established (the real IP address was ...
0
votes
0
answers
30
views
Is there a way to stop "hack-local-variables" from prompting for confirmation?
After creating a document programmatically I need to enable the local variables in the file and with hack-local-variables I always get prompted to confirm.
It is annoying and interferes with the ...
0
votes
3
answers
37
views
Using `let` with `list`
I have read that by default, a function returns the value of the last expression evaluated as the return value.
Does it mean that when using special form let, the value of the last expression in the ...
0
votes
0
answers
14
views
see virtual/recent buffers when switching with fido
I've switched from ido to fido and I'm missing the feature of being able to open recently closed buffers that ido-mode provided with ido-use-virtual-buffers. I spent a lot of time searching for how to ...
0
votes
1
answer
39
views
How can I specify arbitrary headline numbering in org mode?
Suppose I have the following org file (example.org):
* Alpha
** Aleph
* Beta
* Gamma
When I export it to HTML I get:
1. Alpha
1.1. Aleph
2. Beta
3. Gamma
Which is quite useful in most cases. Now ...
0
votes
1
answer
45
views
How to change background color of a specific file?
Let's say I want my file notes.org to have a specific background color. How to do that? But I want other files to adhere to the standard theme color for background.
So, I want yellow background for ...
2
votes
2
answers
61
views
How to show an org-table from another file?
I have a refcards.org file where I store and maintain tens of tables (each having a specific name, e.g. #+name: key-somename).
I would like to mention and show these tables in some other org files ...
0
votes
1
answer
40
views
How to create a non-existing subheader in another local org file from a link?
Let's say I have this in my games.org file:
* Games I own
** Adventures
*** Adventure - Police Quest
*** Adventure - Mixed-Up Mother Goose
And I want to link to the Adventure - Mixed-up Mother Goose ...