Reindent source code to ease future modifications
Only whitespace changes.
This commit is contained in:
@ -76,66 +76,66 @@ when STR is clicked (using RET or mouse-2); if FUNC-OR-SHORTCUT is
|
|||||||
a string, execute the corresponding keyboard action when it is
|
a string, execute the corresponding keyboard action when it is
|
||||||
clicked."
|
clicked."
|
||||||
(let ((newstr
|
(let ((newstr
|
||||||
(replace-regexp-in-string
|
(replace-regexp-in-string
|
||||||
"\\[\\(..?\\)\\]"
|
"\\[\\(..?\\)\\]"
|
||||||
(lambda(m)
|
(lambda(m)
|
||||||
(format "[%s]"
|
(format "[%s]"
|
||||||
(propertize (match-string 1 m) 'face 'mu4e-highlight-face)))
|
(propertize (match-string 1 m) 'face 'mu4e-highlight-face)))
|
||||||
str))
|
str))
|
||||||
(map (make-sparse-keymap))
|
(map (make-sparse-keymap))
|
||||||
(func (if (functionp func-or-shortcut)
|
(func (if (functionp func-or-shortcut)
|
||||||
func-or-shortcut
|
func-or-shortcut
|
||||||
(if (stringp func-or-shortcut)
|
(if (stringp func-or-shortcut)
|
||||||
(lexical-let ((macro func-or-shortcut))
|
(lexical-let ((macro func-or-shortcut))
|
||||||
(lambda()(interactive)
|
(lambda()(interactive)
|
||||||
(execute-kbd-macro macro)))))))
|
(execute-kbd-macro macro)))))))
|
||||||
(define-key map [mouse-2] func)
|
(define-key map [mouse-2] func)
|
||||||
(define-key map (kbd "RET") func)
|
(define-key map (kbd "RET") func)
|
||||||
(put-text-property 0 (length newstr) 'keymap map newstr)
|
(put-text-property 0 (length newstr) 'keymap map newstr)
|
||||||
(put-text-property (string-match "\\[.+$" newstr)
|
(put-text-property (string-match "\\[.+$" newstr)
|
||||||
(- (length newstr) 1) 'mouse-face 'highlight newstr) newstr))
|
(- (length newstr) 1) 'mouse-face 'highlight newstr) newstr))
|
||||||
|
|
||||||
;; NEW
|
;; NEW
|
||||||
;; This is the old `mu4e~main-view' function but without
|
;; This is the old `mu4e~main-view' function but without
|
||||||
;; buffer switching at the end.
|
;; buffer switching at the end.
|
||||||
(defun mu4e~main-view-real (ignore-auto noconfirm)
|
(defun mu4e~main-view-real (ignore-auto noconfirm)
|
||||||
(let ((buf (get-buffer-create mu4e~main-buffer-name))
|
(let ((buf (get-buffer-create mu4e~main-buffer-name))
|
||||||
(inhibit-read-only t))
|
(inhibit-read-only t))
|
||||||
(with-current-buffer buf
|
(with-current-buffer buf
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(insert
|
(insert
|
||||||
"* "
|
"* "
|
||||||
(propertize "mu4e - mu for emacs version " 'face 'mu4e-title-face)
|
(propertize "mu4e - mu for emacs version " 'face 'mu4e-title-face)
|
||||||
(propertize mu4e-mu-version 'face 'mu4e-header-key-face)
|
(propertize mu4e-mu-version 'face 'mu4e-header-key-face)
|
||||||
|
|
||||||
;; show some server properties; in this case; a big C when there's
|
;; show some server properties; in this case; a big C when there's
|
||||||
;; crypto support, a big G when there's Guile support
|
;; crypto support, a big G when there's Guile support
|
||||||
" "
|
" "
|
||||||
(propertize
|
(propertize
|
||||||
(concat
|
(concat
|
||||||
(when (plist-get mu4e~server-props :crypto) "C")
|
(when (plist-get mu4e~server-props :crypto) "C")
|
||||||
(when (plist-get mu4e~server-props :guile) "G"))
|
(when (plist-get mu4e~server-props :guile) "G"))
|
||||||
'face 'mu4e-title-face)
|
'face 'mu4e-title-face)
|
||||||
"\n\n"
|
"\n\n"
|
||||||
(propertize " Basics\n\n" 'face 'mu4e-title-face)
|
(propertize " Basics\n\n" 'face 'mu4e-title-face)
|
||||||
(mu4e~main-action-str "\t* [j]ump to some maildir\n" 'mu4e-jump-to-maildir)
|
(mu4e~main-action-str "\t* [j]ump to some maildir\n" 'mu4e-jump-to-maildir)
|
||||||
(mu4e~main-action-str "\t* enter a [s]earch query\n" 'mu4e-search)
|
(mu4e~main-action-str "\t* enter a [s]earch query\n" 'mu4e-search)
|
||||||
(mu4e~main-action-str "\t* [C]ompose a new message\n" 'mu4e-compose-new)
|
(mu4e~main-action-str "\t* [C]ompose a new message\n" 'mu4e-compose-new)
|
||||||
"\n"
|
"\n"
|
||||||
(propertize " Bookmarks\n\n" 'face 'mu4e-title-face)
|
(propertize " Bookmarks\n\n" 'face 'mu4e-title-face)
|
||||||
;; TODO: it's a bit uncool to hard-code the "b" shortcut...
|
;; TODO: it's a bit uncool to hard-code the "b" shortcut...
|
||||||
(mapconcat
|
(mapconcat
|
||||||
(lambda (bm)
|
(lambda (bm)
|
||||||
(let* ((query (nth 0 bm)) (title (nth 1 bm)) (key (nth 2 bm)))
|
(let* ((query (nth 0 bm)) (title (nth 1 bm)) (key (nth 2 bm)))
|
||||||
(mu4e~main-action-str
|
(mu4e~main-action-str
|
||||||
(concat "\t* [b" (make-string 1 key) "] " title)
|
(concat "\t* [b" (make-string 1 key) "] " title)
|
||||||
(concat "b" (make-string 1 key)))))
|
(concat "b" (make-string 1 key)))))
|
||||||
mu4e-bookmarks "\n")
|
mu4e-bookmarks "\n")
|
||||||
"\n\n"
|
"\n\n"
|
||||||
(propertize " Misc\n\n" 'face 'mu4e-title-face)
|
(propertize " Misc\n\n" 'face 'mu4e-title-face)
|
||||||
|
|
||||||
(mu4e~main-action-str "\t* [U]pdate email & database\n"
|
(mu4e~main-action-str "\t* [U]pdate email & database\n"
|
||||||
'mu4e-update-mail-and-index)
|
'mu4e-update-mail-and-index)
|
||||||
|
|
||||||
;; show the queue functions if `smtpmail-queue-dir' is defined
|
;; show the queue functions if `smtpmail-queue-dir' is defined
|
||||||
(if (file-directory-p smtpmail-queue-dir)
|
(if (file-directory-p smtpmail-queue-dir)
|
||||||
|
|||||||
Reference in New Issue
Block a user