help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I make emacs open next directory in same window?


From: Rupert Swarbrick
Subject: Re: How can I make emacs open next directory in same window?
Date: Sat, 23 Aug 2008 23:39:33 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

ssecorp <address@hidden> writes:

> I have some things about emacs I find annoying.
>
> 1. If I have split emacs into 2 windows and in one I open a directory
> in one and click on them it will open in the other window, how can I
> make it open in the same window?

In dired.el, near the top of a loong initialisation of the dired keymap
(line 1191), there's a line like this:

(define-key map [mouse-2] 'dired-mouse-find-file-other-window)

Looking at the definition of dired-mouse-find-file-other-window, you
find:

Attachment: b.el
Description: application/emacs-lisp

(yes. Eek) So I would try something like the following:

Attachment: c.el
Description: application/emacs-lisp

Note that this is a bit rubbish - the only change is on the 3rd last
line of the function. If anyone knows whether it's possible to
dynamically bind dired-other-window to be dired for a sec while calling
the other version, it'd be a lot more elegant.

Anyway, that worked for me here!
>
> 2. If I have solit first into 2 vertical windows and then split one of
> them into 2 horizontal and I want to undo the last split, can I do
> that? C-x-1 undoes all...

Well this one's easy :)

C-x 0 deletes a window, so if you have the situation you described, when
you're in the window marked *

/-------------\
|  *   |      |
+-------------+
|      |      |
\-------------/

hitting C-x 0 will give you

/-------------\
|      *      |
+-------------+
|      |      |
\-------------/

etc.

>
> 3. If I want to split into 3 equally big windows and not split into 2
> then split one of them into 2, how would I do that?
> I want 1/3,1/3,1/3 not 1/2,1/4,1/4

I didn't know of existing code to do this, so I hacked something up
myself:

Attachment: a.el
Description: application/emacs-lisp

Exercise for reader: Deal with the rounding errors that I've completely
ignored.

That said, it seems to work reasonably well here!


Rupert

Attachment: pgpcxePsjOKJN.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]