mu4e: add NEWS(.org) as a main menu item

This commit is contained in:
djcb
2015-06-07 21:07:59 +03:00
parent f69ced2339
commit f0a34599d0
4 changed files with 37 additions and 28 deletions

View File

@ -57,6 +57,7 @@
(define-key map "$" 'mu4e-show-log) (define-key map "$" 'mu4e-show-log)
(define-key map "A" 'mu4e-about) (define-key map "A" 'mu4e-about)
(define-key map "N" 'mu4e-news)
(define-key map "H" 'mu4e-display-manual) (define-key map "H" 'mu4e-display-manual)
map) map)
@ -146,6 +147,7 @@ clicked."
(mu4e~main-view-queue) (mu4e~main-view-queue)
"") "")
"\n" "\n"
(mu4e~main-action-str "\t* [N]ews\n" 'mu4e-news)
(mu4e~main-action-str "\t* [A]bout mu4e\n" 'mu4e-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* [H]elp\n" 'mu4e-display-manual)
(mu4e~main-action-str "\t* [q]uit\n" 'mu4e-quit)) (mu4e~main-action-str "\t* [q]uit\n" 'mu4e-quit))

View File

@ -5,4 +5,7 @@
(defconst mu4e-builddir "@abs_top_builddir@" (defconst mu4e-builddir "@abs_top_builddir@"
"Top-level build directory.") "Top-level build directory.")
(defconst mu4e-doc-dir "@MU_DOC_DIR@"
"Mu4e's data-dir.")
(provide 'mu4e-meta) (provide 'mu4e-meta)

View File

@ -32,7 +32,7 @@
(eval-when-compile (require 'org nil 'noerror)) (eval-when-compile (require 'org nil 'noerror))
(require 'mu4e-vars) (require 'mu4e-vars)
(require 'mu4e-about) (require 'mu4e-meta)
(require 'mu4e-lists) (require 'mu4e-lists)
(require 'doc-view) (require 'doc-view)
@ -1060,32 +1060,34 @@ displaying it). Do _not_ bury the current buffer, though."
(apply 'encode-time (mu4e-parse-time-string timestr)))) (apply 'encode-time (mu4e-parse-time-string timestr))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defconst mu4e~main-about-buffer-name "*mu4e-about*" (define-derived-mode mu4e-org-mode org-mode "mu4e:org"
"Name for the mu4e-about buffer.") "Major mode for mu4e documents, derived from
`org-mode'.")
(define-derived-mode mu4e-about-mode org-mode "mu4e:about" (defun mu4e-info (path)
"Major mode for the mu4e About page, derived from `org-mode'.") "Show a buffer with the information (an org-file) at PATH."
(defun mu4e-about ()
"Show a buffer with the mu4e-about text."
(interactive) (interactive)
(lexical-let ((oldbuf (current-buffer))) (unless (file-exists-p path)
(with-current-buffer (mu4e-error "Cannot find %s" path))
(get-buffer-create mu4e~main-about-buffer-name) (lexical-let ((curbuf (current-buffer)))
(define-key mu4e-about-mode-map (kbd "q") (find-file path)
(lambda () ;; XXX it seems unnecessarily hard to do this... (mu4e-org-mode)
(setq buffer-read-only t)
(define-key mu4e-org-mode-map (kbd "q")
(lambda ()
(interactive) (interactive)
(bury-buffer) (bury-buffer)
(when (buffer-live-p oldbuf) (switch-to-buffer curbuf)))))
(switch-to-buffer oldbuf))))
(let ((inhibit-read-only t)) (defun mu4e-about ()
(erase-buffer) "Show the mu4e 'about' page."
(insert mu4e-about) (interactive)
(mu4e-about-mode) (mu4e-info (concat mu4e-doc-dir "/mu4e-about.org")))
(show-all))))
(switch-to-buffer mu4e~main-about-buffer-name) (defun mu4e-news ()
(setq buffer-read-only t) "Show the mu4e 'about' page."
(goto-char (point-min))) (interactive)
(mu4e-info (concat mu4e-doc-dir "/NEWS.org")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun mu4e-refresh-message (path maildir) (defun mu4e-refresh-message (path maildir)

View File

@ -57,11 +57,13 @@ link."
(defcustom mu4e-get-mail-command "true" (defcustom mu4e-get-mail-command "true"
"Shell command to run to retrieve new mail. "Shell command to run to retrieve new mail.
Common values are \"offlineimap\", \"fetchmail\" and \"mbsync\", Common values are \"offlineimap\", \"fetchmail\" or \"mbsync\", but
but you use arbitrary shell-commands. If you set it to arbitrary shell-commands can be used.
\"true\" (the default), the command won't don't anything, which is
useful if you get your mail without the need to explicitly run any When set to \"true\" (the default), the command simply finishes
scripts, for example when running your own mail-server." succesfully (running the 'true' command) without retrieving any
mail. This can be useful when mail is already retrieved in another
way."
:type 'string :type 'string
:group 'mu4e :group 'mu4e
:safe 'stringp) :safe 'stringp)