Questions tagged [init-file]

for questions about initialization files `.emacs` or `init.el. DO NOT USE this tag if you assume answers require tweaking initialization files because many solutions do not involve directly manipulating initialization files.

Filter by
Sorted by
Tagged with
0 votes
1 answer
51 views

Why does eval-buffer on init.el kill a buffer?

I tried running M-x eval-buffer to reload my init.el, which looks like this (point was at top, most irrelevant commented-out sections trimmed): (global-set-key (kbd "C-c l") #'org-store-link)...
1 vote
1 answer
113 views

Opening emacs without the scratch buffer when opening a file (Please tell me what is wrong with my init file snippet)?

I recently updated my org-roam package to version 2.2.2 with the following steps: M-x list-packages Then select org-roam and clicked delete. M-x list-packages again Then select org-roam and clicked ...
1 vote
2 answers
15 views

Load default.el configured by libraries but not the user's init.el

As far as I understand libraries can define a default.el file that will be loaded on startup. I would like to run librarie's default.el, but not the init file of the user (e.g. in .emacs/init.el). Is ...
0 votes
1 answer
44 views

Unicode characters missing only in Emacs

A few unicode characters are missing from my Emacs (GNU Emacs 28.2 on macOS 11.6.8.). They are displayed everywhere else on my system just fine, but in Emacs they look like this: (Same character in ...
1 vote
1 answer
35 views

Trouble creating a .py file in emacs [closed]

Whenever I try to create a python file in Emacs I get this error message: unable to find installed server supporting this file. the following servers could be installed automatically: what does this ...
0 votes
0 answers
10 views

auto-save-file-name-transforms not respected on MS Windows 10

On my linux machines, in my ~/.emacs.d/init.el, I have (setq auto-save-file-name-transforms '(("\\`/.*/\\([^/]+\\)\\'" "~/.emacs_autosave/\\1" t)))) which, when I edit ~/foo, gets ...
  • 113
1 vote
0 answers
22 views

Why EAF browser is opening outside emacs buffer?

I'm new to emacs, so excuse any naivety that you might see. These are my sys and emacs config. System Version: macOS 12.5 (21G72) GNU Emacs 28.1 I've tried installing eaf and eaf-browser in emacs, i ...
0 votes
0 answers
15 views

Bind all company completion to <Tab>

I am bit confused about different company completion modes. How can I make company always accept completion by instead of ? Currently these three commands I use most: company-complete-selection ...
  • 113
1 vote
1 answer
47 views

How can I make emacs load `environment modules`?

I keep packages organized on my laptop using environment modules (http://modules.sourceforge.net/). Hence if I need a particular version of python, I can do module load python39 etc. Now if I first ...
  • 113
0 votes
1 answer
16 views

Symbol's value as variable is void: company-transformers

I am trying to prevent company-mode from autocompleting numbers. I added the following to my init file. (push (apply-partially #'cl-remove-if (lambda (c) (string-match-p "\\`[0-9]...
  • 153
0 votes
1 answer
25 views

Windows pdf-tools-install no such program: autoreconf

I'm trying to install pdf-tools on my Windows System, I'm using the same config as for Arch Linux where this error is fixed by installing the arch linux pdf-tools package via pacman. Obviously this is ...
  • 1
3 votes
2 answers
66 views

How to see total line number of a file in emacs Mode line?

I really need this but couldn't figure out how to do it. Let's say I open a file in a new buffer which has 200 line of code. Now I'm in the beginning of my file in line 1. And Mode line showing All(1,...
2 votes
1 answer
65 views

How to set crossline alike highlighting mode in emacs?

What i'm trying to do here is that, in my buffer I want to point the cursor position through highlighting the line horizontally and column vertically. Much like the CrosshairHighlighting mode. (https:...
0 votes
4 answers
58 views

install packages with one command

I have used some packages in init.el, after setup a new environment and copy init.el to .emacs/init.el, then start emacs will report packages missing. I can install it one by one. but I would like to ...
  • 1,506
0 votes
0 answers
18 views

Ido only shows directories and no files

When I am using ido, it only shows the folders and not the files within the folders. I have the following code in the init.el file: ;;Setup ido ...
  • 1
0 votes
1 answer
39 views

Can I change default location of .emacs.d folder?

Emacs 28.1 By default folder .emacs.d location on my home folder. Smt like this: /home/alex/.emacs.d/ But I need to change to another location to e.g: /home/alexeij/dev/.emacs.d/ Is it possible?
  • 3,495
0 votes
0 answers
15 views

How to force a particular compiled verilog-mode.elc file to be used?

I'm using emacs on a server with no root access and paranoid sysadmins. The verilog-mode in the default path is very, very old and does not work well. However, there is a later version of verilog-mode....
0 votes
0 answers
23 views

Access current theme face attributes in init.el

I have these lines in my init.el: (load-theme 'wombat) (deftheme wombat) ... (defvar my/default-cursor-color (face-attribute 'cursor :background t)) I want the variable my/default-cursor-color to be #...
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 ...
  • 103
1 vote
1 answer
75 views

Emacs doesn't pick up .emacs.d/ on windows

I'm using Linux at home but for work reasons I need to use Windows. That's why I've installed emacs on my company computer. I have a implemented at several scripts at home to be able to replicate my ...
  • 45
0 votes
0 answers
21 views

Bug-hunter finds error but it shouldn't (false positive)

I suspect I'm doing something very stupid but I can't figure out what. I have some problems with Eshell, and I was advised to use Bug-hunter. I installed it through Elpa. When I launch it (M-x bug-...
0 votes
1 answer
76 views

command-execute error with straight.el

I have just tried to setup magit using straight.el in my init file as follows: (use-package magit :straight t :bind ("C-x g" . magit-status) :commands (magit-status ...
0 votes
1 answer
29 views

Emacs Social Sciences Starter Kit - Not Loading

I am trying to install Kieran Healy's Emacs Social Sciences Starter Kit. I think I followed the instructions meticulously (details below) but – to cut to the chase – when I launch emacs, I get vanilla ...
0 votes
1 answer
45 views

Update emacs after changing init settings

Is it possible to update emacs after changing my init settings without having to fire another session?
  • 383
0 votes
0 answers
86 views

How to prevent `desktop-save-mode` from opening multiple windows?

I want to restart Emacs at the same cursor position in the file (or buffer) I was just working on. In my Emacs config I have the following code to try and do this: (use-package desktop :straight ...
1 vote
0 answers
48 views

Enabling helm interferes with R/ESS

I have helm enabled in an Org file that init.el calls. The code looks like the following: (use-package helm :config (require 'helm-config)) (global-set-key (kbd "M-x") #'helm-M-x) (...
  • 153
0 votes
1 answer
51 views

Windows making my init.el file into a .txt file

I'm trying to do a basic setup of emacs on my Windows 10 machine. I've used emacs in the past on an Ubuntu system. When I try to make a init.el file in an emacs.d directory it turns my .el file into ...
  • 1
1 vote
1 answer
124 views

Get current point position in elisp function

I want to make a logger that display line number of the point. In init.el I wrote the following function: (defun logger () "Print logger" (print (concat "print(\"" (what-...
  • 27
3 votes
2 answers
365 views

Why does Emacs not load the init file when using sudo?

My Emacs init file works fine in general. But, if I am in my home directory and if I execute: pwd /home/pedro sudo emacs /etc/nixos/hosts.nix For some reason, this opens vanilla Emacs without ...
0 votes
6 answers
110 views

Make `.emacs` more robust

I share an .emacs file on two machines. About once per month I find that Emacs on one machine or the other fails to load the file. Just today the error was: File error: https://melpa.org/packages/with-...
1 vote
1 answer
25 views

general-create-definer and flycheck's "the function foo is not know to be defined"

In my init.el file, I use the package general and the following line (general-create-definer foo/leader-keys and then later (foo/leader-keys I use the package flycheck to lint the code in the init-...
  • 111
1 vote
0 answers
32 views

Key Binding not Working

I have the following code as shown below for my .emacs file. For some reason the keybinding is not working nor are the extensions for deft I am pretty sure. Does anybody know why this is? (require '...
0 votes
2 answers
79 views

Literate Emacs Configuration Exclusion

When using literate configuration, is there a way to exclude code blocks? Maybe tag the babel blocks to include or exclude? Any great ideas?;)
0 votes
1 answer
408 views

lsp mode problems: not enabled, and clangd include file not found

I am trying to configure lsp-mode with clangd using emacs 28.1 (compiled from source), and encounter two problems that I do not manage to solve: First, `lsp-mode` is not started automatically when I ...
  • 131
3 votes
2 answers
182 views

Obviate the need to specify every folder for a manual setup

I run all my Emacs packages manually without any package manager. My setup is a simple init.el file with this kind of direction: (add-to-list 'load-path "~/.emacs.d/packages/ace-window") (...
  • 1,069
1 vote
1 answer
261 views

How does one fix the Warning (initialization): An error occurred while loading error?

What does this error mean: Warning (initialization): An error occurred while loading ‘/Users/brandomiranda/.emacs’: Wrong number of arguments: (3 . 4), 2 To ensure normal operation, you should ...
0 votes
1 answer
121 views

"Invalid read syntax: . in wrong context"

I wanted to add a new display setting to init.el file, but didn't like it and removed the line. Now when I start emacs I get this error: Invalid read syntax: . in wrong context Here is the init.el ...
1 vote
0 answers
65 views

~/.config/emacs and .emacs.d for config?

I've had just one single .emacs since the 1980s (not kidding). I feel like it's finally time to modernize, literatize, and put it in a modern place. I see that emacs now prefers ~/.config/emacs/init....
  • 416
0 votes
2 answers
115 views

Tools for locating and debugging errors

I am getting the following error, but am finding it difficult to locate the problem. Are there any tools for debugging in such instances? Warning (initialization): An error occurred while loading ‘/...
  • 169
1 vote
1 answer
56 views

second frame not using values from default-frame-alist

I'm just starting to customize emacs on RHEL8, the entirety of the .emacs file is this: (setq default-frame-alist '((width . 80) (height . 40) (menu-bar-lines . 1))) When starting Emacs this sets the ...
1 vote
0 answers
33 views

Set a non-default font for latin characters

I want to display phonetic alphabet characters alongside general text in a somewhat coherent manner. My default font is JetBrains Mono, so at the very least, the characters of the phonetic alphabet ...
1 vote
1 answer
64 views

Configure new commands in orgmode

I want to have custom commands for my documents in Org (which I export to Latex) for this I use \newcommand. I use a template that I load with #+setupfile, but if I define the new commands in that ...
  • 21
0 votes
0 answers
44 views

How to setup GTK emacs to open files in its current instance instead of opening a popup window?

Spent a lot of time on this and tried various solutions on the internet. Please help. Using the following emacs version. Want to run it in GUI mode on an Ubuntu 20.04 server, same issue happens on ...
  • 1
1 vote
2 answers
66 views

Is there a way to get the name of the current file being opened?

I'm trying to conditionally load configuration in my init.el. How can I get the filename (preferable the extension) of the current file being opened? For example, if I run emacs foo.rs, I'd like to ...
1 vote
1 answer
165 views

How do I find the init.el file on windows?

I'm currently stuck with not finding the init.el file, how do I find it on Windows and how do I load it?
  • 11
0 votes
0 answers
30 views

indent-region inconsistent with existing code that's indented more than python-indent-offset

Say I have an existing, simple block of code that uses an indent width of 4, as such def incDictValue(d, k): if not k in d: d[k] = 1 else: d[k] += 1 return and setup ...
2 votes
1 answer
72 views

How can I change the default `init.el` file Emacs automatically searches for?

I am new to emacs. Following the instruction online, the default customization file is in my home directory and is under the name .emacs. I want to follow the tutorial I am currently going over and ...
  • 131
4 votes
2 answers
114 views

How can I enable electric indentation for all modes except some?

I am trying to enable electric-indent-mode for all modes except fundamental-mode, where it is just annoying. In my init file, I have the following: (electric-indent-mode +1) (add-hook 'after-change-...
  • 41
0 votes
1 answer
306 views

Error enabling flyspell in emacs - aspell MacOS

I am having some difficulty getting flyspell/aspell to run on emacs 27.2, MacOS 12.01. I think I need to install or enable a dictionary, but no ideas on how to do this. If I type 'M-x flyspell-mode' I ...
1 vote
1 answer
46 views

Ivy minibuffer colums not left-justified with my setup

I am following System Crafters series on Emacs from Scratch on YouTube. With my configuration as I have set it up, Ivy doesn't appear in nice left-justified easy-to-read columns. I am trying to figure ...

1
2 3 4 5
15