unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Alan Mackenzie <acm@muc.de>
Subject: Re: defun not working
Date: Wed, 20 Jul 2005 09:28:40 +0000	[thread overview]
Message-ID: <8g5lbd.46.ln@acm.acm> (raw)
In-Reply-To: 42dbf89e$1_1@news.iprimus.com.au

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").

  parent reply	other threads:[~2005-07-20  9:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-19 11:56 defun not working Baloff
2005-07-18 21:41 ` Pascal Bourguignon
2005-07-18 21:56   ` Lennart Borgman
2005-07-19 15:20 ` Stefan Monnier
2005-07-20  9:28 ` Alan Mackenzie [this message]
2005-07-20 19:32   ` rgb
2005-07-21 12:44   ` Baloff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8g5lbd.46.ln@acm.acm \
    --to=acm@muc.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).