dwim-shell-command icon indicating copy to clipboard operation
dwim-shell-command copied to clipboard

`(pop-to-buffer-same-window ...)` causing margin to be stripped

Open rytswd opened this issue 8 months ago • 2 comments

I just noticed how running (dwim-shell-command) from a buffer with custom margin set with something like (set-window-margins nil 3 3) gets the margin reset to nil due to the following line in cl-defun dwim-shell-command-execute-script:

    ;; Momentarily set buffer to same window, so it's next in recent stack.
    ;; Makes finding the shell command buffer a lot easier.
    (let ((current (current-buffer)))
      (pop-to-buffer-same-window proc-buffer)
      (pop-to-buffer-same-window current))

The comment makes it clear about the rationale of this code, but I'm wondering if there is a better way to achieve this somehow, so that the existing buffer won't get affected?

https://github.com/xenodium/dwim-shell-command/assets/23435099/0530e444-a5e0-47e7-862b-55785f752c39

rytswd avatar May 30 '24 13:05 rytswd