From d1583c48e5bee8a865a78fe1db71dc8c46b40422 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Thu, 14 Jul 2011 19:39:00 +0200 Subject: [PATCH] Only output the man page name on failures * man.el (Man-bgproc-sentinel): Skip any arguments and only output the man page name. Fixes: debbugs:6935 --- lisp/ChangeLog | 3 +++ lisp/man.el | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 936dab89ae5..ec8f794f211 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -10,6 +10,9 @@ 2011-07-14 Lars Magne Ingebrigtsen + * man.el (Man-bgproc-sentinel): Skip any arguments and only output + the man page name (bug#7929). + * image.el (put-image): Mention the `put-image' overlay property (bug#7834). diff --git a/lisp/man.el b/lisp/man.el index b5a70395e59..8782b22c804 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1257,12 +1257,20 @@ manpage command." (Man-mode) (if (not Man-page-list) - (let ((args Man-arguments)) + (let ((args Man-arguments)) (kill-buffer (current-buffer)) - (error "Can't find the %s manpage" args))) - - (set-buffer-modified-p nil) - )) + (error "Can't find the %s manpage" + ;; Skip arguments and only print the page name. + (mapconcat + 'identity + (delete nil + (mapcar + (lambda (elem) + (and (not (string-match "^-" elem)) + elem)) + (split-string args " "))) + " "))) + (set-buffer-modified-p nil)))) ;; Restore case-fold-search before calling ;; Man-notify-when-ready because it may switch buffers.