diff --git a/lib/mu-store-priv.hh b/lib/mu-store-priv.hh index 947b9599..37a1fc58 100644 --- a/lib/mu-store-priv.hh +++ b/lib/mu-store-priv.hh @@ -78,7 +78,6 @@ public: _MuStore (const char *path) { init (path, NULL, false, false); - _db = new Xapian::Database (path); if (mu_store_needs_upgrade(this)) throw MuStoreError (MU_ERROR_XAPIAN_NOT_UP_TO_DATE, diff --git a/lib/mu-store-read.cc b/lib/mu-store-read.cc index 352c301d..83ce6fcb 100644 --- a/lib/mu-store-read.cc +++ b/lib/mu-store-read.cc @@ -79,7 +79,7 @@ mu_store_new_read_only (const char* xpath, GError **err) } catch (const MuStoreError& merr) { 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); @@ -126,9 +126,11 @@ mu_store_needs_upgrade (MuStore *store) { g_return_val_if_fail (store, TRUE); - return (g_strcmp0 (mu_store_version (store), - MU_STORE_SCHEMA_VERSION) == 0) ? FALSE : TRUE; + // g_print ("'%s' <=> '%s'\n", mu_store_version (store), + // 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 -mu_store_get_timestamp (MuStore *store, const char* msgpath, GError **err) +mu_store_get_timestamp (MuStore *store, const char *msgpath, GError **err) { char *stampstr; time_t rv; diff --git a/lib/mu-store.h b/lib/mu-store.h index a28e6a7f..205d9e95 100644 --- a/lib/mu-store.h +++ b/lib/mu-store.h @@ -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, * MU_ERROR in case of error */ -typedef MuError (*MuStoreForeachFunc) (const char* path, - void *user_data); +typedef MuError (*MuStoreForeachFunc) (const char* path, gpointer user_data); MuError mu_store_foreach (MuStore *self, MuStoreForeachFunc func, 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 * 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; diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el index 0379939f..05394d7e 100644 --- a/mu4e/mu4e-headers.el +++ b/mu4e/mu4e-headers.el @@ -138,7 +138,7 @@ PREDICATE-FUNC as PARAM. This is useful for getting user-input.") (defvar mu4e~headers-view-win nil "The view window connected to this headers view.") - + (defvar mu4e~headers-sortfield-choices '( ("date" . :date) ("from" . :from) @@ -148,7 +148,7 @@ PREDICATE-FUNC as PARAM. This is useful for getting user-input.") ("to" . :to)) "List of cells describing the various sort-options (in the format needed for `mu4e-read-option'.") - + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (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 ;; response to output from the server process - (defun mu4e~headers-view-handler (msg) "Handler function for displaying a message." (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 "/" 'mu4e-headers-search-narrow) - + (define-key map "j" 'mu4e~headers-jump-to-maildir) (define-key map (kbd "") 'mu4e-headers-query-prev) (define-key map (kbd "\\") 'mu4e-headers-query-prev) (define-key map (kbd "") 'mu4e-headers-query-next) - + (define-key map "b" 'mu4e-headers-search-bookmark) (define-key map "B" 'mu4e-headers-search-bookmark-edit) @@ -543,7 +542,7 @@ after the end of the search results." (lambda (&optional e) ;; getting the field, inspired by `tabulated-list-col-sort' (interactive "e") - (let* ((obj (posn-object (event-start e))) + (let* ((obj (posn-object (event-start e))) (field (and obj (get-text-property 0 'field (car obj))))) (if (eq field mu4e-headers-sortfield) @@ -564,7 +563,7 @@ after the end of the search results." 'field field) " "))) mu4e-headers-fields))) - + (define-derived-mode mu4e-headers-mode special-mode "mu4e:headers" "Major mode for displaying mu4e search results. @@ -576,8 +575,8 @@ after the end of the search results." (make-local-variable 'global-mode-string) (set (make-local-variable 'hl-line-face) 'mu4e-header-highlight-face) (set (make-local-variable 'glyphless-char-display) - mu4e~glyphless-char-display) - + mu4e~glyphless-char-display) + (setq truncate-lines t 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 (hl-line-mode 1)) - + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; higlighting (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 (mu4e-error "Cannot find message with docid %S" docid))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - + (defun mu4e~headers-search-execute (expr ignore-history) "Search in the mu database for EXPR, and switch to the output buffer for the results. If IGNORE-HISTORY is true, do *not* update @@ -741,7 +740,8 @@ the query history stack." mu4e~headers-buffer buf mode-name "mu4e-headers" 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) (mu4e~proc-find (replace-regexp-in-string "\"" "\\\\\"" expr) ;; escape "\" @@ -1075,7 +1075,7 @@ current window. " (mu4e-error "Cannot get a message view")) (select-window viewwin) (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 () "Rerun the search for the last search expression."