From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Erik Knowles Newsgroups: gmane.emacs.bugs Subject: bug#14134: 24.3; Delphi Mode Doesn't Work With Highlight Changes Mode Date: Wed, 3 Apr 2013 14:03:36 -0600 Message-ID: <20134314336.903334@A6> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1365020068 25468 80.91.229.3 (3 Apr 2013 20:14:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Apr 2013 20:14:28 +0000 (UTC) To: 14134@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 03 22:14:55 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 1UNU58-0003iw-DV for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Apr 2013 22:14:54 +0200 Original-Received: from localhost ([::1]:50891 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNU4j-00039M-Jz for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Apr 2013 16:14:29 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNU4L-0002S5-Uu for bug-gnu-emacs@gnu.org; Wed, 03 Apr 2013 16:14:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNU4D-0007p5-Bo for bug-gnu-emacs@gnu.org; Wed, 03 Apr 2013 16:14:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNU4D-0007or-8J for bug-gnu-emacs@gnu.org; Wed, 03 Apr 2013 16:13:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UNU7C-00052X-34 for bug-gnu-emacs@gnu.org; Wed, 03 Apr 2013 16:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Erik Knowles Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Apr 2013 20:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14134 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.136502017919299 (code B ref -1); Wed, 03 Apr 2013 20:17:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Apr 2013 20:16:19 +0000 X-Mailer: Barca 2.8 (4400) - Licensed Version 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 X-Mailman-Version: 2.1.14 Precedence: list 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:73127 Archived-At: Delphi mode's fontification code erases all existing text properties, including those used by highlight changes mode to mark modified text sections. To duplicate: emacs -Q M-x delphi-mode M-x highlight-changes-mode M-x highlight-changes-visible-mode M-x highlight-changes-visible-mode I've not included a proper patch (intuitively, the "correct" fix would be to rewrite Delphi mode's fontification code to use overlays) because I'm not experienced enough with Elisp to do a proper job; however, I've personally worked around the problem by monkey patching as follows: -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ ;; Delphi-mode marks literals with special text properties, in the process borking *all* ;; existing properties including the properties used by hilit-chg mode for marking ;; changes even when the "changes visible" flag is off. To avoid this, the mode's ;; "delphi-set-text-properties" function is replaced here with a version that simply ;; removes the specific text properties used by the font lock while leaving all the ;; other properties alone. ;; ;; To do this delphi-set-text-properties simply tracks which faces are used by the Delphi ;; font lock code and only removes those faces (setq delphi-used-faces (list)) (defun delphi-set-text-properties (from to properties) ;; Like `set-text-properties', except we do not consider this to be a buffer ;; modification. (delphi-save-state (dolist (prop delphi-used-faces) (remove-text-properties from to prop)) (when properties (add-text-properties from to properties) (add-to-list 'delphi-used-faces properties) ) ) ) -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ In GNU Emacs 24.3.1 (i686-pc-cygwin) of 2013-03-11 on fiona Configured using: `configure '--srcdir=/home/kbrown/src/cygemacs/emacs-24.3-1/src/emacs-24.3' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--libexecdir=/usr/lib' '--datadir=/usr/share' '--localstatedir=/var' '--sysconfdir=/etc' '--datarootdir=/usr/share' '--docdir=/usr/share/doc/emacs' '-C' '--with-x=no' 'CC=gcc' 'CFLAGS=-ggdb -O2 -pipe -fdebug-prefix-map=/home/kbrown/src/cygemacs/emacs-24.3-1/build=/usr/src/debug/emacs-24.3-1 -fdebug-prefix-map=/home/kbrown/src/cygemacs/emacs-24.3-1/src/emacs-24.3=/usr/src/debug/emacs-24.3-1' 'LDFLAGS=-L/usr/lib/ncursesw' 'LIBS=' 'CPPFLAGS=-I/usr/include/ncursesw'' Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: flyspell-mode: t shell-dirtrack-mode: t mouse-wheel-mode: t xterm-mouse-mode: t global-subword-mode: t subword-mode: t cua-mode: t desktop-save-mode: t show-paren-mode: t global-highlight-changes-mode: t highlight-changes-mode: t which-function-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 line-number-mode: t auto-fill-function: do-auto-fill transient-mark-mode: t Load-path shadows: /home/Erik/.emacs.d/indent hides /usr/share/emacs/24.3/lisp/indent Features: (shadow gnus-util mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils server flyspell ispell ido tempbuf grep-a-lot grep bash-completion shell pcomplete init-terminal-fix saveplace tabbar mwheel xt-mouse backup-dir backup-each-save pascal-mode+ delphi pascal subword org-install xterm-title xterm-frobs goto-last-change cua-base sunrise-commander easy-mmode term ehelp electric sort find-dired esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg eldoc esh-groups eshell esh-util esh-module esh-mode disp-table enriched dired-x easymenu dired-aux dired desktop paren hl-line+ advice help-fns cl-lib advice-preload time-date hl-line hilit-chg wid-edit which-func imenu edmacro kmacro warnings byte-opt compile comint regexp-opt ansi-color ring tool-bar bytecomp byte-compile cconv bash-completion-autoloads cygwin-mount-autoloads dired+-autoloads flymake-cursor-autoloads flymake-python-pyflakes-autoloads flymake-easy-autoloads grep-a-lot-autoloads hl-line+-autoloads icicles-autoloads pager-autoloads tabbar-autoloads tidy-autoloads package ediff-hook vc-hooks lisp-float-type tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select 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 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 multi-tty emacs) - Erik R. Knowles