unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#12867: 24.3.50; easy-to-repro crash involving mode line
@ 2012-11-12  3:52 Drew Adams
  2012-11-12 15:40 ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Drew Adams @ 2012-11-12  3:52 UTC (permalink / raw)
  To: 12867

emacs -Q
 
(defun foo ()
  (set (make-local-variable 'mode-line-position)
       '("%99l (line)"))
  (set (make-local-variable 'mode-line-format)
       '(("" mode-name mode-line-position))))
 
M-: (foo)
 
No problem.  The line number is shown at the far right, padded on the
left (see bug #12866).  You might need to widen the window/frame to see
it.  But no problem.
 
Now change 99 to 999 and repeat M-: (foo).  Still no problem.  Now, no
matter how big you make the window or how small you make the font, the
line number has probably moved off the screen at the right, so you no
longer see it.  Good (what I wanted).
 
Now change the value to 9999.  Crash.
 

Background, FWIW:
 
I want to use the fact that a %l construct in the mode line enables you
to do something dynamic when the cursor moves to another line.  This
works very well, except for one thing (besides the corner-case crash
reported here): you must SHOW the line number.
 
By "show the line number", I mean:
 
1. The %l construct must be present in the `mode-line-format'.
2. Its resulting line-number text must not have property `invisible'.
 
Dunno why, but that's what seems to be the case.  So, since my use of
this dynamic display does not really have anything to do with showing
the line number, and I do not want to show it, I looked for another way
to remove it.
 
I first moved it off to the right a bit, so it didn't get in the way too
much.  Then I discovered that even though the text must not be
`invisible' (why?) it is fine if the text is off the screen to the
right.  As a final step, I tried using a very large padding number, just
for good measure.  That produced the crash.
 
Besides fixing the crash, it would be great if I did not have to resort
to such an ugly hack in the first place.
 
Presumably, this feature of dynamic line-sensitive updating is buried in
the bowels of Emacs C code, so not available to Lisp users to tweak.
Must this feature really be tied to an actual display of the line
number?  If so, can't we at least make that text invisible?
 
Regardless, it would also be good if this feature (line-sensitive
updating) were documented.  I could find nothing that even hinted at it.
 

[As Emacs 24 crashes sooner or later, seemingly randomly, for each
session I have, it is a pleasure to be able to report a
simple-to-reproduce crash, for once.]
 
In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600)
 of 2012-11-05 on MS-W7-DANI
Bzr revision: 110809 lekktu@gmail.com-20121105172930-a5gn0bwi4lndchhw
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --no-opt --enable-checking --cflags
 -I../../libs/libXpm-3.5.10/include -I../../libs/libXpm-3.5.10/src
 -I../../libs/libpng-1.2.37-lib/include -I../../libs/zlib-1.2.5
 -I../../libs/giflib-4.1.4-1-lib/include
 -I../../libs/jpeg-6b-4-lib/include
 -I../../libs/tiff-3.8.2-1-lib/include
 -I../../libs/libxml2-2.7.8-w32-bin/include/libxml2
 -I../../libs/gnutls-3.0.9-w32-bin/include
 -I../../libs/libiconv-1.9.2-1-lib/include'
 






^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-11-13 13:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-12  3:52 bug#12867: 24.3.50; easy-to-repro crash involving mode line Drew Adams
2012-11-12 15:40 ` Eli Zaretskii
2012-11-12 17:09   ` Drew Adams
2012-11-12 17:52     ` Eli Zaretskii
2012-11-12 18:16       ` Drew Adams
2012-11-12 18:35         ` Eli Zaretskii
2012-11-12 19:07           ` bug#12872: " Drew Adams
2012-11-12 17:31   ` martin rudalics
2012-11-12 18:19     ` Eli Zaretskii
2012-11-12 20:55       ` Stefan Monnier
2012-11-13  8:22         ` martin rudalics
2012-11-13 12:52           ` Eli Zaretskii
2012-11-13 13:50             ` martin rudalics

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).