From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jiegec Newsgroups: gmane.emacs.bugs Subject: bug#23909: 25.1.50; `button-label' must be called in the buffer where the button is in but not mentioned in document Date: Fri, 8 Jul 2016 18:36:42 +0800 Message-ID: <839DE945-E926-4774-8F30-CE7DE6B66C9F@qq.com> References: <838txdlbdp.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1467974255 23416 80.91.229.3 (8 Jul 2016 10:37:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Jul 2016 10:37:35 +0000 (UTC) Cc: 23909@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 08 12:37:19 2016 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 1bLT9r-0006tk-0O for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Jul 2016 12:37:19 +0200 Original-Received: from localhost ([::1]:44687 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLT9l-0004jc-6i for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Jul 2016 06:37:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLT9e-0004jB-Gn for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2016 06:37:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLT9a-0006di-EG for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2016 06:37:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLT9a-0006dW-BC for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2016 06:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bLT9Z-0002uu-Um for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2016 06:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jiegec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Jul 2016 10:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23909 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23909-submit@debbugs.gnu.org id=B23909.146797421911202 (code B ref 23909); Fri, 08 Jul 2016 10:37:01 +0000 Original-Received: (at 23909) by debbugs.gnu.org; 8 Jul 2016 10:36:59 +0000 Original-Received: from localhost ([127.0.0.1]:41786 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLT9W-0002ub-PX for submit@debbugs.gnu.org; Fri, 08 Jul 2016 06:36:59 -0400 Original-Received: from smtpbguseast2.qq.com ([54.204.34.130]:49642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLT9U-0002uL-FR for 23909@debbugs.gnu.org; Fri, 08 Jul 2016 06:36:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1467974204; bh=i2vTFL7HPnIeV+BqcSw2YeIAeKUNjRTXdbzDTeIyVEs=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To; b=NUZbhWiUD5zAKvGQe1tPHPZi5UFmp4F3lu6K2gMqzCDYTsY9sMwyzSpffQ5A55ozY U3pb6HbwcanzJV5BdnBPQjVeWuiSt5AvOGHh7A+374XZy0HP6DgufGv5iadlRKyvNX oD6R2ysl/ITi0fAhZUXcjMG3Ju8z3BLWi2sXwOB8= X-QQ-mid: esmtp11t1467974203t278t06566 Original-Received: from [192.168.0.162] (unknown [14.20.7.110]) by esmtp4.qq.com (ESMTP) with id ; Fri, 08 Jul 2016 18:36:42 +0800 (CST) X-QQ-SSF: 0000000000000050F31000000000000 X-QQ-FEAT: ZGIeEXsGnU0R2Ju2iv28htb2CizaMNF7bb9pZyaq/ur6TjO3c9gyH0LnugSZp UMX+HdaWNrO9FBWDziGrywEQ/BAgZQmSQsJkGjf6dVik+Ww8PvX2gyuBaX6dzSwUlFq52g+ u/ju2y4Z2AzOJdIF2zEdrf0pGntb8tnkAH7p11Z0339UPCtBaOlz5oUjL11B37SforpuXpi cmCLladIZSOMQTcIF8uJAs3Jp/BibFHn+spS3t/A1Wqfa9yp9ARgM X-QQ-GoodBg: 0 In-Reply-To: <838txdlbdp.fsf@gnu.org> X-Mailer: Apple Mail (2.3124) X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:120620 Archived-At: I have gone through button.el and found only `button-label=E2=80=99 = needs this change. If I have left out some, please add those as well. This change should be small enough and I needn=E2=80=99t sign. diff --git a/lisp/button.el b/lisp/button.el index cb08b78..62a2d0f 100644 --- a/lisp/button.el +++ b/lisp/button.el @@ -244,7 +244,8 @@ button-activate (funcall action button)))) (defun button-label (button) - "Return BUTTON's text label." + "Return BUTTON's text label. +Only works when BUTTON is in the current buffer." (if (button--area-button-p button) (substring-no-properties (button--area-button-string button)) (buffer-substring-no-properties (button-start button) > On Jul 7, 2016, at 11:24 PM, Eli Zaretskii wrote: >=20 >> From: Jiajie Chen >> Date: Thu, 07 Jul 2016 18:19:11 +0800 >>=20 >> The definition of button-label is: >>=20 >> #+BEGIN_SRC elisp >> (defun button-label (button) >> "Return BUTTON's text label." >> (if (button--area-button-p button) >> (substring-no-properties (button--area-button-string button)) >> (buffer-substring-no-properties (button-start button) >> (button-end button)))) >> #+END_SRC >>=20 >> So when the function is called in a different buffer, it >> returns a wrong result. >=20 > AFAICT, all of the functions in button.el operate on buttons in the > current buffer, although only a few mention that explicitly in their > doc strings. Patches to mention that in the doc strings are welcome. >=20 > Thanks. >=20 >=20 >=20 >=20