projects
/
gnus
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add hooks for gcc handling
[gnus]
/
lisp
/
nnmaildir.el
diff --git
a/lisp/nnmaildir.el
b/lisp/nnmaildir.el
index
829b376
..
bbace7c
100644
(file)
--- a/
lisp/nnmaildir.el
+++ b/
lisp/nnmaildir.el
@@
-6,10
+6,10
@@
;; This file is part of GNU Emacs.
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software
;
you can redistribute it and/or modify
+;; GNU Emacs is free software
:
you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation
; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation
, either version 3 of the License, or
+;;
(at your option)
any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-17,9
+17,7
@@
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; Commentary:
@@
-61,6
+59,10
@@
)
]
)
]
+;; For Emacs <22.2 and XEmacs.
+(eval-and-compile
+ (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
+
(eval-and-compile
(require 'nnheader)
(require 'gnus)
(eval-and-compile
(require 'nnheader)
(require 'gnus)
@@
-206,20
+208,16
@@
by nnmaildir-request-article.")
(eval param))
(defmacro nnmaildir--with-nntp-buffer (&rest body)
(eval param))
(defmacro nnmaildir--with-nntp-buffer (&rest body)
- `(save-excursion
- (set-buffer nntp-server-buffer)
+ `(with-current-buffer nntp-server-buffer
,@body))
(defmacro nnmaildir--with-work-buffer (&rest body)
,@body))
(defmacro nnmaildir--with-work-buffer (&rest body)
- `(save-excursion
- (set-buffer (get-buffer-create " *nnmaildir work*"))
+ `(with-current-buffer (get-buffer-create " *nnmaildir work*")
,@body))
(defmacro nnmaildir--with-nov-buffer (&rest body)
,@body))
(defmacro nnmaildir--with-nov-buffer (&rest body)
- `(save-excursion
- (set-buffer (get-buffer-create " *nnmaildir nov*"))
+ `(with-current-buffer (get-buffer-create " *nnmaildir nov*")
,@body))
(defmacro nnmaildir--with-move-buffer (&rest body)
,@body))
(defmacro nnmaildir--with-move-buffer (&rest body)
- `(save-excursion
- (set-buffer (get-buffer-create " *nnmaildir move*"))
+ `(with-current-buffer (get-buffer-create " *nnmaildir move*")
,@body))
(defmacro nnmaildir--subdir (dir subdir)
,@body))
(defmacro nnmaildir--subdir (dir subdir)
@@
-268,8
+266,8
@@
by nnmaildir-request-article.")
(setq attr (file-attributes
(concat dir (number-to-string number-linked))))
(or attr (throw 'return (1- number-linked)))
(setq attr (file-attributes
(concat dir (number-to-string number-linked))))
(or attr (throw 'return (1- number-linked)))
- (
if (/=
ino-opened (nth 10 attr))
-
(setq number-opened number-linked))))))
+ (
unless (equal
ino-opened (nth 10 attr))
+ (setq number-opened number-linked))))))
;; Make the given server, if non-nil, be the current server. Then make the
;; given group, if non-nil, be the current group of the current server. Then
;; Make the given server, if non-nil, be the current server. Then make the
;; given group, if non-nil, be the current group of the current server. Then
@@
-359,9
+357,9
@@
by nnmaildir-request-article.")
number-open number-link))
((nnmaildir--eexist-p err)
(let ((attr (file-attributes path-link)))
number-open number-link))
((nnmaildir--eexist-p err)
(let ((attr (file-attributes path-link)))
- (
if (/=
(nth 10 attr) ino-open)
-
(setq number-open number-link
-
number-link 0))))
+ (
unless (equal
(nth 10 attr) ino-open)
+ (setq number-open number-link
+ number-link 0))))
(t (signal (car err) (cdr err)))))))))
(defun nnmaildir--update-nov (server group article)
(t (signal (car err) (cdr err)))))))))
(defun nnmaildir--update-nov (server group article)
@@
-742,7
+740,7
@@
by nnmaildir-request-article.")
ls (or (nnmaildir--param pgname 'directory-files) srv-ls))
(unless read-only
(setq x (nth 11 (file-attributes tdir)))
ls (or (nnmaildir--param pgname 'directory-files) srv-ls))
(unless read-only
(setq x (nth 11 (file-attributes tdir)))
- (unless (and (
= x (nth 11 nattr)) (=
x (nth 11 cattr)))
+ (unless (and (
equal x (nth 11 nattr)) (equal
x (nth 11 cattr)))
(setf (nnmaildir--srv-error nnmaildir--cur-server)
(concat "Maildir spans filesystems: " absdir))
(throw 'return nil))
(setf (nnmaildir--srv-error nnmaildir--cur-server)
(concat "Maildir spans filesystems: " absdir))
(throw 'return nil))
@@
-918,7
+916,7
@@
by nnmaildir-request-article.")
"\n")))))
'group)
"\n")))))
'group)
-(defun nnmaildir-request-
update-info
(gname info &optional server)
+(defun nnmaildir-request-
marks
(gname info &optional server)
(let ((group (nnmaildir--prepare server gname))
pgname flist always-marks never-marks old-marks dotfile num dir
markdirs marks mark ranges markdir article read end new-marks ls
(let ((group (nnmaildir--prepare server gname))
pgname flist always-marks never-marks old-marks dotfile num dir
markdirs marks mark ranges markdir article read end new-marks ls
@@
-985,7
+983,7
@@
by nnmaildir-request-article.")
(setf (nnmaildir--grp-mmth group) new-mmth)
info)))
(setf (nnmaildir--grp-mmth group) new-mmth)
info)))
-(defun nnmaildir-request-group (gname &optional server fast)
+(defun nnmaildir-request-group (gname &optional server fast
info
)
(let ((group (nnmaildir--prepare server gname))
deactivate-mark)
(catch 'return
(let ((group (nnmaildir--prepare server gname))
deactivate-mark)
(catch 'return
@@
-1247,8
+1245,7
@@
by nnmaildir-request-article.")
(setf (nnmaildir--srv-error nnmaildir--cur-server)
"Article has expired")
(throw 'return nil))
(setf (nnmaildir--srv-error nnmaildir--cur-server)
"Article has expired")
(throw 'return nil))
- (save-excursion
- (set-buffer (or to-buffer nntp-server-buffer))
+ (with-current-buffer (or to-buffer nntp-server-buffer)
(erase-buffer)
(nnheader-insert-file-contents nnmaildir-article-file-name))
(cons gname num-msgid))))
(erase-buffer)
(nnheader-insert-file-contents nnmaildir-article-file-name))
(cons gname num-msgid))))
@@
-1287,8
+1284,7
@@
by nnmaildir-request-article.")
(setf (nnmaildir--srv-error nnmaildir--cur-server)
(concat "File exists: " tmpfile))
(throw 'return nil))
(setf (nnmaildir--srv-error nnmaildir--cur-server)
(concat "File exists: " tmpfile))
(throw 'return nil))
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(gmm-write-region (point-min) (point-max) tmpfile nil 'no-message nil
'excl))
(unix-sync) ;; no fsync :(
(gmm-write-region (point-min) (point-max) tmpfile nil 'no-message nil
'excl))
(unix-sync) ;; no fsync :(
@@
-1385,7
+1381,8
@@
by nnmaildir-request-article.")
(error
(gmm-write-region (point-min) (point-max) tmpfile nil 'no-message nil
'excl)
(error
(gmm-write-region (point-min) (point-max) tmpfile nil 'no-message nil
'excl)
- (unix-sync))) ;; no fsync :(
+ (when (fboundp 'unix-sync)
+ (unix-sync)))) ;; no fsync :(
(nnheader-cancel-timer 24h)
(condition-case err
(add-name-to-file tmpfile curfile)
(nnheader-cancel-timer 24h)
(condition-case err
(add-name-to-file tmpfile curfile)
@@
-1439,6
+1436,8
@@
by nnmaildir-request-article.")
(defun nnmaildir-active-number (gname)
0)
(defun nnmaildir-active-number (gname)
0)
+(declare-function gnus-group-mark-article-read "gnus-group" (group article))
+
(defun nnmaildir-request-expire-articles (ranges &optional gname server force)
(let ((no-force (not force))
(group (nnmaildir--prepare server gname))
(defun nnmaildir-request-expire-articles (ranges &optional gname server force)
(let ((no-force (not force))
(group (nnmaildir--prepare server gname))
@@
-1561,7
+1560,7
@@
by nnmaildir-request-article.")
(t (signal (car err) (cdr err))))))
todo-marks))
set-action (lambda (article)
(t (signal (car err) (cdr err))))))
todo-marks))
set-action (lambda (article)
- (funcall add-action)
+ (funcall add-action
article
)
(mapcar (lambda (mark)
(unless (memq mark todo-marks)
(funcall del-mark mark)))
(mapcar (lambda (mark)
(unless (memq mark todo-marks)
(funcall del-mark mark)))
@@
-1592,7
+1591,7
@@
by nnmaildir-request-article.")
(nnmaildir--nlist-iterate nlist ranges
(cond ((eq 'del (cadr action)) del-action)
((eq 'add (cadr action)) add-action)
(nnmaildir--nlist-iterate nlist ranges
(cond ((eq 'del (cadr action)) del-action)
((eq 'add (cadr action)) add-action)
- (
t
set-action))))
+ (
(eq 'set (cadr action))
set-action))))
nil)))
(defun nnmaildir-close-group (gname &optional server)
nil)))
(defun nnmaildir-close-group (gname &optional server)
@@
-1663,5
+1662,4
@@
by nnmaildir-request-article.")
;; fill-column: 77
;; End:
;; fill-column: 77
;; End:
-;;; arch-tag: 0c4e44cd-dfde-4040-888e-5597ec771849
;;; nnmaildir.el ends here
;;; nnmaildir.el ends here