Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why doesn this [terminal or window-system setup] code work in my `.emacs file, but it works just fine after Emacs starts up?

code Emacs file Fine window-system
0
Posted

Why doesn this [terminal or window-system setup] code work in my `.emacs file, but it works just fine after Emacs starts up?

0

During startup, Emacs initializes itself according to a given code/file order. If some of the code executed in your `.emacs’ file needs to be postponed until the initial terminal or window-system setup code has been executed but is not, then you will experience this problem (this code/file execution order is not enforced after startup). To postpone the execution of Emacs Lisp code until after terminal or window-system setup, treat the code as a lambda list and set the value of either the term-setup-hook or window-setup-hook variable to this lambda function. For example, (add-hook ‘term-setup-hook (lambda () (when (string-match “\\`vt220” (or (getenv “TERM”) “”)) ;; Make vt220’s “Do” key behave like M-x: (global-set-key [do] ‘execute-extended-command)))) For information on what Emacs does every time it is started, see the `lisp/startup.el’ file.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123