Questions tagged [start-up]

About starting and initializing an Emacs session

Filter by
Sorted by
Tagged with
44
votes
3answers
4k views

What can I do to speed up my start-up?

What are some basic things I could do to reduce the start-up time? Is there anything in particular I should pay attention to, for that matter? Note: Startup time can be mitigated by starting Emacs ...
32
votes
2answers
9k views

package-initialize: wrong type argument : arrayp , nil

while going through the emacs as a c/c++ editor , I came across the following lines of code to include in my ~/.emacs file, to connect to melpa archives for package installation (require 'package) (...
20
votes
2answers
4k views

How can I improve startup time despite many packages?

TL;DR I have such a huge amount of packages that it's hurting my startup time. If you don't believe that could be the case, read on. My Emacs startup time is quite small. I don't use use-package, I ...
19
votes
3answers
3k views

replace splash screen with list of recentf

The splash screen is useful in the beginning, but now I want something more useful: I want to have list of recently opened files presented when starting emacs if there is no predefined file to open. ...
19
votes
2answers
4k views

Is there any downside to setting `gc-cons-threshold` very high and collecting garbage when idle?

I added the following two lines to the top of my init.el: (setq gc-cons-threshold (eval-when-compile (* 1024 1024 1024))) (run-with-idle-timer 2 t (lambda () (garbage-collect))) That means that ...
16
votes
1answer
6k views

How to start Emacs without the cmd.exe window (on MS Windows)?

It says emacs/bin/emacs.exe. If it's not necesarily useful, I'd like to stop it from starting with emacs. The extra window is messing me up a bit.
15
votes
2answers
5k views

Why does Emacs take longer to start on Windows than on Linux?

Configuration: One system OS Windows 10 as dual boot OS Ubuntu 15.10 as dual boot Emacs 25.0.1 with GUI I have one dot-emacs file and everything in my .emacs.d folder (the packages also are located ...
11
votes
3answers
484 views

How does Emacs manage to start instantaneously with many el-files?

As every Emacs'er will know, I'm currently suffering from my extensive dot-Emacs configuration. All my packages are within the containers of use-package, and I bytecompiled all of my .el-files. Even ...
11
votes
1answer
1k views

Emacs desktop-save-mode - only save desktop when previous desktop was fully restored

I have the following in my .emacs: (desktop-save-mode 1) (setq desktop-restore-eager 10) (setq desktop-save t) Often I have a lot of buffers open (100 or so), then this really helps - as emacs is ...
8
votes
4answers
5k views

Speed up Emacs start-up time

I have seen this thread but my problem is an order of magnitude larger. Also, a newbie, I did not understand much of what was being discussed there. So, this new question. I am running Emacs 25.2.2 ...
8
votes
1answer
2k views

How do I start a shell automatically after starting emacs

One of my main reasons for using Emacs is to get a powerful environment after sshing into a remote machine. The first thing I do after starting Emacs is to run M-x shell to get a command line. As it ...
7
votes
2answers
618 views

How to disable lisp-interaction when starting Emacs?

When I open Emacs, the *scratch* buffer is in Lisp Interaction mode, but I don't want that. How can I make the buffer have a text mode instead of Lisp Interaction?
7
votes
2answers
196 views

Why expression fails in init file, but works fine during session [duplicate]

I want to understand why an expression of the form (load-theme 'my-kewl-theme t) fails1 when run as the last expression in my init (~/.emacs) file, but works fine if I evaluate it as soon as soon as ...
7
votes
1answer
760 views

What is the difference between `-Q` and `-q --no-init-file --nosplash`

I have started seeing some strange X related behaviour in emacs. I have not been able to pin it down. It goes away when I run emacs -Q, but is still present when running emacs -q --no-init-file --...
7
votes
1answer
288 views

Removing tool bar oddly slow

(tool-bar-mode 0) takes up 11% of my initialization time (about a third of a second). It's not that big of a deal; it's just strange. I've tried it on multiple computers. I've also tried disabling ...
7
votes
1answer
2k views

emacs command-line-default-directory variable is not set correctly

I'm using Emacs on Windows. I also have a VirtualBox VM that I connect to using plink. But then, when I use the eshell, and I do cd <some folder> it tells me No such directory found via CDPATH ...
6
votes
2answers
1k views

Restore welcome screen buffer when closed

How do I open startup/splash/welcome screen/message buffer (*GNU Emacs*) when it's not listed in list-buffers ?
6
votes
1answer
112 views

How can one restore buffers on startup in correct order?

I use desktop-save-mode in order to restore buffers on startup. However, the buffer which is visible immediately after startup is *scratch*, *Messages*, .bbdb, etc. I am not interested in those. Is ...
6
votes
1answer
2k views

“Unable to activate package” when starting Emacs

I get the following message when starting Emacs: Warning (emacs): Unable to activate package `elpy'. Required package `highlight-indentation-0.5.0' is unavailable Warning (emacs): Unable to activate ...
5
votes
2answers
2k views

Handle stale desktop lock files after emacs/system crash

If Emacs or the system crashes when desktop-save-mode is active, Emacs leaves a stale desktop lock file. The next time the desktop is loaded (from another Emacs process ID), loading is interrupted ...
5
votes
2answers
533 views

How to re-load a package?

The situation I have is this. First, I run (require 'prolog) ...which loads the system's default version of prolog.el, and makes the variable prolog-mode-version available. It has value "1.22". ...
5
votes
2answers
249 views

How to load start up screen (*GNU Emacs*) f it hasn't already been created?

When you run Emacs in daemon mode and then connect to it with emacsclient it doesn't show the start screen (*GNU Emacs*) but instead puts you into the *scratch* buffer, which is normally fine. But if ...
5
votes
2answers
150 views

Incremental Search after opening file

Being fairly new to GNU Emacs and intend to use it as a replacement to vi/vim where possible, I came across an obstacle, I seem not be able to overcome. In vim (similar to less) you can provide a ...
5
votes
2answers
3k views

How to lazy load init files to speedup Emacs startup?

My ~/.emacs.d/init.el file looks like this: (package-initialize) (require 'init-my-emacs-settings) (require 'init-my-emacs-performance) (require 'init-my-emacs-font) (require 'init-my-emacs-color-...
5
votes
1answer
3k views

Programming of Initial-buffer-choice

I need to make a function that will choose an org mode file if emacs was called with no arguments, and basically go about its way otherwise. So far I have (defun personaltodo () (if (= 1 (...
5
votes
1answer
5k views

require vs. package-initialize?

Ok, this is a noob question but I've digging into this enough that I think it's reasonable to ask :) My question: In one's .emacs / init.el file, can one use require to load packages that were ...
5
votes
1answer
1k views

How to open multiple files without automatically activating the “Buffer List” split?

Running emacs with multiple files automatically opens the "Buffer List" split-window. eg: emacs -Q *.txt Opens a split window, one which contains a list of buffers. How can multiple files be ...
5
votes
2answers
1k views

How to show startup screen instead of scratch, when no file is opened?

Like a lot of people I think I activated inhibit-startup-screen because it’s ugly and tedious to always have your emacs horizontally split when you open a file with half taken by an useless startup ...
5
votes
1answer
74 views

What mix of customisations are required to have org files always open exactly as they were closed?

org-customize has a node for startup folded, with options no fold, fold, content, and show everything. There doesn't seem to be an option for "remember last folded state". For such a customisable ...
5
votes
1answer
275 views

How to configure emacs to show the file I was working on when I open emacs?

I have save-place and save-visited-files installed however whenever I start emacs first a directory list shows (result of another setting in .emacs), I close it and then a few message buffers show up ...
4
votes
2answers
2k views

How to load all .el files at start-up

Usually there are many .el files in the folders with the name lisp in the installation directory of Emacs. At start-up, Emacs doesn't load all these files, in consequence a command like M-x calendar-...
4
votes
3answers
3k views

Replace welcome screen (aka “splash” screen) with calendar?

I want to replace the welcome screen with the calendar. I've tried adding (calendar) to my .emacs but it opens calendar in addition to the welcome screen not instead of it. EDIT: I'm trying what is ...
4
votes
1answer
1k views

Emacs Mac OSX after upgrade to 26.2 launches only in `-nw` mode

I upgraded to Emacs 26.2 on my Mac OSX Sierra instance via "brew". After the upgrade, the emacs command will not open a new "GUI window", i.e. it runs as if I passed the -nw args or ran it from an ...
4
votes
2answers
698 views

Keep spacemacs from retrieving package archives at startup

I'm trying to figure out a way to speed up my spacemacs start time. The main offender at the moment is the refreshing of package archives at start. I was hoping that setting dotspacemacs-check-for-...
4
votes
2answers
486 views

emacs -nw -q takes long time

emacs -nw -q or emacs -nw -Q takes more than 10 seconds to start in terminal, but the result of M-x emacs-init-time is 0.0 seconds, and the emacs takes shorter time (still more than 5s) than emacs -nw ...
4
votes
3answers
1k views

Is it possible to install emacs 25.1 and emacs 24 on the same machine?

I currently have emacs 24.5.1 running on OSx el capitan. Since the first RC of emacs 25.1 released a few days ago, I am very curious to try it out. Can I have both versions installed on the same ...
4
votes
1answer
195 views

Is `loadup.el` hard-coded, such that `-nl` (aka --no-loadup) is futile?

I would like to create my own startup.el, and it seems that loadup.el is what causes startup to do its thing -- i.e., (load "startup"). I see that an option for starting Emacs is -nl or --no-loadup; ...
4
votes
2answers
106 views

Prevent TTY fallback when X fails

I frequently forget to start my X server before I fire up emacs. Obviously emacs will attempt to open an X window and fail. In older versions of emacs (I forget when this changed) the behavior was ...
4
votes
2answers
1k views

Portable Emacs: Remapping user-emacs-directory

The Problem I want to install Emacs on a USB Flash Drive in a portable fashion, that is, Emacs should be able to be run from the UFD, once plugged on a device, without predefined paths to its ...
4
votes
1answer
477 views

How to init emacs with an option (such as `--debug-init`)

This might be a very silly question, and that's maybe why there's no answer on the internet. I'm using Windows 10. And I tried to click on properties, and then change the ending of the file's name ...
3
votes
4answers
1k views

How to replace the default contents of the scratch buffer with the contents of a file (if it exists)?

I would like emacs to check for a ~/emacs.d/scratch.txt and use it's contents instead of the default message when emacs starts. How can this be done?
3
votes
1answer
3k views

How to auto-toggle NeoTree on startup?

I would like to have NeoTree automatically toggle-open upon Emacs start up. I have tried adding: (neotree-mode t) under my: (require 'neotree) line in ~/.spacemacs (and yes, I am using Spacemacs ...
3
votes
2answers
2k views

How to detect Windows XP vs Windows 7 in startup file?

Presently, I'm testing for windows like this in my startup for Emacs v23.1.1: (if (eq system-type 'windows-nt) (load-library "visual-basic-mode")) However, this is true for both Windows 7 and ...
3
votes
1answer
701 views

How to customize a lazy-loaded variable?

In Spacemacs, how can I customize a variable used in a layer that's loaded lazily? Specifically, I'm trying to use Zathura and Synctex with Spacemacs' Latex layer. I have the following code in my ...
3
votes
1answer
765 views

How to prevent Emacs from creating two windows on startup Windows 10?

When I start Emacs not from the command line on Windows 10 it creates two windows, not one. Is there any way to make the blue window go away? I usually needs 4-5 instances of Emacs running so it ...
3
votes
3answers
529 views

Hide emacs frame until loaded

In my init.el file, I have some code to hide the Emacs toolbar: ;;; Hide the toolbar (tool-bar-mode -1) But when I load Emacs, it first enables the toolbar, and then quickly hides it, after it reads ...
3
votes
1answer
93 views

How to activate diff-mode from command line?

Git's editor config is set to launch emacs in no-window mode and to execute lisp function diff-mode: git config --global core.editor "emacs -nw -f diff-mode" However, when I execute git commit -v to ...
3
votes
1answer
96 views

Was Emacs launched with a filename argument?

Suppose I want Emacs to be configured differently depending on whether or not it was launched with a filename as an argument. Is there a way I can deduce this as part of my init file? One way is to ...
3
votes
2answers
81 views

Changing the file association of todoo or alternatively completely disable it

I am using emacs on a debian system and have installed emacs-goodies-el. One of the many things in there is todoo which registers itself in auto-mode-alist for all files ending in TODO. This ...
3
votes
1answer
440 views

Using org in emacs batch mode

I'd like to export an org file to LaTeX from the command line. I have created a file export.el with the following contents (simplified to reproduce the problem): (require 'org) (when (not (assoc "...