From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "rgb" Newsgroups: gmane.emacs.help Subject: Re: defun not working Date: 20 Jul 2005 12:32:21 -0700 Organization: http://groups.google.com Message-ID: <1121887941.783281.267360@f14g2000cwb.googlegroups.com> References: <42dbf89e$1_1@news.iprimus.com.au><8g5lbd.46.ln@acm.acm> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1121888086 6196 80.91.229.2 (20 Jul 2005 19:34:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 20 Jul 2005 19:34:46 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 20 21:34:45 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DvKK3-0000Sf-Iv for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Jul 2005 21:33:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DvKM6-00012l-Nn for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Jul 2005 15:35:46 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!f14g2000cwb.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Original-NNTP-Posting-Host: 198.74.20.118 Original-X-Trace: posting.google.com 1121887947 28375 127.0.0.1 (20 Jul 2005 19:32:27 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 20 Jul 2005 19:32:27 +0000 (UTC) User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: f14g2000cwb.googlegroups.com; posting-host=198.74.20.118; posting-account=C7LM4w0AAAD23IRuMuUUJVCLQTuHhTK8 Original-Xref: shelby.stanford.edu gnu.emacs.help:132515 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:28030 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:28030 > > 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)) > After using the above for a while you might become annoyed by the loss of your cursor position when switching views. So I use this. ;; Idea and starter code from Benjamin Rutt (rutt.4+news@osu.edu) ;; on comp.emacs. Enhanced by RGB. (defun rgb-window-horizontal-to-vertical () "Switches from a horizontal split to a vertical split." (interactive) (let ((one-buf (window-buffer (selected-window))) (buf-point (point))) (other-window 1) (delete-other-windows) (split-window-horizontally) (switch-to-buffer one-buf) (goto-char buf-point))) ;; complement of above created by RGB 11/2004 (defun rgb-window-vertical-to-horizontal () "Switches from a vertical split to a horizontal split." (interactive) (let ((one-buf (window-buffer (selected-window))) (buf-point (point))) (other-window 1) (delete-other-windows) (split-window-vertically) (switch-to-buffer one-buf) (goto-char buf-point)))