From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#34506: 27.0.50: push-button bug with basic text-property button Date: Mon, 25 Feb 2019 02:40:26 +0000 Message-ID: <874l8ssi91.fsf@tcd.ie> References: <83pnrql9p0.fsf@gnu.org> <831s45ksiz.fsf@gnu.org> <875ztgrfb3.fsf@tcd.ie> <838sycjw0j.fsf@gnu.org> <87lg2bsssc.fsf@tcd.ie> <9A74136C-D6E3-44B8-8C9F-060BFC29E068@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="87322"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 34506@debbugs.gnu.org To: Robert Weiner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 25 03:41:17 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gy6Ci-000MbH-9l for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Feb 2019 03:41:16 +0100 Original-Received: from localhost ([127.0.0.1]:58922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gy6Ch-0001Fg-Bl for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Feb 2019 21:41:15 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gy6Ca-0001Fb-3v for bug-gnu-emacs@gnu.org; Sun, 24 Feb 2019 21:41:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gy6CY-0004JR-5c for bug-gnu-emacs@gnu.org; Sun, 24 Feb 2019 21:41:08 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37184) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gy6CU-0004GL-4K for bug-gnu-emacs@gnu.org; Sun, 24 Feb 2019 21:41:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gy6CT-0001Lt-Ur for bug-gnu-emacs@gnu.org; Sun, 24 Feb 2019 21:41:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Feb 2019 02:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34506 X-GNU-PR-Package: emacs Original-Received: via spool by 34506-submit@debbugs.gnu.org id=B34506.15510624415163 (code B ref 34506); Mon, 25 Feb 2019 02:41:01 +0000 Original-Received: (at 34506) by debbugs.gnu.org; 25 Feb 2019 02:40:41 +0000 Original-Received: from localhost ([127.0.0.1]:50728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gy6C9-0001LD-5u for submit@debbugs.gnu.org; Sun, 24 Feb 2019 21:40:41 -0500 Original-Received: from mail-ed1-f46.google.com ([209.85.208.46]:45963) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gy6C7-0001L0-3f for 34506@debbugs.gnu.org; Sun, 24 Feb 2019 21:40:39 -0500 Original-Received: by mail-ed1-f46.google.com with SMTP id d9so6235761edh.12 for <34506@debbugs.gnu.org>; Sun, 24 Feb 2019 18:40:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=LX7bxBv5e5TmBpOq1l5C7eBrK1GobL+nqhgrBwlY1XE=; b=wxly1qKx/y/GCRUGWWdylgXngZDUOW25O57NZVm/RwtrVvRggyaqf7nvZNQGNkKGy1 zWWdBJT5U73NcStCYk+Z7+73ibUVO9F8Csk6I2mxzLpqf0AapKcy+/OZ+XiWBnU5Q3gY KZTy04Iz9EInxbHbbEdCpC3GTP7CeuPoQWa9b+TKL22kRDKd4pnwKf98DezG9OkHDAgY 36s3oR5XjNlFewGTaujr4YET4ph1GLyXGojEVhBb0QzPllxWOV1bZKMpN4HngblREVsp 0jF/S/h4Kdg7Qz8U4caZeDJDu5IV2HWVc3/om2o1PWjs+zp2G5S5wF3SFAtmLoyjx4uq Zmiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=LX7bxBv5e5TmBpOq1l5C7eBrK1GobL+nqhgrBwlY1XE=; b=H/C6oW1S+BgI7BnxVWRS4WtfnUz6HnxpXXHzrewn0OmF2BGexZCjl9+ZXyOX6WXu8N 2QSZP2mfcV0CUv/3LN8tPGEsD7NCNi2riVb/IQ6n9v0yXvb9HlxxGVcRTJPHPYCGBygL FP5DqEW8tKYz3AOgSGl2Oa6uECOdo4/c7aTqLILuaoUtXqZ/71APjqokDGxeqCGSAUXd htH49vFESmH3RuEwcerP4vKv9C5vbrmVnlV0rctEm7OqGQzimjs+giRj7aYfi3XTIJDL oVSH8+Jt8Smbg0soBqn6Dy3/BxjxeIfKQPiAZ8nWMKP4SpFQ0sbKkfCSvPlM99rVynxf /kZA== X-Gm-Message-State: AHQUAuYZ0BNpE89V61/MNUCFXoiw19/rlX8AzIkrTA1soc79y/JJjAG1 Lv5hCRbfXJ02Uq+toNFtyr95kA== X-Google-Smtp-Source: AHgI3IaagVPEm3s4yHyUm2Nby4+FL19cG3TbS1OjBnwmFhpqACZ8n78zRfscpBaBmAFUnc0vFp1V+w== X-Received: by 2002:a50:ba8c:: with SMTP id x12mr13017455ede.230.1551062433132; Sun, 24 Feb 2019 18:40:33 -0800 (PST) Original-Received: from localhost ([2a02:8084:20e2:c380:20c2:134e:4f3a:683a]) by smtp.gmail.com with ESMTPSA id g31sm2349856edb.45.2019.02.24.18.40.32 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 24 Feb 2019 18:40:32 -0800 (PST) In-Reply-To: <9A74136C-D6E3-44B8-8C9F-060BFC29E068@gmail.com> (Robert Weiner's message of "Wed, 20 Feb 2019 00:22:44 -0500") 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: 209.51.188.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:155755 Archived-At: --=-=-= Content-Type: text/plain Robert Weiner writes: >> On Feb 19, 2019, at 10:26 AM, Basil L. Contovounesios wrote: >> >> I don't see why anyone >> would mix widgets and buttons in the same buffer and run the risk of >> such gotchas. I believe this contributed in part to Robert's >> confusion. > > If buttons and widgets are wholly incompatible and separate then button-at > should return nil when on a widget even if both buttons and widgets use the same > underlying mechanism. How's the following? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=button.diff diff --git a/lisp/button.el b/lisp/button.el index c46f3d9a52..921e84dfa6 100644 --- a/lisp/button.el +++ b/lisp/button.el @@ -382,10 +382,12 @@ button-at If the button at POS is a text property button, the return value is a marker pointing to POS." (let ((button (get-char-property pos 'button))) - (if (or (overlayp button) (null button)) - button - ;; Must be a text-property button; return a marker pointing to it. - (copy-marker pos t)))) + (and button (get-char-property pos 'category) + (if (overlayp button) + button + ;; Must be a text-property button; + ;; return a marker pointing to it. + (copy-marker pos t))))) (defun next-button (pos &optional count-current) "Return the next button after position POS in the current buffer. diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 52c0b5b74d..b9f98cdc4c 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -1163,8 +1163,9 @@ widget-field-list (defun widget-at (&optional pos) "The button or field at POS (default, point)." - (or (get-char-property (or pos (point)) 'button) - (widget-field-at pos))) + (let ((widget (or (get-char-property (or pos (point)) 'button) + (widget-field-at pos)))) + (and (widgetp widget) widget))) ;;;###autoload (defun widget-setup () --=-=-= Content-Type: text/plain -- Basil --=-=-=--