mu4e: remove emacs < 28.1 shims
We can depend on more functions now, so can get rid of our own versions.
This commit is contained in:
@ -268,9 +268,6 @@ buffers; lets remap its faces so it uses the ones for mu4e."
|
||||
(define-key map (kbd "C-c C-u") #'mu4e-update-mail-and-index)
|
||||
(define-key map (kbd "C-c ;") #'mu4e-compose-context-switch)
|
||||
|
||||
;; emacs 29
|
||||
;;(keymap-set map "<remap> <beginning-of-buffer>" #'mu4e-compose-goto-top)
|
||||
;;(keymap-set map "<remap> <end-of-buffer>" #'mu4e-compose-goto-bottom)
|
||||
(define-key map (vector 'remap #'beginning-of-buffer)
|
||||
#'mu4e-compose-goto-top)
|
||||
(define-key map (vector 'remap #'end-of-buffer)
|
||||
|
||||
@ -132,20 +132,6 @@ For example for bogofile, use \"/usr/bin/bogofilter -Sn < %s\"")
|
||||
|
||||
|
||||
|
||||
;; backward compat until 27.1 is univeral.
|
||||
(defalias 'mu4e--flatten-list
|
||||
(if (fboundp 'flatten-list)
|
||||
#'flatten-list
|
||||
(with-no-warnings
|
||||
#'eshell-flatten-list)))
|
||||
|
||||
;; backward compat ntil 28.1 is universal.
|
||||
(defalias 'mu4e--mm-default-file-type
|
||||
(if (fboundp 'mm-default-file-type)
|
||||
#'mm-default-file-type
|
||||
(with-no-warnings
|
||||
#'mm-default-file-encoding)))
|
||||
|
||||
(defun eshell/mu4e-attach (&rest args)
|
||||
"Attach files to a mu4e message using eshell with ARGS.
|
||||
If no mu4e buffers found, compose a new message and then attach
|
||||
@ -159,7 +145,7 @@ the file."
|
||||
(lambda (f) (when (and (file-exists-p f)
|
||||
(not (file-directory-p f)))
|
||||
(expand-file-name f)))
|
||||
(mu4e--flatten-list (reverse args)))))
|
||||
(flatten-list (reverse args)))))
|
||||
;; warn if user tries to attach without any files marked
|
||||
(if (null files-to-attach)
|
||||
(error "No files to attach")
|
||||
@ -188,7 +174,7 @@ the file."
|
||||
(goto-char (point-max)) ; attach at end of buffer
|
||||
(while files-to-attach
|
||||
(mml-attach-file (car files-to-attach)
|
||||
(or (mu4e--mm-default-file-type
|
||||
(or (mm-default-file-type
|
||||
(car files-to-attach))
|
||||
"application/octet-stream") nil)
|
||||
(setq files-to-attach (cdr files-to-attach)))
|
||||
|
||||
@ -254,8 +254,7 @@ It looks something like
|
||||
|
||||
This filename is used for the draft message and the sent message,
|
||||
depending on `mu4e-sent-messages-behavior'."
|
||||
(let* ((sysname (if (fboundp 'system-name)
|
||||
(system-name) (with-no-warnings system-name)))
|
||||
(let* ((sysname (system-name))
|
||||
(sysname (if (string= sysname "") "localhost" sysname))
|
||||
(hostname (downcase
|
||||
(save-match-data
|
||||
|
||||
@ -1189,13 +1189,8 @@ The following specs are supported:
|
||||
|
||||
;; Eldoc support
|
||||
(when (and (featurep 'eldoc) mu4e-eldoc-support)
|
||||
(if (boundp 'eldoc-documentation-functions)
|
||||
;; Emacs 28 or newer
|
||||
(add-hook 'eldoc-documentation-functions
|
||||
#'mu4e-headers-eldoc-function nil t)
|
||||
;; Emacs 27 or older
|
||||
(add-function :before-until (local 'eldoc-documentation-function)
|
||||
#'mu4e-headers-eldoc-function)))
|
||||
(add-hook 'eldoc-documentation-functions
|
||||
#'mu4e-headers-eldoc-function nil t))
|
||||
|
||||
;; support bookmarks.
|
||||
(setq-local bookmark-make-record-function
|
||||
|
||||
@ -359,9 +359,8 @@ Function returns the value (cdr) of the matching cell."
|
||||
(unless (get-buffer mu4e--log-buffer-name)
|
||||
(with-current-buffer (get-buffer-create mu4e--log-buffer-name)
|
||||
(view-mode)
|
||||
(when (fboundp 'so-long-mode)
|
||||
(unless (eq major-mode 'so-long-mode)
|
||||
(eval '(so-long-mode))))
|
||||
(unless (eq major-mode 'so-long-mode)
|
||||
(so-long-mode))
|
||||
(setq buffer-undo-list t)))
|
||||
mu4e--log-buffer-name)
|
||||
|
||||
|
||||
@ -249,9 +249,7 @@ Returns the full path."
|
||||
(kill-buffer mu4e--sexp-buffer-name))
|
||||
(with-current-buffer-window
|
||||
(get-buffer-create mu4e--sexp-buffer-name) nil nil
|
||||
(if (fboundp 'lisp-data-mode)
|
||||
(lisp-data-mode)
|
||||
(lisp-mode))
|
||||
(lisp-data-mode)
|
||||
(insert (pp-to-string msg))
|
||||
(font-lock-ensure)
|
||||
;; add basic `quit-window' bindings
|
||||
|
||||
@ -128,8 +128,7 @@ I.e. a message with the draft flag set."
|
||||
:group 'mu4e-faces)
|
||||
|
||||
(defface mu4e-header-highlight-face
|
||||
`((t :inherit hl-line :weight bold :underline t
|
||||
,@(and (>= emacs-major-version 27) '(:extend t))))
|
||||
'((t :inherit hl-line :weight bold :underline t :extend t))
|
||||
"Face for the header at point."
|
||||
:group 'mu4e-faces)
|
||||
|
||||
|
||||
@ -191,16 +191,6 @@ buffer's major mode."
|
||||
(eq (mu4e--get-current-buffer-type) type))
|
||||
|
||||
|
||||
;; backward-compat; buffer-local-boundp was introduced in emacs 28.
|
||||
(defun mu4e--buffer-local-boundp (symbol buffer)
|
||||
"Return non-nil if SYMBOL is bound in BUFFER.
|
||||
Also see `local-variable-p'."
|
||||
(condition-case nil
|
||||
(buffer-local-value symbol buffer)
|
||||
(:success t)
|
||||
(void-variable nil)))
|
||||
|
||||
|
||||
(defun mu4e-get-view-buffer (&optional headers-buffer create)
|
||||
"Return a view buffer belonging optionally to HEADERS-BUFFER.
|
||||
|
||||
@ -229,7 +219,7 @@ being created if CREATE is non-nil."
|
||||
(linked-buffer
|
||||
(mu4e-get-view-buffers
|
||||
(lambda (buf)
|
||||
(and (mu4e--buffer-local-boundp 'mu4e-linked-headers-buffer buf)
|
||||
(and (buffer-local-boundp 'mu4e-linked-headers-buffer buf)
|
||||
(eq mu4e-linked-headers-buffer headers-buffer))))))
|
||||
;; If such a linked buffer exists and its buffer is live, we use that
|
||||
;; buffer.
|
||||
|
||||
Reference in New Issue
Block a user