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

时间:2013-05-30 16:38:36

标签: emacs

有关如何配置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 http://www.lawlist.com/images/multiple_windows.png

1 个答案:

答案 0 :(得分:1)

解决方案#1:wl-message-buffer-name中定义的变量wl-vars.el由于缓冲区名称开头的空格而使消息缓冲区无趣:  *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-read,以便按空格键激活所述函数。 wl-summary-enter-handler仍然定义为enter键,它以默认方式打开邮件。

(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) ))