unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Emacs (nowindows) get confused about line display
@ 2016-05-20 21:28 David M. Karr
  2016-05-20 23:28 ` Emanuel Berg
  0 siblings, 1 reply; 7+ messages in thread
From: David M. Karr @ 2016-05-20 21:28 UTC (permalink / raw)
  To: help-gnu-emacs

On my CentOS laptop, I have a CentOS VM that I created with Vagrant.  I 
have Emacs 24.3.1 on the VM.

I start a terminal window on the laptop and ssh to the VM.  I run Emacs, 
but I don't have X11, so it's in "no windows" mode.

Sometimes, when I start emacs on the VM, it starts up fine and displays 
properly.

Quite often, and pretty continuously when it gets into this state, it 
will start up with a blank editor view, with no menu bar, and the cursor 
displays on the SECOND line of the window.  When I then view or edit 
files, it appears that Emacs is confused about its line rendering.  The 
cursor appears at the bottom of the window, even though it "thinks" it's 
on the top line of the file I'm viewing.  I can scroll the cursor to the 
right, and it will jump back to the beginning when it reaches the length 
of the first line, and so on.

Emacs is completely useless in this state.

What can I do at this point?



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

* Re: Emacs (nowindows) get confused about line display
  2016-05-20 21:28 Emacs (nowindows) get confused about line display David M. Karr
@ 2016-05-20 23:28 ` Emanuel Berg
  2016-05-21  0:45   ` David M. Karr
       [not found]   ` <mailman.9.1463791518.1216.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 7+ messages in thread
From: Emanuel Berg @ 2016-05-20 23:28 UTC (permalink / raw)
  To: help-gnu-emacs

"David M. Karr" <davidmichaelkarr@gmail.com>
writes:

> On my CentOS laptop, I have a CentOS VM that
> I created with Vagrant. I have Emacs 24.3.1
> on the VM.
>
> I start a terminal window on the laptop and ssh
> to the VM. I run Emacs, but I don't have X11,
> so it's in "no windows" mode.
>
> Sometimes, when I start emacs on the VM, it
> starts up fine and displays properly.
>
> Quite often, and pretty continuously when it
> gets into this state, it will start up with
> a blank editor view, with no menu bar, and
> the cursor displays on the SECOND line of the
> window. When I then view or edit files, it
> appears that Emacs is confused about its line
> rendering. The cursor appears at the bottom
> of the window, even though it "thinks" it's
> on the top line of the file I'm viewing.
> I can scroll the cursor to the right, and it
> will jump back to the beginning when it
> reaches the length of the first line, and
> so on.
>
> Emacs is completely useless in this state.
>
> What can I do at this point?

You can analyze the whole chain of invocation.
What is the terminal emulator, shell, ssh
command, and Emacs invocation command? And if
you have tmux or something to that extent in
between any of those, that can influence, also.

-- 
underground experts united .... http://user.it.uu.se/~embe8573
Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
                   - so far: 36 Blogomatic articles -                   




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

* Re: Emacs (nowindows) get confused about line display
  2016-05-20 23:28 ` Emanuel Berg
@ 2016-05-21  0:45   ` David M. Karr
  2016-05-21  0:51     ` David M. Karr
       [not found]   ` <mailman.9.1463791518.1216.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 7+ messages in thread
From: David M. Karr @ 2016-05-21  0:45 UTC (permalink / raw)
  To: help-gnu-emacs

On 05/20/2016 04:28 PM, Emanuel Berg wrote:
> "David M. Karr" <davidmichaelkarr@gmail.com>
> writes:
>
>> On my CentOS laptop, I have a CentOS VM that
>> I created with Vagrant. I have Emacs 24.3.1
>> on the VM.
>>
>> I start a terminal window on the laptop and ssh
>> to the VM. I run Emacs, but I don't have X11,
>> so it's in "no windows" mode.
>>
>> Sometimes, when I start emacs on the VM, it
>> starts up fine and displays properly.
>>
>> Quite often, and pretty continuously when it
>> gets into this state, it will start up with
>> a blank editor view, with no menu bar, and
>> the cursor displays on the SECOND line of the
>> window. When I then view or edit files, it
>> appears that Emacs is confused about its line
>> rendering. The cursor appears at the bottom
>> of the window, even though it "thinks" it's
>> on the top line of the file I'm viewing.
>> I can scroll the cursor to the right, and it
>> will jump back to the beginning when it
>> reaches the length of the first line, and
>> so on.
>>
>> Emacs is completely useless in this state.
>>
>> What can I do at this point?
> You can analyze the whole chain of invocation.
> What is the terminal emulator, shell, ssh
> command, and Emacs invocation command? And if
> you have tmux or something to that extent in
> between any of those, that can influence, also.
>
Ok, well, $TERM appears to be "xterm-256color", shell is bash, I got 
there with "vagrant ssh", and I execute Emacs with "emacs".

That gave me the idea to run "emacs -q", and that does provide a clue.  
The display is fine after that, but when I load my .emacs after the fact 
(eval-current-buffer), it's then messed up.  Before I do a binary search 
to narrow down what initially creates the symptom, are there any other 
guidelines for narrowing down something like this?



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

* Re: Emacs (nowindows) get confused about line display
  2016-05-21  0:45   ` David M. Karr
@ 2016-05-21  0:51     ` David M. Karr
  2016-05-21  1:19       ` John Mastro
  0 siblings, 1 reply; 7+ messages in thread
From: David M. Karr @ 2016-05-21  0:51 UTC (permalink / raw)
  To: help-gnu-emacs

On 05/20/2016 05:45 PM, David M. Karr wrote:
> On 05/20/2016 04:28 PM, Emanuel Berg wrote:
>> "David M. Karr" <davidmichaelkarr@gmail.com>
>> writes:
>>
>>> On my CentOS laptop, I have a CentOS VM that
>>> I created with Vagrant. I have Emacs 24.3.1
>>> on the VM.
>>>
>>> I start a terminal window on the laptop and ssh
>>> to the VM. I run Emacs, but I don't have X11,
>>> so it's in "no windows" mode.
>>>
>>> Sometimes, when I start emacs on the VM, it
>>> starts up fine and displays properly.
>>>
>>> Quite often, and pretty continuously when it
>>> gets into this state, it will start up with
>>> a blank editor view, with no menu bar, and
>>> the cursor displays on the SECOND line of the
>>> window. When I then view or edit files, it
>>> appears that Emacs is confused about its line
>>> rendering. The cursor appears at the bottom
>>> of the window, even though it "thinks" it's
>>> on the top line of the file I'm viewing.
>>> I can scroll the cursor to the right, and it
>>> will jump back to the beginning when it
>>> reaches the length of the first line, and
>>> so on.
>>>
>>> Emacs is completely useless in this state.
>>>
>>> What can I do at this point?
>> You can analyze the whole chain of invocation.
>> What is the terminal emulator, shell, ssh
>> command, and Emacs invocation command? And if
>> you have tmux or something to that extent in
>> between any of those, that can influence, also.
>>
> Ok, well, $TERM appears to be "xterm-256color", shell is bash, I got 
> there with "vagrant ssh", and I execute Emacs with "emacs".
>
> That gave me the idea to run "emacs -q", and that does provide a 
> clue.  The display is fine after that, but when I load my .emacs after 
> the fact (eval-current-buffer), it's then messed up.  Before I do a 
> binary search to narrow down what initially creates the symptom, are 
> there any other guidelines for narrowing down something like this?
Actually, narrowing it down didn't take very long, but I'd still like to 
understand this better.

The 2-3rd line of my .emacs file has this:
--------------------------
(set-frame-position (selected-frame) 0 0)
(set-frame-height (selected-frame) 60)
----------------

This is obviously not relevant in a emacs-nw situation, but I copied 
this from my "home" .emacs file.  Why would this cause the symptom that 
I'm seeing?

It's easy enough to wrap this with a "(display-graphic-p)" call, but I'd 
like to understand why this is happening.



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

* Re: Emacs (nowindows) get confused about line display
  2016-05-21  0:51     ` David M. Karr
@ 2016-05-21  1:19       ` John Mastro
  2016-05-21  6:42         ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: John Mastro @ 2016-05-21  1:19 UTC (permalink / raw)
  To: David M. Karr; +Cc: help-gnu-emacs@gnu.org

David M. Karr <davidmichaelkarr@gmail.com> wrote:
> Actually, narrowing it down didn't take very long, but I'd still like to
> understand this better.
>
> The 2-3rd line of my .emacs file has this:
> --------------------------
> (set-frame-position (selected-frame) 0 0)
> (set-frame-height (selected-frame) 60)
> ----------------
>
> This is obviously not relevant in a emacs-nw situation, but I copied this
> from my "home" .emacs file.  Why would this cause the symptom that I'm
> seeing?
>
> It's easy enough to wrap this with a "(display-graphic-p)" call, but I'd
> like to understand why this is happening.

It looks like the problem is with the call to `set-frame-height'
specifically. `set-frame-position' has no effect on a tty frame.

Further, (set-frame-height (selected-frame) (frame-height)) didn't cause
any problems in my experiments; only when I set a wrong frame height did
I get Emacs into a bad state. So it's not that `set-frame-height'
inherently breaks things on a tty.

However, I don't know whether there are scenarios where it makes sense
to call `set-frame-height' on a tty frame, or if this is just one of
those "well don't do that" situations.

        John



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

* Re: Emacs (nowindows) get confused about line display
       [not found]   ` <mailman.9.1463791518.1216.help-gnu-emacs@gnu.org>
@ 2016-05-21  2:36     ` Emanuel Berg
  0 siblings, 0 replies; 7+ messages in thread
From: Emanuel Berg @ 2016-05-21  2:36 UTC (permalink / raw)
  To: help-gnu-emacs

"David M. Karr" <davidmichaelkarr@gmail.com>
writes:

> That gave me the idea to run "emacs -q", and
> that does provide a clue. The display is fine
> after that, but when I load my .emacs after
> the fact (eval-current-buffer), it's then
> messed up. Before I do a binary search to
> narrow down what initially creates the
> symptom, are there any other guidelines for
> narrowing down something like this?

Well, probably not. Binary search is a brute
force method that is rather the opposite of
educated heuristics.

Here are some thoughts on binary search and
Emacs:

    http://user.it.uu.se/~embe8573/blogomatic/emacs/binary-search-to-find-bugs-in-emacs-init-files.html

-- 
underground experts united .... http://user.it.uu.se/~embe8573
Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
                   - so far: 37 Blogomatic articles -                   


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

* Re: Emacs (nowindows) get confused about line display
  2016-05-21  1:19       ` John Mastro
@ 2016-05-21  6:42         ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2016-05-21  6:42 UTC (permalink / raw)
  To: help-gnu-emacs

> From: John Mastro <john.b.mastro@gmail.com>
> Date: Fri, 20 May 2016 18:19:00 -0700
> Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
> 
> David M. Karr <davidmichaelkarr@gmail.com> wrote:
> > Actually, narrowing it down didn't take very long, but I'd still like to
> > understand this better.
> >
> > The 2-3rd line of my .emacs file has this:
> > --------------------------
> > (set-frame-position (selected-frame) 0 0)
> > (set-frame-height (selected-frame) 60)
> > ----------------
> >
> > This is obviously not relevant in a emacs-nw situation, but I copied this
> > from my "home" .emacs file.  Why would this cause the symptom that I'm
> > seeing?
> >
> > It's easy enough to wrap this with a "(display-graphic-p)" call, but I'd
> > like to understand why this is happening.
> 
> It looks like the problem is with the call to `set-frame-height'
> specifically. `set-frame-position' has no effect on a tty frame.
> 
> Further, (set-frame-height (selected-frame) (frame-height)) didn't cause
> any problems in my experiments; only when I set a wrong frame height did
> I get Emacs into a bad state. So it's not that `set-frame-height'
> inherently breaks things on a tty.
> 
> However, I don't know whether there are scenarios where it makes sense
> to call `set-frame-height' on a tty frame, or if this is just one of
> those "well don't do that" situations.

I suggest to upgrade to a later version of Emacs, but in general, my
advice is not to use set-frame-height in TTY sessions.  That function
does produce a non-trivial effect on a TTY, but the effect is only
useful for debugging Emacs, not for normal usage.



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

end of thread, other threads:[~2016-05-21  6:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-20 21:28 Emacs (nowindows) get confused about line display David M. Karr
2016-05-20 23:28 ` Emanuel Berg
2016-05-21  0:45   ` David M. Karr
2016-05-21  0:51     ` David M. Karr
2016-05-21  1:19       ` John Mastro
2016-05-21  6:42         ` Eli Zaretskii
     [not found]   ` <mailman.9.1463791518.1216.help-gnu-emacs@gnu.org>
2016-05-21  2:36     ` Emanuel Berg

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