GNU bug report logs - #32790
27.0.50; point jumps unexpectedly after delete-window

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Thu, 20 Sep 2018 23:57:01 UTC

Severity: minor

Found in version 27.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>
Cc: 32790 <at> debbugs.gnu.org
Subject: bug#32790: 27.0.50; point jumps unexpectedly after delete-window
Date: Wed, 17 Oct 2018 09:30:55 +0200
> For window selection I use (windmove-default-keybindings 'hyper),
> so e.g. '<H-left>' selects the left window.  Could you recommend
> a command to bind to e.g. 'C-x <H-left>' that will delete the left
> window?

Here <H-left> drags the character under the cursor by one character to
the left and <H-up> drags the current line up by one line.  I use
<M-S-left> for selecting the window on the left.  <C-M-S-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.  The
code for that command is below.

martin

(defun window-delete-or-split-left ()
  "If selected window has a window on left delete that window.
Otherwise split selected window horizontally and select left
window."
  (interactive)
  (unless (condition-case nil
              (save-selected-window
		(if (fboundp 'window-in-direction)
		    (let ((window (window-in-direction 'left)))
		      (when window (delete-window window) t))
		  (windmove-do-window-select 'left)
		  (delete-window) t))
            (error nil))
    (if (fboundp 'window-in-direction)
	(let ((window (split-window nil nil 'left)))
	  (select-window window))
      (split-window-horizontally))))




This bug report was last modified 5 years and 235 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.