From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: valgrind warnings [Re: Emacs bzr memory footprint] Date: Fri, 28 Oct 2011 17:35:05 +0200 Message-ID: <83mxcl9ljq.fsf@gnu.org> References: <87sjmvpmd2.fsf@lifelogs.com> <87aa93wmc4.fsf@turtle.gmx.de> <87sjmnrdjw.fsf@spindle.srvr.nix> <87ty73mc0m.fsf@spindle.srvr.nix> <4EA19111.7060401@yandex.ru> <87vcrhfmww.fsf@uwakimon.sk.tsukuba.ac.jp> <87pqhpf1qo.fsf@uwakimon.sk.tsukuba.ac.jp> <87k47qaxvz.fsf@lifelogs.com> <83bot1bovw.fsf@gnu.org> <87y5w531eo.fsf@uwakimon.sk.tsukuba.ac.jp> <83zkgla1mg.fsf@gnu.org> <87vcr92z6x.fsf@uwakimon.sk.tsukuba.ac.jp> <83ty6t9zd0.fsf@gnu.org> <87k47puow0.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1319816113 22706 80.91.229.12 (28 Oct 2011 15:35:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 28 Oct 2011 15:35:13 +0000 (UTC) Cc: dann@gnu.org, stephen@xemacs.org, emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 28 17:35:08 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RJoSa-0000Mv-LL for ged-emacs-devel@m.gmane.org; Fri, 28 Oct 2011 17:35:08 +0200 Original-Received: from localhost ([::1]:34900 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJoSa-0005kG-66 for ged-emacs-devel@m.gmane.org; Fri, 28 Oct 2011 11:35:08 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:53327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJoSW-0005iv-Ij for emacs-devel@gnu.org; Fri, 28 Oct 2011 11:35:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJoSU-0002bO-Oe for emacs-devel@gnu.org; Fri, 28 Oct 2011 11:35:04 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:34858) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJoSR-0002Za-E5; Fri, 28 Oct 2011 11:34:59 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0LTS00M008I12F00@a-mtaout21.012.net.il>; Fri, 28 Oct 2011 17:34:57 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.124.212.197]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LTS00LWF8M8WG90@a-mtaout21.012.net.il>; Fri, 28 Oct 2011 17:34:57 +0200 (IST) In-reply-to: <87k47puow0.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:145718 Archived-At: > From: Chong Yidong > Cc: Eli Zaretskii , "Stephen J. Turnbull" , emacs-devel@gnu.org > Date: Fri, 28 Oct 2011 23:17:19 +0800 > > Dan Nicolaescu writes: > > > This is because window_from_coordinates in note_mouse_highlight is > > passed "&part", where "part" is an uninitialized local variable. > > When !NILP(window) "part" is not touched, so it stays uninitialized. > > Can someone who understands this code fix this please? > > Fixed; thanks. I don't understand the fix. --- src/xdisp.c 2011-10-19 11:46:17 +0000 +++ src/xdisp.c 2011-10-28 15:17:09 +0000 @@ -26835,11 +26835,14 @@ note_mouse_highlight (struct frame *f, i /* Which window is that in? */ window = window_from_coordinates (f, x, y, &part, 1); - /* If we were displaying active text in another window, clear that. - Also clear if we move out of text area in same window. */ + /* If displaying active text in another window, clear that. */ if (! EQ (window, hlinfo->mouse_face_window) - || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE - && !NILP (hlinfo->mouse_face_window))) + /* Also clear if we move out of text area in same window. */ + || (!NILP (hlinfo->mouse_face_window) + && !NILP (window) + && part != ON_TEXT + && part != ON_MODE_LINE + && part != ON_HEADER_LINE)) clear_mouse_face (hlinfo); What is the purpose of testing that "window" is non-nil? How can it be nil if it is EQ to hlinfo->mouse_face_window, which is non-nil? That's the only real change in this revision, AFAICS. What am I missing?