From 39ca289a7a33d514c2a46f005db4e7173fb7e9f5 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 31 Dec 2017 18:20:12 +0200 Subject: 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(-) (limited to 'lisp/man.el') 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." :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) -- cgit v1.2.1 From 5c7dd8a783fa2503f042f6671279e5fca38c35cb Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 1 Jan 2018 00:21:42 -0800 Subject: Update copyright year to 2018 Run admin/update-copyright. --- lisp/man.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/man.el') diff --git a/lisp/man.el b/lisp/man.el index 3241043bebd..c62a61c708d 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1,6 +1,6 @@ ;;; man.el --- browse UNIX manual pages -*- lexical-binding: t -*- -;; Copyright (C) 1993-1994, 1996-1997, 2001-2017 Free Software +;; Copyright (C) 1993-1994, 1996-1997, 2001-2018 Free Software ;; Foundation, Inc. ;; Author: Barry A. Warsaw -- cgit v1.2.1