all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Have to run redraw-display manually
@ 2021-09-21  9:06 Cos Chan
  2021-09-21  9:26 ` Eli Zaretskii
  2021-09-21 11:28 ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 2 replies; 6+ messages in thread
From: Cos Chan @ 2021-09-21  9:06 UTC (permalink / raw)
  To: help-gnu-emacs

Dear All

I have a problem while using zsh 5.7.1 and GNU Emacs 26.1. The Emacs is
none X.
I have the same problem in Debian 10, 11 and FreeBSD 12, 13. I assume it is
not an OS related problem.

The problem is moving point by M-b/M-f/C-up/C-down or kill words/line, the
display would be wrong.
The point or the characters would be in the wrong places until I manually
run M-x redraw-display to get it back.

I can easily reproduce this problem in zsh, which is gone while the shell
is switched to tcsh.

-- 
Regards
Cos Chan


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

* Re: Have to run redraw-display manually
  2021-09-21  9:06 Have to run redraw-display manually Cos Chan
@ 2021-09-21  9:26 ` Eli Zaretskii
       [not found]   ` <CAKV+xLDsh1=BaDpVxkCSTeHUfn6xCr10fScZtD3JXRVXmqoYJg@mail.gmail.com>
  2021-09-21 11:28 ` Emanuel Berg via Users list for the GNU Emacs text editor
  1 sibling, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2021-09-21  9:26 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Cos Chan <rosettas@gmail.com>
> Date: Tue, 21 Sep 2021 11:06:45 +0200
> 
> Dear All
> 
> I have a problem while using zsh 5.7.1 and GNU Emacs 26.1. The Emacs is
> none X.
> I have the same problem in Debian 10, 11 and FreeBSD 12, 13. I assume it is
> not an OS related problem.
> 
> The problem is moving point by M-b/M-f/C-up/C-down or kill words/line, the
> display would be wrong.
> The point or the characters would be in the wrong places until I manually
> run M-x redraw-display to get it back.
> 
> I can easily reproduce this problem in zsh, which is gone while the shell
> is switched to tcsh.

Are there any non-ASCII characters in the problematic display?

If not, can you show the display in which it happens?  Does the
problem happen in "emacs -Q"?



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

* Re: Have to run redraw-display manually
       [not found]   ` <CAKV+xLDsh1=BaDpVxkCSTeHUfn6xCr10fScZtD3JXRVXmqoYJg@mail.gmail.com>
@ 2021-09-21 11:16     ` Eli Zaretskii
  2021-09-21 11:33       ` Cos Chan
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2021-09-21 11:16 UTC (permalink / raw)
  To: help-gnu-emacs

[Why private email?]
> From: Cos Chan <rosettas@gmail.com>
> Date: Tue, 21 Sep 2021 13:03:46 +0200
> 
> I did more testing, and it seems that changing the system tab width by 
> $ tabs 4
> would create this problem(also in tcsh). If I change it back to 8 the problem is gone.
> 
> Here is content of my .emacs file:
> (add-to-list 'load-path "~/.emacs.d/lisp/")
> ;; lisp scripts
> (require 'sudo-save)
> ;; editting settings
> (setq-default indent-tabs-mode t)
> (setq-default tab-width 4)
> (normal-erase-is-backspace-mode 1)
> ;; backup and autosave to temporary directory
> (setq backup-directory-alist
>       `((".*" . ,temporary-file-directory)))
> (setq auto-save-file-name-transforms
>       `((".*" ,temporary-file-directory t)))
> ;; set color to be compatible with dark background
> (setq frame-background-mode 'dark)
> 
> I made a simple file test_emacs for testing, here is the content:
> HISTSIZE=999
> SAVEHIST=999
> setopt appendhistory autocd beep extendedglob nomatch notify
> 
> How to reproduce:
> $ emacs test_emacs
> type 2 times ctrl-n, the point is on "s" (from setopt, line 3)
> type alt-f, the point is on character "t" (from setopt, line 3, the third character)
> type alt-x and redraw display, the point is on the first space (line3, the 7th character)
> 
> With little tuning for the testing file, I removed the last "t" from "setopt" and the testing result was:
> $ emacs test_emacs
> type 2 times ctrl-n, the point is on "s" (from setopt, line 3)
> type alt-f, the point is on the first space. (Which is correct)
> type alt-f, the point is on the second space. (Which is correct)
> type alt-f, the point is on the third space. (Which is correct)
> type alt-f, the point is on the "b". (from beep, which is incorrect)
> type alt-x and redraw display, the point is on the fourth space.
> 
> Please suggest.

My suggestion is not to do "tabs 4", it changes how the terminal
behaves regarding cursor motion.



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

* Re: Have to run redraw-display manually
  2021-09-21  9:06 Have to run redraw-display manually Cos Chan
  2021-09-21  9:26 ` Eli Zaretskii
@ 2021-09-21 11:28 ` Emanuel Berg via Users list for the GNU Emacs text editor
  1 sibling, 0 replies; 6+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-09-21 11:28 UTC (permalink / raw)
  To: help-gnu-emacs

Cos Chan wrote:

> I have a problem while using zsh 5.7.1 and GNU Emacs 26.1.
> The Emacs is none X.

... you mean a terminal Emacs, i.e. not in X?

emacs-nox rings a semi-distant bell but that isn't in the
Debian 11 repos what I can see. (I'm also on Debian with zsh
and a terminal Emacs (in the Linux VT/tty/console) BTW.)

> I have the same problem in Debian 10, 11 and FreeBSD 12, 13.
> I assume it is not an OS related problem.

Sounds like a character/terminal emulator issue ...

> The problem is moving point by M-b/M-f/C-up/C-down or kill
> words/line, the display would be wrong. The point or the
> characters would be in the wrong places until I manually run
> M-x redraw-display to get it back.
>
> I can easily reproduce this problem in zsh, which is gone
> while the shell is switched to tcsh.

Sounds like a shell/terminal emulator charmap mismatch ...

Start by upgrading your stuff (suggestion) ... I have

$ uname -a
Linux ebih 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2
(2019-11-11) x86_64 GNU/Linux

$ lsb_release -d -s
Debian GNU/Linux 11 (bullseye)

$ zsh --version
zsh 5.8 (x86_64-debian-linux-gnu)

C-u M-x emacs-version RET
GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, cairo
version 1.16.0) of 2021-08-27

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Have to run redraw-display manually
  2021-09-21 11:16     ` Eli Zaretskii
@ 2021-09-21 11:33       ` Cos Chan
  2021-09-21 11:54         ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Cos Chan @ 2021-09-21 11:33 UTC (permalink / raw)
  To: help-gnu-emacs

On Tue, Sep 21, 2021 at 1:16 PM Eli Zaretskii <eliz@gnu.org> wrote:

> [Why private email?]
>
Sorry I didn't notice that Gmail automatically put the private Email in
reply.


> > From: Cos Chan <rosettas@gmail.com>
> > Date: Tue, 21 Sep 2021 13:03:46 +0200
> >
> > I did more testing, and it seems that changing the system tab width by
> > $ tabs 4
> > would create this problem(also in tcsh). If I change it back to 8 the
> problem is gone.
> >
> > Here is content of my .emacs file:
> > (add-to-list 'load-path "~/.emacs.d/lisp/")
> > ;; lisp scripts
> > (require 'sudo-save)
> > ;; editting settings
> > (setq-default indent-tabs-mode t)
> > (setq-default tab-width 4)
> > (normal-erase-is-backspace-mode 1)
> > ;; backup and autosave to temporary directory
> > (setq backup-directory-alist
> >       `((".*" . ,temporary-file-directory)))
> > (setq auto-save-file-name-transforms
> >       `((".*" ,temporary-file-directory t)))
> > ;; set color to be compatible with dark background
> > (setq frame-background-mode 'dark)
> >
> > I made a simple file test_emacs for testing, here is the content:
> > HISTSIZE=999
> > SAVEHIST=999
> > setopt appendhistory autocd beep extendedglob nomatch notify
> >
> > How to reproduce:
> > $ emacs test_emacs
> > type 2 times ctrl-n, the point is on "s" (from setopt, line 3)
> > type alt-f, the point is on character "t" (from setopt, line 3, the
> third character)
> > type alt-x and redraw display, the point is on the first space (line3,
> the 7th character)
> >
> > With little tuning for the testing file, I removed the last "t" from
> "setopt" and the testing result was:
> > $ emacs test_emacs
> > type 2 times ctrl-n, the point is on "s" (from setopt, line 3)
> > type alt-f, the point is on the first space. (Which is correct)
> > type alt-f, the point is on the second space. (Which is correct)
> > type alt-f, the point is on the third space. (Which is correct)
> > type alt-f, the point is on the "b". (from beep, which is incorrect)
> > type alt-x and redraw display, the point is on the fourth space.
> >
> > Please suggest.
>
> My suggestion is not to do "tabs 4", it changes how the terminal
> behaves regarding cursor motion.
>
>
Clear and I will not do it. May I suggest adding this warning to the Emacs
documents?
In case I may reproduce in several systems, that can be a common issue.

And I am pretty sure before I upgraded the Emacs there was no such issue.
But I don't remember the version number of the Emacs I had.

-- 
Regards
Cos Chan


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

* Re: Have to run redraw-display manually
  2021-09-21 11:33       ` Cos Chan
@ 2021-09-21 11:54         ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2021-09-21 11:54 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Cos Chan <rosettas@gmail.com>
> Date: Tue, 21 Sep 2021 13:33:40 +0200
> 
> > My suggestion is not to do "tabs 4", it changes how the terminal
> > behaves regarding cursor motion.
> >
> >
> Clear and I will not do it. May I suggest adding this warning to the Emacs
> documents?

I would instead suggest that you report this as a bug, using the
"M-x report-emacs-bug" command.  It is possible that Emacs should be
able to automatically detect this situation somehow; currently it
doesn't, and I'm not an expert in this area to know if it could and
how.  Be sure to mention the "tabs 4" command in your report, as that
is the root cause.

> And I am pretty sure before I upgraded the Emacs there was no such issue.
> But I don't remember the version number of the Emacs I had.

It doesn't have to do anything with the Emacs version.  Emacs employs
a complicated algorithm to determine the least expensive sequence of
terminal commands to send to the terminal, given some cursor
movement.  The output depends on many factors, such as your terminal
screen dimensions etc.  So it could be that you never saw this before
due to factors other than the Emacs version.

It is also possible that this is related to the fact that we nowadays
use terminfo for finding out the terminal capabilities, whereas we
used termcap in older versions.

Reporting a bug will allow us to investigate this thoroughly and see
what can be done.

Thanks.



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

end of thread, other threads:[~2021-09-21 11:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-21  9:06 Have to run redraw-display manually Cos Chan
2021-09-21  9:26 ` Eli Zaretskii
     [not found]   ` <CAKV+xLDsh1=BaDpVxkCSTeHUfn6xCr10fScZtD3JXRVXmqoYJg@mail.gmail.com>
2021-09-21 11:16     ` Eli Zaretskii
2021-09-21 11:33       ` Cos Chan
2021-09-21 11:54         ` Eli Zaretskii
2021-09-21 11:28 ` Emanuel Berg via Users list for the GNU Emacs text editor

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.