* cosmetics

This commit is contained in:
djcb
2012-08-01 10:48:56 +03:00
parent 86e3c3095b
commit 279f627c5e
4 changed files with 22 additions and 21 deletions

View File

@ -78,7 +78,6 @@ public:
_MuStore (const char *path) { _MuStore (const char *path) {
init (path, NULL, false, false); init (path, NULL, false, false);
_db = new Xapian::Database (path); _db = new Xapian::Database (path);
if (mu_store_needs_upgrade(this)) if (mu_store_needs_upgrade(this))
throw MuStoreError (MU_ERROR_XAPIAN_NOT_UP_TO_DATE, throw MuStoreError (MU_ERROR_XAPIAN_NOT_UP_TO_DATE,

View File

@ -79,7 +79,7 @@ mu_store_new_read_only (const char* xpath, GError **err)
} catch (const MuStoreError& merr) { } catch (const MuStoreError& merr) {
mu_util_g_set_error (err, merr.mu_error(), "%s", mu_util_g_set_error (err, merr.mu_error(), "%s",
merr.what().c_str()); merr.what().c_str());
} MU_XAPIAN_CATCH_BLOCK_G_ERROR(err, MU_ERROR_XAPIAN); } MU_XAPIAN_CATCH_BLOCK_G_ERROR(err, MU_ERROR_XAPIAN);
@ -126,9 +126,11 @@ mu_store_needs_upgrade (MuStore *store)
{ {
g_return_val_if_fail (store, TRUE); g_return_val_if_fail (store, TRUE);
return (g_strcmp0 (mu_store_version (store), // g_print ("'%s' <=> '%s'\n", mu_store_version (store),
MU_STORE_SCHEMA_VERSION) == 0) ? FALSE : TRUE; // MU_STORE_SCHEMA_VERSION);
return (g_strcmp0 (mu_store_version (store),
MU_STORE_SCHEMA_VERSION) == 0) ? FALSE : TRUE;
} }
@ -197,7 +199,7 @@ mu_store_get_docid_for_path (MuStore *store, const char* path, GError **err)
time_t time_t
mu_store_get_timestamp (MuStore *store, const char* msgpath, GError **err) mu_store_get_timestamp (MuStore *store, const char *msgpath, GError **err)
{ {
char *stampstr; char *stampstr;
time_t rv; time_t rv;

View File

@ -308,8 +308,7 @@ gboolean mu_store_is_read_only (MuStore *store);
* @return MU_OK if all went well, MU_STOP if the foreach was interrupted, * @return MU_OK if all went well, MU_STOP if the foreach was interrupted,
* MU_ERROR in case of error * MU_ERROR in case of error
*/ */
typedef MuError (*MuStoreForeachFunc) (const char* path, typedef MuError (*MuStoreForeachFunc) (const char* path, gpointer user_data);
void *user_data);
MuError mu_store_foreach (MuStore *self, MuStoreForeachFunc func, MuError mu_store_foreach (MuStore *self, MuStoreForeachFunc func,
void *user_data, GError **err); void *user_data, GError **err);
@ -397,7 +396,8 @@ gboolean mu_store_database_is_locked (const gchar *xpath);
* @return a MuMsg instance (use mu_msg_unref when done with it), or * @return a MuMsg instance (use mu_msg_unref when done with it), or
* NULL in case of error * NULL in case of error
*/ */
MuMsg* mu_store_get_msg (MuStore *self, unsigned docid, GError **err); MuMsg* mu_store_get_msg (MuStore *self, unsigned docid, GError **err)
G_GNUC_WARN_UNUSED_RESULT;

View File

@ -138,7 +138,7 @@ PREDICATE-FUNC as PARAM. This is useful for getting user-input.")
(defvar mu4e~headers-view-win nil (defvar mu4e~headers-view-win nil
"The view window connected to this headers view.") "The view window connected to this headers view.")
(defvar mu4e~headers-sortfield-choices (defvar mu4e~headers-sortfield-choices
'( ("date" . :date) '( ("date" . :date)
("from" . :from) ("from" . :from)
@ -148,7 +148,7 @@ PREDICATE-FUNC as PARAM. This is useful for getting user-input.")
("to" . :to)) ("to" . :to))
"List of cells describing the various sort-options (in the format "List of cells describing the various sort-options (in the format
needed for `mu4e-read-option'.") needed for `mu4e-read-option'.")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun mu4e~headers-clear () (defun mu4e~headers-clear ()
@ -165,7 +165,6 @@ PREDICATE-FUNC as PARAM. This is useful for getting user-input.")
;; next are a bunch of handler functions; those will be called from mu4e~proc in ;; next are a bunch of handler functions; those will be called from mu4e~proc in
;; response to output from the server process ;; response to output from the server process
(defun mu4e~headers-view-handler (msg) (defun mu4e~headers-view-handler (msg)
"Handler function for displaying a message." "Handler function for displaying a message."
(mu4e-view msg mu4e~headers-buffer)) (mu4e-view msg mu4e~headers-buffer))
@ -370,13 +369,13 @@ after the end of the search results."
(define-key map "S" 'mu4e-headers-search-edit) (define-key map "S" 'mu4e-headers-search-edit)
(define-key map "/" 'mu4e-headers-search-narrow) (define-key map "/" 'mu4e-headers-search-narrow)
(define-key map "j" 'mu4e~headers-jump-to-maildir) (define-key map "j" 'mu4e~headers-jump-to-maildir)
(define-key map (kbd "<M-left>") 'mu4e-headers-query-prev) (define-key map (kbd "<M-left>") 'mu4e-headers-query-prev)
(define-key map (kbd "\\") 'mu4e-headers-query-prev) (define-key map (kbd "\\") 'mu4e-headers-query-prev)
(define-key map (kbd "<M-right>") 'mu4e-headers-query-next) (define-key map (kbd "<M-right>") 'mu4e-headers-query-next)
(define-key map "b" 'mu4e-headers-search-bookmark) (define-key map "b" 'mu4e-headers-search-bookmark)
(define-key map "B" 'mu4e-headers-search-bookmark-edit) (define-key map "B" 'mu4e-headers-search-bookmark-edit)
@ -543,7 +542,7 @@ after the end of the search results."
(lambda (&optional e) (lambda (&optional e)
;; getting the field, inspired by `tabulated-list-col-sort' ;; getting the field, inspired by `tabulated-list-col-sort'
(interactive "e") (interactive "e")
(let* ((obj (posn-object (event-start e))) (let* ((obj (posn-object (event-start e)))
(field (field
(and obj (get-text-property 0 'field (car obj))))) (and obj (get-text-property 0 'field (car obj)))))
(if (eq field mu4e-headers-sortfield) (if (eq field mu4e-headers-sortfield)
@ -564,7 +563,7 @@ after the end of the search results."
'field field) " "))) 'field field) " ")))
mu4e-headers-fields))) mu4e-headers-fields)))
(define-derived-mode mu4e-headers-mode special-mode (define-derived-mode mu4e-headers-mode special-mode
"mu4e:headers" "mu4e:headers"
"Major mode for displaying mu4e search results. "Major mode for displaying mu4e search results.
@ -576,8 +575,8 @@ after the end of the search results."
(make-local-variable 'global-mode-string) (make-local-variable 'global-mode-string)
(set (make-local-variable 'hl-line-face) 'mu4e-header-highlight-face) (set (make-local-variable 'hl-line-face) 'mu4e-header-highlight-face)
(set (make-local-variable 'glyphless-char-display) (set (make-local-variable 'glyphless-char-display)
mu4e~glyphless-char-display) mu4e~glyphless-char-display)
(setq (setq
truncate-lines t truncate-lines t
buffer-undo-list t ;; don't record undo information buffer-undo-list t ;; don't record undo information
@ -586,7 +585,7 @@ after the end of the search results."
(mu4e~mark-initialize) ;; initialize the marking subsystem (mu4e~mark-initialize) ;; initialize the marking subsystem
(hl-line-mode 1)) (hl-line-mode 1))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; higlighting ;;; higlighting
(defvar mu4e~highlighted-docid nil (defvar mu4e~highlighted-docid nil
@ -721,7 +720,7 @@ non-nill, don't raise an error when the docid is not found."
(unless ignore-missing (unless ignore-missing
(mu4e-error "Cannot find message with docid %S" docid))))) (mu4e-error "Cannot find message with docid %S" docid)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun mu4e~headers-search-execute (expr ignore-history) (defun mu4e~headers-search-execute (expr ignore-history)
"Search in the mu database for EXPR, and switch to the output "Search in the mu database for EXPR, and switch to the output
buffer for the results. If IGNORE-HISTORY is true, do *not* update buffer for the results. If IGNORE-HISTORY is true, do *not* update
@ -741,7 +740,8 @@ the query history stack."
mu4e~headers-buffer buf mu4e~headers-buffer buf
mode-name "mu4e-headers" mode-name "mu4e-headers"
mu4e~headers-last-query expr mu4e~headers-last-query expr
global-mode-string (propertize mu4e~headers-last-query 'face 'mu4e-title-face))) global-mode-string (propertize mu4e~headers-last-query
'face 'mu4e-title-face)))
(switch-to-buffer buf) (switch-to-buffer buf)
(mu4e~proc-find (mu4e~proc-find
(replace-regexp-in-string "\"" "\\\\\"" expr) ;; escape "\" (replace-regexp-in-string "\"" "\\\\\"" expr) ;; escape "\"
@ -1075,7 +1075,7 @@ current window. "
(mu4e-error "Cannot get a message view")) (mu4e-error "Cannot get a message view"))
(select-window viewwin) (select-window viewwin)
(switch-to-buffer (mu4e~headers-get-loading-buf)) (switch-to-buffer (mu4e~headers-get-loading-buf))
(mu4e~proc-view docid mu4e-view-show-images))) (mu4e~proc-view docid mu4e-view-show-images)))
(defun mu4e-headers-rerun-search () (defun mu4e-headers-rerun-search ()
"Rerun the search for the last search expression." "Rerun the search for the last search expression."