From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: C-x 3 (split-window-horizontally) & C-x 1 (delete-other-windows) Date: Mon, 05 May 2008 20:44:41 +0200 Message-ID: <87hcdcio9y.fsf@baldur.tsdh.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1210013188 14724 80.91.229.12 (5 May 2008 18:46:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 May 2008 18:46:28 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 05 20:47:04 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jt5iE-0007Uo-RL for ged-emacs-devel@m.gmane.org; Mon, 05 May 2008 20:46:59 +0200 Original-Received: from localhost ([127.0.0.1]:56361 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jt5hX-0001YP-1x for ged-emacs-devel@m.gmane.org; Mon, 05 May 2008 14:46:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jt5g3-0000eV-7X for emacs-devel@gnu.org; Mon, 05 May 2008 14:44:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jt5g2-0000cs-2a for emacs-devel@gnu.org; Mon, 05 May 2008 14:44:42 -0400 Original-Received: from [199.232.76.173] (port=50502 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jt5g1-0000cZ-Ki for emacs-devel@gnu.org; Mon, 05 May 2008 14:44:41 -0400 Original-Received: from out4.smtp.messagingengine.com ([66.111.4.28]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jt5g1-0008U7-7p for emacs-devel@gnu.org; Mon, 05 May 2008 14:44:41 -0400 Original-Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 3919D104EDD for ; Mon, 5 May 2008 14:44:39 -0400 (EDT) Original-Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 05 May 2008 14:44:39 -0400 X-Sasl-enc: Rj7JLGILRla/k3q6lJX444kQzrDY3Q44QakBxi0K8P8y 1210013078 Original-Received: from baldur.tsdh.de (p54AF26E6.dip0.t-ipconnect.de [84.175.38.230]) by mail.messagingengine.com (Postfix) with ESMTPA id 4D89D27E25 for ; Mon, 5 May 2008 14:44:38 -0400 (EDT) Mail-Followup-To: emacs-devel@gnu.org In-Reply-To: (Sam Steingold's message of "Mon, 05 May 2008 14:16:26 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:96524 Archived-At: "Sam Steingold" writes: Hi Sam, > When I split the emacs window horizontally and maximize the frame (X > window), I get two 80-char-wide buffers + wide menu bar which can > accommodate even the dired menus, which is very convenient. I see 2 > issues with this arrangement: > > 1. even though I can imagine that I might want to have one 160-char-wide > window every once in a while, by far the more common situation would > be wanting to preserve 2 columns. Thus I would want C-x 1 to delete > all other windows in the current column and leave the other column > intact (as if the other column were a separate frame glued to this > one side by side) Yes, that's my preference, too. I've bound the function `th-delete-other-windows' to `C-x 1' to get that behavior. --8<---------------cut here---------------start------------->8--- (require 'windmove) (defun th-delete-other-windows-vertically () "Delete all windows above or below the current window." (interactive) (let ((win (selected-window))) (save-excursion (while (condition-case nil (windmove-up) (error nil)) (delete-window) (select-window win)) (while (condition-case nil (windmove-down) (error nil)) (delete-window) (select-window win))))) (defun th-delete-other-windows-horizontally () "Delete all windows left or right of the current window." (interactive) (let ((win (selected-window))) (save-excursion (while (condition-case nil (windmove-left) (error nil)) (delete-window) (select-window win)) (while (condition-case nil (windmove-right) (error nil)) (delete-window) (select-window win))))) (defun th-delete-other-windows (&optional arg) "If ARG is 1 (no prefix arg given) or 2 delete all windows which are above or below the current window. If ARG is 3 delete all windows which are left or right of the current window. If prefix arg is negative, delete all other windows." (interactive "p") (cond ((< arg 0) (delete-other-windows)) ((= arg 2) (th-delete-other-windows-vertically)) ((= arg 3) (th-delete-other-windows-horizontally)) (t (th-delete-other-windows-vertically)))) --8<---------------cut here---------------end--------------->8--- A bit hackish, but works. > 2. it would be nice to be able to drag the separator between the columns > with the mouse to resize the windows, much like it is done with the > vertically split windows (one can drag the mode line). Well, here that's possible. The mouse pointer turns to <-> on the right fringe of the left window. Bye, Tassilo