From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jeremy Moore Newsgroups: gmane.emacs.bugs Subject: bug#11353: Suggested patch to whitespace.el Date: Thu, 16 May 2013 15:41:14 +0100 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c34830b91e9604dcd6dbd7 X-Trace: ger.gmane.org 1368715357 29305 80.91.229.3 (16 May 2013 14:42:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 May 2013 14:42:37 +0000 (UTC) Cc: viniciusjl@ig.com.br To: 11353@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 16 16:42:36 2013 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 1UczO7-0004n9-FE for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 May 2013 16:42:35 +0200 Original-Received: from localhost ([::1]:52359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UczO7-0002mq-3D for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 May 2013 10:42:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UczNW-0001yX-Gw for bug-gnu-emacs@gnu.org; Thu, 16 May 2013 10:42:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UczNQ-00028Q-0w for bug-gnu-emacs@gnu.org; Thu, 16 May 2013 10:41:58 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59145) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UczNP-00028M-TC for bug-gnu-emacs@gnu.org; Thu, 16 May 2013 10:41:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UczNa-00076G-4I for bug-gnu-emacs@gnu.org; Thu, 16 May 2013 10:42:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Jeremy Moore Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 May 2013 14:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11353 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11353-submit@debbugs.gnu.org id=B11353.136871529527197 (code B ref 11353); Thu, 16 May 2013 14:42:02 +0000 Original-Received: (at 11353) by debbugs.gnu.org; 16 May 2013 14:41:35 +0000 Original-Received: from localhost ([127.0.0.1]:47503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UczN8-00074c-IQ for submit@debbugs.gnu.org; Thu, 16 May 2013 10:41:34 -0400 Original-Received: from mail-wg0-f53.google.com ([74.125.82.53]:61968) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UczN5-00074N-0Y for 11353@debbugs.gnu.org; Thu, 16 May 2013 10:41:31 -0400 Original-Received: by mail-wg0-f53.google.com with SMTP id y10so2802313wgg.20 for <11353@debbugs.gnu.org>; Thu, 16 May 2013 07:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:date:x-google-sender-auth:message-id :subject:from:to:cc:content-type; bh=cFVoV1QMP95egrlEtjAOs2SXeaGqB6RUbS0a43X6h4s=; b=g+sWkqffxdw/yJM5xONHj4w5Ao/2OGdy3WNw/ygywwU8OGW280plJS/2HYtfBM9Eo8 BlXEjfm8ViNGQqC9Lx6btSd0V+bmpCXN7LHZuAEUlEf1WuBqJZh+JfE4o6bppRKY+Mm9 x+f/AcgDUsaREpDhO0HMafxY/nu/UBj3SQ/ltS/tJkfbmXdJcKkQLhbVJNO0Yuv4JRhL 1CWpfa73lXu75dfmyxUqUdW66E5rTMLZIyxvkZ5zSuw49wIqik/NM+UCQJcQLnDAuyOl d6mXifVgPfoyACJCxhP/Dix1Xcbrs1ZNwWIh3WEosnrySfeBttvfp0S3DWtT146IDijC HD1Q== X-Received: by 10.180.189.41 with SMTP id gf9mr24977685wic.32.1368715274295; Thu, 16 May 2013 07:41:14 -0700 (PDT) Original-Received: by 10.180.105.199 with HTTP; Thu, 16 May 2013 07:41:14 -0700 (PDT) X-Google-Sender-Auth: Z5mp8u6BRrMGfqiL_CWjZD7-Fi0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:74327 Archived-At: --001a11c34830b91e9604dcd6dbd7 Content-Type: text/plain; charset=ISO-8859-1 (whitespace-turn-on-if-enabled) gets called multiple times by hooks when a file is opened. The value of font-lock-keywords is changed by the first call, and subsequent calls record that value into whitespace-font-lock-keywords. When GWM is disabled, the value restored to font-lock-keywords still includes highlighting for white space characters. How's this change? *** whitespace.el.orig Thu May 16 15:22:05 2013 --- whitespace.el Thu May 16 15:22:59 2013 *************** resultant list will be returned." *** 2176,2183 **** (add-hook 'write-file-functions 'whitespace-write-file-hook nil t) ;; create whitespace local buffer environment (set (make-local-variable 'whitespace-font-lock-mode) nil) ! (set (make-local-variable 'whitespace-font-lock) nil) ! (set (make-local-variable 'whitespace-font-lock-keywords) nil) (set (make-local-variable 'whitespace-display-table) nil) (set (make-local-variable 'whitespace-display-table-was-local) nil) (set (make-local-variable 'whitespace-active-style) --- 2176,2184 ---- (add-hook 'write-file-functions 'whitespace-write-file-hook nil t) ;; create whitespace local buffer environment (set (make-local-variable 'whitespace-font-lock-mode) nil) ! (unless whitespace-font-lock ! (set (make-local-variable 'whitespace-font-lock) nil) ! (set (make-local-variable 'whitespace-font-lock-keywords) nil)) (set (make-local-variable 'whitespace-display-table) nil) (set (make-local-variable 'whitespace-display-table-was-local) nil) (set (make-local-variable 'whitespace-active-style) Regards, Jeremy Moore --001a11c34830b91e9604dcd6dbd7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
(whitespace-turn-on-if-enabled) gets called multiple times= by hooks when a file is opened. The value of font-lock-keywords is changed= by the first call, and subsequent calls record that value into whitespace-= font-lock-keywords. When GWM is disabled, the value restored to font-lock-k= eywords still includes highlighting for white space characters.

How's this change?

*** whitespace.el.orig =A0 =A0Thu May 16 = 15:22:05 2013
--- whitespace.el =A0 =A0Thu May 16 15:22:59 2013
*****= ********** resultant list will be returned."
*** 2176,2183 ****
= =A0 =A0 (add-hook 'write-file-functions 'whitespace-write-file-hook= nil t)
=A0 =A0 ;; create whitespace local buffer environment
=A0 =A0 (set (make= -local-variable 'whitespace-font-lock-mode) nil)
! =A0 (set (make-lo= cal-variable 'whitespace-font-lock) nil)
! =A0 (set (make-local-vari= able 'whitespace-font-lock-keywords) nil)
=A0 =A0 (set (make-local-variable 'whitespace-display-table) nil)
= =A0 =A0 (set (make-local-variable 'whitespace-display-table-was-local) = nil)
=A0 =A0 (set (make-local-variable 'whitespace-active-style)
= --- 2176,2184 ----
=A0 =A0 (add-hook 'write-file-functions 'whitespace-write-file-hook= nil t)
=A0 =A0 ;; create whitespace local buffer environment
=A0 =A0= (set (make-local-variable 'whitespace-font-lock-mode) nil)
! =A0 (u= nless whitespace-font-lock
! =A0 =A0 (set (make-local-variable 'whitespace-font-lock) nil)
! = =A0 =A0 (set (make-local-variable 'whitespace-font-lock-keywords) nil))=
=A0 =A0 (set (make-local-variable 'whitespace-display-table) nil)=A0 =A0 (set (make-local-variable 'whitespace-display-table-was-local= ) nil)
=A0 =A0 (set (make-local-variable 'whitespace-active-style)


= Regards,
Jeremy Moore
--001a11c34830b91e9604dcd6dbd7--