From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: defun not working Date: Wed, 20 Jul 2005 09:28:40 +0000 Organization: muc.de e.V. -- private internet access Message-ID: <8g5lbd.46.ln@acm.acm> References: <42dbf89e$1_1@news.iprimus.com.au> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1121855238 32043 80.91.229.2 (20 Jul 2005 10:27:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 20 Jul 2005 10:27:18 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 20 12:27:07 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DvBn0-0008E5-L6 for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Jul 2005 12:26:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DvBp1-0008EO-J3 for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Jul 2005 06:29:04 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.gamma.ru!Gamma.RU!npeer.de.kpn-eurorings.net!news.csl-gmbh.net!informatik.tu-muenchen.de!news.muc.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 70 Original-NNTP-Posting-Host: acm.muc.de Original-X-Trace: marvin.muc.de 1121854376 21150 193.149.49.134 (20 Jul 2005 10:12:56 GMT) Original-X-Complaints-To: news-admin@muc.de Original-NNTP-Posting-Date: 20 Jul 2005 10:12:56 GMT User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686)) Original-Xref: shelby.stanford.edu gnu.emacs.help:132512 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:28026 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:28026 Baloff 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").