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

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

Re: defun not working


From: Alan Mackenzie
Subject: Re: defun not working
Date: Wed, 20 Jul 2005 09:28:40 +0000
User-agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686))

Baloff <vddr2u@bi.edu.gr> wrote on Tue, 19 Jul 2005 04:56:26 -0700:
> Hello
> I have this in my ~/.emacs

> (defun edo-vertical-to-horizontal ()
> (interactive)
> (let ((one-buf (window-buffer (selected-window))))
> (other-window 1)
> (delete-other-window)
> (split-window-horizontally)
> (switch-to-buffer one-buf))

I don't think that's _quite_ what you've got in your .emacs:  I think in
your real .emacs you've got (delete-other-windows)
                                                ^
                                                |

, and there's an extra parenthesis at the end, to balance the one opening
the defun.  You seem to be using Mozilla on Windows NT.  Have you been
having trouble copying and pasting text from Emacs into Mozilla?

> upone M-x edo-vertical-to-horizontal
> it actually do horizontal to vertical which is the opposite to what it 
> is suppost to do. it was working good last time I used it which was a 
> year or so ago, I since upgraded my debain.

What the function does for me is to change this layout:

*******************************
*                             *
*                             *
*******************************
*                             *
*                             *
*******************************

to this one:

*******************************
*              *              *
*              *              *
*              *              *
*              *              *
*              *              *
*******************************

> not sure why it would do this.

`split-window-horizonally' means "split so that to go between the
resulting windows means moving horizontally", NOT "split so that the
resulting windows are separated by a horizontal line".  This seems
arbitrary, but the choice had to be made one way or the other.
Personally, I agree with you, and I think the choice was made the wrong
way - looking at the second of my diagrams, I imagine a sword swiping
VERTICALLY through a sheet of paper.

> thanks

THANK YOU for this function!  I've been doing this with the clumsy double
sequence C-x 1, C-x 3 for years, and never quite consciously realised
what a hassle this was.  So, I've now put this into my .emacs with this
key-binding:  (global-set-key "\C-cv 'edo-vertical-to-horizontal).  I've
also made the obvious other function, and bound (global-set-key "\C-ch
'edo-horizontal-to-vertical).

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").



reply via email to

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