This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Unable to hide welcome screen in Emacs
Is there a way I can prevent the GNU Emacs buffer from coming up when emacs starts?
I believe this in your ~/.emacs will do that
;; no startup msg
(setq inhibit-startup-message t) ; Disable startup message
The following in your .emacs will do the trick.
(setq inhibit-startup-screen t)
Related
This question already has answers here:
"Wrong type argument: commandp" error when binding a lambda to a key
(3 answers)
Closed 2 years ago.
I'm attempting to set up a command that automatically reloads my .emacs file bound to a control key.
I have used ielm mode and the defun portion evaluates fine, but the keyboard macro is where it's failing
Defun starts here
(defun reinit ()
"reloads .emacs file "
(load "/home/phoenix/.emacs"))
keyboard shortcut starts here
(global-set-key (kbd "C-c r") 'reinit)
in ielm both evalute as reinit, however, if I attempt to reload and run I get wrong type argument: commandp, reinit
Any ideas on how to get this working? I'm using Emacs 26.3.
Thanks!
Thanks for the assistance #steve-vinoski.
I went back and read it again, and I was able to figure it out.
In case anyone else has this issue with 26.3 or 27.1, don't write a separate defun then call it later - it won't work.
On one line only do the enter this ("C-c r" maps to Control-C then r, change that to what ever you want!)
(global-set-key (kbd "C-c r") (lambda () (interactive) (load "/your/home/directory/.emacs")))
It works like a champ! Thanks again!
(change the your/home/directory/.emacs to whatever you call your init file and point it to wherever it lives in your directory.
This question already has answers here:
How do I "M-x replace-string" across all buffers in emacs?
(4 answers)
emacs: interactively search open buffers
(7 answers)
Closed 8 years ago.
How do I replace string across all open buffers in emacs?
I found this on internet but option 'Y' to change all buffers in one shot doesn't work and I need to change one buffer for time with '!' option.
;; Query Replace in open Buffers
(defun query-replace-in-open-buffers (arg1 arg2)
"query-replace in open files"
(interactive "sQuery Replace in open Buffers: \nsquery with: ")
(mapcar
(lambda (x)
(find-file x)
(save-excursion
(beginning-of-buffer)
(query-replace arg1 arg2)))
(delq
nil
(mapcar
(lambda (x)
(buffer-file-name x))
(buffer-list)))))
Easy, just use multi-occur-in-matching-buffers and then press e
for occur-edit-mode. Then query-replace I guess. Finish off with C-c C-c. And don't forget to save all changed buffers.
With Icicles, Use C-u C-c ' in Icicle mode. That searches a subset you choose
of the open buffers (or all of them).
See also https://stackoverflow.com/a/7137348/729907.
This question already has an answer here:
Emacs: How to use a major mode for non-standard file extension
(1 answer)
Closed 8 years ago.
Does anyone know how I can get Emacs Live to recognize Hoplon (hl)? These hl files should be treated as a clojurescript file.
If you use both HTML and s-expression syntax you may want to use the .cljs.hl and .html.hl extensions to help emacs differentiate between them. So you may want something like:
(add-to-list 'auto-mode-alist '("\\.html\\.hl\\'" . html-mode))
(add-to-list 'auto-mode-alist '("\\.cljs\\.hl\\'" . clojure-mode))
As stated in the comment(s),
(add-to-list 'auto-mode-alist '("\\.hl" . clojurescript-mode))
Should do the trick.
This question already has answers here:
Viper mode in all modes
(2 answers)
Closed 8 years ago.
I've set up my emacs so that it automatically uses Octave mode when I open a .m file (really I'm working on Matlab files). I like to use viper-mode.
However, when I open a .m file, viper mode gets turned off, and I have to manually
restart it. Is there a way to modify my configuration so that viper mode stays on?
.emacs.d/init.el:
(setq viper-mode t)
(require 'viper)
(require 'vista-c-style)
(add-hook 'c-mode-common-hook 'vista-set-c-style)
(add-to-list 'auto-mode-alist '("\\.h" . c++-mode)) ;; open .h files in c++ mode
;; octave mode
(autoload 'octave-mode "octave-mod" nil t)
(setq auto-mode-alist
(cons '("\\.m$" . octave-mode) auto-mode-alist) )
;; other config (relate to org-mode) and definition of 'vista-c-style are snipped
This
(add-to-list 'viper-vi-state-mode-list 'octave-mode)
adapted from this question worked.
This question already has answers here:
Emacs: check for no-window-system in .emacs
(2 answers)
Closed 8 years ago.
there are portions of my .emacs file that I would like to behave differently depending if emacs was opened in a terminal (ie, emacs -nw) or in a window. How does one go about detecting this?
In my FSF .emacs, I have code like this:
(if (null window-system)
(global-set-key "\C-h" 'delete-backward-char))
It looks like this works under XEmacs as well, though the preferred XEmacs way is to use the console-type function instead. Do M-x describe-function on console-type for details.