unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Large text files - no line numbers ?
@ 2019-12-04 14:47 jonetsu
  2019-12-04 14:57 ` Robert Pluim
  0 siblings, 1 reply; 18+ messages in thread
From: jonetsu @ 2019-12-04 14:47 UTC (permalink / raw)
  To: help-gnu-emacs

When browsing large text files, 'L??' is shown instead of line
numbers.  Is it possible to have line numbers, is there an option hat
would allow it ?  Would be useful in setting bookmarks.




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

* Re: Large text files - no line numbers ?
  2019-12-04 14:47 Large text files - no line numbers ? jonetsu
@ 2019-12-04 14:57 ` Robert Pluim
  2019-12-04 15:07   ` jonetsu
  2019-12-04 15:31   ` Eli Zaretskii
  0 siblings, 2 replies; 18+ messages in thread
From: Robert Pluim @ 2019-12-04 14:57 UTC (permalink / raw)
  To: help-gnu-emacs

>>>>> On Wed, 4 Dec 2019 09:47:04 -0500, jonetsu <jonetsu@teksavvy.com> said:

    jonetsu> When browsing large text files, 'L??' is shown instead of line
    jonetsu> numbers.  Is it possible to have line numbers, is there an option hat
    jonetsu> would allow it ?  Would be useful in setting bookmarks.

I assume you mean in the mode line? What's your value of
line-number-display-limit? (and I donʼt think bookmarks depend on
being able to show the line number, at least not the ones created by
'C-x r m')

Robert




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

* Re: Large text files - no line numbers ?
  2019-12-04 14:57 ` Robert Pluim
@ 2019-12-04 15:07   ` jonetsu
  2019-12-04 15:49     ` jonetsu
  2019-12-04 15:31   ` Eli Zaretskii
  1 sibling, 1 reply; 18+ messages in thread
From: jonetsu @ 2019-12-04 15:07 UTC (permalink / raw)
  To: help-gnu-emacs

On Wed, 04 Dec 2019 15:57:49 +0100
Robert Pluim <rpluim@gmail.com> wrote:

> I assume you mean in the mode line? What's your value of
> line-number-display-limit? (and I donʼt think bookmarks depend on
> being able to show the line number, at least not the ones created by
> 'C-x r m')

It's currently set to 'no limit'.  The mode is Fundamental and the
percentage into the file is shown.  But no line numbers. And yes, adding
bookmarks from that 733K file results in all bookmarks pointing at the
same location, Whereas bookmarks are working fine for other files.

There's another variable though, called line-number-display-limit-width
which was set to 200.  Setting it to 1000 (arbitrary number for
testing) brings back the line numbers in the mode line.

Thanks for the hint.



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

* Re: Large text files - no line numbers ?
  2019-12-04 14:57 ` Robert Pluim
  2019-12-04 15:07   ` jonetsu
@ 2019-12-04 15:31   ` Eli Zaretskii
  2019-12-05 14:44     ` jonetsu
  1 sibling, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2019-12-04 15:31 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Robert Pluim <rpluim@gmail.com>
> Date: Wed, 04 Dec 2019 15:57:49 +0100
> 
> >>>>> On Wed, 4 Dec 2019 09:47:04 -0500, jonetsu <jonetsu@teksavvy.com> said:
> 
>     jonetsu> When browsing large text files, 'L??' is shown instead of line
>     jonetsu> numbers.  Is it possible to have line numbers, is there an option hat
>     jonetsu> would allow it ?  Would be useful in setting bookmarks.
> 
> I assume you mean in the mode line? What's your value of
> line-number-display-limit?

There's also line-number-display-limit-width, for when the file has
long lines.



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

* Re: Large text files - no line numbers ?
  2019-12-04 15:07   ` jonetsu
@ 2019-12-04 15:49     ` jonetsu
  0 siblings, 0 replies; 18+ messages in thread
From: jonetsu @ 2019-12-04 15:49 UTC (permalink / raw)
  To: help-gnu-emacs

On Wed, 4 Dec 2019 10:07:41 -0500
jonetsu <jonetsu@teksavvy.com> wrote:

> There's another variable though, called
> line-number-display-limit-width which was set to 200.  Setting it to
> 1000 (arbitrary number for testing) brings back the line numbers in
> the mode line.

I'm afraid that even with that set, bookmarks (C-x r m <name given> )
appears to be quite broken for that 733K log file in Fundamental mode.
Condition stays the same after restarting emacs.  Add a bookmark and all
bookmarks will be pointing to the last one.




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

* Re: Large text files - no line numbers ?
  2019-12-04 15:31   ` Eli Zaretskii
@ 2019-12-05 14:44     ` jonetsu
  2019-12-05 14:50       ` Stefan Monnier
                         ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: jonetsu @ 2019-12-05 14:44 UTC (permalink / raw)
  To: help-gnu-emacs

On Wed, 04 Dec 2019 17:31:07 +0200
Eli Zaretskii <eliz@gnu.org> wrote:

> There's also line-number-display-limit-width, for when the file has
> long lines.

It looks as if the bookmark functionality (C-x r m) is unaffected by
this setting and will simply behave wrongly no matter and is thus
useless in this case.




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

* Re: Large text files - no line numbers ?
  2019-12-05 14:44     ` jonetsu
@ 2019-12-05 14:50       ` Stefan Monnier
  2019-12-05 15:03         ` jonetsu
  2019-12-05 14:56       ` Robert Pluim
  2019-12-05 15:22       ` Eli Zaretskii
  2 siblings, 1 reply; 18+ messages in thread
From: Stefan Monnier @ 2019-12-05 14:50 UTC (permalink / raw)
  To: help-gnu-emacs

> It looks as if the bookmark functionality (C-x r m) is unaffected by
> this setting and will simply behave wrongly no matter and is thus
> useless in this case.
             ^^^^
For some value of "this" which you have kept secret so far.


        Stefan




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

* Re: Large text files - no line numbers ?
  2019-12-05 14:44     ` jonetsu
  2019-12-05 14:50       ` Stefan Monnier
@ 2019-12-05 14:56       ` Robert Pluim
  2019-12-05 15:27         ` jonetsu
  2019-12-05 15:22       ` Eli Zaretskii
  2 siblings, 1 reply; 18+ messages in thread
From: Robert Pluim @ 2019-12-05 14:56 UTC (permalink / raw)
  To: jonetsu; +Cc: help-gnu-emacs

>>>>> On Thu, 5 Dec 2019 09:44:21 -0500, jonetsu <jonetsu@teksavvy.com> said:

    jonetsu> On Wed, 04 Dec 2019 17:31:07 +0200
    jonetsu> Eli Zaretskii <eliz@gnu.org> wrote:

    >> There's also line-number-display-limit-width, for when the file has
    >> long lines.

    jonetsu> It looks as if the bookmark functionality (C-x r m) is unaffected by
    jonetsu> this setting and will simply behave wrongly no matter and is thus
    jonetsu> useless in this case.

Thatʼs surprising, since the bookmark function records the value of
(point), which should always be available regardless of whether Emacs
can determine the line number.

Does it fail from 'emacs -Q' as well?

Robert





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

* Re: Large text files - no line numbers ?
  2019-12-05 14:50       ` Stefan Monnier
@ 2019-12-05 15:03         ` jonetsu
  2019-12-06 18:16           ` Stefan Monnier
  0 siblings, 1 reply; 18+ messages in thread
From: jonetsu @ 2019-12-05 15:03 UTC (permalink / raw)
  To: help-gnu-emacs

On Thu, 05 Dec 2019 09:50:39 -0500
Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> For some value of "this" which you have kept secret so far.

Yesterday I replied that the file size was 733K.  That it was a log
file.  And that setting an arbitrary/test value of 1000 (default: 200)
in line-number-display-limit-width solved the problem as far the the
mode line line numbers are concerned as they went from 'L??' to
'L<actual number>'.  I can add that the file is a text file.

What else ?  emacs is: GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, X
toolkit, Xaw3d scroll bars) of 2019-01-28.

Basically the use case is:

Load the log file.  See that the line number display is: 
'L??'.  Try to set several bookmarks, they do not go back to the lines
they were set.  Ask here. Modify the line-number-display-limit-width to
1000.  See that the line numbers are now displayed.  Set some
bookmarks.  Bookmark behaviour is still wrong.

Let me know if there are other details that are needed.  





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

* Re: Large text files - no line numbers ?
  2019-12-05 14:44     ` jonetsu
  2019-12-05 14:50       ` Stefan Monnier
  2019-12-05 14:56       ` Robert Pluim
@ 2019-12-05 15:22       ` Eli Zaretskii
  2019-12-05 15:46         ` jonetsu
  2 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2019-12-05 15:22 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Thu, 5 Dec 2019 09:44:21 -0500
> From: jonetsu <jonetsu@teksavvy.com>
> 
> On Wed, 04 Dec 2019 17:31:07 +0200
> Eli Zaretskii <eliz@gnu.org> wrote:
> 
> > There's also line-number-display-limit-width, for when the file has
> > long lines.
> 
> It looks as if the bookmark functionality (C-x r m) is unaffected by
> this setting and will simply behave wrongly no matter and is thus
> useless in this case.

Sorry, I don't understand.  What do you mean by "unaffected", and what
do you mean by "behave wrongly"?

All I was saying was that sometimes one sees L?? in the mode line
because the lines are too long, not because there are too many lines.
When the reason is the line length, you need to customize
line-number-display-limit-width, not line-number-display-limit.

How is this related to bookmarks?



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

* Re: Large text files - no line numbers ?
  2019-12-05 14:56       ` Robert Pluim
@ 2019-12-05 15:27         ` jonetsu
  0 siblings, 0 replies; 18+ messages in thread
From: jonetsu @ 2019-12-05 15:27 UTC (permalink / raw)
  To: help-gnu-emacs

On Thu, 05 Dec 2019 15:56:21 +0100
Robert Pluim <rpluim@gmail.com> wrote:

> Thatʼs surprising, since the bookmark function records the value of
> (point), which should always be available regardless of whether Emacs
> can determine the line number.
> 
> Does it fail from 'emacs -Q' as well?

Yes it does.  I used bookmark-bmenu-list to list the named bookmarks.
The mode line line numbers were shown as 'L??'

Here is the content of the ~/.emacs.d/bookmarks file.  I'm afraid I had
to replace some text in there, eg. path and file name, reference text
(sometext). The rest is as is.


;;;; Emacs Bookmark Format Version 1 ;;;; -*- coding: utf-8-emacs -*- 
;;; This format is meant to be slightly human-readable;
;;; nevertheless, you probably don't want to edit it.
;;; -*- End Of Bookmark File Format Version Stamp -*-
(("test2"
 (filename . "logfile.log")
 (front-context-string . "1/sometext")
 (rear-context-string . "nclude -I/home/x")
 (position . 264231))
("test1"
 (filename . "logfile.log")
 (front-context-string . "sometext production")
 (rear-context-string . "sutil3.empty.o\n\n")
 (position . 88415))



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

* Re: Large text files - no line numbers ?
  2019-12-05 15:22       ` Eli Zaretskii
@ 2019-12-05 15:46         ` jonetsu
  2019-12-05 16:40           ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: jonetsu @ 2019-12-05 15:46 UTC (permalink / raw)
  To: help-gnu-emacs

On Thu, 05 Dec 2019 17:22:55 +0200
Eli Zaretskii <eliz@gnu.org> wrote:

> Sorry, I don't understand.  What do you mean by "unaffected", and what
> do you mean by "behave wrongly"?

Unaffected means that whereas putting 1000 in
line-number-display-limit-width has solved the 'L??' by making it
display actual line numbers, the bookmark functionality behaves wrongly
as it will not jump to a bookmark, but somewhere else in the file.  As
it did before updating the line-number-display-limit-width value.

It behaves wrongly in the sense that since line numbers are now
displayed correctly, it could be right to assume that the bookmarks
will now work as intended (they did not when L?? was displayed) - but
they do not.

It also behaves wrongly in this use case as setting bookmarks in other,
much smaller files, still works as expected.

> How is this related to bookmarks?

By assuming that the L?? display also prevented the bookmark
feature from functioning correctly.  Mind you, I do not know how the
bookmark feature works.




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

* Re: Large text files - no line numbers ?
  2019-12-05 15:46         ` jonetsu
@ 2019-12-05 16:40           ` Eli Zaretskii
  2019-12-05 17:56             ` jonetsu
  0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2019-12-05 16:40 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Thu, 5 Dec 2019 10:46:11 -0500
> From: jonetsu <jonetsu@teksavvy.com>
> 
> Unaffected means that whereas putting 1000 in
> line-number-display-limit-width has solved the 'L??' by making it
> display actual line numbers, the bookmark functionality behaves wrongly
> as it will not jump to a bookmark, but somewhere else in the file.  As
> it did before updating the line-number-display-limit-width value.
> 
> It behaves wrongly in the sense that since line numbers are now
> displayed correctly, it could be right to assume that the bookmarks
> will now work as intended (they did not when L?? was displayed) - but
> they do not.

AFAIK, there's no relation whatsoever between the line-number display
in the mode line and bookmarks.

> > How is this related to bookmarks?
> 
> By assuming that the L?? display also prevented the bookmark
> feature from functioning correctly.

It doesn't, AFAICT.



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

* Re: Large text files - no line numbers ?
  2019-12-05 16:40           ` Eli Zaretskii
@ 2019-12-05 17:56             ` jonetsu
  0 siblings, 0 replies; 18+ messages in thread
From: jonetsu @ 2019-12-05 17:56 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Thu, 05 Dec 2019 18:40:57 +0200
Eli Zaretskii <eliz@gnu.org> wrote:

> It doesn't, AFAICT.

It's OK.  So the bookmark functionality is simply broken in this case.




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

* Re: Large text files - no line numbers ?
  2019-12-05 15:03         ` jonetsu
@ 2019-12-06 18:16           ` Stefan Monnier
  2019-12-06 18:56             ` jonetsu
  0 siblings, 1 reply; 18+ messages in thread
From: Stefan Monnier @ 2019-12-06 18:16 UTC (permalink / raw)
  To: help-gnu-emacs

> Load the log file.  See that the line number display is: 'L??'.

Line numbers shouldn't affect bookmarks at all, so this is likely a red herring.

> Try to set several bookmarks, they do not go back to the lines
> they were set.

How do you set the bookmarks?  How do you "go back" to them?
What happens between the two operations?  Where do they go instead of
where you wanted (they are not supposed to go back to "a line" but to
a buffer position instead)?


        Stefan




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

* Re: Large text files - no line numbers ?
  2019-12-06 18:16           ` Stefan Monnier
@ 2019-12-06 18:56             ` jonetsu
  2019-12-06 19:08               ` Stefan Monnier
  0 siblings, 1 reply; 18+ messages in thread
From: jonetsu @ 2019-12-06 18:56 UTC (permalink / raw)
  To: help-gnu-emacs

On Fri, 06 Dec 2019 13:16:10 -0500
Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> Line numbers shouldn't affect bookmarks at all, so this is likely a
> red herring.

Could very well be.  The main subject is about the display of L??.
Then I noticed that bookmarks on that file did not work.  So maybe by
having the correct line number being displayed ...  It's all
assumption.  Maybe I should have started another thread in retrospect.

> How do you set the bookmarks?  How do you "go back" to them?
> What happens between the two operations?  Where do they go instead of
> where you wanted (they are not supposed to go back to "a line" but to
> a buffer position instead)?

C-x r m for setting.  I always give a name to the bookmark.  Then
bookmark-bmenu-list to show them and cursor or mouse to select one.

I always delete the existing ~/emacs.d/boomarks file before doing any
tests.  Or erase the current ones if they were not saved.

In the 733K log file, I go to line # 423 and set a bookmark named
'test1'.  Then I scroll further down to line # 536 and set a 'test2'
bookmark.  Jumping to the first bookmark will jump to the last one.
Jumping to the last one will jump tot he last one.

Setting a 3rd bookmark named 'test3' at line # 762 makes all bookmarks
jump to that line/location.

Do you think there's a possibility that some other lisp code in
the .emacs file could interfere with the bookmarks behaviour ?
Through time I have copy/pasted some useful snippets found here and
there.




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

* Re: Large text files - no line numbers ?
  2019-12-06 18:56             ` jonetsu
@ 2019-12-06 19:08               ` Stefan Monnier
  2019-12-06 19:46                 ` jonetsu
  0 siblings, 1 reply; 18+ messages in thread
From: Stefan Monnier @ 2019-12-06 19:08 UTC (permalink / raw)
  To: help-gnu-emacs

> Do you think there's a possibility that some other lisp code in
> the .emacs file could interfere with the bookmarks behaviour ?

That would be my first guess, yes.


        Stefan "via Teksavvy as well"




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

* Re: Large text files - no line numbers ?
  2019-12-06 19:08               ` Stefan Monnier
@ 2019-12-06 19:46                 ` jonetsu
  0 siblings, 0 replies; 18+ messages in thread
From: jonetsu @ 2019-12-06 19:46 UTC (permalink / raw)
  To: help-gnu-emacs

On Fri, 06 Dec 2019 14:08:32 -0500
Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> That would be my first guess, yes.

Thanks, I'll try to read through the lisp code :)  See if there could be
any interaction.

>         Stefan "via Teksavvy as well"

I noticed the UdM.  J'ai vécu à Montréal.

Cheers.






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

end of thread, other threads:[~2019-12-06 19:46 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-04 14:47 Large text files - no line numbers ? jonetsu
2019-12-04 14:57 ` Robert Pluim
2019-12-04 15:07   ` jonetsu
2019-12-04 15:49     ` jonetsu
2019-12-04 15:31   ` Eli Zaretskii
2019-12-05 14:44     ` jonetsu
2019-12-05 14:50       ` Stefan Monnier
2019-12-05 15:03         ` jonetsu
2019-12-06 18:16           ` Stefan Monnier
2019-12-06 18:56             ` jonetsu
2019-12-06 19:08               ` Stefan Monnier
2019-12-06 19:46                 ` jonetsu
2019-12-05 14:56       ` Robert Pluim
2019-12-05 15:27         ` jonetsu
2019-12-05 15:22       ` Eli Zaretskii
2019-12-05 15:46         ` jonetsu
2019-12-05 16:40           ` Eli Zaretskii
2019-12-05 17:56             ` jonetsu

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