unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 1/3] gnu: man-db: Pass --with-col to configure.
@ 2015-07-21 14:57 Alex Kost
  2015-07-21 15:06 ` Thompson, David
  2015-07-21 15:21 ` Ludovic Courtès
  0 siblings, 2 replies; 3+ messages in thread
From: Alex Kost @ 2015-07-21 14:57 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]

Quote from "man man":

--8<---------------cut here---------------start------------->8---
Normally, when output is not being directed to a terminal (such as to a
file or a pipe), formatting characters are discarded to make it easier
to read the result without special tools.
--8<---------------cut here---------------end--------------->8---

However it does not happen with the current "man", as may be checked for
example by evaluating the following in Emacs:

(let ((buf (get-buffer-create "*man true*")))
  (with-current-buffer buf
    (call-process "man" nil t nil "true"))
  (pop-to-buffer buf))

As you can see there are escape sequences (such as "^[[1m") there, which
shouldn't happen.  Configuring man-db "--with-col" fixes the issue (at
least for me).

BTW (a note for Ludovic), the current man behaviour "breaks" completions
of many commands provided by "pcmpl-args" emacs package, because
'pcmpl-args-extract-argspecs-from-manpage' can't parse a man page to find
completions.  For example, "sudo --<TAB>" (in shell-mode) doesn't complete
anything.  After this patch it should work.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-man-db-Pass-with-col-to-configure.patch --]
[-- Type: text/x-patch, Size: 2455 bytes --]

From 2b2e4b79fa37f50587d195792df4e00b743acf1a Mon Sep 17 00:00:00 2001
From: Alex Kost <alezost@gmail.com>
Date: Tue, 21 Jul 2015 17:04:10 +0300
Subject: [PATCH 1/3] gnu: man-db: Pass --with-col to configure.

* gnu/packages/man.scm (man-db)[inputs]: Add 'util-linux'.
  [arguments]: Add '--with-col' to configure flags.
---
 gnu/packages/man.scm | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/man.scm b/gnu/packages/man.scm
index 3173fac..16b891c 100644
--- a/gnu/packages/man.scm
+++ b/gnu/packages/man.scm
@@ -30,7 +30,8 @@
   #:use-module (gnu packages less)
   #:use-module (gnu packages lynx)
   #:use-module (gnu packages perl)
-  #:use-module (gnu packages pkg-config))
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages linux))
 
 (define-public libpipeline
   (package
@@ -82,14 +83,16 @@ a flexible and convenient way.")
        (let ((groff (assoc-ref %build-inputs "groff"))
              (less  (assoc-ref %build-inputs "less"))
              (gzip  (assoc-ref %build-inputs "gzip"))
-             (bzip2  (assoc-ref %build-inputs "bzip2"))
-             (xz  (assoc-ref %build-inputs "xz")))
+             (bzip2 (assoc-ref %build-inputs "bzip2"))
+             (xz    (assoc-ref %build-inputs "xz"))
+             (util  (assoc-ref %build-inputs "util-linux")))
          ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
          (append (list "--disable-setuid" ;; Disable setuid man user.
                        (string-append "--with-pager=" less "/bin/less")
                        (string-append "--with-gzip=" gzip "/bin/gzip")
                        (string-append "--with-bzip2=" bzip2 "/bin/gzip")
-                       (string-append "--with-xz=" xz "/bin/xz"))
+                       (string-append "--with-xz=" xz "/bin/xz")
+                       (string-append "--with-col=" util "/bin/col"))
                  (map (lambda (prog)
                         (string-append "--with-" prog "=" groff "/bin/" prog))
                       '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
@@ -103,7 +106,8 @@ a flexible and convenient way.")
        ("gdbm" ,gdbm)
        ("groff" ,groff)
        ("less" ,less)
-       ("libpipeline" ,libpipeline)))
+       ("libpipeline" ,libpipeline)
+       ("util-linux" ,util-linux)))
     (native-search-paths
      (list (search-path-specification
             (variable "MANPATH")
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/3] gnu: man-db: Pass --with-col to configure.
  2015-07-21 14:57 [PATCH 1/3] gnu: man-db: Pass --with-col to configure Alex Kost
@ 2015-07-21 15:06 ` Thompson, David
  2015-07-21 15:21 ` Ludovic Courtès
  1 sibling, 0 replies; 3+ messages in thread
From: Thompson, David @ 2015-07-21 15:06 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

On Tue, Jul 21, 2015 at 10:57 AM, Alex Kost <alezost@gmail.com> wrote:
> Quote from "man man":
>
> --8<---------------cut here---------------start------------->8---
> Normally, when output is not being directed to a terminal (such as to a
> file or a pipe), formatting characters are discarded to make it easier
> to read the result without special tools.
> --8<---------------cut here---------------end--------------->8---
>
> However it does not happen with the current "man", as may be checked for
> example by evaluating the following in Emacs:
>
> (let ((buf (get-buffer-create "*man true*")))
>   (with-current-buffer buf
>     (call-process "man" nil t nil "true"))
>   (pop-to-buffer buf))
>
> As you can see there are escape sequences (such as "^[[1m") there, which
> shouldn't happen.  Configuring man-db "--with-col" fixes the issue (at
> least for me).
>
> BTW (a note for Ludovic), the current man behaviour "breaks" completions
> of many commands provided by "pcmpl-args" emacs package, because
> 'pcmpl-args-extract-argspecs-from-manpage' can't parse a man page to find
> completions.  For example, "sudo --<TAB>" (in shell-mode) doesn't complete
> anything.  After this patch it should work.

Nice catch.  LGTM!

- Dave

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/3] gnu: man-db: Pass --with-col to configure.
  2015-07-21 14:57 [PATCH 1/3] gnu: man-db: Pass --with-col to configure Alex Kost
  2015-07-21 15:06 ` Thompson, David
@ 2015-07-21 15:21 ` Ludovic Courtès
  1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2015-07-21 15:21 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

Alex Kost <alezost@gmail.com> skribis:

> BTW (a note for Ludovic), the current man behaviour "breaks" completions
> of many commands provided by "pcmpl-args" emacs package, because
> 'pcmpl-args-extract-argspecs-from-manpage' can't parse a man page to find
> completions.  For example, "sudo --<TAB>" (in shell-mode) doesn't complete
> anything.  After this patch it should work.

Aah, great, thanks for nailing it down.

Ludo’.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-21 15:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-21 14:57 [PATCH 1/3] gnu: man-db: Pass --with-col to configure Alex Kost
2015-07-21 15:06 ` Thompson, David
2015-07-21 15:21 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).