From 04903c568d24b4ac608c8abb180063886a7b2ffd Mon Sep 17 00:00:00 2001 From: Mickey Petersen Date: Fri, 9 Dec 2022 09:01:18 +0000 Subject: [PATCH] Move defcustoms to mu4e-window.el --- mu4e/mu4e-draft.el | 5 ----- mu4e/mu4e-headers.el | 11 ----------- mu4e/mu4e-helpers.el | 20 ++------------------ mu4e/mu4e-main.el | 1 + mu4e/mu4e-message.el | 1 + mu4e/mu4e-window.el | 41 ++++++++++++++++++++++++++++++++++++++++- 6 files changed, 44 insertions(+), 35 deletions(-) diff --git a/mu4e/mu4e-draft.el b/mu4e/mu4e-draft.el index 90d03423..847c12df 100644 --- a/mu4e/mu4e-draft.el +++ b/mu4e/mu4e-draft.el @@ -231,11 +231,6 @@ mu4e-specific version of `message-signature'." :type 'boolean :group 'mu4e-compose) -(defcustom mu4e-compose-in-new-frame nil - "Whether to compose messages in a new frame." - :type 'boolean - :group 'mu4e-compose) - (defvar mu4e-user-agent-string (format "mu4e %s; emacs %s" mu4e-mu-version emacs-version) "The User-Agent string for mu4e, or nil.") diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el index e3b5ae07..c74bbfdf 100644 --- a/mu4e/mu4e-headers.el +++ b/mu4e/mu4e-headers.el @@ -104,18 +104,7 @@ In the format of `format-time-string'." :type 'string :group 'mu4e-headers) -(defcustom mu4e-headers-visible-lines 10 - "Number of lines to display in the header view when using the -horizontal split-view. This includes the header-line at the top, -and the mode-line." - :type 'integer - :group 'mu4e-headers) -(defcustom mu4e-headers-visible-columns 30 - "Number of columns to display for the header view when using the -vertical split-view." - :type 'integer - :group 'mu4e-headers) (defcustom mu4e-headers-precise-alignment nil "When set, use precise (but relatively slow) alignment for columns. diff --git a/mu4e/mu4e-helpers.el b/mu4e/mu4e-helpers.el index dd6bfc01..ef17d188 100644 --- a/mu4e/mu4e-helpers.el +++ b/mu4e/mu4e-helpers.el @@ -32,6 +32,7 @@ (require 'cl-lib) (require 'bookmark) +(require 'mu4e-window) (require 'mu4e-config) ;;; Customization @@ -86,24 +87,7 @@ marked as read-only, or non-nil otherwise." :group 'mu4e-view) -(defcustom mu4e-split-view 'horizontal - "How to show messages / headers. -A symbol which is either: - * `horizontal': split horizontally (headers on top) - * `vertical': split vertically (headers on the left). - * `single-window': view and headers in one window (mu4e will try not to - touch your window layout), main view in minibuffer - * a function: the function is responsible to return some window for - the view. - * anything else: don't split (show either headers or messages, - not both). -Also see `mu4e-headers-visible-lines' -and `mu4e-headers-visible-columns'." - :type '(choice (const :tag "Split horizontally" horizontal) - (const :tag "Split vertically" vertical) - (const :tag "Single window" single-window) - (const :tag "Don't split" nil)) - :group 'mu4e-headers) + (defun mu4e-select-other-view () diff --git a/mu4e/mu4e-main.el b/mu4e/mu4e-main.el index f00c0c43..511fdb51 100644 --- a/mu4e/mu4e-main.el +++ b/mu4e/mu4e-main.el @@ -33,6 +33,7 @@ (require 'mu4e-contacts) (require 'mu4e-search) (require 'mu4e-vars) ;; mu-wide variables +(require 'mu4e-window) (declare-function mu4e-compose-new "mu4e-compose") (declare-function mu4e~headers-jump-to-maildir "mu4e-headers") diff --git a/mu4e/mu4e-message.el b/mu4e/mu4e-message.el index ae30902f..1e494db8 100644 --- a/mu4e/mu4e-message.el +++ b/mu4e/mu4e-message.el @@ -28,6 +28,7 @@ (require 'mu4e-vars) (require 'mu4e-contacts) +(require 'mu4e-window) (require 'flow-fill) (require 'shr) (require 'pp) diff --git a/mu4e/mu4e-window.el b/mu4e/mu4e-window.el index cb93ddca..c5bcfa89 100644 --- a/mu4e/mu4e-window.el +++ b/mu4e/mu4e-window.el @@ -56,6 +56,45 @@ linked to.") (defvar-local mu4e-linked-headers-buffer nil "Holds the headers buffer object that ties it to a view.") +(defcustom mu4e-split-view 'horizontal + "How to show messages / headers. +A symbol which is either: + * `horizontal': split horizontally (headers on top) + * `vertical': split vertically (headers on the left). + * `single-window': view and headers in one window (mu4e will try not to + touch your window layout), main view in minibuffer + * a function: the function is responsible to return some window for + the view. + * anything else: don't split (show either headers or messages, + not both). +Also see `mu4e-headers-visible-lines' +and `mu4e-headers-visible-columns'." + :type '(choice (const :tag "Split horizontally" horizontal) + (const :tag "Split vertically" vertical) + (const :tag "Single window" single-window) + (const :tag "Don't split" nil)) + :group 'mu4e-headers) + +(defcustom mu4e-compose-in-new-frame nil + "Whether to compose messages in a new frame." + :type 'boolean + :group 'mu4e-compose) + +(defcustom mu4e-headers-visible-lines 10 + "Number of lines to display in the header view when using the +horizontal split-view. This includes the header-line at the top, +and the mode-line." + :type 'integer + :group 'mu4e-headers) + +(defcustom mu4e-headers-visible-columns 30 + "Number of columns to display for the header view when using the +vertical split-view." + :type 'integer + :group 'mu4e-headers) + +(declare-function mu4e-view-mode "mu4e-view") + (defun mu4e-get-headers-buffer (&optional buffer-name create) "Return a related headers buffer optionally named BUFFER-NAME. @@ -160,7 +199,7 @@ being created if CREATE is non-nil." (eq mu4e-linked-headers-buffer headers-buffer)))))) ;; If such a linked buffer exists and its buffer is live, we use that buffer. (if (and linked-buffer (buffer-live-p (car linked-buffer))) - ;; NOTE: It's possible for there to be one than one linked view buffer. + ;; NOTE: It's possible for there to be more than one linked view buffer. ;; ;; What, if anything, should the heuristic be to pick the ;; one to use? Presently `car' is used, but there are better