abo-abo / ace-window

Quickly switch windows in Emacs
970 stars 86 forks source link

Why not copy point and window-start in aw-copy-window? #193

Closed ramblehead closed 4 years ago

ramblehead commented 4 years ago

I am using ace-window quite often - both in my elisp extensions and in normal workflow.

I think, it might be more convenient if aw-copy-window() copies window and point position as well as the buffer:

(defun aw-copy-window (window)
  "Copy the current buffer to WINDOW - including window-start and point."
  (let ((buffer (current-buffer))
        (window-start (window-start))
        (point (point)))
    (aw-switch-to-window window)
    (switch-to-buffer buffer)
    (set-window-start (frame-selected-window) window-start)
    (goto-char point)))

Are there workflows/libs where such additional logic could be harmful?

abo-abo commented 4 years ago

Sounds like a nice improvement. Please PR.