diff options
| author | Leo Liu | 2011-05-30 20:23:56 +0800 |
|---|---|---|
| committer | Leo Liu | 2011-05-30 20:23:56 +0800 |
| commit | 5ab33f2b8a7184d062c33bc43b1bfd3fe990e3b5 (patch) | |
| tree | 82b60a74e73a38c5548eafe278d50e90314eb77f | |
| parent | 3767e706d7c9914c3451a64d04eac0f1f4059260 (diff) | |
| download | emacs-5ab33f2b8a7184d062c33bc43b1bfd3fe990e3b5.tar.gz emacs-5ab33f2b8a7184d062c33bc43b1bfd3fe990e3b5.zip | |
Decode all incoming messages in rcirc.el
Also allow automatic coding system detection if
rcirc-decode-coding-system is nil.
See discussion in http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8744
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/net/rcirc.el | 10 |
2 files changed, 9 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5176ceca0a0..0064bb79544 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,6 +1,9 @@ | |||
| 1 | 2011-05-30 Leo Liu <sdl.web@gmail.com> | 1 | 2011-05-30 Leo Liu <sdl.web@gmail.com> |
| 2 | 2 | ||
| 3 | * net/rcirc.el (rcirc-debug-buffer): Use visible buffer name. | 3 | * net/rcirc.el (rcirc-debug-buffer): Use visible buffer name. |
| 4 | (rcirc-print): Decode all incoming messages (bug#8744). | ||
| 5 | (rcirc-decode-coding-system): Allow value nil for automatic coding | ||
| 6 | system detection. | ||
| 4 | 7 | ||
| 5 | 2011-05-29 Chong Yidong <cyd@stupidchicken.com> | 8 | 2011-05-29 Chong Yidong <cyd@stupidchicken.com> |
| 6 | 9 | ||
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 7b1f85769dc..b1ee4c45373 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el | |||
| @@ -314,9 +314,11 @@ Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT." | |||
| 314 | :type 'boolean | 314 | :type 'boolean |
| 315 | :group 'rcirc) | 315 | :group 'rcirc) |
| 316 | 316 | ||
| 317 | (defcustom rcirc-decode-coding-system 'utf-8 | 317 | (defcustom rcirc-decode-coding-system nil |
| 318 | "Coding system used to decode incoming irc messages." | 318 | "Coding system used to decode incoming irc messages. |
| 319 | If nil automatically detect the coding system." | ||
| 319 | :type 'coding-system | 320 | :type 'coding-system |
| 321 | :version "24.1" | ||
| 320 | :group 'rcirc) | 322 | :group 'rcirc) |
| 321 | 323 | ||
| 322 | (defcustom rcirc-encode-coding-system 'utf-8 | 324 | (defcustom rcirc-encode-coding-system 'utf-8 |
| @@ -1480,9 +1482,9 @@ record activity." | |||
| 1480 | (old-point (point-marker)) | 1482 | (old-point (point-marker)) |
| 1481 | (fill-start (marker-position rcirc-prompt-start-marker))) | 1483 | (fill-start (marker-position rcirc-prompt-start-marker))) |
| 1482 | 1484 | ||
| 1485 | (setq text (decode-coding-string text (or rcirc-decode-coding-system | ||
| 1486 | (detect-coding-string text t)))) | ||
| 1483 | (unless (string= sender (rcirc-nick process)) | 1487 | (unless (string= sender (rcirc-nick process)) |
| 1484 | ;; only decode text from other senders, not ours | ||
| 1485 | (setq text (decode-coding-string text rcirc-decode-coding-system)) | ||
| 1486 | ;; mark the line with overlay arrow | 1488 | ;; mark the line with overlay arrow |
| 1487 | (unless (or (marker-position overlay-arrow-position) | 1489 | (unless (or (marker-position overlay-arrow-position) |
| 1488 | (get-buffer-window (current-buffer)) | 1490 | (get-buffer-window (current-buffer)) |