希望的功能是自动竖直分割当前buffer同时各自打开三个文件,左右window固定是4个字符
代码如下:
(defun my-split-layout ()
(interactive)
(find-file "~/test.txt")
(setq window-min-width 4)
(setq my-split-main-window (get-buffer-window))
(split-window nil 4 'right)
(with-selected-window (selected-window)
(setq my-split-keya-window (selected-window))
(find-file "~/a.txt")
(setq window-size-fixed t
cursor-type nil))
(select-window (next-window))
(split-window nil 4 'left)
(with-selected-window (selected-window)
(setq my-split-keyb-window (selected-window))
(find-file "~/b.txt")
(setq window-size-fixed t
cursor-type nil)))
奇怪的是朋友的电脑执行正常,版本是emacs29,我的报错,版本是emacs30