* How can I change the default loading buffer?
@ 2015-07-29 10:17 Navy Cheng
2015-07-29 13:54 ` kastian
0 siblings, 1 reply; 20+ messages in thread
From: Navy Cheng @ 2015-07-29 10:17 UTC (permalink / raw)
To: help-gnu-emacs; +Cc: Navy Cheng
Hello,
When I open emacs, the default buffer is *GNU Emacs*. How can I change
it to *shell*?
I have add
(shell)
(switch-to-buffer "*shell*")
to the end of *.emacs*. (shell) is success, but the default buffer is
not changed.
Thanks.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How can I change the default loading buffer?
2015-07-29 10:17 How can I change the default loading buffer? Navy Cheng
@ 2015-07-29 13:54 ` kastian
2015-07-29 14:32 ` kastian
0 siblings, 1 reply; 20+ messages in thread
From: kastian @ 2015-07-29 13:54 UTC (permalink / raw)
To: Navy Cheng; +Cc: help-gnu-emacs
Hello
(switch-to-buffer (get-buffer-create (shell)))
to the ent of .emacs
On Wed, Jul 29, 2015 at 06:17:42PM +0800, Navy Cheng wrote:
> Hello,
> When I open emacs, the default buffer is *GNU Emacs*. How can I change
> it to *shell*?
>
> I have add
>
> (shell)
> (switch-to-buffer "*shell*")
>
> to the end of *.emacs*. (shell) is success, but the default buffer is
> not changed.
> Thanks.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How can I change the default loading buffer?
2015-07-29 13:54 ` kastian
@ 2015-07-29 14:32 ` kastian
2015-07-29 17:31 ` Navy Cheng
0 siblings, 1 reply; 20+ messages in thread
From: kastian @ 2015-07-29 14:32 UTC (permalink / raw)
To: Navy Cheng; +Cc: help-gnu-emacs
UPD
(switch-to-buffer (get-buffer-create (shell)))
This works only if you have also
(setq inhibit-startup-message t) ;; remove startup message
in .emacs
On Wed, Jul 29, 2015 at 04:54:51PM +0300, kastian@mail.ru wrote:
> Hello
>
> (switch-to-buffer (get-buffer-create (shell)))
>
> to the ent of .emacs
>
> On Wed, Jul 29, 2015 at 06:17:42PM +0800, Navy Cheng wrote:
> > Hello,
> > When I open emacs, the default buffer is *GNU Emacs*. How can I change
> > it to *shell*?
> >
> > I have add
> >
> > (shell)
> > (switch-to-buffer "*shell*")
> >
> > to the end of *.emacs*. (shell) is success, but the default buffer is
> > not changed.
> > Thanks.
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How can I change the default loading buffer?
2015-07-29 14:32 ` kastian
@ 2015-07-29 17:31 ` Navy Cheng
2015-07-29 20:11 ` Robert Thorpe
0 siblings, 1 reply; 20+ messages in thread
From: Navy Cheng @ 2015-07-29 17:31 UTC (permalink / raw)
To: kastian; +Cc: help-gnu-emacs
Thanks for you answer. *inhibit-startup-message* seems to be the key.
When I set the variable, my method is OK. But your .emacs seems to be
smarter.
On Wed, Jul 29, 2015 at 05:32:05PM +0300, kastian@mail.ru wrote:
> UPD
>
> (switch-to-buffer (get-buffer-create (shell)))
>
> This works only if you have also
>
> (setq inhibit-startup-message t) ;; remove startup message
>
> in .emacs
>
> On Wed, Jul 29, 2015 at 04:54:51PM +0300, kastian@mail.ru wrote:
> > Hello
> >
> > (switch-to-buffer (get-buffer-create (shell)))
> >
> > to the ent of .emacs
> >
> > On Wed, Jul 29, 2015 at 06:17:42PM +0800, Navy Cheng wrote:
> > > Hello,
> > > When I open emacs, the default buffer is *GNU Emacs*. How can I change
> > > it to *shell*?
> > >
> > > I have add
> > >
> > > (shell)
> > > (switch-to-buffer "*shell*")
> > >
> > > to the end of *.emacs*. (shell) is success, but the default buffer is
> > > not changed.
> > > Thanks.
> >
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How can I change the default loading buffer?
2015-07-29 17:31 ` Navy Cheng
@ 2015-07-29 20:11 ` Robert Thorpe
2015-07-29 22:43 ` Emanuel Berg
0 siblings, 1 reply; 20+ messages in thread
From: Robert Thorpe @ 2015-07-29 20:11 UTC (permalink / raw)
To: Navy Cheng; +Cc: help-gnu-emacs
Navy Cheng <navych@126.com> writes:
> Thanks for you answer. *inhibit-startup-message* seems to be the key.
> When I set the variable, my method is OK. But your .emacs seems to be
> smarter.
You should probably put this in the emacs-startup-hook rather than at
the end of your init file.
See this node in the Emacs Lisp Manual and figure out where you want it
to happen in relation to other things: (info "(elisp)Startup Summary") .
If you want it in that hook do:
(add-hook 'emacs-startup-hook
(lambda ()
(switch-to-buffer (get-buffer-create (shell)))))
BR,
Robert Thorpe
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How can I change the default loading buffer?
2015-07-29 20:11 ` Robert Thorpe
@ 2015-07-29 22:43 ` Emanuel Berg
2015-07-30 0:38 ` Robert Thorpe
0 siblings, 1 reply; 20+ messages in thread
From: Emanuel Berg @ 2015-07-29 22:43 UTC (permalink / raw)
To: help-gnu-emacs
Robert Thorpe <rt@robertthorpeconsulting.com> writes:
> See this node in the Emacs Lisp Manual and figure
> out where you want it to happen in relation to other
> things: (info "(elisp)Startup Summary") .
>
> If you want it in that hook do:
>
> (add-hook 'emacs-startup-hook (lambda ()
> (switch-to-buffer (get-buffer-create (shell)))))
You mean so not to interfere with batch mode Emacs and
other (?) stuff like that? Well, yeah, but just
putting Emacs in some mode and displaying some buffer
shouldn't disturb that, should it?
For example, I have this last in my .emacs:
;; no fanfare / init
(setq inhibit-startup-screen t)
(setq inhibit-startup-echo-area-message "incal")
;; scratch buffer
(require 'buc)
(setq initial-scratch-message nil)
(let ((scratch-buffer "*scratch*"))
(when (member scratch-buffer (buffer-names))
(kill-buffer scratch-buffer) ))
;; starting point
(call-interactively 'w3m)
(cd "~/")
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How can I change the default loading buffer?
2015-07-29 22:43 ` Emanuel Berg
@ 2015-07-30 0:38 ` Robert Thorpe
2015-07-30 1:58 ` Emanuel Berg
0 siblings, 1 reply; 20+ messages in thread
From: Robert Thorpe @ 2015-07-30 0:38 UTC (permalink / raw)
To: help-gnu-emacs; +Cc: Emanuel Berg
Emanuel Berg <embe8573@student.uu.se> writes:
> Robert Thorpe <rt@robertthorpeconsulting.com> writes:
>
>> See this node in the Emacs Lisp Manual and figure
>> out where you want it to happen in relation to other
>> things: (info "(elisp)Startup Summary") .
>>
>> If you want it in that hook do:
>>
>> (add-hook 'emacs-startup-hook (lambda ()
>> (switch-to-buffer (get-buffer-create (shell)))))
>
> You mean so not to interfere with batch mode Emacs and
> other (?) stuff like that? Well, yeah, but just
> putting Emacs in some mode and displaying some buffer
> shouldn't disturb that, should it?
Batch mode is one aspect of it.
Another is packages. Package-initialize runs after the init file is
loaded. Suppose a package is used that affects the operations of M-x
shell (e.g. bash-completion.el). That package may need initializing
prior to shell-mode starting to function correctly.
If you run in a terminal then there can be terminal specific elisp
libraries. That library is selected and loaded after the init file.
So, if M-x shell depends on it being already loaded there will be
problems. I don't know that it does, but it legitimately could. The
colour set could be different in the shell started at init to elsewhere.
> ;; starting point
> (call-interactively 'w3m)
> (cd "~/")
The way I use Emacs that would work fine too, but it's not universal.
BR,
Robert Thorpe
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How can I change the default loading buffer?
2015-07-30 0:38 ` Robert Thorpe
@ 2015-07-30 1:58 ` Emanuel Berg
2015-08-02 15:56 ` Robert Thorpe
0 siblings, 1 reply; 20+ messages in thread
From: Emanuel Berg @ 2015-07-30 1:58 UTC (permalink / raw)
To: help-gnu-emacs
Robert Thorpe <rt@robertthorpeconsulting.com> writes:
> Batch mode is one aspect of it.
>
> Another is packages. Package-initialize runs after
> the init file is loaded. Suppose a package is used
> that affects the operations of M-x shell (e.g.
> bash-completion.el). That package may need
> initializing prior to shell-mode starting to
> function correctly.
>
> If you run in a terminal then there can be terminal
> specific elisp libraries. That library is selected
> and loaded after the init file. So, if M-x shell
> depends on it being already loaded there will be
> problems. I don't know that it does, but it
> legitimately could. The colour set could be
> different in the shell started at init to elsewhere.
OK, so what is the method to find out (or rule of
thumb) what you shouldn't put directly into .emacs but
instead into `emacs-startup-hook'?
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How can I change the default loading buffer?
2015-07-30 1:58 ` Emanuel Berg
@ 2015-08-02 15:56 ` Robert Thorpe
2015-08-05 20:19 ` get Elisp reference to info files (was: Re: How can I change the default loading buffer?) Emanuel Berg
[not found] ` <mailman.7859.1438806073.904.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 20+ messages in thread
From: Robert Thorpe @ 2015-08-02 15:56 UTC (permalink / raw)
To: Emanuel Berg; +Cc: help-gnu-emacs
Emanuel Berg <embe8573@student.uu.se> writes:
> OK, so what is the method to find out (or rule of
> thumb) what you shouldn't put directly into .emacs but
> instead into `emacs-startup-hook'?
Have a look at (info "(elisp)Startup Summary") and see if any of it
applies to you. Check from the bottom of the list up.
You can only delay things as far at step 24, so there's little
use in worrying much about the earlier steps. For people who use the
session manager and --daemon they could cause problems though.
This is how it is for me, going backwards, last step first:
* 24. `emacs-startup-hook' and `term-setup-hook' are run.
* 23. initial-buffer-choice. Because the initial-buffer-choice is set
here, what happens in emacs-startup-hook can change it. What happens in
the init file can't though. I use this feature. I setup
initial-buffer-choice to my ToDo file. In emacs-startup-hook I look for
a bookmark into my init file, if it exists then I jump to it.
* 22. Exit point for --batch. If you use Emacs a lot in batch mode
it's worth doing a lot of visual stuff in emacs-startup-hook because
that way it won't slow down your batch programs.
* 21. Other command line options. I think this includes files
specified on the command line.
* 20. Initial echo area message. Not very important.
* 19. Terminal specific lisp library. This can be important if you use
terminal emulation and need one of these. I've never had to worry about
this.
* 18. Set the mode of *scratch*.
* 17. Run after-init-hook.
* 16. Set after-init-time. I think this is used in measuring how fast
Emacs init is. If you use after-init-hook or emacs-startup-hook then
the stuff in those isn't measured. In different situations you may want
that or not want it. You can always put everything into the init file
temporarily just to see how long the full init takes.
* 15. Initialize packages. This is important, packages aren't
initialized in the init file. There has been some discussion about
changing this. Many people change it by putting package-initialize in
their init file.
* 14. Load abbrevs. Abbrevs are rarely used programmatically so I
don't think this matters much.
* 13. Load "default" library. I've never used that.
* 12. Loading of the init file.
BR,
Robert Thorpe
^ permalink raw reply [flat|nested] 20+ messages in thread
* get Elisp reference to info files (was: Re: How can I change the default loading buffer?)
2015-08-02 15:56 ` Robert Thorpe
@ 2015-08-05 20:19 ` Emanuel Berg
[not found] ` <mailman.7859.1438806073.904.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 20+ messages in thread
From: Emanuel Berg @ 2015-08-05 20:19 UTC (permalink / raw)
To: help-gnu-emacs
Robert Thorpe <rt@robertthorpeconsulting.com> writes:
>> OK, so what is the method to find out (or rule of
>> thumb) what you shouldn't put directly into .emacs
>> but instead into `emacs-startup-hook'?
>
> Have a look at (info "(elisp)Startup Summary") and see
> if any of it applies to you. Check from the bottom of
> the list up.
OK!
In another thread, I asked how to automatically get
that kind of Elisp references to the info files.
I don't know if anyone replied to that, if so I missed
it, but here is a function that has proved to work in
the two cases I have tested it:
(defun Info-get-reference ()
(interactive)
(let*((field (car (last (split-string Info-current-file "/"))))
(topic Info-current-node)
(ref (format "(info \"(%s)%s\")" field topic) ))
(message "Killed: %s" ref)
(kill-new ref)) )
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 20+ messages in thread
[parent not found: <mailman.7859.1438806073.904.help-gnu-emacs@gnu.org>]
* Re: get Elisp reference to info files
[not found] ` <mailman.7859.1438806073.904.help-gnu-emacs@gnu.org>
@ 2015-08-06 1:23 ` Ted Zlatanov
2015-08-07 22:41 ` Emanuel Berg
0 siblings, 1 reply; 20+ messages in thread
From: Ted Zlatanov @ 2015-08-06 1:23 UTC (permalink / raw)
To: help-gnu-emacs
On Wed, 05 Aug 2015 22:19:20 +0200 Emanuel Berg <embe8573@student.uu.se> wrote:
EB> Robert Thorpe <rt@robertthorpeconsulting.com> writes:
>> Have a look at (info "(elisp)Startup Summary") and see
EB> In another thread, I asked how to automatically get
EB> that kind of Elisp references to the info files.
EB> I don't know if anyone replied to that, if so I missed
EB> it, but here is a function that has proved to work in
EB> the two cases I have tested it:
EB> (defun Info-get-reference ()
EB> (interactive)
EB> (let*((field (car (last (split-string Info-current-file "/"))))
EB> (topic Info-current-node)
EB> (ref (format "(info \"(%s)%s\")" field topic) ))
EB> (message "Killed: %s" ref)
EB> (kill-new ref)) )
In an Info page, `w' will copy the reference to the current node (the
`(%s)%s' part of your format string).
Ted
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: get Elisp reference to info files
2015-08-06 1:23 ` get Elisp reference to info files Ted Zlatanov
@ 2015-08-07 22:41 ` Emanuel Berg
2015-08-07 23:06 ` John Mastro
0 siblings, 1 reply; 20+ messages in thread
From: Emanuel Berg @ 2015-08-07 22:41 UTC (permalink / raw)
To: help-gnu-emacs
Ted Zlatanov <tzz@lifelogs.com> writes:
> In an Info page, `w' will copy the reference to the
> current node (the `(%s)%s' part of your format
> string).
OK, so it will look like this:
(defun Info-get-reference ()
(interactive)
(let*((node (Info-copy-current-node-name))
(ref (format "(info \"%s\")" node)) )
(message "Killed: %s" ref)
(kill-new ref)) )
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: get Elisp reference to info files
2015-08-07 22:41 ` Emanuel Berg
@ 2015-08-07 23:06 ` John Mastro
2015-08-07 23:19 ` Emanuel Berg
0 siblings, 1 reply; 20+ messages in thread
From: John Mastro @ 2015-08-07 23:06 UTC (permalink / raw)
To: help-gnu-emacs@gnu.org
>> In an Info page, `w' will copy the reference to the
>> current node (the `(%s)%s' part of your format
>> string).
>
> OK, so it will look like this:
>
> (defun Info-get-reference ()
> (interactive)
> (let*((node (Info-copy-current-node-name))
> (ref (format "(info \"%s\")" node)) )
> (message "Killed: %s" ref)
> (kill-new ref)) )
IIUC, `Info-copy-current-node-name' does exactly what you
want when called with a 0 argument.
--
john
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: get Elisp reference to info files
2015-08-07 23:06 ` John Mastro
@ 2015-08-07 23:19 ` Emanuel Berg
2015-08-07 23:25 ` John Mastro
0 siblings, 1 reply; 20+ messages in thread
From: Emanuel Berg @ 2015-08-07 23:19 UTC (permalink / raw)
To: help-gnu-emacs
John Mastro <john.b.mastro@gmail.com> writes:
> IIUC, `Info-copy-current-node-name' does exactly
> what you want when called with a 0 argument.
With that, I get:
(dir) Top
but I want, and now have:
(info "(dir) Top")
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: get Elisp reference to info files
2015-08-07 23:19 ` Emanuel Berg
@ 2015-08-07 23:25 ` John Mastro
2015-08-08 17:37 ` Robert Thorpe
2015-08-09 2:05 ` Emanuel Berg
0 siblings, 2 replies; 20+ messages in thread
From: John Mastro @ 2015-08-07 23:25 UTC (permalink / raw)
To: help-gnu-emacs@gnu.org
>> IIUC, `Info-copy-current-node-name' does exactly
>> what you want when called with a 0 argument.
>
> With that, I get:
>
> (dir) Top
>
> but I want, and now have:
>
> (info "(dir) Top")
Ah, maybe it's new in Emacs 25.
I get "(dir) Top" from `w' but "(info \"(dir) Top\")" from `M-0 w'.
--
john
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: get Elisp reference to info files
2015-08-07 23:25 ` John Mastro
@ 2015-08-08 17:37 ` Robert Thorpe
2015-08-09 1:24 ` Emanuel Berg
2015-08-09 2:05 ` Emanuel Berg
1 sibling, 1 reply; 20+ messages in thread
From: Robert Thorpe @ 2015-08-08 17:37 UTC (permalink / raw)
To: John Mastro; +Cc: help-gnu-emacs
John Mastro <john.b.mastro@gmail.com> writes:
>>> IIUC, `Info-copy-current-node-name' does exactly
>>> what you want when called with a 0 argument.
>>
>> With that, I get:
>>
>> (dir) Top
>>
>> but I want, and now have:
>>
>> (info "(dir) Top")
>
> Ah, maybe it's new in Emacs 25.
No, it works in Emacs 24.3. It's a good tip.
BR,
Robert Thorpe
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: get Elisp reference to info files
2015-08-07 23:25 ` John Mastro
2015-08-08 17:37 ` Robert Thorpe
@ 2015-08-09 2:05 ` Emanuel Berg
2015-08-09 2:23 ` John Mastro
1 sibling, 1 reply; 20+ messages in thread
From: Emanuel Berg @ 2015-08-09 2:05 UTC (permalink / raw)
To: help-gnu-emacs
John Mastro <john.b.mastro@gmail.com> writes:
>> With that, I get:
>>
>> (dir) Top
>>
>> but I want, and now have:
>>
>> (info "(dir) Top")
>
> Ah, maybe it's new in Emacs 25.
>
> I get "(dir) Top" from `w' but "(info \"(dir) Top\")"
> from `M-0 w'.
Right, I get that with `M-0 w' as well.
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2015-08-09 2:30 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-29 10:17 How can I change the default loading buffer? Navy Cheng
2015-07-29 13:54 ` kastian
2015-07-29 14:32 ` kastian
2015-07-29 17:31 ` Navy Cheng
2015-07-29 20:11 ` Robert Thorpe
2015-07-29 22:43 ` Emanuel Berg
2015-07-30 0:38 ` Robert Thorpe
2015-07-30 1:58 ` Emanuel Berg
2015-08-02 15:56 ` Robert Thorpe
2015-08-05 20:19 ` get Elisp reference to info files (was: Re: How can I change the default loading buffer?) Emanuel Berg
[not found] ` <mailman.7859.1438806073.904.help-gnu-emacs@gnu.org>
2015-08-06 1:23 ` get Elisp reference to info files Ted Zlatanov
2015-08-07 22:41 ` Emanuel Berg
2015-08-07 23:06 ` John Mastro
2015-08-07 23:19 ` Emanuel Berg
2015-08-07 23:25 ` John Mastro
2015-08-08 17:37 ` Robert Thorpe
2015-08-09 1:24 ` Emanuel Berg
2015-08-09 2:05 ` Emanuel Berg
2015-08-09 2:23 ` John Mastro
2015-08-09 2:30 ` Emanuel Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).