From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#32790: 27.0.50; point jumps unexpectedly after delete-window Date: Mon, 05 Nov 2018 00:07:35 +0200 Organization: LINKOV.NET Message-ID: <8736sgij28.fsf@mail.linkov.net> References: <87efdnsp2k.fsf@mail.linkov.net> <5BA490EA.4000502@gmx.at> <87bm8pxjcb.fsf@mail.linkov.net> <5BA74E75.8000405@gmx.at> <87zhw8nd8g.fsf@mail.linkov.net> <5BA8A143.9040604@gmx.at> <87sh1ybyo6.fsf@mail.linkov.net> <5BA9E390.8030506@gmx.at> <87pnx1h1op.fsf@mail.linkov.net> <5BAB489E.5090002@gmx.at> <87h8ibvrs2.fsf@mail.linkov.net> <5BAD2507.6040605@gmx.at> <87a7nedidg.fsf@mail.linkov.net> <5BC5A558.9010401@gmx.at> <87zhvd7mg9.fsf@mail.linkov.net> <5BC6E52F.2070209@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1541370076 18788 195.159.176.226 (4 Nov 2018 22:21:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 4 Nov 2018 22:21:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 32790@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 04 23:21:11 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJQlb-0004o1-Ko for geb-bug-gnu-emacs@m.gmane.org; Sun, 04 Nov 2018 23:21:11 +0100 Original-Received: from localhost ([::1]:60395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJQni-000354-2o for geb-bug-gnu-emacs@m.gmane.org; Sun, 04 Nov 2018 17:23:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJQnR-0002fh-UI for bug-gnu-emacs@gnu.org; Sun, 04 Nov 2018 17:23:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJQnO-0001RJ-Oh for bug-gnu-emacs@gnu.org; Sun, 04 Nov 2018 17:23:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58354) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gJQnO-0001RD-KF for bug-gnu-emacs@gnu.org; Sun, 04 Nov 2018 17:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gJQnO-0001yi-FL for bug-gnu-emacs@gnu.org; Sun, 04 Nov 2018 17:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Nov 2018 22:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32790 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32790-submit@debbugs.gnu.org id=B32790.15413701677545 (code B ref 32790); Sun, 04 Nov 2018 22:23:02 +0000 Original-Received: (at 32790) by debbugs.gnu.org; 4 Nov 2018 22:22:47 +0000 Original-Received: from localhost ([127.0.0.1]:34375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJQn9-0001xd-31 for submit@debbugs.gnu.org; Sun, 04 Nov 2018 17:22:47 -0500 Original-Received: from bisque.maple.relay.mailchannels.net ([23.83.214.18]:46712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJQn7-0001xV-8L for 32790@debbugs.gnu.org; Sun, 04 Nov 2018 17:22:45 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 301DF41F11; Sun, 4 Nov 2018 22:22:44 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a60.g.dreamhost.com (unknown [100.96.26.166]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id EDF9441F00; Sun, 4 Nov 2018 22:22:43 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a60.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Sun, 04 Nov 2018 22:22:44 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Grain-Reign: 34e4e5d11d2c0d27_1541370164066_1426178405 X-MC-Loop-Signature: 1541370164066:355429534 X-MC-Ingress-Time: 1541370164065 Original-Received: from pdx1-sub0-mail-a60.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a60.g.dreamhost.com (Postfix) with ESMTP id B60048027D; Sun, 4 Nov 2018 14:22:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=Oq24SL/3O80ocPbWxVeDS6rsDkA=; b= FQO0PEtcl0CoXFjBAZwVtuRa4fJuAB6CFvMkgo9UHQ0eNzPxLtc+8RbmaDj5iNKU igdhTG37/sp7WeOfaLZHrb8gmD8eeLChXe4ii+0RJ8hzRaBH1n2z8iNDFlDlmld3 y8NN8tMkXCb/cac49QeQPQy/QIpr8S/yjvZRlJNxuoo= Original-Received: from mail.jurta.org (m91-129-101-157.cust.tele2.ee [91.129.101.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a60.g.dreamhost.com (Postfix) with ESMTPSA id 334448027B; Sun, 4 Nov 2018 14:22:41 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a60 In-Reply-To: <5BC6E52F.2070209@gmx.at> (martin rudalics's message of "Wed, 17 Oct 2018 09:30:55 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrjeeggddtiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtuddrudehjeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutddurdduheejpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtoheprhhuuggrlhhitghssehgmhigrdgrthenucevlhhushhtvghrufhiiigvpedt X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:152032 Archived-At: > Here drags the character under the cursor by one character to > the left and drags the current line up by one line. I use > for selecting the window on the left. either > deletes the window on the left of the selected window provided there > is one or makes a new window on the left of the selected window > provided the selected window is already on the left of the frame. Making a new window is especially good idea. So I implemented this feature in windmove.el: diff --git a/lisp/windmove.el b/lisp/windmove.el index 42e10b591f..69f2a9665a 100644 --- a/lisp/windmove.el +++ b/lisp/windmove.el @@ -149,6 +149,15 @@ windmove-wrap-around :type 'boolean :group 'windmove) +(defcustom windmove-create-window nil + "Whether movement off the edge of the frame creates a new window. +If this variable is set to t, moving left from the leftmost window in +a frame will create a new window on the left, and similarly for the other +directions." + :type 'boolean + :group 'windmove + :version "27.1") + ;; If your Emacs sometimes places an empty column between two adjacent ;; windows, you may wish to set this delta to 2. (defcustom windmove-window-distance-delta 1 @@ -471,8 +480,15 @@ windmove-find-other-window (defun windmove-do-window-select (dir &optional arg window) "Move to the window at direction DIR. DIR, ARG, and WINDOW are handled as by `windmove-other-window-loc'. -If no window is at direction DIR, an error is signaled." +If no window is at direction DIR, an error is signaled. +If `windmove-create-window' is non-nil, instead of signalling an error +it creates a new window at direction DIR ." (let ((other-window (windmove-find-other-window dir arg window))) + (when (and windmove-create-window + (or (null other-window) + (and (window-minibuffer-p other-window) + (not (minibuffer-window-active-p other-window))))) + (setq other-window (split-window window nil dir))) (cond ((null other-window) (user-error "No window %s from selected window" dir)) ((and (window-minibuffer-p other-window) @@ -493,7 +509,8 @@ windmove-left \"left\" is relative to the position of point in the window; otherwise it is relative to the top edge (for positive ARG) or the bottom edge \(for negative ARG) of the current window. -If no window is at the desired location, an error is signaled." +If no window is at the desired location, an error is signaled +unless `windmove-create-window' is non-nil." (interactive "P") (windmove-do-window-select 'left arg)) @@ -504,7 +521,8 @@ windmove-up is relative to the position of point in the window; otherwise it is relative to the left edge (for positive ARG) or the right edge (for negative ARG) of the current window. -If no window is at the desired location, an error is signaled." +If no window is at the desired location, an error is signaled +unless `windmove-create-window' is non-nil." (interactive "P") (windmove-do-window-select 'up arg)) @@ -515,7 +533,8 @@ windmove-right \"right\" is relative to the position of point in the window; otherwise it is relative to the top edge (for positive ARG) or the bottom edge (for negative ARG) of the current window. -If no window is at the desired location, an error is signaled." +If no window is at the desired location, an error is signaled +unless `windmove-create-window' is non-nil." (interactive "P") (windmove-do-window-select 'right arg)) @@ -526,7 +545,8 @@ windmove-down \"down\" is relative to the position of point in the window; otherwise it is relative to the left edge (for positive ARG) or the right edge \(for negative ARG) of the current window. -If no window is at the desired location, an error is signaled." +If no window is at the desired location, an error is signaled +unless `windmove-create-window' is non-nil." (interactive "P") (windmove-do-window-select 'down arg))