unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: jsynacek@redhat.com (Jan Synáček)
To: 17543@debbugs.gnu.org
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	[thread overview]
Message-ID: <m6fk39f8unc.fsf@jsynacek-ntb-work.brq.redhat.com> (raw)


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):

<start file>
stuff

stuff2

test1
test2
test3  
test4

end
<end file>

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





             reply	other threads:[~2014-05-21  7:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-21  7:20 Jan Synáček [this message]
2014-05-21 23:01 ` bug#17543: 24.3.91; highlight-regexp in find-file-hook doesn't work as expected Glenn Morris
2014-05-22  6:23   ` Jan Synacek
2014-05-22 16:00     ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m6fk39f8unc.fsf@jsynacek-ntb-work.brq.redhat.com \
    --to=jsynacek@redhat.com \
    --cc=17543@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).