Why does :q kill my emacs?
I've been using viper up to now and would like to use the visual and inner word extensions provided by vimpulse. So I downloaded http://www.emacswiki.org/emacs/vimpulse.el, installed it in my lisp directory, and required it iso viper. However, I am frustrated by the fact that now :q or :wq completely kill emacs rather than the current buffer. This is not the case when I stick to viper. I have no idea how to figure this out, lease advise, Guivho.
That is the expected behavior in Vim. What you describe would lead believe that Vimpulse in its attempt to more closely emulate Vim causes it to behave that way. To achieve what you want in Vim you'd use :bd :bdel :bdelete which kills the current buffer - I would expect Vimpulse has that implemented given the change in behavior you described. dborba On Wed, Jan 26, 2011 at 3:40 AM, guivho <[email protected]> wrote:
I've been using viper up to now and would like to use the visual and inner word extensions provided by vimpulse.
So I downloaded http://www.emacswiki.org/emacs/vimpulse.el, installed it in my lisp directory, and required it iso viper.
However, I am frustrated by the fact that now :q or :wq completely kill emacs rather than the current buffer.
This is not the case when I stick to viper.
I have no idea how to figure this out, lease advise,
Guivho.
_______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
Yes, but it's quite annoying when you use emacs in daemon/client mode... On Wed, 26 Jan 2011 at 03:59:03 -0500, Daniel Borba wrote:
That is the expected behavior in Vim. What you describe would lead believe that Vimpulse in its attempt to more closely emulate Vim causes it to behave that way. To achieve what you want in Vim you'd use :bd :bdel :bdelete which kills the current buffer - I would expect Vimpulse has that implemented given the change in behavior you described.
dborba
On Wed, Jan 26, 2011 at 3:40 AM, guivho <[email protected]> wrote:
I've been using viper up to now and would like to use the visual and inner word extensions provided by vimpulse.
So I downloaded http://www.emacswiki.org/emacs/vimpulse.el, installed it in my lisp directory, and required it iso viper.
However, I am frustrated by the fact that now :q or :wq completely kill emacs rather than the current buffer.
This is not the case when I stick to viper.
I have no idea how to figure this out, lease advise,
Guivho.
_______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
_______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
-- Félix
On Wed, Jan 26, 2011 at 09:59, Daniel Borba <[email protected]> wrote:
That is the expected behavior in Vim. What you describe would lead believe
I think that this is not correct. From the vim help file: :q[uit] Quit the current window. Quit Vim if this is the last window. This fails when changes have been made and Vim refuses to |abandon| the current buffer, and when the last file in the argument list has not been edited. If there are other tab pages and quitting the last window in the current tab page the current tab page is closed |tab-page|.
that Vimpulse in its attempt to more closely emulate Vim causes it to behave that way. To achieve what you want in Vim you'd use :bd :bdel :bdelete which kills the current buffer - I would expect Vimpulse has that implemented given the change in behavior you described.
Anyhow I really would like to be able to :wq without loosing emacs. I don't think one can thing that this can only be achieved by :w followed by :bd So please advise about how to setup so that :q quits the current buffer, preferably without changing my window configuration. TIA, guivho.
I think that this is not correct. From the vim help file:
:q[uit] Quit the current window. Quit Vim if this is the last window. This fails when changes have been made and Vim refuses to |abandon| the current buffer, and when the last file in the argument list has not been edited. If there are other tab pages and quitting the last window in the current tab page the current tab page is closed |tab-page|.
I do think I over simplified the answer the first time around. However, all the details of vim documentation for the different types of quits, closing/hiding windows, closing/hiding/unloading buffers is a bit overwhelming and probably unnecessary for this specific problem. As noted in the documentation :q targets a Vim window (view) in a tab-page - if you only have one, Vim quits. An easy example of the behavior within vim is when you use :h - in that case :q closes the help but not Vim). How that related to Vimpulse & the different states of emacs I am not sure. Anyhow I really would like to be able to :wq without loosing emacs. I
don't think one can thing that this can only be achieved by :w followed by :bd
So please advise about how to setup so that :q quits the current buffer, preferably without changing my window configuration.
While others have already made other suggestions, to write & close a buffer, :w | bd suffices, though it uses more keystrokes than :wq.
On 2011-01-26 09:40, Guivho wrote:
However, I am frustrated by the fact that now :q or :wq completely kill emacs rather than the current buffer.
This is not the case when I stick to viper.
For an immediate fix, you can revert to the original Viper behavior by setting `vimpulse-want-quit-like-Vim' to nil before loading Vimpulse: (setq vimpulse-want-quit-like-Vim nil) (require 'vimpulse) I'm all ears to suggestions regarding daemon/client mode. Maybe :q should call `server-edit' (bound to "C-x #" by server.el) when the buffer was initiated by emacsclient? -- Vegard
Hi Vegard,
For an immediate fix, you can revert to the original Viper behavior by setting `vimpulse-want-quit-like-Vim' to nil before loading Vimpulse:
(setq vimpulse-want-quit-like-Vim nil) (require 'vimpulse)
Thanks, that fixes the issue I had with vimpulse.
I'm all ears to suggestions regarding daemon/client mode. Maybe :q should call `server-edit' (bound to "C-x #" by server.el) when the buffer was initiated by emacsclient?
That sounds very reasonable to me. Right now I achieve this through my own mapping, but hey, if it'd be automatic with a :wq, that would be a nice touch! Guivho
On Wed, Jan 26, 2011 at 11:14 AM, Vegard Øye <[email protected]> wrote:
On 2011-01-26 09:40, Guivho wrote: I'm all ears to suggestions regarding daemon/client mode. Maybe :q should call `server-edit' (bound to "C-x #" by server.el) when the buffer was initiated by emacsclient?
I'm new to Vimpulse, so please forgive me if the following doesn't make sense. When coming from Vim, you're used to have many Vim instances which you often quit. When working with Vimpulse and emacsclient, you have one emacs instance instead and the pattern to use :q to close files doesn't make much sense anymore. But I'd prefer to learn using :bd or C-x # over redefining :q to mean something else than quit. Apart from that, if :q kills only a client, what would you use to quit emacs? Titus
Hi Titus
When coming from Vim, you're used to have many Vim instances which you
I'm coming from Vim (MacVim now, but on Ubuntu before, and before that on MS*) and I used to have a gvim window that I used for all my edits, using tab and window combinations and remote-silent-tab stuff etc. So I seldom did quit the Vim session, only buffers within it.
often quit. When working with Vimpulse and emacsclient, you have one emacs instance instead and the pattern to use :q to close files doesn't make much sense anymore. But I'd prefer to learn using :bd or C-x # over redefining :q to mean something else than quit.
Apart from that, if :q kills only a client, what would you use to quit emacs?
Who wants to quit emacs as a common task. Isn't this the thingie that yoou start automatically and stays alive for all your editing, directory browsing, eshelling etc... I rarely quit Emacs, but I frequently want to save and quit a buffer, so I prefer the viper way to do this in one sinle :wq command and I do think that it would be nice of this was combined with server-edit so that I even don't need to think about quitting differently if I am editing as a client to e.g. my gmail. I wouldn't mind to use C-x C-c to quit emacs on the rare occasions that I want to quit emacs. Guivho.
To me, :q should be bind to C-x C-c with emacsclient... On Wed, 26 Jan 2011 at 11:56:03 +0100, guivho wrote:
Hi Titus
When coming from Vim, you're used to have many Vim instances which you
I'm coming from Vim (MacVim now, but on Ubuntu before, and before that on MS*) and I used to have a gvim window that I used for all my edits, using tab and window combinations and remote-silent-tab stuff etc.
So I seldom did quit the Vim session, only buffers within it.
often quit. When working with Vimpulse and emacsclient, you have one emacs instance instead and the pattern to use :q to close files doesn't make much sense anymore. But I'd prefer to learn using :bd or C-x # over redefining :q to mean something else than quit.
Apart from that, if :q kills only a client, what would you use to quit emacs?
Who wants to quit emacs as a common task. Isn't this the thingie that yoou start automatically and stays alive for all your editing, directory browsing, eshelling etc...
I rarely quit Emacs, but I frequently want to save and quit a buffer, so I prefer the viper way to do this in one sinle :wq command and I do think that it would be nice of this was combined with server-edit so that I even don't need to think about quitting differently if I am editing as a client to e.g. my gmail.
I wouldn't mind to use C-x C-c to quit emacs on the rare occasions that I want to quit emacs.
Guivho.
_______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
-- Félix
Hi Felix,
To me, :q should be bind to C-x C-c with emacsclient...
Well, I do not have strong feelings about it. I have a two keystrokes mapping that calls my guivo-save-server-edit: (defun guivho-save-server-edit () "Save the buffer and perform a 'server-edit'." (interactive) (save-buffer) (server-edit)) I'm quite happy to keep using that mapping iso :wq Guivho
participants (7)
-
Daniel Borba -
Félix Sipma -
Guido Van Hoecke -
guivho -
guivho -
Titus von der Malsburg -
Vegard Øye