gpt4 book ai didi

emacs - Wanderlust -- 在新缓冲区中打开电子邮件,而不是拆分窗口

转载 作者:行者123 更新时间:2023-12-02 02:01:53 25 4
gpt4 key购买 nike

有关如何配置 Wanderlust 以在新缓冲区而不是拆分窗口中打开电子邮件的任何想法?四 (4) 个窗口发生了太多事情——摘要消息缓冲区;消息缓冲区;大哥阴险的数据库地址管理器;和迷你缓冲区。 (请参见下面的屏幕截图。)

我想我已经在 wl-message.el 中找到了代码的相关部分,但我不确定要更改哪一部分。 (setq wl-message-window-size '(1 . 1))init.el不是我要找的,因为我仍然需要与其他缓冲区共享屏幕。

我花了很多时间切换和关闭窗口以获得全尺寸缓冲区,我希望在查看电子邮件时只消除多个窗口。

谢谢。 . .任何帮助将不胜感激。

;;; wl-message.el -- Message buffer handling from summary buffer.

(defun wl-message-buffer-window ()
"Get message buffer window if any."
(let* ((start-win (selected-window))
(cur-win start-win))
(catch 'found
(while (progn
(setq cur-win (next-window cur-win))
(with-current-buffer (window-buffer cur-win)
(if (or (eq major-mode 'wl-message-mode)
(eq major-mode 'mime-view-mode))
(throw 'found cur-win)))
(not (eq cur-win start-win)))))))

(defun wl-message-select-buffer (buffer)
"Select BUFFER as a message buffer."
(let ((window (get-buffer-window buffer))
(sum (car wl-message-window-size))
(mes (cdr wl-message-window-size))
whi)
(when (and window
(not (eq (with-current-buffer (window-buffer window)
wl-message-buffer-cur-summary-buffer)
(current-buffer))))
(delete-window window)
(run-hooks 'wl-message-window-deleted-hook)
(setq window nil))
(if window
(select-window window)
(when wl-fixed-window-configuration
(delete-other-windows)
(and wl-stay-folder-window
(wl-summary-toggle-disp-folder)))
;; There's no buffer window. Search for message window and snatch it.
(if (setq window (wl-message-buffer-window))
(select-window window)
(setq whi (1- (window-height)))
(if mes
(progn
(let ((total (+ sum mes)))
(setq sum (max window-min-height (/ (* whi sum) total)))
(setq mes (max window-min-height (/ (* whi mes) total))))
(if (< whi (+ sum mes))
(enlarge-window (- (+ sum mes) whi)))))
(split-window (get-buffer-window (current-buffer)) sum)
(other-window 1)))
(switch-to-buffer buffer)))

multiple_windows
(来源:lawlist.com)

最佳答案

解决方案 # 1:在 wl-vars.el 中定义的变量 wl-message-buffer-name 使消息缓冲区变得无趣,因为缓冲区名称的开头: *WL:Message*。由于 Emacs 默认隐藏不感兴趣的缓冲区,一种解决方案是通过删除缓冲区名称开头的空格来修改上述变量。这样,缓冲区始终可见,只需切换到显示消息的窗口,然后 delete-other-windows 即可。额外的好处是不再需要返回到摘要缓冲区来查看已经打开的电子邮件,因为已经有一个专门用于该电子邮件的打开缓冲区。

(defcustom wl-message-buffer-name "*WL:Message*" ;; " *WL:Message*"
"*Buffer name for message buffers."
:group 'wl-pref
:group 'wl-setting)

解决方案 # 2:第二种解决方案不再是首选方法,很可能会从该答案中完全删除。由于某些未知原因,我使用的单词搜索实用程序无法梳理 wl-vars.el 文件,因此第二种解决方案是一种解决方法。

编辑 wl-summary-read 的键映射(在 wl-summary.el 内)并将其替换为函数 lawlist-wl-summary-阅读 以便点击空格键激活所述功能。 wl-summary-enter-handler 仍定义为回车键,以默认方式打开消息。

(define-key wl-summary-mode-map " "    'lawlist-wl-summary-read)

(defun lawlist-wl-summary-read nil
"Clone the the buffer and make new buffer name unique."
(interactive)
(wl-summary-enter-handler)
(windmove-down)
(let ((n 0)
bufname)
(while (progn
(setq bufname (concat "email"
(if (= n 0) "" (int-to-string n))
"")) ;; could be an ending, like an asterick *
(setq n (1- n)) ;; if + instead of -, then no hyphen and no space between buffer name and the number
(get-buffer bufname)))
(clone-indirect-buffer bufname nil)
(switch-to-buffer bufname)
(delete-other-windows) ))

关于emacs - Wanderlust -- 在新缓冲区中打开电子邮件,而不是拆分窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16841576/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com