aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2017-12-31 18:20:12 +0200
committerEli Zaretskii2017-12-31 18:20:12 +0200
commit39ca289a7a33d514c2a46f005db4e7173fb7e9f5 (patch)
treec39c7483c9d506d33428ba2aa873a67b20cd51a4
parentf8240815ea1e44cf0b16552ed3a3676b2dc85787 (diff)
downloademacs-39ca289a7a33d514c2a46f005db4e7173fb7e9f5.tar.gz
emacs-39ca289a7a33d514c2a46f005db4e7173fb7e9f5.zip
Allow customization of decoding of "man" command
* lisp/man.el (Man-coding-system): New defcustom. (Man-start-calling): Use it, and also pay attention to user overriding coding-system-for-read. (Bug#29872)
-rw-r--r--lisp/man.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/lisp/man.el b/lisp/man.el
index f7b1609c929..3241043bebd 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -268,6 +268,16 @@ Used in `bookmark-set' to get the default bookmark name."
268 :type 'string 268 :type 'string
269 :group 'man) 269 :group 'man)
270 270
271;; This is for people who have UTF-8 encoded man pages in non-UTF-8
272;; locales, or who use Cygwin 'man' command from a native MS-Windows
273;; build of Emacs.
274(defcustom Man-coding-system nil
275 "Coding-system to decode output from the commands run by `man'.
276If this is nil, `man' will use `locale-coding-system'."
277 :type 'coding-system
278 :group 'man
279 :version "26.1")
280
271(defcustom Man-mode-hook nil 281(defcustom Man-mode-hook nil
272 "Hook run when Man mode is enabled." 282 "Hook run when Man mode is enabled."
273 :type 'hook 283 :type 'hook
@@ -1003,7 +1013,10 @@ names or descriptions. The pattern argument is usually an
1003 (coding-system-for-write 'raw-text-unix) 1013 (coding-system-for-write 'raw-text-unix)
1004 ;; We must decode the output by a coding system that the 1014 ;; We must decode the output by a coding system that the
1005 ;; system's locale suggests in multibyte mode. 1015 ;; system's locale suggests in multibyte mode.
1006 (coding-system-for-read locale-coding-system) 1016 (coding-system-for-read
1017 (or coding-system-for-read ; allow overriding with "C-x RET c"
1018 Man-coding-system
1019 locale-coding-system))
1007 ;; Avoid possible error by using a directory that always exists. 1020 ;; Avoid possible error by using a directory that always exists.
1008 (default-directory 1021 (default-directory
1009 (if (and (file-directory-p default-directory) 1022 (if (and (file-directory-p default-directory)