diff options
| author | Stefan Monnier | 2008-06-25 15:10:16 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-06-25 15:10:16 +0000 |
| commit | eafee8f2174ec13e93f1b7c14472b207fb5f9f60 (patch) | |
| tree | 39ffb90ed07c7caae6bb058c85189b88f0e28c08 | |
| parent | ee5b7365d543288bf354ef40dae34a2d4c6258b8 (diff) | |
| download | emacs-eafee8f2174ec13e93f1b7c14472b207fb5f9f60.tar.gz emacs-eafee8f2174ec13e93f1b7c14472b207fb5f9f60.zip | |
* mm-util.el (mm-with-multibyte, mm-with-unibyte): Remove.
* nnkiboze.el (nnkiboze-generate-group):
Use explicit mm-disable-multibyte rather than mm-with-unibyte.
| -rw-r--r-- | lisp/gnus/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/gnus/mm-util.el | 14 | ||||
| -rw-r--r-- | lisp/gnus/nnkiboze.el | 191 |
3 files changed, 101 insertions, 109 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 5da9aee70f4..14d15e70842 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2008-06-25 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2008-06-25 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * mm-util.el (mm-with-multibyte, mm-with-unibyte): Remove. | ||
| 4 | |||
| 5 | * nnkiboze.el (nnkiboze-generate-group): | ||
| 6 | Use explicit mm-disable-multibyte rather than mm-with-unibyte. | ||
| 7 | |||
| 3 | * nnmairix.el: Require CL. | 8 | * nnmairix.el: Require CL. |
| 4 | 9 | ||
| 5 | 2008-06-15 David Engster <dengste@eml.cc> | 10 | 2008-06-15 David Engster <dengste@eml.cc> |
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index ad092130340..453beae5216 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el | |||
| @@ -1093,20 +1093,6 @@ Emacs 23 (unicode)." | |||
| 1093 | (put 'mm-with-unibyte-current-buffer 'lisp-indent-function 0) | 1093 | (put 'mm-with-unibyte-current-buffer 'lisp-indent-function 0) |
| 1094 | (put 'mm-with-unibyte-current-buffer 'edebug-form-spec '(body)) | 1094 | (put 'mm-with-unibyte-current-buffer 'edebug-form-spec '(body)) |
| 1095 | 1095 | ||
| 1096 | (defmacro mm-with-unibyte (&rest forms) | ||
| 1097 | "Eval the FORMS with the default value of `enable-multibyte-characters' nil." | ||
| 1098 | `(let (default-enable-multibyte-characters) | ||
| 1099 | ,@forms)) | ||
| 1100 | (put 'mm-with-unibyte 'lisp-indent-function 0) | ||
| 1101 | (put 'mm-with-unibyte 'edebug-form-spec '(body)) | ||
| 1102 | |||
| 1103 | (defmacro mm-with-multibyte (&rest forms) | ||
| 1104 | "Eval the FORMS with the default value of `enable-multibyte-characters' t." | ||
| 1105 | `(let ((default-enable-multibyte-characters t)) | ||
| 1106 | ,@forms)) | ||
| 1107 | (put 'mm-with-multibyte 'lisp-indent-function 0) | ||
| 1108 | (put 'mm-with-multibyte 'edebug-form-spec '(body)) | ||
| 1109 | |||
| 1110 | (defun mm-find-charset-region (b e) | 1096 | (defun mm-find-charset-region (b e) |
| 1111 | "Return a list of Emacs charsets in the region B to E." | 1097 | "Return a list of Emacs charsets in the region B to E." |
| 1112 | (cond | 1098 | (cond |
diff --git a/lisp/gnus/nnkiboze.el b/lisp/gnus/nnkiboze.el index ab657a610cd..9ad06a8703a 100644 --- a/lisp/gnus/nnkiboze.el +++ b/lisp/gnus/nnkiboze.el | |||
| @@ -247,101 +247,102 @@ Finds out what articles are to be part of the nnkiboze groups." | |||
| 247 | (unless info | 247 | (unless info |
| 248 | (error "No such group: %s" group)) | 248 | (error "No such group: %s" group)) |
| 249 | ;; Load the kiboze newsrc file for this group. | 249 | ;; Load the kiboze newsrc file for this group. |
| 250 | (mm-with-unibyte | 250 | (when (file-exists-p newsrc-file) |
| 251 | (when (file-exists-p newsrc-file) | 251 | (load newsrc-file)) |
| 252 | (load newsrc-file)) | 252 | (let ((coding-system-for-write nnkiboze-file-coding-system)) |
| 253 | (let ((coding-system-for-write nnkiboze-file-coding-system)) | 253 | (gnus-make-directory (file-name-directory nov-file)) |
| 254 | (gnus-make-directory (file-name-directory nov-file)) | 254 | (with-temp-file nov-file |
| 255 | (with-temp-file nov-file | 255 | (mm-disable-multibyte) |
| 256 | (when (file-exists-p nov-file) | 256 | (when (file-exists-p nov-file) |
| 257 | (insert-file-contents nov-file)) | 257 | (insert-file-contents nov-file)) |
| 258 | (setq nov-buffer (current-buffer)) | 258 | (setq nov-buffer (current-buffer)) |
| 259 | ;; Go through the active hashtb and add new all groups that match the | 259 | ;; Go through the active hashtb and add new all groups that match the |
| 260 | ;; kiboze regexp. | 260 | ;; kiboze regexp. |
| 261 | (mapatoms | 261 | (mapatoms |
| 262 | (lambda (group) | 262 | (lambda (group) |
| 263 | (and (string-match nnkiboze-regexp | 263 | (and (string-match nnkiboze-regexp |
| 264 | (setq gname (symbol-name group))) ; Match | 264 | (setq gname (symbol-name group))) ; Match |
| 265 | (not (assoc gname nnkiboze-newsrc)) ; It isn't registered | 265 | (not (assoc gname nnkiboze-newsrc)) ; It isn't registered |
| 266 | (numberp (car (symbol-value group))) ; It is active | 266 | (numberp (car (symbol-value group))) ; It is active |
| 267 | (or (> nnkiboze-level 7) | 267 | (or (> nnkiboze-level 7) |
| 268 | (and (setq glevel | 268 | (and (setq glevel |
| 269 | (gnus-info-level (gnus-get-info gname))) | 269 | (gnus-info-level (gnus-get-info gname))) |
| 270 | (>= nnkiboze-level glevel))) | 270 | (>= nnkiboze-level glevel))) |
| 271 | (not (string-match "^nnkiboze:" gname)) ; Exclude kibozes | 271 | (not (string-match "^nnkiboze:" gname)) ; Exclude kibozes |
| 272 | (push (cons gname (1- (car (symbol-value group)))) | 272 | (push (cons gname (1- (car (symbol-value group)))) |
| 273 | nnkiboze-newsrc))) | 273 | nnkiboze-newsrc))) |
| 274 | gnus-active-hashtb) | 274 | gnus-active-hashtb) |
| 275 | ;; `newsrc' is set to the list of groups that possibly are | 275 | ;; `newsrc' is set to the list of groups that possibly are |
| 276 | ;; component groups to this kiboze group. This list has elements | 276 | ;; component groups to this kiboze group. This list has elements |
| 277 | ;; on the form `(GROUP . NUMBER)', where NUMBER is the highest | 277 | ;; on the form `(GROUP . NUMBER)', where NUMBER is the highest |
| 278 | ;; number that has been kibozed in GROUP in this kiboze group. | 278 | ;; number that has been kibozed in GROUP in this kiboze group. |
| 279 | (setq newsrc nnkiboze-newsrc) | 279 | (setq newsrc nnkiboze-newsrc) |
| 280 | (while newsrc | 280 | (while newsrc |
| 281 | (if (not (setq active (gnus-active (caar newsrc)))) | 281 | (if (not (setq active (gnus-active (caar newsrc)))) |
| 282 | ;; This group isn't active after all, so we remove it from | 282 | ;; This group isn't active after all, so we remove it from |
| 283 | ;; the list of component groups. | 283 | ;; the list of component groups. |
| 284 | (setq nnkiboze-newsrc (delq (car newsrc) nnkiboze-newsrc)) | 284 | (setq nnkiboze-newsrc (delq (car newsrc) nnkiboze-newsrc)) |
| 285 | (setq lowest (cdar newsrc)) | 285 | (setq lowest (cdar newsrc)) |
| 286 | ;; Ok, we have a valid component group, so we jump to it. | 286 | ;; Ok, we have a valid component group, so we jump to it. |
| 287 | (switch-to-buffer gnus-group-buffer) | 287 | (switch-to-buffer gnus-group-buffer) |
| 288 | (gnus-group-jump-to-group (caar newsrc)) | 288 | (gnus-group-jump-to-group (caar newsrc)) |
| 289 | (gnus-message 3 "nnkiboze: Checking %s..." (caar newsrc)) | 289 | (gnus-message 3 "nnkiboze: Checking %s..." (caar newsrc)) |
| 290 | (setq ginfo (gnus-get-info (gnus-group-group-name)) | 290 | (setq ginfo (gnus-get-info (gnus-group-group-name)) |
| 291 | orig-info (gnus-copy-sequence ginfo) | 291 | orig-info (gnus-copy-sequence ginfo) |
| 292 | num-unread (gnus-group-unread (caar newsrc))) | 292 | num-unread (gnus-group-unread (caar newsrc))) |
| 293 | (unwind-protect | 293 | (unwind-protect |
| 294 | (progn | 294 | (progn |
| 295 | ;; We set all list of article marks to nil. Since we operate | 295 | ;; We set all list of article marks to nil. Since we operate |
| 296 | ;; on copies of the real lists, we can destroy anything we | 296 | ;; on copies of the real lists, we can destroy anything we |
| 297 | ;; want here. | 297 | ;; want here. |
| 298 | (when (nth 3 ginfo) | 298 | (when (nth 3 ginfo) |
| 299 | (setcar (nthcdr 3 ginfo) nil)) | 299 | (setcar (nthcdr 3 ginfo) nil)) |
| 300 | ;; We set the list of read articles to be what we expect for | 300 | ;; We set the list of read articles to be what we expect for |
| 301 | ;; this kiboze group -- either nil or `(1 . LOWEST)'. | 301 | ;; this kiboze group -- either nil or `(1 . LOWEST)'. |
| 302 | (when ginfo | 302 | (when ginfo |
| 303 | (setcar (nthcdr 2 ginfo) | 303 | (setcar (nthcdr 2 ginfo) |
| 304 | (and (not (= lowest 1)) (cons 1 lowest)))) | 304 | (and (not (= lowest 1)) (cons 1 lowest)))) |
| 305 | (when (and (or (not ginfo) | 305 | (when (and (or (not ginfo) |
| 306 | (> (length (gnus-list-of-unread-articles | 306 | (> (length (gnus-list-of-unread-articles |
| 307 | (car ginfo))) | 307 | (car ginfo))) |
| 308 | 0)) | 308 | 0)) |
| 309 | (progn | 309 | (progn |
| 310 | (ignore-errors | 310 | (ignore-errors |
| 311 | (gnus-group-select-group nil)) | 311 | (gnus-group-select-group nil)) |
| 312 | (eq major-mode 'gnus-summary-mode))) | 312 | (eq major-mode 'gnus-summary-mode))) |
| 313 | ;; We are now in the group where we want to be. | 313 | ;; We are now in the group where we want to be. |
| 314 | (setq method (gnus-find-method-for-group | 314 | (setq method (gnus-find-method-for-group |
| 315 | gnus-newsgroup-name)) | 315 | gnus-newsgroup-name)) |
| 316 | (when (eq method gnus-select-method) | 316 | (when (eq method gnus-select-method) |
| 317 | (setq method nil)) | 317 | (setq method nil)) |
| 318 | ;; We go through the list of scored articles. | 318 | ;; We go through the list of scored articles. |
| 319 | (while gnus-newsgroup-scored | 319 | (while gnus-newsgroup-scored |
| 320 | (when (> (caar gnus-newsgroup-scored) lowest) | 320 | (when (> (caar gnus-newsgroup-scored) lowest) |
| 321 | ;; If it has a good score, then we enter this article | 321 | ;; If it has a good score, then we enter this article |
| 322 | ;; into the kiboze group. | 322 | ;; into the kiboze group. |
| 323 | (nnkiboze-enter-nov | 323 | (nnkiboze-enter-nov |
| 324 | nov-buffer | 324 | nov-buffer |
| 325 | (gnus-summary-article-header | 325 | (gnus-summary-article-header |
| 326 | (caar gnus-newsgroup-scored)) | 326 | (caar gnus-newsgroup-scored)) |
| 327 | gnus-newsgroup-name)) | 327 | gnus-newsgroup-name)) |
| 328 | (setq gnus-newsgroup-scored (cdr gnus-newsgroup-scored))) | 328 | (setq gnus-newsgroup-scored (cdr gnus-newsgroup-scored))) |
| 329 | ;; That's it. We exit this group. | 329 | ;; That's it. We exit this group. |
| 330 | (when (eq major-mode 'gnus-summary-mode) | 330 | (when (eq major-mode 'gnus-summary-mode) |
| 331 | (kill-buffer (current-buffer))))) | 331 | (kill-buffer (current-buffer))))) |
| 332 | ;; Restore the proper info. | 332 | ;; Restore the proper info. |
| 333 | (when ginfo | 333 | (when ginfo |
| 334 | (setcdr ginfo (cdr orig-info))) | 334 | (setcdr ginfo (cdr orig-info))) |
| 335 | (setcar (gnus-group-entry (caar newsrc)) num-unread))) | 335 | (setcar (gnus-group-entry (caar newsrc)) num-unread))) |
| 336 | (setcdr (car newsrc) (cdr active)) | 336 | (setcdr (car newsrc) (cdr active)) |
| 337 | (gnus-message 3 "nnkiboze: Checking %s...done" (caar newsrc)) | 337 | (gnus-message 3 "nnkiboze: Checking %s...done" (caar newsrc)) |
| 338 | (setq newsrc (cdr newsrc))))) | 338 | (setq newsrc (cdr newsrc))))) |
| 339 | ;; We save the kiboze newsrc for this group. | 339 | ;; We save the kiboze newsrc for this group. |
| 340 | (gnus-make-directory (file-name-directory newsrc-file)) | 340 | (gnus-make-directory (file-name-directory newsrc-file)) |
| 341 | (with-temp-file newsrc-file | 341 | (with-temp-file newsrc-file |
| 342 | (insert "(setq nnkiboze-newsrc '") | 342 | (mm-disable-multibyte) |
| 343 | (gnus-prin1 nnkiboze-newsrc) | 343 | (insert "(setq nnkiboze-newsrc '") |
| 344 | (insert ")\n"))) | 344 | (gnus-prin1 nnkiboze-newsrc) |
| 345 | (insert ")\n")) | ||
| 345 | (unless inhibit-list-groups | 346 | (unless inhibit-list-groups |
| 346 | (save-excursion | 347 | (save-excursion |
| 347 | (set-buffer gnus-group-buffer) | 348 | (set-buffer gnus-group-buffer) |