unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: LanX <lanx.perl@googlemail.com>
Cc: 6013@debbugs.gnu.org
Subject: bug#6013: [cperl-mode] cperl-perldoc doesn't work anymore with file test operators like -e
Date: Fri, 5 Jul 2019 21:10:28 +0200	[thread overview]
Message-ID: <CADwFkmktfitVvyUvaTRY1ZOkVtg3AS5+pBqFecc=ia69h+7M6w@mail.gmail.com> (raw)
In-Reply-To: <w2mec36f5051004230416y9a95feafi252c3080dd50dd10@mail.gmail.com>

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

tags 6013 patch
thanks

LanX <lanx.perl@googlemail.com> writes:

> Hi
>
> cperl-mode can't call perldocs for functions with a hyphen anymore like "-e" or "-X"
>
> (cperl-perldoc "-e") or "M-x cperl-perldoc RET -e" result to
>    "error in process sentinel: Man-bgproc-sentinel: Can't find the -e manpage"
>
> But perldoc -f -e works fine in the shell, and as far as I can see from the sources of cperl-mode "-e" this case is covered to be mapped on the -f switch.
>
> Tested on 23 and 22 from two different users on different continents.
>
> Cheers
>   Rolf

I can confirm this bug, and have attached a fix.

This is tested only on one continent.

Best regards,
Stefan Kangas

[-- Attachment #2: 0001-Fix-looking-up-functions-like-e-in-cperl-mode.patch --]
[-- Type: text/x-patch, Size: 902 bytes --]

From 0025bfde027cbcd2d1fee6f0b9429a84c4770ac2 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Fri, 5 Jul 2019 20:53:53 +0200
Subject: [PATCH] Fix looking up functions like "-e" in cperl-mode

* lisp/progmodes/cperl-mode.el (cperl-perldoc): Handle functions with
leading dash (e.g. "-f"). (Bug#6013)
---
 lisp/progmodes/cperl-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 254269ddf1..6970b5ec84 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -8382,7 +8382,7 @@ cperl-perldoc
   (require 'man)
   (let* ((case-fold-search nil)
 	 (is-func (and
-		   (string-match "^[a-z]+$" word)
+		   (string-match "^\\(-[A-Za-z]\\|[a-z]+\\)$" word)
 		   (string-match (concat "^" word "\\>")
 				 (documentation-property
 				  'cperl-short-docs
-- 
2.11.0


  reply	other threads:[~2019-07-05 19:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-23 11:16 bug#6013: [cperl-mode] cperl-perldoc doesn't work anymore with file test operators like -e LanX
2019-07-05 19:10 ` Stefan Kangas [this message]
2019-07-13  7:41   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkmktfitVvyUvaTRY1ZOkVtg3AS5+pBqFecc=ia69h+7M6w@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=6013@debbugs.gnu.org \
    --cc=lanx.perl@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).