GNU bug report logs -
#17543
24.3.91; highlight-regexp in find-file-hook doesn't work as expected
Previous Next
Reported by: jsynacek <at> redhat.com (Jan Synáček)
Date: Wed, 21 May 2014 15:00:03 UTC
Severity: minor
Tags: notabug
Found in version 24.3.91
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17543 in the body.
You can then email your comments to 17543 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#17543
; Package
emacs
.
(Wed, 21 May 2014 15:00:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
jsynacek <at> redhat.com (Jan Synáček)
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 21 May 2014 15:00:04 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#17543
; Package
emacs
.
(Wed, 21 May 2014 23:02:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 17543 <at> debbugs.gnu.org (full text, mbox):
I suggest you use instead:
(defun jsynacek-highlight-trailing-whitespace ()
(setq-local show-trailing-whitespace t))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#17543
; Package
emacs
.
(Thu, 22 May 2014 06:24:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 17543 <at> debbugs.gnu.org (full text, mbox):
On 05/22/2014 01:01 AM, Glenn Morris wrote:
> I suggest you use instead:
>
> (defun jsynacek-highlight-trailing-whitespace ()
> (setq-local show-trailing-whitespace t))
This works, thank you.
Just wondering. Is my original problem supposed to work like it does now?
--
Jan Synacek
Software Engineer, Red Hat
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#17543
; Package
emacs
.
(Thu, 22 May 2014 16:01:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 17543 <at> debbugs.gnu.org (full text, mbox):
Jan Synacek wrote:
> Just wondering. Is my original problem supposed to work like it does now?
I think it's something to do with \n having whitespace syntax in some
modes, and "end of comment" in others, and whatever highlight- does.
Since Emacs has a standard way to highlight trailing whitespace, I have
not looked in detail.
Added tag(s) notabug.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Fri, 23 May 2014 19:15:03 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
17543 <at> debbugs.gnu.org and jsynacek <at> redhat.com (Jan Synáček)
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Fri, 23 May 2014 19:15:03 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 21 Jun 2014 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 11 years and 5 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.