bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#12867: 24.3.50; easy-to-repro crash involving mode line


From: Drew Adams
Subject: bug#12867: 24.3.50; easy-to-repro crash involving mode line
Date: Sun, 11 Nov 2012 19:52:09 -0800

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'
 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]