diff options
| author | Lars Magne Ingebrigtsen | 2011-05-02 03:37:06 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2011-05-02 03:37:06 +0000 |
| commit | 9f5e78f7d565d4d779d8ed2715ef72ff70c10e45 (patch) | |
| tree | 630e772f2de65695d356b05537700f5b34aa4832 | |
| parent | bafcf6a5549e9b0fcce1671c1100716fc4c0c9b3 (diff) | |
| download | emacs-9f5e78f7d565d4d779d8ed2715ef72ff70c10e45.tar.gz emacs-9f5e78f7d565d4d779d8ed2715ef72ff70c10e45.zip | |
nnheader.el (nnheader-insert-buffer-substring): Renamed from nntp- and moved from that file for reuse.
| -rw-r--r-- | lisp/gnus/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/gnus/nnheader.el | 13 | ||||
| -rw-r--r-- | lisp/gnus/nnimap.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/nntp.el | 21 |
4 files changed, 21 insertions, 18 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 3038ef53ef4..e4a5aede155 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2011-05-02 Lars Magne Ingebrigtsen <larsi@gnus.org> | 1 | 2011-05-02 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 2 | 2 | ||
| 3 | * nnheader.el (nnheader-insert-buffer-substring): Renamed from nntp- | ||
| 4 | and moved from that file for reuse. | ||
| 5 | |||
| 3 | * pop3.el (pop3-open-server): Error messages are "-ERR". | 6 | * pop3.el (pop3-open-server): Error messages are "-ERR". |
| 4 | 7 | ||
| 5 | 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org> | 8 | 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org> |
diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el index ae5893ae42d..6f871ccb9e8 100644 --- a/lisp/gnus/nnheader.el +++ b/lisp/gnus/nnheader.el | |||
| @@ -1099,6 +1099,19 @@ See `find-file-noselect' for the arguments." | |||
| 1099 | backend-marks))))) | 1099 | backend-marks))))) |
| 1100 | backend-marks) | 1100 | backend-marks) |
| 1101 | 1101 | ||
| 1102 | (defmacro nnheader-insert-buffer-substring (buffer &optional start end) | ||
| 1103 | "Copy string from unibyte buffer to multibyte current buffer." | ||
| 1104 | (if (featurep 'xemacs) | ||
| 1105 | `(insert-buffer-substring ,buffer ,start ,end) | ||
| 1106 | `(if enable-multibyte-characters | ||
| 1107 | (insert (with-current-buffer ,buffer | ||
| 1108 | (mm-string-to-multibyte | ||
| 1109 | ,(if (or start end) | ||
| 1110 | `(buffer-substring (or ,start (point-min)) | ||
| 1111 | (or ,end (point-max))) | ||
| 1112 | '(buffer-string))))) | ||
| 1113 | (insert-buffer-substring ,buffer ,start ,end)))) | ||
| 1114 | |||
| 1102 | (when (featurep 'xemacs) | 1115 | (when (featurep 'xemacs) |
| 1103 | (require 'nnheaderxm)) | 1116 | (require 'nnheaderxm)) |
| 1104 | 1117 | ||
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 681d483b462..6882ed63135 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el | |||
| @@ -545,7 +545,7 @@ textual parts.") | |||
| 545 | (nnimap-get-whole-article article)) | 545 | (nnimap-get-whole-article article)) |
| 546 | (let ((buffer (current-buffer))) | 546 | (let ((buffer (current-buffer))) |
| 547 | (with-current-buffer (or to-buffer nntp-server-buffer) | 547 | (with-current-buffer (or to-buffer nntp-server-buffer) |
| 548 | (nntp-insert-buffer-substring buffer) | 548 | (nnheader-insert-buffer-substring buffer) |
| 549 | (nnheader-ms-strip-cr))) | 549 | (nnheader-ms-strip-cr))) |
| 550 | (cons group article))))))) | 550 | (cons group article))))))) |
| 551 | 551 | ||
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index c8f1d04d4d3..727d9b4d8c0 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el | |||
| @@ -364,19 +364,6 @@ be restored and the command retried." | |||
| 364 | 364 | ||
| 365 | (throw 'nntp-with-open-group-error t)) | 365 | (throw 'nntp-with-open-group-error t)) |
| 366 | 366 | ||
| 367 | (defmacro nntp-insert-buffer-substring (buffer &optional start end) | ||
| 368 | "Copy string from unibyte buffer to multibyte current buffer." | ||
| 369 | (if (featurep 'xemacs) | ||
| 370 | `(insert-buffer-substring ,buffer ,start ,end) | ||
| 371 | `(if enable-multibyte-characters | ||
| 372 | (insert (with-current-buffer ,buffer | ||
| 373 | (mm-string-to-multibyte | ||
| 374 | ,(if (or start end) | ||
| 375 | `(buffer-substring (or ,start (point-min)) | ||
| 376 | (or ,end (point-max))) | ||
| 377 | '(buffer-string))))) | ||
| 378 | (insert-buffer-substring ,buffer ,start ,end)))) | ||
| 379 | |||
| 380 | (defmacro nntp-copy-to-buffer (buffer start end) | 367 | (defmacro nntp-copy-to-buffer (buffer start end) |
| 381 | "Copy string from unibyte current buffer to multibyte buffer." | 368 | "Copy string from unibyte current buffer to multibyte buffer." |
| 382 | (if (featurep 'xemacs) | 369 | (if (featurep 'xemacs) |
| @@ -434,7 +421,7 @@ be restored and the command retried." | |||
| 434 | (unless discard | 421 | (unless discard |
| 435 | (with-current-buffer buffer | 422 | (with-current-buffer buffer |
| 436 | (goto-char (point-max)) | 423 | (goto-char (point-max)) |
| 437 | (nntp-insert-buffer-substring (process-buffer process)) | 424 | (nnheader-insert-buffer-substring (process-buffer process)) |
| 438 | ;; Nix out "nntp reading...." message. | 425 | ;; Nix out "nntp reading...." message. |
| 439 | (when nntp-have-messaged | 426 | (when nntp-have-messaged |
| 440 | (setq nntp-have-messaged nil) | 427 | (setq nntp-have-messaged nil) |
| @@ -996,7 +983,7 @@ command whose response triggered the error." | |||
| 996 | (narrow-to-region | 983 | (narrow-to-region |
| 997 | (setq point (goto-char (point-max))) | 984 | (setq point (goto-char (point-max))) |
| 998 | (progn | 985 | (progn |
| 999 | (nntp-insert-buffer-substring buf last-point (cdr entry)) | 986 | (nnheader-insert-buffer-substring buf last-point (cdr entry)) |
| 1000 | (point-max))) | 987 | (point-max))) |
| 1001 | (setq last-point (cdr entry)) | 988 | (setq last-point (cdr entry)) |
| 1002 | (nntp-decode-text) | 989 | (nntp-decode-text) |
| @@ -1472,7 +1459,7 @@ password contained in '~/.nntp-authinfo'." | |||
| 1472 | (goto-char (point-max)) | 1459 | (goto-char (point-max)) |
| 1473 | (save-restriction | 1460 | (save-restriction |
| 1474 | (narrow-to-region (point) (point)) | 1461 | (narrow-to-region (point) (point)) |
| 1475 | (nntp-insert-buffer-substring buf start) | 1462 | (nnheader-insert-buffer-substring buf start) |
| 1476 | (when decode | 1463 | (when decode |
| 1477 | (nntp-decode-text)))))) | 1464 | (nntp-decode-text)))))) |
| 1478 | ;; report it. | 1465 | ;; report it. |
| @@ -1700,7 +1687,7 @@ password contained in '~/.nntp-authinfo'." | |||
| 1700 | (when in-process-buffer-p | 1687 | (when in-process-buffer-p |
| 1701 | (set-buffer buf) | 1688 | (set-buffer buf) |
| 1702 | (goto-char (point-max)) | 1689 | (goto-char (point-max)) |
| 1703 | (nntp-insert-buffer-substring process-buffer) | 1690 | (nnheader-insert-buffer-substring process-buffer) |
| 1704 | (set-buffer process-buffer) | 1691 | (set-buffer process-buffer) |
| 1705 | (erase-buffer) | 1692 | (erase-buffer) |
| 1706 | (set-buffer buf)) | 1693 | (set-buffer buf)) |