From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#14838: 24.3.50; repeating next-line or previous-line is broken Date: Thu, 11 Jul 2013 20:51:42 +0200 Message-ID: <87zjttx741.fsf@rosalinde.fritz.box> References: <87ip0ije8n.fsf@gmx.net> <83bo69vmev.fsf@gnu.org> <8761whxvjc.fsf@rosalinde.fritz.box> <838v1dulyl.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1373568737 12925 80.91.229.3 (11 Jul 2013 18:52:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Jul 2013 18:52:17 +0000 (UTC) Cc: 14838@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 11 20:52:17 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 1UxLyS-0001LF-Da for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Jul 2013 20:52:16 +0200 Original-Received: from localhost ([::1]:36826 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxLyS-0000mG-3N for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Jul 2013 14:52:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxLyK-0000dr-4e for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2013 14:52:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UxLyE-0007lS-LI for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2013 14:52:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxLyE-0007lM-Dj for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2013 14:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1UxLyE-00083Y-5i for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2013 14:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Jul 2013 18:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14838 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14838-submit@debbugs.gnu.org id=B14838.137356871630952 (code B ref 14838); Thu, 11 Jul 2013 18:52:02 +0000 Original-Received: (at 14838) by debbugs.gnu.org; 11 Jul 2013 18:51:56 +0000 Original-Received: from localhost ([127.0.0.1]:48398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UxLy7-000836-L2 for submit@debbugs.gnu.org; Thu, 11 Jul 2013 14:51:56 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:50545) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UxLy4-00082g-Ka for 14838@debbugs.gnu.org; Thu, 11 Jul 2013 14:51:54 -0400 Original-Received: from rosalinde.fritz.box ([89.245.121.253]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MFtf4-1V02qP2ttO-00Exyq; Thu, 11 Jul 2013 20:51:46 +0200 In-Reply-To: <838v1dulyl.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 11 Jul 2013 18:59:14 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Provags-ID: V03:K0:F9nG0xg3Gul6AJiytJelcKZbWrolnMkXBWLGaiU1BqsBHjSda5J Nvf2QyOMv4XXkSOWDxVmApwMlLybtSU168fyFPQiZKLZkURfc0sw4krplD4dIA8bxNXXqEu 5v4F/K8R3nV5lC4mnqXAKtDJzLbKl8543bpeFXJ9a3ARqdd3ztSoCFDjhqgJC4W4f3afiRm bvNwluc67AUHRlMd59cRA== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org 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:76241 Archived-At: On Thu, 11 Jul 2013 18:59:14 +0300 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: 14838@debbugs.gnu.org >> Date: Thu, 11 Jul 2013 12:04:07 +0200 >> >> Yes. First, I found out that the problems I observed do not happen when >> I repeat exactly the above recipe after having removed my ~/.Xresources >> file and logged in again. That file contains this: >> >> Emacs.FontBackend: xft >> Emacs.Font: DejaVu Sans Mono-9 >> >> ! ---------[ xft ] --------- >> Xft*antialias: true >> Xft*autohint: true >> >> Without this, when I start Emacs with -Q, the font is still the one I >> reported above, but now holding down C-n in NEWS works fine. I don't >> understand why, since I thought -Q means no X resources are read. > > It should. Is inhibit-x-resources set when you invoke with -Q? Yes, its value is t. > Maybe the fact that X resources matter is a GTK thing? Just > guessing. Jan, could you please comment on this? > >> When I start Emacs with my init file but without the .Xresources file, I >> also don't observe the problem with C-n. In my initializations, I have >> the font DejaVu Sans Mono-9 set as default in a custom theme loaded from >> my init file (I've been using the .Xresources file since long before >> creating the them, and didn't try removing till now). So without the >> .Xresources file, I have no problem using C-n with this font, but with >> the above .Xresources, the problem occurs with this font. > > FWIW, I tried such a font as well (but without anti-aliasing), and > didn't see any problem. > >> I started Emacs like this: >> >> emacs -Q -l ~/bzr/emacs/quickfixes/lisp/simple.el >> >> switched the default font to Adobe Courier as described above and then >> followed your instructions; here is the report: >> >> + call-interactively 6758 29% >> + next-line 6059 26% >> + if 5176 22% >> + line-move 3875 16% >> + command-execute 522 2% >> Automatic GC 445 1% >> + let 86 0% >> + redisplay_internal (C function) 35 0% >> + prog1 26 0% >> + read-from-minibuffer 24 0% >> + find-file-noselect 19 0% >> + run-hooks 18 0% >> + condition-case 16 0% >> + cond 12 0% >> + view-file 8 0% >> + mapc 4 0% >> + list 4 0% >> + read-extended-command 4 0% >> + vc-mode-line 3 0% >> + line-move-visual 3 0% >> + file-truename 2 0% >> + vc-find-file-hook 2 0% >> + vc-backend 2 0% >> + after-find-file 2 0% >> + completing-read 2 0% >> + let* 1 0% >> + view-emacs-news 1 0% >> + find-file-noselect-1 1 0% >> + vc-call-backend 1 0% >> internal-timer-start-idle 1 0% >> + and 1 0% > > What do you see if you completely expand the profile? Do you see > line-move-partial anywhere in the profile? That's the only function > where I made significant changes in the offending revisions, so if > it's not high in the profile, I don't know what to think. Here are the top 200 lines of another profile (not identical to the one I posted previously, but similar), which account for 99% of the CPU time. Is this saying that 70% of CPU time is spent in line-move-partial (and 82% in aref)? - call-interactively 7225 30% - next-line 7225 30% - if 7225 30% - if 7225 30% - condition-case 7225 30% - line-move 7225 30% - if 7225 30% - if 7225 30% - if 5398 22% - prog1 5398 22% - let 5397 22% - default-line-height 5397 22% - let 5397 22% - default-font-height 5397 22% - cond 5397 22% aref 5396 22% display-multi-font 1 0% - line-move-visual 1 0% - let 1 0% - if 1 0% - let 1 0% - posn-at-point 1 0% eval 1 0% - and 1827 7% - line-move-partial 1827 7% - if 1827 7% - let* 1827 7% - if 1801 7% - progn 1801 7% - if 1799 7% let 1795 7% if 3 0% and 1 0% - setq 2 0% or 2 0% - default-line-height 21 0% - let 21 0% - if 21 0% or 20 0% display-graphic-p 1 0% - window-screen-lines 5 0% - let 5 0% - default-line-height 3 0% let 3 0% - / 2 0% * 2 0% - next-line 6340 26% - if 6340 26% - if 6340 26% - condition-case 6340 26% - line-move 6340 26% - if 6340 26% - if 6340 26% - and 6247 25% - line-move-partial 6247 25% - if 6247 25% - let* 6247 25% - default-line-height 5351 22% - let 5351 22% - default-font-height 5350 22% - cond 5350 22% aref 5348 22% display-multi-font 2 0% - if 1 0% - display-graphic-p 1 0% framep-on-display 1 0% - if 891 3% - progn 891 3% - setq 888 3% - or 888 3% let 888 3% - if 3 0% - let 3 0% setq 2 0% pos-visible-in-win 1 0% - window-screen-lines 5 0% - let 5 0% - default-line-height 5 0% - let 5 0% if 4 0% default-font-heigh 1 0% - if 93 0% - prog1 93 0% - line-move-visual 89 0% - let 89 0% - or 89 0% - and 89 0% - or 89 0% - and 89 0% >= 89 0% - let 4 0% - default-line-height 4 0% - let 4 0% - default-font-height 4 0% - cond 4 0% - aref 2 0% font-info 2 0% - display-multi-font-p 2 0% framep-on-display 2 0% - if 5387 22% - condition-case 5344 22% - line-move 5344 22% - if 5344 22% - if 5344 22% - and 5342 22% - line-move-partial 5342 22% - if 5342 22% - let* 5342 22% - window-screen-lines 5311 22% - let 5311 22% - default-line-height 5311 22% - let 5311 22% - default-font-height 5311 22% - cond 5311 22% aref 5310 22% display-multi-font 1 0% - if 31 0% - progn 31 0% - if 23 0% - let 23 0% - pos-visible-in-window- 23 0% - eval 23 0% if 21 0% unless 1 0% mode-line-eol-desc 1 0% - setq 6 0% - or 6 0% - let 6 0% - posn-at-point 4 0% eval 3 0% file-remote-p 1 0% - if 2 0% cdr 2 0% - cond 2 0% - and 2 0% - or 2 0% - < 2 0% setq 2 0% - if 2 0% - prog1 2 0% - line-move-visual 2 0% - let 2 0% - or 2 0% - and 2 0% - or 2 0% - and 2 0% - >= 2 0% - vertical-motion 2 0% jit-lock-function 2 0% - if 43 0% - condition-case 43 0% - line-move 43 0% - if 43 0% - if 43 0% - and 43 0% - line-move-partial 43 0% - if 43 0% - let* 43 0% - window-screen-lines 22 0% - let 22 0% - default-line-height 22 0% - let 22 0% - if 21 0% or 20 0% display-graphic-p 1 0% - default-font-height 1 0% cond 1 0% - if 15 0% - progn 15 0% - if 9 0% - let 9 0% - pos-visible-in-windo 9 0% file-remote-p 6 0% eval 3 0% - setq 6 0% - or 6 0% - let 6 0% posn-at-point 5 0% setq 1 0% - default-line-height 6 0% - let 6 0% - default-font-height 6 0% - cond 6 0% - aref 6 0% font-info 6 0% - line-move 4084 16% - if 4084 16% - if 4084 16% - and 4084 16% - line-move-partial 4084 16% - if 4084 16% - let* 4084 16% - if 4084 16% - progn 4084 16% - if 4084 16% - if 4083 16% - and 4083 16% - >= 4083 16% - default-font-height 4083 16% - cond 4083 16% aref 4083 16% >> followed by exactly 175 repetitions of these two lines (I used `M-x >> occur' to make sure they were all identical): >> >> vs 0 dlh 14 this nil rowh 13 rbot 1 py 0 vpos 32 last 31.0 >> 2 >> >> and nothing else. > > The "py 0" part is very strange. "py" is the vertical coordinate of > point in screen line units. Since this was with C-n, I expect py > never to be less than half the screen height, which is 16. How come > it is zero, i.e. point is in the first line? Can you step through > line-move-partial in Edebug and see what is going on there? If I instrument line-move-partial and type `C-n', I see py = 0 on the first line and it increases by 1 on each subsequent line. I have no idea why *Messages* only showed a value of 0 for py; could it be that the messages were overwritten when the CPU load hit 90%? Is it possible to make Edebug break execution only when that load level occurs? >> > I also asked to try reducing the keyboard auto-repeat rate, and see if >> > that makes any difference. >> >> The default rate in my setup is 25 repeats/s. I lowered it to 15 and >> repeated the above experiment, and the problem again occurs, but starts >> later, around line 300. Then I lowered the repeat rate to 10, which is >> annoyingly slow, and here too the problem occurs, starting around line >> 500. > > This is consistent with the high CPU load you see. But I'd be damned > if I understand what is causing that CPU load, or why it happens with > some fonts, but not others. > > Btw, do you have any local changes in your builds? The builds I tested for my OP were from a branch that mirrors trunk, plus or minus the changes to simple.el from before and after revision 113314; the only changes in the build used for profiling are those you added to simple.el from 113360 to get the messages. Steve Berman