From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.help Subject: button face vs font-lock Date: Sun, 27 Jan 2008 13:13:46 +0100 Message-ID: <87ve5f1n5x.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1201438707 29674 80.91.229.12 (27 Jan 2008 12:58:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Jan 2008 12:58:27 +0000 (UTC) To: gnu-emacs-help@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 27 13:58:46 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JJ75y-0000KX-3G for geh-help-gnu-emacs@m.gmane.org; Sun, 27 Jan 2008 13:58:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JJ75X-0001js-Ca for geh-help-gnu-emacs@m.gmane.org; Sun, 27 Jan 2008 07:58:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JJ75J-0001jd-0B for help-gnu-emacs@gnu.org; Sun, 27 Jan 2008 07:58:05 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JJ75G-0001jM-My for help-gnu-emacs@gnu.org; Sun, 27 Jan 2008 07:58:03 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JJ75G-0001j5-Cj for help-gnu-emacs@gnu.org; Sun, 27 Jan 2008 07:58:02 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JJ75G-0005ZQ-1G for help-gnu-emacs@gnu.org; Sun, 27 Jan 2008 07:58:02 -0500 Original-Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JJ75F-0004OX-NO for gnu-emacs-help@gnu.org; Sun, 27 Jan 2008 07:58:01 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JJ75C-0005Yd-Lp for gnu-emacs-help@gnu.org; Sun, 27 Jan 2008 07:58:01 -0500 Original-Received: from ppp-191-34.21-151.libero.it ([151.21.34.191] helo=ambire.localdomain) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JJ75C-0005YN-CH for gnu-emacs-help@gnu.org; Sun, 27 Jan 2008 07:57:58 -0500 Original-Received: from ttn by ambire.localdomain with local (Exim 4.63) (envelope-from ) id 1JJ6OR-00021C-0E for gnu-emacs-help@gnu.org; Sun, 27 Jan 2008 13:13:47 +0100 X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-Greylist: delayed 2538 seconds by postgrey-1.27 at monty-python; Sun, 27 Jan 2008 07:57:58 EST X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:51009 Archived-At: Greetings, I'm trying to implement a simple toggle button, using: (define-button-type 'toggle 'mouse-face nil 'follow-link t 'help-echo nil 'active nil 'face 'button 'action (lambda (button) (let ((now (not (button-get button 'active)))) (button-put button 'active now) (button-put button 'face (if now font-lock-keyword-face 'button)) (message "%s %s" (button-label button) now)))) (insert-text-button "abc" :type 'toggle) This works fine when font-lock is off (M-x font-lock-mode RET), but when i enable font-lock, the button refuses to change face, although the toggling is still evidenced in the echo area. What do i need to do get font lock to leave dynamic button face changing alone? thi