* mu4e: move mu4e-about to mu4e-utils, fix build, add [A] shortcut in mu4e-main

This commit is contained in:
djcb 2012-06-15 11:00:21 +03:00
parent 62efed8772
commit 53ac79dd9c
3 changed files with 30 additions and 39 deletions

View File

@ -24,6 +24,7 @@ mu4e_TEXINFOS=fdl.texi
lispdir=${prefix}/share/emacs/site-lisp/mu4e/
dist_lisp_LISP= \
mu4e-about.el \
mu4e-actions.el \
mu4e-compose.el \
mu4e-headers.el \
@ -38,8 +39,8 @@ dist_lisp_LISP= \
mu4e.el \
org-mu4e.el
BUILT_SOURCES= \
mu4e-about.el
# BUILT_SOURCES= \
# mu4e-about.el
mu4e-about.el: mu4e-about.org
@echo ";; auto-generated" > mu4e-about.el

View File

@ -25,7 +25,6 @@
;;; Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'mu4e-utils) ;; utility functions
(require 'mu4e-about)
(defconst mu4e~main-buffer-name "*mu4e-main*"
"*internal* Name of the mu4e main view buffer.")
@ -46,6 +45,7 @@
(define-key map "U" 'mu4e-update-mail-show-window)
(define-key map "$" 'mu4e-show-log)
(define-key map "A" 'mu4e-about)
(define-key map "H" 'mu4e-display-manual)
map)
@ -130,7 +130,7 @@ clicked."
'smtpmail-send-queued-mail))
"")
"\n"
(mu4e~main-action-str "\t* [A]bout mu4e\n" 'mu4e~main-about)
(mu4e~main-action-str "\t* [A]bout mu4e\n" 'mu4e-about)
(mu4e~main-action-str "\t* [H]elp\n" 'mu4e-display-manual)
(mu4e~main-action-str "\t* [q]uit\n" 'mu4e-quit))
(mu4e-main-mode)
@ -148,23 +148,5 @@ clicked."
(concat "Outgoing mail will now be "
(if smtpmail-queue-mail "queued" "sent directly")))
(mu4e~main-view))
(defconst mu4e~main-about-buffer-name "*mu4e-about*"
"Name for the mu4e-about buffer.")
(defun mu4e~main-about ()
"Create a buffer with the mu4e-about text."
(interactive)
(with-current-buffer
(get-buffer-create mu4e~main-about-buffer-name)
(let ((inhibit-read-only t))
(erase-buffer)
(insert mu4e-about)
(org-mode)))
(switch-to-buffer mu4e~main-about-buffer-name)
(setq buffer-read-only t)
(local-set-key "q" 'bury-buffer)
(goto-char (point-min)))
(provide 'mu4e-main)

View File

@ -30,6 +30,7 @@
(require 'html2text)
(require 'mu4e-vars)
(require 'mu4e-about)
(require 'doc-view)
(require 'org) ;; for org-parse-time-string
@ -775,23 +776,7 @@ is ignored."
(newline)
(insert-image img imgpath nil t))))
(defun mu4e-quit-buffer ()
"Bury the current buffer (and delete all windows displaying it)."
(interactive)
(let ((buf (current-buffer)))
(walk-windows
;; kill any window that:
;; a) displays the current buffer
;; b) is not the only win
(lambda (win)
(when (eq (window-buffer win) (current-buffer))
(unless (one-window-p t)
(delete-window win)))) nil t)
;; if current buffer is still here, bury it
(when (eq buf (current-buffer))
(bury-buffer))))
(defun mu4e-hide-other-mu4e-buffers ()
"Bury mu4e-buffers (main, headers, view) (and delete all windows
@ -814,5 +799,28 @@ displaying it). Do _not_ bury the current buffer, though."
(let ((timestr (read-string (mu4e-format "%s" prompt))))
(apply 'encode-time (org-parse-time-string timestr))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defconst mu4e~main-about-buffer-name "*mu4e-about*"
"Name for the mu4e-about buffer.")
(defun mu4e-about ()
"Show a buffer with the mu4e-about text."
(interactive)
(with-current-buffer
(get-buffer-create mu4e~main-about-buffer-name)
(let ((inhibit-read-only t))
(erase-buffer)
(insert mu4e-about)
(org-mode)))
(switch-to-buffer mu4e~main-about-buffer-name)
(setq buffer-read-only t)
(local-set-key "q" 'bury-buffer)
(goto-char (point-min)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(provide 'mu4e-utils)
;;; End of mu4e-utils.el