From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#32790: 27.0.50; point jumps unexpectedly after delete-window Date: Thu, 22 Nov 2018 08:40:47 +0100 Message-ID: <5BF65D7F.2090805@gmx.at> References: <87efdnsp2k.fsf@mail.linkov.net> <5BA490EA.4000502@gmx.at> <87y39m9f8b.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1542872422 9899 195.159.176.226 (22 Nov 2018 07:40:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 22 Nov 2018 07:40:22 +0000 (UTC) Cc: 32790@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 22 08:40:18 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 1gPjaz-0002Si-1I for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Nov 2018 08:40:17 +0100 Original-Received: from localhost ([::1]:44537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPjd5-00054y-Fj for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Nov 2018 02:42:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPjcv-00053j-Cr for bug-gnu-emacs@gnu.org; Thu, 22 Nov 2018 02:42:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPjcq-0002NX-3f for bug-gnu-emacs@gnu.org; Thu, 22 Nov 2018 02:42:15 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36194) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gPjcg-0002Hd-FA for bug-gnu-emacs@gnu.org; Thu, 22 Nov 2018 02:42:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gPjcg-0001SB-BP for bug-gnu-emacs@gnu.org; Thu, 22 Nov 2018 02:42:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Nov 2018 07:42: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.15428724675520 (code B ref 32790); Thu, 22 Nov 2018 07:42:02 +0000 Original-Received: (at 32790) by debbugs.gnu.org; 22 Nov 2018 07:41:07 +0000 Original-Received: from localhost ([127.0.0.1]:40452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPjbn-0001Qy-In for submit@debbugs.gnu.org; Thu, 22 Nov 2018 02:41:07 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:45131) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPjbk-0001QE-DA for 32790@debbugs.gnu.org; Thu, 22 Nov 2018 02:41:06 -0500 Original-Received: from [192.168.1.101] ([212.95.5.41]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MbOrg-1g6xlb1kEm-00InFT; Thu, 22 Nov 2018 08:40:55 +0100 In-Reply-To: <87y39m9f8b.fsf@mail.linkov.net> X-Provags-ID: V03:K1:i1ZOw5V42Fl2s4rIJ4jZm6HRcqgIOUeNwiQcUDvVZXxuK7nWCl4 SvYA2piV5BwNgY9q1niTLsEPHCwYMb0bo/dTnaZ2wkukd4zx1hx2rgqQDnFEvGPKY3v1VTk AVWXIUWqHJEcp9TIxXhFQE9syFXqn5RUq0Z/wYLrFvus937Hww9yN/0v1s9bmC41tfycd0T r0nuiZsNtUblhf6HwzZvQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:a25L9TxkIBc=:A0EcVeAdMiyAnk/vlIQ3rY IDXwcWCWXuzbkGaR745Hy6ATmIKCNB5CWEtoMIhUdWhXAhQtHQKSB8bW+9cTJ8NKwhqYzpYB6 7OzbnJpQTVGJ1u6e55Z4z+dqWi0YUPF1MvQ4jp2MdkyoLdJv+OhBf/7YOwrHxDh38RDgvGXON dihRnW2uil5PgEhBCpa3/GC7gfOu7nNDb9JsFcv3U91rBMaXWZO8Ea6KbQizqWJ6CzinehqOz lCSY5RedZXhpcYfahGw5WaQmzkNDwknPLbMrsdxToRNPhGq3YHpteT4S7nGB3SKjUp4zoZikp U12ivVlq4xt6dEFwDhTAuTUodQrKxY8Gb1flc9G3LDKDWqnFf8X1+ia7iDNWTZfbJZpmrOgDL BjRoOp7GT75iBPTgFSSICp0bL9x7qEspIa4ZCvBP7nScCRGcugBY0K95k4JoInVANtv6bc8T2 d7uuHwtg0GJXk3URFB0d07EW80jUQZ+12aynqvIJsU//97SBPv1Dppyg27WC9Pj1jMu4kDYo/ H99AT2owXaF0amlPtH3wMd0B3ztMCbnkKs0GkrGM0LZIOI4z/8yWZ/RJFIMH+lOuA5Hi3SXoC yYKZjWxvFnuc8NmhyBRTaSOnR1GzIxkU4BuNt0+PrVcINiyvUO8+VmnRR93YXfza9D2mBKG27 2v7f6ckb2z80s3r1kTzcwm+7hbsS6kXAha2adyh6guf0mStLvhxZ/B4o5bZ7OEl8Fhw25Zyi1 PzlTWrRkocSmZLF+sv0jGblixHoHZnpnszF6dvrvZuLHr0UA2IFECp8oGACbQETdkGevlnW/ 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:152662 Archived-At: > One possible solution is to implement directional window deletion. > The following patch allows using the prefix argument that will delete > the selected window and select the window at the given direction. Delete and select - smart idea. > +;;; Directional window deletion > + > +(defun windmove-delete-in-direction (dir &optional arg) > + "Delete the window at direction DIR. > +If prefix ARG is `C-u', delete the selected window and > +select the window at direction DIR." > + (let ((other-window (window-in-direction dir nil nil arg > + windmove-wrap-around t))) So 'windmove-wrap-around' non-nil means that the other window could be the selected one and we try to delete ourselves. Right? > + ((and (window-minibuffer-p other-window) > + (not (minibuffer-window-active-p other-window))) > + (user-error "Minibuffer is inactive")) Should we try to delete the active minibuffer window? > +;;;###autoload > +(defun windmove-delete-default-keybindings (&optional prefix modifiers) > + "Set up keybindings for directional window deletion. > +Keys are bound to commands that delete windows in the specified > +direction. Keybindings are of the form PREFIX MODIFIERS-{left,right,up,down}, > +where PREFIX is a prefix key and MODIFIERS is either a list of modifiers or > +a single modifier. Default value of PREFIX is `C-x' and MODIFIERS is `shift'." > + (interactive) > + (unless prefix (setq prefix '(?\C-x))) > + (unless (listp prefix) (setq prefix (list prefix))) > + (unless modifiers (setq modifiers '(shift))) > + (unless (listp modifiers) (setq modifiers (list modifiers))) > + (global-set-key (vector prefix (append modifiers '(left))) 'windmove-delete-left) > + (global-set-key (vector prefix (append modifiers '(right))) 'windmove-delete-right) > + (global-set-key (vector prefix (append modifiers '(up))) 'windmove-delete-up) > + (global-set-key (vector prefix (append modifiers '(down))) 'windmove-delete-down)) Feel free to install. But note that eventually we should document the keybinding stuff with a few, good examples. Thanks, martin