unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* master c430f7e breaks diff-mode fontification
       [not found] ` <20160623212913.536AF220129@vcs.savannah.gnu.org>
@ 2016-06-27  9:22   ` Stephen Berman
  2016-06-27 15:01     ` Stephen Berman
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Berman @ 2016-06-27  9:22 UTC (permalink / raw)
  To: emacs-devel; +Cc: Mark Oteiza

This change breaks diff-mode fontification:

> branch: master
> commit c430f7e23fc2c22f251ace4254e37dea1452dfc3
> Author: Mark Oteiza <mvoteiza@udel.edu>
> Commit: Mark Oteiza <mvoteiza@udel.edu>
>
>     Remove some face aliases obsoleted in 22.1

To reproduce (after git pull and make bootstrap):

0. emacs -Q
1. C-x v L RET <path to emacs master git root> RET
2. In the *vc-change-log* buffer type `d' on one of the entries.
=> The diff displayed in the *vc-diff* buffer lack the expected faces on
   the removed and added lines, and the *Messages* buffer contains these
   messages:
Error during redisplay: (jit-lock-function 1) signaled (void-variable diff-hunk-header)
Error during redisplay: (jit-lock-function 501) signaled (void-variable diff-removed)
Error during redisplay: (jit-lock-function 1001) signaled (void-variable diff-hunk-header)
Error during redisplay: (jit-lock-function 1501) signaled (void-variable diff-context)

If prior to step 1 above I evaluate the file diff-mode.el from emacs-25
(i.e. the version before the above commit), then after 2 the *vc-diff*
buffer is fontified as expected and there no such error messages in *Messages*.

Steve Berman



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: master c430f7e breaks diff-mode fontification
  2016-06-27  9:22   ` master c430f7e breaks diff-mode fontification Stephen Berman
@ 2016-06-27 15:01     ` Stephen Berman
  2016-06-27 20:58       ` Mark Oteiza
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Berman @ 2016-06-27 15:01 UTC (permalink / raw)
  To: emacs-devel; +Cc: Mark Oteiza

On Mon, 27 Jun 2016 11:22:50 +0200 Stephen Berman <stephen.berman@gmx.net> wrote:

> This change breaks diff-mode fontification:
>
>> branch: master
>> commit c430f7e23fc2c22f251ace4254e37dea1452dfc3
>> Author: Mark Oteiza <mvoteiza@udel.edu>
>> Commit: Mark Oteiza <mvoteiza@udel.edu>
>>
>>     Remove some face aliases obsoleted in 22.1
>
> To reproduce (after git pull and make bootstrap):
>
> 0. emacs -Q
> 1. C-x v L RET <path to emacs master git root> RET
> 2. In the *vc-change-log* buffer type `d' on one of the entries.
> => The diff displayed in the *vc-diff* buffer lack the expected faces on
>    the removed and added lines, and the *Messages* buffer contains these
>    messages:
> Error during redisplay: (jit-lock-function 1) signaled (void-variable
> diff-hunk-header)
> Error during redisplay: (jit-lock-function 501) signaled (void-variable diff-removed)
> Error during redisplay: (jit-lock-function 1001) signaled (void-variable
> diff-hunk-header)
> Error during redisplay: (jit-lock-function 1501) signaled (void-variable diff-context)
>
> If prior to step 1 above I evaluate the file diff-mode.el from emacs-25
> (i.e. the version before the above commit), then after 2 the *vc-diff*
> buffer is fontified as expected and there no such error messages in *Messages*.

The following patch fixes the breakage.  (I haven't yet gone through the
other files changed by commit c430f7e to see if there are similar
problems.)

diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 43ff9e0..58498cb 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -371,22 +371,22 @@ diff-use-changed-face
 
 (defvar diff-font-lock-keywords
   `((,(concat "\\(" diff-hunk-header-re-unified "\\)\\(.*\\)$")
-     (1 diff-hunk-header) (6 diff-function))
+     (1 'diff-hunk-header) (6 'diff-function))
     ("^\\(\\*\\{15\\}\\)\\(.*\\)$"                        ;context
-     (1 diff-hunk-header) (2 diff-function))
-    ("^\\*\\*\\* .+ \\*\\*\\*\\*". diff-hunk-header) ;context
-    (,diff-context-mid-hunk-header-re . diff-hunk-header) ;context
-    ("^[0-9,]+[acd][0-9,]+$"     . diff-hunk-header) ;normal
-    ("^---$"                     . diff-hunk-header) ;normal
+     (1 'diff-hunk-header) (2 'diff-function))
+    ("^\\*\\*\\* .+ \\*\\*\\*\\*". 'diff-hunk-header) ;context
+    (,diff-context-mid-hunk-header-re . 'diff-hunk-header) ;context
+    ("^[0-9,]+[acd][0-9,]+$"     . 'diff-hunk-header) ;normal
+    ("^---$"                     . 'diff-hunk-header) ;normal
     ;; For file headers, accept files with spaces, but be careful to rule
     ;; out false-positives when matching hunk headers.
     ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\([^\t\n]+?\\)\\(?:\t.*\\| \\(\\*\\*\\*\\*\\|----\\)\\)?\n"
-     (0 diff-header)
-     (2 (if (not (match-end 3)) diff-file-header) prepend))
+     (0 'diff-header)
+     (2 (if (not (match-end 3)) 'diff-file-header) prepend))
     ("^\\([-<]\\)\\(.*\n\\)"
-     (1 diff-indicator-removed-face) (2 diff-removed))
+     (1 diff-indicator-removed-face) (2 'diff-removed))
     ("^\\([+>]\\)\\(.*\n\\)"
-     (1 diff-indicator-added-face) (2 diff-added))
+     (1 diff-indicator-added-face) (2 'diff-added))
     ("^\\(!\\)\\(.*\n\\)"
      (1 (if diff-use-changed-face
 	    diff-indicator-changed-face
@@ -399,20 +399,20 @@ diff-font-lock-keywords
 		  diff-indicator-added-face
 		diff-indicator-removed-face)))))
      (2 (if diff-use-changed-face
-	    diff-changed
+	    'diff-changed
 	  ;; Otherwise, use the same method as above.
 	  (save-match-data
 	    (let ((limit (save-excursion (diff-beginning-of-hunk))))
 	      (if (save-excursion (re-search-backward diff-context-mid-hunk-header-re limit t))
-		  diff-added
-		diff-removed))))))
+		  'diff-added
+		'diff-removed))))))
     ("^\\(?:Index\\|revno\\): \\(.+\\).*\n"
-     (0 diff-header) (1 diff-index prepend))
-    ("^Only in .*\n" . diff-nonexistent)
+     (0 'diff-header) (1 'diff-index prepend))
+    ("^Only in .*\n" . 'diff-nonexistent)
     ("^\\(#\\)\\(.*\\)"
      (1 font-lock-comment-delimiter-face)
      (2 font-lock-comment-face))
-    ("^[^-=+*!<>#].*\n" (0 diff-context))))
+    ("^[^-=+*!<>#].*\n" (0 'diff-context))))
 
 (defconst diff-font-lock-defaults
   '(diff-font-lock-keywords t nil nil nil (font-lock-multiline . nil)))



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: master c430f7e breaks diff-mode fontification
  2016-06-27 15:01     ` Stephen Berman
@ 2016-06-27 20:58       ` Mark Oteiza
  2016-06-27 21:32         ` Stephen Berman
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Oteiza @ 2016-06-27 20:58 UTC (permalink / raw)
  To: Stephen Berman; +Cc: emacs-devel

On 27/06/16 at 05:01pm, Stephen Berman wrote:
> On Mon, 27 Jun 2016 11:22:50 +0200 Stephen Berman <stephen.berman@gmx.net> wrote:
> 
> > This change breaks diff-mode fontification:
> >
> >> branch: master
> >> commit c430f7e23fc2c22f251ace4254e37dea1452dfc3
> >> Author: Mark Oteiza <mvoteiza@udel.edu>
> >> Commit: Mark Oteiza <mvoteiza@udel.edu>
> >>
> >>     Remove some face aliases obsoleted in 22.1
> >
> > To reproduce (after git pull and make bootstrap):
> >
> > 0. emacs -Q
> > 1. C-x v L RET <path to emacs master git root> RET
> > 2. In the *vc-change-log* buffer type `d' on one of the entries.
> > => The diff displayed in the *vc-diff* buffer lack the expected faces on
> >    the removed and added lines, and the *Messages* buffer contains these
> >    messages:
> > Error during redisplay: (jit-lock-function 1) signaled (void-variable
> > diff-hunk-header)
> > Error during redisplay: (jit-lock-function 501) signaled (void-variable diff-removed)
> > Error during redisplay: (jit-lock-function 1001) signaled (void-variable
> > diff-hunk-header)
> > Error during redisplay: (jit-lock-function 1501) signaled (void-variable diff-context)
> >
> > If prior to step 1 above I evaluate the file diff-mode.el from emacs-25
> > (i.e. the version before the above commit), then after 2 the *vc-diff*
> > buffer is fontified as expected and there no such error messages in *Messages*.
> 
> The following patch fixes the breakage.  (I haven't yet gone through the
> other files changed by commit c430f7e to see if there are similar
> problems.)

Thanks, applied.  It's clear to me now why this broke, so I'll have
a closer look as well.

> <snip>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: master c430f7e breaks diff-mode fontification
  2016-06-27 20:58       ` Mark Oteiza
@ 2016-06-27 21:32         ` Stephen Berman
  2016-06-28  8:25           ` martin rudalics
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Berman @ 2016-06-27 21:32 UTC (permalink / raw)
  To: Mark Oteiza; +Cc: emacs-devel

On Mon, 27 Jun 2016 16:58:28 -0400 Mark Oteiza <mvoteiza@udel.edu> wrote:

> On 27/06/16 at 05:01pm, Stephen Berman wrote:
>> 
>> The following patch fixes the breakage.  (I haven't yet gone through the
>> other files changed by commit c430f7e to see if there are similar
>> problems.)
>
> Thanks, applied.  It's clear to me now why this broke, so I'll have
> a closer look as well.

Thanks.

Steve Berman



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: master c430f7e breaks diff-mode fontification
  2016-06-27 21:32         ` Stephen Berman
@ 2016-06-28  8:25           ` martin rudalics
  0 siblings, 0 replies; 5+ messages in thread
From: martin rudalics @ 2016-06-28  8:25 UTC (permalink / raw)
  To: Stephen Berman, Mark Oteiza; +Cc: emacs-devel

 >> Thanks, applied.  It's clear to me now why this broke, so I'll have
 >> a closer look as well.
 >
 > Thanks.

And thanks to you for the fix.

martin



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-28  8:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20160623212912.4921.57688@vcs.savannah.gnu.org>
     [not found] ` <20160623212913.536AF220129@vcs.savannah.gnu.org>
2016-06-27  9:22   ` master c430f7e breaks diff-mode fontification Stephen Berman
2016-06-27 15:01     ` Stephen Berman
2016-06-27 20:58       ` Mark Oteiza
2016-06-27 21:32         ` Stephen Berman
2016-06-28  8:25           ` martin rudalics

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