From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail
From: Eli Zaretskii <eliz@gnu.org>
Newsgroups: gmane.emacs.devel
Subject: Re: Semantic font-lock for Java
Date: Wed, 22 Jan 2020 19:25:36 +0200
Message-ID: <83wo9jtncf.fsf@gnu.org>
References: <CADm7Y4mgswK2UmTG8ivPZZNXV-WfJBUrBeMhoOLqran4ng_BTg@mail.gmail.com>
 <83eevsx1eh.fsf@gnu.org>
 <CADm7Y4=isYoz05oYk+J597WykFqfbtr7JcxELeYE2-Fq9n7aig@mail.gmail.com>
Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202";
	logging-data="118197"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: emacs-devel@gnu.org
To: Anand Tamariya <atamariya@gmail.com>
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 22 18:26:09 2020
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
Envelope-to: ged-emacs-devel@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
	by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1iuJlY-000UhG-Ui
	for ged-emacs-devel@m.gmane-mx.org; Wed, 22 Jan 2020 18:26:08 +0100
Original-Received: from localhost ([::1]:45108 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1iuJlX-0001XB-QD
	for ged-emacs-devel@m.gmane-mx.org; Wed, 22 Jan 2020 12:26:07 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55490)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@gnu.org>) id 1iuJkr-00013o-GM
 for emacs-devel@gnu.org; Wed, 22 Jan 2020 12:25:26 -0500
Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:41410)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@gnu.org>)
 id 1iuJkr-0001q6-Cx; Wed, 22 Jan 2020 12:25:25 -0500
Original-Received: from [176.228.60.248] (port=4512 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@gnu.org>)
 id 1iuJkp-0002TY-NN; Wed, 22 Jan 2020 12:25:24 -0500
In-reply-to: <CADm7Y4=isYoz05oYk+J597WykFqfbtr7JcxELeYE2-Fq9n7aig@mail.gmail.com>
 (message from Anand Tamariya on Wed, 22 Jan 2020 10:43:21 +0530)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "Emacs development discussions." <emacs-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-devel>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=subscribe>
Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org
Original-Sender: "Emacs-devel"
 <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
Xref: news.gmane.io gmane.emacs.devel:244510
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/244510>

> From: Anand Tamariya <atamariya@gmail.com>
> Date: Wed, 22 Jan 2020 10:43:21 +0530
> Cc: emacs-devel@gnu.org
> 
>  This seems to be a complete forked repository.  Is it possible to show
>  a patch relative to the current master?
> 
> https://gitlab.com/atamariya/emacs/compare/v0.5...dev

Thanks.

> Most relevant changes are in lisp/cedet/semantic/java.el . Other minor changes are for disabling jit-lock.
> - Font lock setup : semantic-font-lock-mode()
> - Fontify region function: extract()
> - Helper function: semantic-fontify-tag()

I don't think I understand the reasons for the changes in font-lock.el
and cc-mode.el.  Can you explain?

Also, what do you mean by "disable jit-lock"?  Where does that happen?
And if you disable jit-lock, does that mean Emacs will no longer
fontify only the portions of the window it is about to display?

>  you could run a benchmark of scrolling through a
>  large source file top to bottom, and show the results in terms of time
>  and number of GCs.
> 
> Not sure how to do this. If you can help me with steps, I can collect the data. 

I find this function useful:

  (defun scroll-up-benchmark ()
    (interactive)
    (let ((oldgc gcs-done)
	  (oldtime (float-time)))
      (condition-case nil (while t (scroll-up) (redisplay))
	(error (message "GCs: %d Elapsed time: %f seconds"
			(- gcs-done oldgc) (- (float-time) oldtime))))))

Run it after loading a file, and look at the times with the default
font-lock and with your modifications.