Skip to content

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

@rytswd

Description

@rytswd

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?

Screen.Recording.2024-05-30.at.13.57.40.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions