From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: [rudalics@gmx.at: Re: jit lock sit-for provokes redisplay provokes imenu] Date: Mon, 28 Aug 2006 05:52:17 -0400 Message-ID: Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1156758916 7539 80.91.229.2 (28 Aug 2006 09:55:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 28 Aug 2006 09:55:16 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 28 11:55:14 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GHdpj-0002aB-NJ for ged-emacs-devel@m.gmane.org; Mon, 28 Aug 2006 11:55:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GHdpj-0002iP-C0 for ged-emacs-devel@m.gmane.org; Mon, 28 Aug 2006 05:55:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GHdn1-0001C4-L6 for emacs-devel@gnu.org; Mon, 28 Aug 2006 05:52:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GHdn0-0001B7-Vt for emacs-devel@gnu.org; Mon, 28 Aug 2006 05:52:19 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GHdn0-0001Ap-Mi for emacs-devel@gnu.org; Mon, 28 Aug 2006 05:52:18 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GHdvv-0001CH-Va for emacs-devel@gnu.org; Mon, 28 Aug 2006 06:01:32 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1GHdmz-0005RD-V6; Mon, 28 Aug 2006 05:52:18 -0400 Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:58978 Archived-At: This is what we're thinking of using instead of buffer-chars-modified-tick. It is a smaller change and more modular; presuming it solves the problem well enough, it is definitely preferable for installation now. So, what do people think of this change? ------- Start of forwarded message ------- Date: Sun, 27 Aug 2006 12:14:22 +0200 From: martin rudalics MIME-Version: 1.0 To: rms@gnu.org Subject: Re: jit lock sit-for provokes redisplay provokes imenu In-Reply-To: Content-Type: multipart/mixed; boundary="------------090602040009010004050308" X-Spam-Status: No, score=1.0 required=5.0 tests=RCVD_IN_NJABL_PROXY autolearn=no version=3.0.4 This is a multi-part message in MIME format. - --------------090602040009010004050308 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Sorry for procrastinating. Is the attached patch acceptable? - --------------090602040009010004050308 Content-Type: text/plain; name="buffer-hash.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="buffer-hash.patch" *** buffer.c.~1.506.~ Tue Aug 15 10:01:00 2006 - --- buffer.c Sun Aug 27 11:41:52 2006 *************** *** 1148,1153 **** - --- 1148,1187 ---- return make_number (BUF_MODIFF (buf)); } + + DEFUN ("buffer-hash", Fbuffer_hash, Sbuffer_hash, + 0, 1, 0, + doc: /* Return hash code for BUFFER. + No argument or nil as argument means use current buffer as BUFFER. */) + (buffer) + register Lisp_Object buffer; + { + register struct buffer *buf; + register unsigned char *at, *to; + register unsigned int hash = 0; + + if (NILP (buffer)) + buf = current_buffer; + else + { + CHECK_BUFFER (buffer); + buf = XBUFFER (buffer); + } + + at = BUF_BEG_ADDR (buf); + to = BUF_GPT_ADDR (buf); + while (at < to) + hash = ((((unsigned)(hash) << 4) + (((unsigned)(hash) >> 24) & 0x0fffffff)) + + (unsigned)(*at++)); + + at = BUF_GAP_END_ADDR (buf); + to = BUF_Z_ADDR (buf); + while (at < to) + hash = ((((unsigned)(hash) << 4) + (((unsigned)(hash) >> 24) & 0x0fffffff)) + + (unsigned)(*at++)); + + return make_number (hash & INTMASK); + } DEFUN ("rename-buffer", Frename_buffer, Srename_buffer, 1, 2, "sRename buffer (to new name): \nP", *************** *** 6024,6029 **** - --- 6058,6064 ---- defsubr (&Sbuffer_modified_p); defsubr (&Sset_buffer_modified_p); defsubr (&Sbuffer_modified_tick); + defsubr (&Sbuffer_hash); defsubr (&Srename_buffer); defsubr (&Sother_buffer); defsubr (&Sbuffer_enable_undo); *** imenu.el.~1.118.~ Tue Aug 15 10:00:50 2006 - --- imenu.el Sun Aug 27 11:32:36 2006 *************** *** 970,981 **** "The value of (buffer-modified-tick) as of last call to `imenu-update-menubar'.") (make-variable-buffer-local 'imenu-menubar-modified-tick) (defun imenu-update-menubar () (when (and (current-local-map) (keymapp (lookup-key (current-local-map) [menu-bar index])) ! (not (eq (buffer-modified-tick) ! imenu-menubar-modified-tick))) ! (setq imenu-menubar-modified-tick (buffer-modified-tick)) (let ((index-alist (imenu--make-index-alist t))) ;; Don't bother updating if the index-alist has not changed ;; since the last time we did it. - --- 970,988 ---- "The value of (buffer-modified-tick) as of last call to `imenu-update-menubar'.") (make-variable-buffer-local 'imenu-menubar-modified-tick) + (defvar imenu-buffer-hash 0 + "The value returned by `buffer-hash' as of last call to `imenu-update-menubar'.") + (make-variable-buffer-local 'imenu-buffer-hash) + (defun imenu-update-menubar () (when (and (current-local-map) (keymapp (lookup-key (current-local-map) [menu-bar index])) ! (let ((tick (buffer-modified-tick))) ! (when (/= tick imenu-menubar-modified-tick) ! (setq imenu-menubar-modified-tick tick))) ! (let ((hash (buffer-hash))) ! (when (/= hash imenu-buffer-hash) ! (setq imenu-buffer-hash hash)))) (let ((index-alist (imenu--make-index-alist t))) ;; Don't bother updating if the index-alist has not changed ;; since the last time we did it. - --------------090602040009010004050308-- ------- End of forwarded message -------