unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#54745: Subject: 28.1; woman fails on "file"
@ 2022-04-06  9:20 Andreas Röhler
  2022-04-06 10:02 ` Lars Ingebrigtsen
  2022-04-06 11:14 ` Eli Zaretskii
  0 siblings, 2 replies; 5+ messages in thread
From: Andreas Röhler @ 2022-04-06  9:20 UTC (permalink / raw)
  To: 54745

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

M-x woman RET file RET

errors saying:

Debugger entered--Lisp error: (error "WoMan can only format man pages
   written with the usual ‘-man’ macros") signal(error ("WoMan can only
   format man pages written with the usual ‘-man’ macros"))
   error("WoMan can only format man pages written with the usual `-man'
   macros") woman-decode-region(1 21597) woman-decode-buffer()
   woman-process-buffer()
   woman-really-find-file("/usr/share/man/man1/file.1.gz" t "*WoMan 1
   file*<2>") woman-find-file("/usr/share/man/man1/file.1.gz")

However from bash, manpage appears correctly.
Also would read nicely from:  "man file > file.txt"

But woman shows:

.Dd July 13, 2019
.Dt FILE 1
.Os
.Sh NAME
.Nm file
.Nd determine file type
.Sh SYNOPSIS
.Nm
.Bk -words
.Op Fl bcdEhiklLNnprsSvzZ0
.Op Fl Fl apple
.Op Fl Fl extension
.Op Fl Fl mime-encoding
.Op Fl Fl mime-type
.Op Fl e Ar testname
.Op Fl F Ar separator
.Op Fl f Ar namefile
.Op Fl m Ar magicfiles
.Op Fl P Ar name=value
.Ar

...

In GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32, 
cairo version 1.16.0)
  of 2022-04-05 built on affe
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Ubuntu 20.04.4 LTS

Configured using:
  'configure --with-json --with-modules --with-mailutils'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LIBOTF LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK2
ZLIB

Important settings:
   value of $LANG: de_DE.UTF-8
   locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
   tooltip-mode: t
   global-eldoc-mode: t
   show-paren-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   blink-cursor-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   line-number-mode: t
   indent-tabs-mode: t
   transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map text-property-search time-date
subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils disp-table view
jka-compr woman man cl-loaddefs cl-lib ansi-color iso-transl tooltip
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads dbusbind
inotify dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 203536 7948)
  (symbols 48 30679 1)
  (strings 32 80456 1880)
  (string-bytes 1 1321075)
  (vectors 16 14738)
  (vector-slots 8 203630 12255)
  (floats 8 25 137)
  (intervals 56 192 15)
  (buffers 992 12))

[-- Attachment #2: Type: text/html, Size: 5466 bytes --]

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

* bug#54745: Subject: 28.1; woman fails on "file"
  2022-04-06  9:20 bug#54745: Subject: 28.1; woman fails on "file" Andreas Röhler
@ 2022-04-06 10:02 ` Lars Ingebrigtsen
  2022-04-06 11:14 ` Eli Zaretskii
  1 sibling, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-06 10:02 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: 54745

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

> Debugger entered--Lisp error: (error "WoMan can only format man pages
>   written with the usual ‘-man’ macros") signal(error ("WoMan can only
>   format man pages written with the usual ‘-man’ macros"))

This is a duplicate of bug#33504.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#54745: Subject: 28.1; woman fails on "file"
  2022-04-06  9:20 bug#54745: Subject: 28.1; woman fails on "file" Andreas Röhler
  2022-04-06 10:02 ` Lars Ingebrigtsen
@ 2022-04-06 11:14 ` Eli Zaretskii
  2022-04-06 15:47   ` Andreas Röhler
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2022-04-06 11:14 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: 54745

> Date: Wed, 6 Apr 2022 11:20:52 +0200
> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
> 
> M-x woman RET file RET
> 
> errors saying:
> 
> Debugger entered--Lisp error: (error "WoMan can only format man pages
>   written with the usual ‘-man’ macros") signal(error ("WoMan can only
>   format man pages written with the usual ‘-man’ macros"))
>   error("WoMan can only format man pages written with the usual `-man'
>   macros") woman-decode-region(1 21597) woman-decode-buffer()
>   woman-process-buffer()
>   woman-really-find-file("/usr/share/man/man1/file.1.gz" t "*WoMan 1
>   file*<2>") woman-find-file("/usr/share/man/man1/file.1.gz")
> 
> However from bash, manpage appears correctly.
> Also would read nicely from:  "man file > file.txt"

woman.el doesn't use the 'man' program.  It is implemented completely
in Emacs Lisp.  So what 'man' does is not really relevant; what _is_
relevant is that Someone(TM) should step up and volunteer to keep
woman.el up-to-date with all the recent advances in roff markup.
Until that happens, the error you see above is intentional, meant to
alert you, the user, to the fact that the man page cannot be reliably
formatted this way.





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

* bug#54745: Subject: 28.1; woman fails on "file"
  2022-04-06 11:14 ` Eli Zaretskii
@ 2022-04-06 15:47   ` Andreas Röhler
  2022-04-06 16:27     ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Röhler @ 2022-04-06 15:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 54745


[-- Attachment #1.1: Type: text/plain, Size: 1313 bytes --]


Am 06.04.22 um 13:14 schrieb Eli Zaretskii:
>> Date: Wed, 6 Apr 2022 11:20:52 +0200
>> From: Andreas Röhler<andreas.roehler@easy-emacs.de>
>>
>> M-x woman RET file RET
>>
>> errors saying:
>>
>> Debugger entered--Lisp error: (error "WoMan can only format man pages
>>    written with the usual ‘-man’ macros") signal(error ("WoMan can only
>>    format man pages written with the usual ‘-man’ macros"))
>>    error("WoMan can only format man pages written with the usual `-man'
>>    macros") woman-decode-region(1 21597) woman-decode-buffer()
>>    woman-process-buffer()
>>    woman-really-find-file("/usr/share/man/man1/file.1.gz" t "*WoMan 1
>>    file*<2>") woman-find-file("/usr/share/man/man1/file.1.gz")
>>
>> However from bash, manpage appears correctly.
>> Also would read nicely from:  "man file > file.txt"
> woman.el doesn't use the 'man' program.  It is implemented completely
> in Emacs Lisp.  So what 'man' does is not really relevant; what _is_
> relevant is that Someone(TM) should step up and volunteer to keep
> woman.el up-to-date with all the recent advances in roff markup.
> Until that happens, the error you see above is intentional, meant to
> alert you, the user, to the fact that the man page cannot be reliably
> formatted this way.


That workaround attached does it here.

[-- Attachment #1.2: Type: text/html, Size: 1865 bytes --]

[-- Attachment #2: woman.el.patch --]
[-- Type: text/x-patch, Size: 653 bytes --]

diff --git a/lisp/woman.el b/lisp/woman.el
index c0c8f34348..2f923c5455 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -1644,7 +1644,9 @@ woman-really-find-file
     (setq default-directory (file-name-directory filename))
     (setq-local backup-inhibited t)
     (set-visited-file-name "")
-    (woman-process-buffer)))
+    (or (ignore-errors (woman-process-buffer))
+        (erase-buffer) 
+        (shell-command (concat "man " (replace-regexp-in-string "^\\([^\\.]+\\).\\(.*\\)" "\\1" (file-name-nondirectory (file-name-sans-extension filename)))) bufname))))
 
 (defun woman-process-buffer ()
   "The second half of `woman-really-find-file'!"

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

* bug#54745: Subject: 28.1; woman fails on "file"
  2022-04-06 15:47   ` Andreas Röhler
@ 2022-04-06 16:27     ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2022-04-06 16:27 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: 54745

> Date: Wed, 6 Apr 2022 17:47:04 +0200
> Cc: 54745@debbugs.gnu.org
> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
> 
> woman.el doesn't use the 'man' program.  It is implemented completely
> in Emacs Lisp.  So what 'man' does is not really relevant; what _is_
> relevant is that Someone(TM) should step up and volunteer to keep
> woman.el up-to-date with all the recent advances in roff markup.
> Until that happens, the error you see above is intentional, meant to
> alert you, the user, to the fact that the man page cannot be reliably
> formatted this way.
> 
> That workaround attached does it here.

Thanks, but I don't think we want this workaround.  It is better to
alert the user to the fact that woman.el cannot process the man page
in question.  And invoking the 'man' command from woman.el is against
the reason that package exist: if you want to do that, use "M-x man"
instead to begin with.  woman.el was originally developed for systems
where the 'man' command is not available.





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

end of thread, other threads:[~2022-04-06 16:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-06  9:20 bug#54745: Subject: 28.1; woman fails on "file" Andreas Röhler
2022-04-06 10:02 ` Lars Ingebrigtsen
2022-04-06 11:14 ` Eli Zaretskii
2022-04-06 15:47   ` Andreas Röhler
2022-04-06 16:27     ` Eli Zaretskii

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

	https://git.savannah.gnu.org/cgit/emacs.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).