From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vaidheeswaran C Newsgroups: gmane.emacs.bugs Subject: bug#21024: help-xref-button in header line doesn't work (PATCH attached) Date: Thu, 09 Jul 2015 23:04:07 +0530 Message-ID: <559EB08F.1080507@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040106020009060001090301" X-Trace: ger.gmane.org 1436492242 25683 80.91.229.3 (10 Jul 2015 01:37:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jul 2015 01:37:22 +0000 (UTC) To: 21024@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 10 03:37:11 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZDNFX-0004Q2-3n for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Jul 2015 03:37:11 +0200 Original-Received: from localhost ([::1]:42583 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDNFW-0002sQ-5c for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 Jul 2015 21:37:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDNFS-0002sK-K6 for bug-gnu-emacs@gnu.org; Thu, 09 Jul 2015 21:37:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDNFP-0002w5-D7 for bug-gnu-emacs@gnu.org; Thu, 09 Jul 2015 21:37:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44231) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDNFP-0002vo-8O for bug-gnu-emacs@gnu.org; Thu, 09 Jul 2015 21:37:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZDNFO-0003Q3-Pb for bug-gnu-emacs@gnu.org; Thu, 09 Jul 2015 21:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vaidheeswaran C Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Jul 2015 01:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21024 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.143649219813104 (code B ref -1); Fri, 10 Jul 2015 01:37:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Jul 2015 01:36:38 +0000 Original-Received: from localhost ([127.0.0.1]:45676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDNEy-0003PC-IE for submit@debbugs.gnu.org; Thu, 09 Jul 2015 21:36:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55345) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDFi4-0000JU-4C for submit@debbugs.gnu.org; Thu, 09 Jul 2015 13:34:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDFhx-0001IZ-Hy for submit@debbugs.gnu.org; Thu, 09 Jul 2015 13:34:02 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:44279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDFhx-0001IV-F1 for submit@debbugs.gnu.org; Thu, 09 Jul 2015 13:34:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDFhw-0005gP-6s for bug-gnu-emacs@gnu.org; Thu, 09 Jul 2015 13:34:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDFhs-0001H1-77 for bug-gnu-emacs@gnu.org; Thu, 09 Jul 2015 13:34:00 -0400 Original-Received: from mail-pd0-x234.google.com ([2607:f8b0:400e:c02::234]:34090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDFhr-0001GA-VJ for bug-gnu-emacs@gnu.org; Thu, 09 Jul 2015 13:33:56 -0400 Original-Received: by pdbep18 with SMTP id ep18so168617967pdb.1 for ; Thu, 09 Jul 2015 10:33:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; bh=ZZ+nvWYgLtS+OifySW/QT+6frgkZa/XPIdWsBiJQKVM=; b=eMFCth+sgBTD/+pdFm/YE0Zm2kSnw3oECzZtvqUoplF+imebPpGqepynWQbXn9qW/Y nyMgrugql+fAeaqpVHv1I1mMI5gJanrx0ru6QQ+ZbS6hcT60cDTo4UiiUz7p0jUt58AD O//63jxqx9nsMy/GyvqyPSjIH2YnXhxv1YIVUPfpzMdkxqnDf4VZJtm2Hc444I+Wpm6Q v6HxR+LbhQ8+QRKAdv3/aLc5FSXs8zzUQpkf64KlBktL4CGpOg/bp49ik3Anj11tz9P7 cujhkUusZ6id2Jm2jKPVC/TmN/QpShFXDJ/hs9DOgX08dcxU99Amkd4uRdc4DUjOcZ3e UoGQ== X-Received: by 10.66.101.9 with SMTP id fc9mr32870126pab.37.1436463233498; Thu, 09 Jul 2015 10:33:53 -0700 (PDT) Original-Received: from [192.168.43.83] ([106.216.167.5]) by smtp.gmail.com with ESMTPSA id af5sm6592196pbc.90.2015.07.09.10.33.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 10:33:52 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.3.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Thu, 09 Jul 2015 21:36:34 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:104869 Archived-At: This is a multi-part message in MIME format. --------------040106020009060001090301 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 1. Copy this snippet to scratch buffer and eval it. (define-button-type 'hello-world :supertype 'help-xref 'help-function (lambda () (message "Hello World"))) (setq header-line-format (make-text-button "Hello World" nil 'type 'hello-world)) 2. Click on the header buton 3. Note the following stack trace Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p (#("Hello World" 0 11 (button (t) category hello-world-button)) . 10)) button-start((#("Hello World" 0 11 (button (t) category hello-world-button)) . 10)) help-button-action((#("Hello World" 0 11 (button (t) category hello-world-button)) . 10)) button-activate((#("Hello World" 0 11 (button (t) category hello-world-button)) . 10) t) push-button((mouse-2 (# header-line (103 . 14) 11071944 (#("Hello World" 0 11 (button (t) category hello-world-button)) . 10) nil (10 . -1) nil (3 . 14) (10 . 18)))) funcall-interactively(push-button (mouse-2 (# header-line (103 . 14) 11071944 (#("Hello World" 0 11 (button (t) category hello-world-button)) . 10) nil (10 . -1) nil (3 . 14) (10 . 18)))) call-interactively(push-button nil nil) command-execute(push-button) ---------------------------------------------------------------- This bug is related to bug#12817: 24.2; The button library does not work on the header line. The sole difference here is that button is a help-xref button. See http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-12/msg00203.html The related commit is 24fc948039 ---------------------------------------------------------------- Without getting in to nitty gritties of the "area buttons", the fix is fairly simple once you notice that `help-do-xref' doesn't use the first argument. See the attached patch. ---------------------------------------------------------------- (I am working on a dictionary client for Emacs. I will circulate the module -- I call it edictc.el -- in another week. The package uses xref links in header line, FWIW.) --------------040106020009060001090301 Content-Type: text/x-patch; name="help-mode.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="help-mode.diff" diff --git a/lisp/help-mode.el b/lisp/help-mode.el index e1fc9fd..ac74e03 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -107,7 +107,7 @@ The format is (FUNCTION ARGS...).") (defun help-button-action (button) "Call BUTTON's help function." - (help-do-xref (button-start button) + (help-do-xref nil (button-get button 'help-function) (button-get button 'help-args))) --------------040106020009060001090301--