emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 39ca289: Allow customization of decoding of "man"


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-26 39ca289: Allow customization of decoding of "man" command
Date: Sun, 31 Dec 2017 11:21:32 -0500 (EST)

branch: emacs-26
commit 39ca289a7a33d514c2a46f005db4e7173fb7e9f5
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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)
---
 lisp/man.el | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/lisp/man.el b/lisp/man.el
index f7b1609..3241043 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -268,6 +268,16 @@ Used in `bookmark-set' to get the default bookmark name."
   :type 'string
   :group 'man)
 
+;; This is for people who have UTF-8 encoded man pages in non-UTF-8
+;; locales, or who use Cygwin 'man' command from a native MS-Windows
+;; build of Emacs.
+(defcustom Man-coding-system nil
+  "Coding-system to decode output from the commands run by `man'.
+If this is nil, `man' will use `locale-coding-system'."
+  :type 'coding-system
+  :group 'man
+  :version "26.1")
+
 (defcustom Man-mode-hook nil
   "Hook run when Man mode is enabled."
   :type 'hook
@@ -1003,7 +1013,10 @@ names or descriptions.  The pattern argument is usually 
an
        (coding-system-for-write 'raw-text-unix)
        ;; We must decode the output by a coding system that the
        ;; system's locale suggests in multibyte mode.
-       (coding-system-for-read locale-coding-system)
+       (coding-system-for-read
+         (or coding-system-for-read  ; allow overriding with "C-x RET c"
+             Man-coding-system
+             locale-coding-system))
        ;; Avoid possible error by using a directory that always exists.
        (default-directory
          (if (and (file-directory-p default-directory)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]