unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Keith David Bershatsky <esq@lawlist.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 32351@debbugs.gnu.org
Subject: bug#32351: assq_no_quit: circular loop (default, line-number, line-number-current-line)
Date: Sat, 04 Aug 2018 20:26:33 -0700	[thread overview]
Message-ID: <m2y3dlo5na.wl%esq@lawlist.com> (raw)
In-Reply-To: <m2ftzw6vzv.wl%esq@lawlist.com>

Yes, refusing to display the line numbers seems like a good choice to avoid a never-ending infinite loop.

At the outset of maybe_produce_line_number, I added the following code:

  int text_area_width = window_box_width (it->w, TEXT_AREA);
  if (!NILP (Vdisplay_line_numbers)
      && text_area_width < it->lnum_pixel_width)
    return;

It does not necessarily have to be that code exactly, but something along those lines would suffice.

And, the never-ending loop is now gone when using the above modification.  Due to my inexperience with gdb, I erroneously assumed that assq_no_quit or the function calling it was to blame.  However, pressing C-z to break with gdb simply ended up on assq_no_quit by the laws of probability because the LIST takes more time to process than everything else in the redisplay of the target window loop.  By setting up a break in maybe_produce_line_numbers and other functions, I was able to see that the loop is caused by trying/retrying to display the window containing line numbers.

With the above code, redisplay finishes successfully and I can see that just one (1) column of text is visible in the tall/thin sliver of a window.  And, the above code of course disables line numbers in this situation.

If it is not too much trouble, would it be possible for you to please teach me how to print a human-readable int with gdb such as text_area_width.  I ended up with:

(gdb) print text_area_width 
$1 = 1606380704

To see a human-readable value, I turned it into a Lisp Object and used pp OBJECT.  It would be nice to print int values from gdb and see human readable values without modifying the code to turn the int it into a Lisp Object prior thereto.

Thanks,

Keith

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

> Date: [08-03-2018 10:54:37] <03 Aug 2018 20:54:37 +0300>
> From: Eli Zaretskii <eliz@gnu.org>
> To: Keith David Bershatsky <esq@lawlist.com>
> CC: 32351@debbugs.gnu.org
> Subject: Re: bug#32351: assq_no_quit: circular loop (default, line-number, line-number-current-line)
> 
> > Date:  Fri, 03 Aug 2018 08:17:30 -0700
> > From:  Keith David Bershatsky <esq@lawlist.com>
> > Cc:  32351@debbugs.gnu.org
> >
> > 1.  Original single window in a GUI frame with native line numbers and truncate-lines non-nil.
> >
> > 2.  Try to create/display a new window to the right that takes up approximately 95 percent of the overall frame; e.g., my custom 12 month rotating calendar.  [A workaround would be "well, if it hurts, then don't do that".  However, it would be nice to come up with a programmatic solution to avoid a never-ending loop.]
> >
> > 3.  Emacs tries to display line numbers on the little sliver of a tall/razor-thin window.  However, redisplay never finishes so the new window is not yet displayed and all that is visible to the naked eye is the full-size original window.
> >
> > 4.  assq_no_quit goes into a forever never-ending loop.
> 
> Are you saying that this happens when the window is too narrow to show
> the line numbers?  If so, what solution would you like to have? refuse
> to display the line numbers?





  parent reply	other threads:[~2018-08-05  3:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-03  2:10 bug#32351: assq_no_quit: circular loop (default, line-number, line-number-current-line) Keith David Bershatsky
2018-08-03  6:45 ` Eli Zaretskii
2018-08-03 15:17 ` Keith David Bershatsky
2018-08-03 17:54   ` Eli Zaretskii
2018-08-05  3:26 ` Keith David Bershatsky [this message]
2018-08-13  1:36 ` Keith David Bershatsky
2018-08-28 11:12   ` Eli Zaretskii
2018-08-28 18:46 ` Keith David Bershatsky
2018-08-28 19:19   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2y3dlo5na.wl%esq@lawlist.com \
    --to=esq@lawlist.com \
    --cc=32351@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).