bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#32790: 27.0.50; point jumps unexpectedly after delete-window


From: martin rudalics
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))))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]