all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#23647: 25.1.50; In man pages, links on hyphenated words don't work
@ 2016-05-29  9:52 Stephen Berman
  2016-05-29 14:42 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Berman @ 2016-05-29  9:52 UTC (permalink / raw)
  To: 23647

O. emacs -Q
1. Open a man page that has a link on a hyphenated word, e.g. on my
   system: M-x man RET signal RET, put point on the word spanning lines
   129-130, which is displayed as `sig-
   nalfd(2)'.
2. Type RET (or click mouse-1 or mouse-2) on that link.
=> The error message "Can’t find the 2 sig-nalfd manpage" is displayed.

The following patch makes the link DTRT:

diff --git a/lisp/man.el b/lisp/man.el
index 5acf90b..5d4cacc 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -1430,8 +1430,14 @@ Man-bgproc-sentinel
 			(quit-restore-window
 			 (get-buffer-window (current-buffer) t) 'kill)
 		      (kill-buffer (current-buffer)))
-		    (message "Can't find the %s manpage"
-			     (Man-page-from-arguments args)))
+                    ;; Entries hyphenated due to the window width
+                    ;; won't be found in the man database, so remove
+                    ;; the hyphenation and look again.
+		    (if (string-match "-" args)
+			(let ((str (replace-match "" nil nil args)))
+			  (Man-getpage-in-background str))
+                      (message "Can't find the %s manpage"
+                               (Man-page-from-arguments args))))
 
 		(if Man-fontify-manpage-flag
 		    (message "%s man page formatted"

This is a long-standing bug (presumably since commit
162a12b1d7b1e985a8810bad24d068c825286f56 of Sep 13 2007), but although
the fix seems safe, I suppose it's too late for emacs-25.  So if there
are no objections, should I commit it to master, or is it ok for the
upcoming release?


In GNU Emacs 25.1.50.19 (x86_64-suse-linux-gnu, GTK+ Version 3.14.15)
 of 2016-05-28 built on rosalinde
Repository revision: 4ef0fc192b8a10625053dbb9376c814e68612eb6
Windowing system distributor 'The X.Org Foundation', version 11.0.11601000
System Description:	openSUSE 13.2 (Harlequin) (x86_64)

Configured using:
 'configure --with-xwidgets 'CFLAGS=-Og -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GCONF GSETTINGS NOTIFY
GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 XWIDGETS

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix





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

end of thread, other threads:[~2016-06-05 11:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-29  9:52 bug#23647: 25.1.50; In man pages, links on hyphenated words don't work Stephen Berman
2016-05-29 14:42 ` Eli Zaretskii
2016-05-29 23:09   ` Stephen Berman
2016-05-30  0:22     ` Eli Zaretskii
2016-05-30 13:55       ` Stephen Berman
2016-06-04 15:35         ` Eli Zaretskii
2016-06-05 11:17           ` Stephen Berman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.