From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jsynacek@redhat.com (Jan =?UTF-8?Q?Syn=C3=A1=C4=8Dek?=) Newsgroups: gmane.emacs.bugs Subject: bug#17543: 24.3.91; highlight-regexp in find-file-hook doesn't work as expected Date: Wed, 21 May 2014 09:20:55 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1400684439 12074 80.91.229.3 (21 May 2014 15:00:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 May 2014 15:00:39 +0000 (UTC) To: 17543@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 21 17:00:31 2014 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 1Wn80H-0003Tw-PG for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 May 2014 17:00:25 +0200 Original-Received: from localhost ([::1]:60283 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn80H-0004XR-Fr for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 May 2014 11:00:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn805-0004U7-FI for bug-gnu-emacs@gnu.org; Wed, 21 May 2014 11:00:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wn7zw-0003nD-Ch for bug-gnu-emacs@gnu.org; Wed, 21 May 2014 11:00:13 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn7zw-0003n2-AH for bug-gnu-emacs@gnu.org; Wed, 21 May 2014 11:00:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Wn7zw-00057e-1X for bug-gnu-emacs@gnu.org; Wed, 21 May 2014 11:00:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: jsynacek@redhat.com (Jan =?UTF-8?Q?Syn=C3=A1=C4=8Dek?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 May 2014 15:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17543 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.140068439519633 (code B ref -1); Wed, 21 May 2014 15:00:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 May 2014 14:59:55 +0000 Original-Received: from localhost ([127.0.0.1]:55445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wn7zk-00056Y-GI for submit@debbugs.gnu.org; Wed, 21 May 2014 10:59:54 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47451) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wn0q9-0006JY-JF for submit@debbugs.gnu.org; Wed, 21 May 2014 03:21:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wn0pv-00013w-AP for submit@debbugs.gnu.org; Wed, 21 May 2014 03:21:24 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:47249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn0pv-00013q-5Y for submit@debbugs.gnu.org; Wed, 21 May 2014 03:21:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn0po-0006ZA-Tf for bug-gnu-emacs@gnu.org; Wed, 21 May 2014 03:21:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wn0pi-00012H-Lr for bug-gnu-emacs@gnu.org; Wed, 21 May 2014 03:21:08 -0400 Original-Received: from mx1.redhat.com ([209.132.183.28]:21342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn0pi-00011t-DJ for bug-gnu-emacs@gnu.org; Wed, 21 May 2014 03:21:02 -0400 Original-Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4L7L0lU026094 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 21 May 2014 03:21:00 -0400 Original-Received: from jsynacek-ntb-work.brq.redhat.com (dhcp-24-160.brq.redhat.com [10.34.24.160]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s4L7KvaS027713 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 21 May 2014 03:20:59 -0400 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Wed, 21 May 2014 10:59:50 -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:89319 Archived-At: I use the following snippet to highlight trailing whitespace: (defun jsynacek-highlight-trailing-whitespace () (highlight-regexp "\\s-+$" 'hi-pink)) (add-hook 'find-file-hook 'jsynacek-highlight-trailing-whitespace) After opening any org-mode file or a plain text file (and possibly more formats), whenever a paragraph ends, the whole rest of its last line is highlighted. The following piece of text can be used (without the pseudo quotes): stuff stuff2 test1 test2 test3 test4 end To reproduce the problem: 0) Save the above piece of text to a file. 1) Start Emacs. 2) Eval the elisp snippet I've provided. 3) Open the text file. 4) Observe incorrect highlighting. Note that only the line beginning with "test3" has whitespaces at the end, and I expect only those whitespaces to be highlighted. The problem doesn't appear in .el files. In GNU Emacs 24.3.91.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2014-05-12 on jsynacek-ntb.brq.redhat.com Windowing system distributor `Fedora Project', version 11.0.11404000 Configured using: `configure --prefix=/home/jsynacek/.local/emacs-24.3.91' Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Minor modes in effect: helm-match-plugin-mode: t helm-occur-match-plugin-mode: t erc-list-mode: t erc-menu-mode: t erc-autojoin-mode: t erc-ring-mode: t erc-networks-mode: t erc-pcomplete-mode: t erc-track-mode: t erc-match-mode: t erc-button-mode: t erc-fill-mode: t erc-stamp-mode: t erc-netsplit-mode: t erc-irccontrols-mode: t erc-noncommands-mode: t erc-move-to-prompt-mode: t erc-readonly-mode: t ido-everywhere: t recentf-mode: t projectile-global-mode: t projectile-mode: t magit-auto-revert-mode: t shell-dirtrack-mode: t diff-auto-refine-mode: t override-global-mode: t winner-mode: t delete-selection-mode: t show-paren-mode: t global-auto-revert-mode: t tooltip-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t column-number-mode: t line-number-mode: t transient-mark-mode: t Features: (shadow sort mail-extr dabbrev emacsbug sendmail visual-regexp helm-command helm-elisp helm-eval eldoc helm-mode eieio-opt speedbar sb-image ezimage dframe vc-git misearch multi-isearch hi-lock org-element org-rmail org-mhe org-irc org-info org-gnus org-docview doc-view jka-compr image-mode org-bibtex bibtex org-bbdb org-w3m epa-file helm-files image-dired dired-aux ffap helm-buffers helm-elscreen helm-tags helm-bookmark helm-adaptative helm-info helm-net browse-url xml url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse url-vars mailcap helm-plugin bookmark helm-locate helm-help helm-match-plugin helm-grep helm-regexp helm-external helm-utils setup-erc erc-autoaway erc-list erc-menu erc-join erc-ring erc-networks erc-pcomplete erc-track erc-match erc-button erc-fill erc-stamp erc-netsplit erc-goodies erc erc-backend erc-compat pp private undo-tree diff smex ido recentf tree-widget wid-edit projectile pkg-info lisp-mnt epl s ob-python ob-plantuml htmlize org org-macro org-footnote org-pcomplete org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint ob-core ob-eval org-compat org-macs org-loaddefs find-func magit-key-mode magit view tramp tramp-compat auth-source eieio eieio-core gnus-util password-cache tramp-loaddefs trampver shell pcomplete help-mode grep compile comint epa derived epg epg-config diff-mode ansi-color git-rebase-mode thingatpt git-commit-mode log-edit message byte-opt format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log edmacro kmacro ibuffer helm dired-x dired cal-menu calendar cal-loaddefs server use-package diminish bytecomp byte-compile cconv bind-key easy-mmode winner ring delsel solarized-dark-theme solarized dash paren autorevert filenotify cus-start cus-load cl-macs ace-window ace-jump-mode cl gv cl-loaddefs cl-lib browse-kill-ring-autoloads buffer-move-autoloads etags-select-autoloads highlight-symbol-autoloads pydoc-info advice help-fns info-look info easymenu package time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) -- Jan Synacek Software Engineer, Red Hat