I use
(message "..some text...")
in my init file to send messages to the Message buffer while EMACS loads. This is a quick way for me to see where a change I have just made crashes the startup.
However, I have not been able to find a way view that buffer during the load and watch the messages scroll. I always have to switch to it after a loading failure to see where it occcured.
Is there anyway to view the messages being sent to the Messages buffer (not the echo line) while Emacs is processing the init file?
How about putting
(view-echo-area-messages)
at the beginning of your init.el?
Or if you instead want the messages buffer to take up the whole screen,
(with-current-buffer (messages-buffer)
(goto-char (point-max))
(switch-to-buffer (current-buffer)))
However, putting messages in your init-file is a crude workaround. You probably actually want to launch Emacs with the --debug-init option:
$ emacs --debug-init
This will halt on the error and present you with a backtrace.
Or alternatively, you could just M-x toggle-debug-on-error and reload your init-file (M-x load-file RET ~/.emacs.d/init.el RET).
Related
I'm trying to get TeXcount to work inside Emacs with AUCTeX. According to the TeXCount website, it should be possible to use the following to run texcount on the current buffer:
(require 'tex)
(add-to-list 'TeX-command-list
(list "TeXcount" "texcount %s.tex" 'TeX-run-command nil t))
When I run this, a buffer is created with the results, but the buffer does not open in the current window and is instead buried in the buffer list where I have to then go and look for it. How can I get AucTeX to open the buffer next to the one I'm currently looking at?
How can I make Emacs start in text-mode and get rid of the following message?
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.
To get rid of the start message just set the initial-scratch-message variable to ""
(setq initial-scratch-message "")
To start the scratch buffer in text mode you will want to initial-major-mode variable
(setq initial-major-mode 'text-mode)
For setting of auto-mode when you start a specific major-mode you'll want to add an event to the mode hook
(add-hook 'text-mode-hook 'turn-on-auto-fill)
Rather than fiddle with the way the scratch buffer works, I'd recommend you open Emacs with a file argument. E.g. if you do "emacs foo.txt" chances are it will already start up in text-mode without you having to do anything special for it.
You only do M-x text-mode in the scratch buffer.
That's all.
Is there a way to disable the Messages buffer? I know I can kill it, but it reappears. I know I can scroll through buffers without passing by Messages, but is there a way I can just disable the creation of it?
Thank you.
Based on the answer above, place this in your .emacs to completely disable the messages
;; Forces the messages to 0, and kills the *Messages* buffer - thus disabling it on startup.
(setq-default message-log-max nil)
(kill-buffer "*Messages*")
Also, if you're like me, this is how you remove the Completions buffer that appears when opening a new file from the buffer.
;; Disabled *Completions*
(add-hook 'minibuffer-exit-hook
'(lambda ()
(let ((buffer "*Completions*"))
(and (get-buffer buffer)
(kill-buffer buffer)))))
You can customize the variable message-log-max and give a value of nil to disable logging:
Maximum number of lines to keep in the message log buffer.
If nil, disable message logging. If t, log messages but don't truncate
the buffer when it becomes large.
I tried killing the *Messages* buffer, producing messages (that show on the minibuffer), and no new messages buffer appears.
How to view the files that are loaded by the emacs at start up.
I have put the following line in my .emacs file
(setq load-path (cons "~/org/org-mode/lisp/" load-path))
(require 'org-install)
and expect the file org-install.el to be displayed in the *Messages* buffer,
I have looked at the *Messages* buffer and not able to find any info on the org-install.* file name.
I use "load" rather than "require" in my .emacs because it appends a message to *Messages* regardless of whether is fails or succeeds.
If you are still confused, say ESC ESC : (load "~/org/org-mode/lisp/org-install.el") RET, and tell us what new messages have appeared in *Messages*.
When I open 3+ files in emacs, I get a split window with one of my files in the upper buffer and Buffer List in the lower buffer.
How can I get emacs to NOT put Buffer List there, but instead show another one of my files.
thanks. -John
Try this:
(setq inhibit-startup-buffer-menu t)
Documentation can be found here.
Note: This option was introduced in Emacs 22.
For Emacs 21 and before, you could add the following workaround to your .emacs which will force Emacs to only have one window visible upon startup:
(add-hook 'after-init-hook 'delayed-delete-other-windows)
(defun delayed-delete-other-windows ()
"need the call to happen after startup runs, so wait for idle"
(run-with-idle-timer 0 nil 'delete-other-windows))