Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
2answers
35 views

How to create a .emacs.d repository [on hold]

I am trying to create a github repo of my .emacs.d/ for a group of students. Basically, I have two choices: A) simply take a "git snapshot" of my entire ~/.emacs.d/ including all the packages in elpa/,...
1
vote
1answer
37 views

LISP command won't work in init.el but works in *scratch*

I've executed the following lines in my scratch buffer (require 'expand-region) (global-set-key (kbd "C-=") 'er/expand-region) and everything worked without any problems, but if I add those same ...
2
votes
1answer
156 views

Confused about .emacs vs .emacs.d/init.el

I read somewhere the two files were interchangeable, so I cut/paste the content of the former, shown below, to the latter. But then Xreader was missing when I tried to view a document generated by ...
1
vote
0answers
84 views

Remove scrollbar, faster

I like a clean interface. One without the clutter of scroll bars, or menu bars. So, to remove them, I have the following in my init.el (progn (menu-bar-mode -1) (scroll-bar-mode -1) (tooltip-...
63
votes
4answers
9k views

Advantages of setting variables with setq instead of custom.el?

I see a lot of people (extension authors and others) give configuration examples with setq: (setq foo 'bar) These parameters are often defined with defcustom, making them available for customization ...
0
votes
1answer
41 views

On emacs26, is it possible to halt initializing and attach to running emacs-server with init.el?

I'm using emacs26 on macOS and using server-client for the fast initialization. However, it's a bit annoying that a new emacs instance is always spawning when I run "Emacs.app" with SpotLight instead ...
1
vote
1answer
79 views

Error enabling flyspell mode in Emacs

I use flyspell hunspell for checking my spelling mistakes in Emacs. Recently, when I run M-x flyspell-mode in .org or .tex files I got the following error: Error enabling Flyspell mode: (hunspell ...
2
votes
1answer
22 views

Rewriting `defadvice' as `advice-add' makes advice ineffective

I am trying to make undo-tree auto compress the history save file. The document suggests adding the following advice (defadvice undo-tree-make-history-save-file-name (after undo-tree activate) (...
1
vote
1answer
17 views

“void-variable” error when adding advice to `kill-ring-save`

I am trying to add an advice to kill-ring-save and kill-region, so that when I call them with no active regions, instead of throwing an error, the line the point is currently on would be marked ...
0
votes
1answer
59 views

Should I use “require” or “load” when writing my own configuration? [duplicate]

I am following this tutorial, and the author is doing something like this: ~/.emacs.d/init.el ;; add your modules path (add-to-list 'load-path "~/.emacs.d/custom/") ;; load your modules (require '...
1
vote
1answer
24 views

(require ) a certain file only when opening a particular file type

I've started using Emacs for Ocaml programming, and used opam for installing some Emacs scripts which enable IDE features. To use these, opam added the following line to my .emacs: (require 'opam-...
4
votes
1answer
39 views

How to postpone redrawing on startup?

On startup I can see the fonts and color scheme before my own are loaded in. Is it possible to drawing the interface until a certain moment when settings are loaded? Incase it's important: Linux, ...
0
votes
1answer
73 views

highlight-indent-guides-mode

I'm trying to activate highlight-indent-guides-mode by default but it is not working. If i do M-x highlight-indent-guides-mode it works fine but adding (highlight-indent-guides-mode 1) to my .emacs ...
0
votes
1answer
33 views

Need to load initial file every time when restart emacs

I'm a newbie in Emacs who just is familiar with basic key bindings. I'm trying to learn more. I just learned to create initial file ~/.emacs.d/init.el and how to evaluate. But I find I need to load ...
0
votes
2answers
64 views

Why doesn't set-background-color work in my init file?

I have an init file for Emacs located at /home/username/.emacs.d/init.el and it has the command (set-background-color "honeydew"). However, when I open Emacs the color has obviously not changed from ...
2
votes
1answer
531 views

lsp-mode: How to use built-in clangd client?

I'm trying to use lsp-mode (together with company-lsp) for auto completion in C++. According to the docs[0], recent lsp-mode includes clangd support, so I should be all set when I do (require 'lsp-...
0
votes
2answers
168 views

Emacs not loading org-agenda-files on startup

So i've put this in my emacs.org: (setq org-agenda-files (list "~/todo.org")) But whenever i close and reopen Emacs, my org-agenda is empty until i reload my config-File. Is there anything ...
1
vote
1answer
45 views

%%j and %%S in format string for frame-title-format

In my cobbled-together init.el, my frame-title-format variable has these %-sequences in it: %%j and %%S Does anyone recognize these specific sequences? They come up blank in my frame title. Here's ...
0
votes
1answer
46 views

Eval Buffer works on .emacs but loading when emacs starts

I know there are some other questions like this on the site, but none of them seem to work. I am trying to enable relative line numbers with a package, and when I do M-x eval-buffer, the mode is ...
0
votes
1answer
21 views

Set auto-fill when opening an .md file [duplicate]

Sadly, my Emacs is too old (and not mine to upgrade) and so I can't run markdown-mode. I'd like to set a buffer to fill mode when I open an .md file. Is there a simple way to do this? The whole ...
1
vote
1answer
168 views

Themes in emacs-nox displaying bottom part of frame black instead of background color

Edit: I tried many themes and it was an issue for all of them so this is not a Zenburn specific issue. Edit: Docker is not part of the issue as there is the same behavior when this is done using just ...
1
vote
1answer
162 views

No org-babel execute function for go

#+Begin_SRC go package main import ("fmt") func main(){ fmt.Println("emacs") } #+End_Src ~/.emacs.d/init.el: (when (memq window-system '(mac ns)) (exec-path-from-shell-initialize) (exec-path-...
1
vote
1answer
38 views

How to use `column-marker-1` with every buffer?

Question may be very dumb, but I can't find the answer on the web : I have a command C-u 80 M-x column-marker-1, and I want it to be launched automatically on every buffer I open. What should I add ...
54
votes
10answers
20k views

How to start emacs with a custom user-emacs-directory

I'm working on a custom and small Emacs configuration that I want to share with some friends as a git repository for them to use as a baseline for their own future configurations. For this I need ...
0
votes
1answer
147 views

My emacs does not use the LaTeX-includegraphics-extensions option in my .emacs file

I tried to customize my .emacs file adding the options to the macro command \includegraphics. I use Emacs 25.3.1 on MacOS. My .emacsfile is as follows: (package-initialize) (custom-set-variables '(...
4
votes
2answers
479 views

Use several Emacs configurations/versions simultaneously

I want to use several emacs configurations/versions simultaneously so that no configuration disturbs each other, each with their own configuration directory and elpa repository. I heard about the ...
5
votes
1answer
350 views

Under Windows, Emacs cannot handle encodings correctly for subprocesses, can it?

I have two simple text files on my D: drive, as shown below. D:\我.txt I D:\你.txt You After I execute M-x diff and type the correct filenames (Yes, I can input Chinese and filename ...
3
votes
1answer
304 views

Use system-installed package with spacemacs that depends on MELPA packages

How can I include a package that is available locally on my system that depends on the string library s with spacemacs? I have an company internal package that adds functionality to magit available ...
0
votes
2answers
279 views

where to put .el files on Windows10 for loading at startup

I'm using emacs as a bog-standard program in Windows, and also from the command line in cygwin. They both use the same installation of emacs. I just grabbed yaml-mode.el off the net but I can't ...
9
votes
1answer
952 views

Coding System utf-8 on Mac - Which one and why as default?

I want to change my default encoding system from non defined to UTF-8 (I think that would be useful). Now I have seen many different UTF-8 coding systems: mule-utf-8 mule-utf-8-dos mule-utf-8-...
1
vote
2answers
268 views

Automatically toggling margin width on resizing

So I'm using Emacs in Windows (Emacs 24.5.1, Windows 10). I've set a default margin width of 20 on both sides for text-mode, but occasionally I like to resize the window in half (Windows+left or right ...
1
vote
1answer
144 views

Change permanently font size in Aquamacs

I have been looking on the web to the existing answers to this question, but non of them works for me. I would like to change the default font size for all frames in Aquamacs 3.3 GNU Emacs 25.1.1 (...
5
votes
3answers
63 views

How can I avoid accidentally editing installed packages while still being able to install new packages?

I end up looking at source files of packages I have installed fairly often and want to avoid accidentally editing them while I am viewing them. After looking at https://emacs.stackexchange.com/a/3681/...
1
vote
1answer
308 views

org-agenda-files not setting after update?

I recently upgraded to emacs 25.1.1 and noticed my org setup wasn't working as usual. in my init.el I have: (setq org-directory "~/Dropbox (Personal)/org") (setq org-archive-location "~/Dropbox (...
2
votes
1answer
333 views

auto-complete Key binding doesn't work in one emacs mode

I have changed the keybindings for yasnippet and autocomplete so that I can use tab for indentation anywhere in a line without accidentally autocompleting or inserting a snippet. I have this in my ...
0
votes
1answer
53 views

File-missing “No such file or directory” “c:/emacs-26.1-x86_64/bin/%HOMEDRIVE%%HOMEPATH%/”

I'm launching Emacs using runemacs on Windows 7, from the emacs directory (C:\emacs-26.1-x86_64\bin), using runemacs --debug-init. I get the following error text: Debugger entered--Lisp error: (file-...
0
votes
1answer
472 views

When to call package-refresh-contents in init.el

I have found the following lisp code in an init.el file. I am wondering if this code logic is correct. I am learning Elisp and have reviewed the documentation and searched Stack Overflow. If this is ...
2
votes
1answer
176 views

Configuring Prettify Symbols Mode

I've configured prettify-symbols-mode as below. However, only in the scratch buffer is any drawing performed. Further, lambda (λ) is the only multi-character token drawn as a unicode glyph. Is ...
2
votes
1answer
552 views

How to customize org-agenda-* faces in .emacs file?

I am trying to customize org-agenda-* faces such as org-agenda-date, org-agenda-date-today, and org-agenda-date-weekend in my .emacs file. Normally, I install the use-package package to lazily load ...
1
vote
1answer
204 views

M-x shell from MSYS2: cannot set terminal process group

I'm using MSYS2-x86_64, and whenever I do M-x shell I see the following: bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell ]0;~/.emacs.d ...
2
votes
1answer
62 views

Idiom to default a setting for most modes, except specific others?

I generally like show-trailing-whitespace. But it's distracting in shell/REPL modes, where for instance completion may leave a trailing space (e.g. ls foo TAB RET in shell-mode). Plus I'm not git- or ...
7
votes
2answers
632 views

Relative paths in init file

When loading things like themes from custom directories, is it possible to specify a path relative to the init.el file, rather than an absolute path? I ask because I want to be able to use the same ...
1
vote
1answer
854 views

Loading and executing .el file if it exists on startup

I am having trouble telling Emacs to load and evaluate an additional .el file which only contains some lisp code to load an org file ;; keep my personal settings not in the .emacs file ;; http://www....
0
votes
1answer
78 views

Weird behavior: GUI won't start, but terminal emacs will

As I said in the title, I'm having a problem with starting Emacs, whenever I try to start it with rofi, nothing happens, and when I try and start with terminal (using emacs), it returns "Args out of ...
3
votes
2answers
393 views

Setting Default Font in Emacs 26.1

I want to set a default font in my Emacs (version 26.1, running on Arch, using Xmonad). I have tried various options in my init.el file (under .emacs.d). None seemed to work or persist when I ...
1
vote
1answer
44 views

Why is emacs creating multiple nested bak/ folders?

I recently tried to back up and move my .emacs.d to another folder and got the error down below. Does anyone know why my system is generating all of these bak/ folders? Also, is it safe to delete ...
3
votes
2answers
82 views

Separate customizations according to modes

Using emacs 25.2.2 on Kubuntu 18.04. I have customized several variables using M-x customize-variable. So, there is a large custom-set-variables section at the very beginning of my init.el. Moreover, ...
1
vote
1answer
106 views

Setting C-p as helm-projectile-find-file

I put this at the very end of my config file: (global-set-key (kbd "C-p") 'helm-projectile-find-file) On Emacs start I can see that it is getting assigned using C-h k C-p. Then when I actually load ...
0
votes
1answer
38 views

emacs hangs when loading csharp (.cs) file

Just upgraded to emacs 26.1 from 25.3 on windows (emacs-version = GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of 2018-05-30). I downloaded the latest version of csharp-mode from melpa. Now when I'm ...
0
votes
0answers
67 views

Cannot enable visual line mode globally

I would like visual-line-mode to be always on. For this reason I put in the very end of my init.el file the following line of code (global-visual-line-mode 1) (as suggested here). Anyway, the above ...