mm-decode.el (mm-display-external): Spelling fix
[gnus] / lisp / nnmairix.el
index 0b7f0a4..96b40e5 100644 (file)
@@ -1,10 +1,10 @@
 ;;; nnmairix.el --- Mairix back end for Gnus, the Emacs newsreader
 
-;; Copyright (C) 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
 
 ;; Author: David Engster <dengste@eml.cc>
 ;; Keywords: mail searching
-;; Version: 0.6
+;; Old-Version: 0.6
 
 ;; This file is part of GNU Emacs.
 
 (defun nnmairix-summary-mode-hook ()
   "Nnmairix summary mode keymap."
   (define-key gnus-summary-mode-map
-    (kbd "$ t") 'nnmairix-search-thread-this-article)
+    (kbd "G G t") 'nnmairix-search-thread-this-article)
   (define-key gnus-summary-mode-map
-    (kbd "$ f") 'nnmairix-search-from-this-article)
+    (kbd "G G f") 'nnmairix-search-from-this-article)
   (define-key gnus-summary-mode-map
-    (kbd "$ m") 'nnmairix-widget-search-from-this-article)
+    (kbd "G G m") 'nnmairix-widget-search-from-this-article)
   (define-key gnus-summary-mode-map
-    (kbd "$ g") 'nnmairix-create-search-group-from-message)
+    (kbd "G G g") 'nnmairix-create-search-group-from-message)
   (define-key gnus-summary-mode-map
-    (kbd "$ o") 'nnmairix-goto-original-article)
+    (kbd "G G o") 'nnmairix-goto-original-article)
   (define-key gnus-summary-mode-map
-    (kbd "$ u") 'nnmairix-remove-tick-mark-original-article))
+    (kbd "G G u") 'nnmairix-remove-tick-mark-original-article))
 
 (add-hook 'gnus-group-mode-hook 'nnmairix-group-mode-hook)
 (add-hook 'gnus-summary-mode-hook 'nnmairix-summary-mode-hook)
 
 ;; ;;;###autoload
-;; (defun nnmairix-initalize (&optional force)
+;; (defun nnmairix-initialize (&optional force)
 ;;   (interactive "P")
 ;;   (if (not (or (file-readable-p "~/.mairixrc")
 ;;            force))
@@ -308,13 +308,13 @@ The default chooses the largest window in the current frame."
 
 (defcustom nnmairix-propagate-marks-upon-close t
   "Flag if marks should be propagated upon closing a group.
-The default of this variable is t. If set to 'ask, the
+The default of this variable is t.  If set to 'ask, the
 user will be asked if the flags should be propagated when the
 group is closed.  If set to nil, the user will have to manually
 call 'nnmairix-propagate-marks'."
   :version "23.1"
   :type '(choice (const :tag "always" t)
-                (const :tag "ask" 'ask)
+                (const :tag "ask" ask)
                 (const :tag "never" nil))
   :group 'nnmairix)
 
@@ -333,7 +333,7 @@ can happen are wrong marks in nnmairix groups."
   "Use only the registry for determining original group(s).
 If set to t, nnmairix will only use the registry for determining
 the original group(s) of an article (which is also necessary for
-propapagting marks).  If set to nil, it will also try to determine
+propagating marks).  If set to nil, it will also try to determine
 the group from an additional mairix search which might be slow
 when propagating lots of marks."
   :version "23.1"
@@ -417,7 +417,7 @@ Other back ends might or might not work.")
 
 (nnoo-define-basics nnmairix)
 
-(gnus-declare-backend "nnmairix" 'mail 'address)
+(gnus-declare-backend "nnmairix" 'mail 'address 'virtual)
 
 (deffoo nnmairix-open-server (server &optional definitions)
   ;; just set server variables
@@ -483,7 +483,7 @@ Other back ends might or might not work.")
               mfolder query threads)))
       ;; Check return value
       (cond
-       ((zerop rval)                   ; call was succesful
+       ((zerop rval)                   ; call was successful
        (nnmairix-call-backend
         "open-server" nnmairix-backend-server)
        ;; If we're dealing with nnml, rename files
@@ -512,7 +512,7 @@ Other back ends might or might not work.")
        ;; Everything else is an error
        (t
        (nnheader-report
-        'nnmairix "Error running marix. See buffer %s for details"
+        'nnmairix "Error running mairix. See buffer %s for details"
         nnmairix-mairix-output-buffer)
        nil))))))
 
@@ -603,10 +603,7 @@ Other back ends might or might not work.")
     nil))
 
 ;; Silence byte-compiler.
-(defvar gnus-registry-install)
-(autoload 'gnus-registry-fetch-group "gnus-registry")
-(autoload 'gnus-registry-fetch-groups "gnus-registry")
-(autoload 'gnus-registry-add-group "gnus-registry")
+(autoload 'gnus-registry-get-id-key "gnus-registry")
 
 (deffoo nnmairix-request-set-mark (group actions &optional server)
   (when server
@@ -660,13 +657,7 @@ Other back ends might or might not work.")
                              nnmairix-only-use-registry)
                    (setq ogroup
                          (nnmairix-determine-original-group-from-path
-                          mid nnmairix-current-server))
-                   ;; if available and allowed, add this entry to the registry
-                   (when (and (boundp 'gnus-registry-install)
-                              gnus-registry-install)
-                     (dolist (cur ogroup)
-                       (unless (gnus-parameter-registry-ignore cur)
-                         (gnus-registry-add-group mid cur)))))
+                          mid nnmairix-current-server)))
                  (unless ogroup
                    (nnheader-message
                     3 "Unable to set mark: couldn't find original group for %s" mid)
@@ -1357,7 +1348,7 @@ If ALL is t, return also the unopened/failed ones."
                 (not (member (car server) gnus-ephemeral-servers))
                 (not (member (gnus-method-to-server (car server)) occ)))
        (push
-        (list mserver)
+        mserver
         openedserver)))
     openedserver))
 
@@ -1630,14 +1621,7 @@ search in raw mode."
        ;; registry was not available or did not find article
        ;; so we search again with mairix in raw mode to get filename
        (setq allgroups
-             (nnmairix-determine-original-group-from-path mid server))
-       ;; if available and allowed, add this entry to the registry
-       (when (and (not no-registry)
-                  (boundp 'gnus-registry-install)
-                  gnus-registry-install)
-         (dolist (cur allgroups)
-           (unless (gnus-parameter-registry-ignore cur)
-             (gnus-registry-add-group mid cur)))))
+             (nnmairix-determine-original-group-from-path mid server)))
       (if (> (length allgroups) 1)
          (setq group
                (gnus-completing-read
@@ -1650,14 +1634,13 @@ search in raw mode."
       (nnheader-message 3 "Couldn't find original article"))))
 
 (defun nnmairix-determine-original-group-from-registry (mid)
-  "Try to determinale original group for message-id MID from the registry."
-  (when (and (boundp 'gnus-registry-install)
-            gnus-registry-install)
+  "Try to determine original group for message-id MID from the registry."
+  (when (gnus-bound-and-true-p 'gnus-registry-enabled)
     (unless (string-match "^<" mid)
       (set mid (concat "<" mid)))
     (unless (string-match ">$" mid)
       (set mid (concat mid ">")))
-    (gnus-registry-fetch-groups mid)))
+    (gnus-registry-get-id-key mid 'group)))
 
 (defun nnmairix-determine-original-group-from-path (mid server)
   "Determine original group(s) for message-id MID from the file path.