all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* emacs -nw display bug?
@ 2014-06-30 15:57 Joost Kremers
  2014-06-30 16:10 ` Eli Zaretskii
       [not found] ` <mailman.4590.1404144667.1147.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Joost Kremers @ 2014-06-30 15:57 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all,

I seem to have run into a bug in Emacs's display code. Recipe to
reproduce:

- start Emacs with `emacs -nw'
- open a longish text file
- (set-window-margins nil 40 40) ; use some value appropriate to the window width
- (setq-local mode-line-format nil) ; disable the mode line in the current window

Now, if the file is long enough (that is, longer than one screen), the
last line of the file will not have the appropriate window margin but
will instead start at the left window edge, as if the left margin equals
0.

I suspect this may be due to interference with the mode line, even
though there isn't one, but that's speculation.

The problem does not occur with GUI Emacs. Furthermore, it is
independent of the terminal emulator being used and even occurs on the
Linux console (i.e., without X altogether), so it's safe to assume it is
indeed an Emacs bug.

Anyone have an idea what's going on, or should I simply submit a bug
report?

TIA


-- 
Joost Kremers                                   joostkremers@fastmail.fm
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


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

* Re: emacs -nw display bug?
  2014-06-30 15:57 emacs -nw display bug? Joost Kremers
@ 2014-06-30 16:10 ` Eli Zaretskii
       [not found] ` <mailman.4590.1404144667.1147.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2014-06-30 16:10 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Joost Kremers <joost.m.kremers@gmail.com>
> Date: 30 Jun 2014 15:57:09 GMT
> 
> I seem to have run into a bug in Emacs's display code.

It's a feature.

> - (setq-local mode-line-format nil) ; disable the mode line in the current window

Don't do that.  Emacs display engine assumes that there always is a
mode line.

> Anyone have an idea what's going on, or should I simply submit a bug
> report?

You could submit a bug report, but the assumption of a mode line as
the last line of the window is so deeply entrenched that I doubt the
bug will ever be fixed.



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

* Re: emacs -nw display bug?
       [not found] ` <mailman.4590.1404144667.1147.help-gnu-emacs@gnu.org>
@ 2014-06-30 16:22   ` Joost Kremers
  2014-06-30 16:58     ` Eli Zaretskii
  2014-06-30 21:06   ` Stefan Monnier
  1 sibling, 1 reply; 10+ messages in thread
From: Joost Kremers @ 2014-06-30 16:22 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii wrote:
>> From: Joost Kremers <joost.m.kremers@gmail.com>
>> Date: 30 Jun 2014 15:57:09 GMT
>> - (setq-local mode-line-format nil) ; disable the mode line in the current window
>
> Don't do that.  Emacs display engine assumes that there always is a
> mode line.

Then why does the Elisp manual say:

,----
|  -- User Option: mode-line-format
|
|      [...]
| 
|      If you set this variable to `nil' in a buffer, that buffer does not
|      have a mode line.  (A window that is just one line tall also does
|      not display a mode line.)
`----

A similar remark is in the doc string for `mode-line-format`.

And it does work fine in GUI Emacs.



-- 
Joost Kremers                                   joostkremers@fastmail.fm
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


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

* Re: emacs -nw display bug?
  2014-06-30 16:22   ` Joost Kremers
@ 2014-06-30 16:58     ` Eli Zaretskii
  2014-06-30 17:04       ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2014-06-30 16:58 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Joost Kremers <joost.m.kremers@gmail.com>
> Date: 30 Jun 2014 16:22:38 GMT
> 
> Eli Zaretskii wrote:
> >> From: Joost Kremers <joost.m.kremers@gmail.com>
> >> Date: 30 Jun 2014 15:57:09 GMT
> >> - (setq-local mode-line-format nil) ; disable the mode line in the current window
> >
> > Don't do that.  Emacs display engine assumes that there always is a
> > mode line.
> 
> Then why does the Elisp manual say:
> 
> ,----
> |  -- User Option: mode-line-format
> |
> |      [...]
> | 
> |      If you set this variable to `nil' in a buffer, that buffer does not
> |      have a mode line.  (A window that is just one line tall also does
> |      not display a mode line.)
> `----

Because in some windows it does work.  Like minibuffer-only frames.

> And it does work fine in GUI Emacs.

GUI Emacs uses a different redisplay strategy.  But even there
disabling the mode line will get you in trouble, eventually.

Just say no.



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

* Re: emacs -nw display bug?
  2014-06-30 16:58     ` Eli Zaretskii
@ 2014-06-30 17:04       ` Eli Zaretskii
  0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2014-06-30 17:04 UTC (permalink / raw)
  To: help-gnu-emacs

> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD
> 	autolearn=disabled version=3.3.2
> Date: Mon, 30 Jun 2014 19:58:46 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> 
> Just say no.

On second thought, go ahead and submit a bug report.  Who knows, it
could be easy to fix.  Or there might be a rainy day soon.  Or
something.



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

* Re: emacs -nw display bug?
       [not found] ` <mailman.4590.1404144667.1147.help-gnu-emacs@gnu.org>
  2014-06-30 16:22   ` Joost Kremers
@ 2014-06-30 21:06   ` Stefan Monnier
  2014-07-01  8:53     ` Joost Kremers
  1 sibling, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2014-06-30 21:06 UTC (permalink / raw)
  To: help-gnu-emacs

>> - (setq-local mode-line-format nil) ; disable the mode line in the current window
> Don't do that.  Emacs display engine assumes that there always is a
> mode line.

This situation is poorly tested, but it's documented, and some code
relies on it, so I think we should try to make it work.  It's not super
high priority, obviously, tho,


        Stefan


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

* Re: emacs -nw display bug?
  2014-06-30 21:06   ` Stefan Monnier
@ 2014-07-01  8:53     ` Joost Kremers
  2014-07-01 14:32       ` Stefan Monnier
                         ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Joost Kremers @ 2014-07-01  8:53 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier wrote:
>>> - (setq-local mode-line-format nil) ; disable the mode line in the current window
>> Don't do that.  Emacs display engine assumes that there always is a
>> mode line.
>
> This situation is poorly tested, but it's documented, and some code
> relies on it, so I think we should try to make it work.  It's not super
> high priority, obviously, tho,

Ok, I sent a bug report, so it doesn't get forgotten. I'll also add a
workaround to my code (setting the mode line to "" or something). If
that turns out to be a permanent solution, it won't be so bad. ;-)

Thanks,

Joost



-- 
Joost Kremers                                   joostkremers@fastmail.fm
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


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

* Re: emacs -nw display bug?
  2014-07-01  8:53     ` Joost Kremers
@ 2014-07-01 14:32       ` Stefan Monnier
  2014-07-01 17:21       ` Eli Zaretskii
       [not found]       ` <mailman.4669.1404235282.1147.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2014-07-01 14:32 UTC (permalink / raw)
  To: help-gnu-emacs

> Ok, I sent a bug report, so it doesn't get forgotten.

Got it, thank you.

> I'll also add a
> workaround to my code (setting the mode line to "" or something). If
> that turns out to be a permanent solution, it won't be so bad. ;-)

FWIW, mpc.el (bundled with Emacs) sets mode-line-format to nil in some
of its buffers.


        Stefan


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

* Re: emacs -nw display bug?
  2014-07-01  8:53     ` Joost Kremers
  2014-07-01 14:32       ` Stefan Monnier
@ 2014-07-01 17:21       ` Eli Zaretskii
       [not found]       ` <mailman.4669.1404235282.1147.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2014-07-01 17:21 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Joost Kremers <joost.m.kremers@gmail.com>
> Date: 1 Jul 2014 08:53:36 GMT
> 
> Stefan Monnier wrote:
> >>> - (setq-local mode-line-format nil) ; disable the mode line in the current window
> >> Don't do that.  Emacs display engine assumes that there always is a
> >> mode line.
> >
> > This situation is poorly tested, but it's documented, and some code
> > relies on it, so I think we should try to make it work.  It's not super
> > high priority, obviously, tho,
> 
> Ok, I sent a bug report, so it doesn't get forgotten. I'll also add a
> workaround to my code (setting the mode line to "" or something). If
> that turns out to be a permanent solution, it won't be so bad. ;-)

The bug is now fixed in the repository.



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

* Re: emacs -nw display bug?
       [not found]       ` <mailman.4669.1404235282.1147.help-gnu-emacs@gnu.org>
@ 2014-07-03 13:42         ` Joost Kremers
  0 siblings, 0 replies; 10+ messages in thread
From: Joost Kremers @ 2014-07-03 13:42 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii wrote:
>> From: Joost Kremers <joost.m.kremers@gmail.com>
>> Date: 1 Jul 2014 08:53:36 GMT
>> Ok, I sent a bug report, so it doesn't get forgotten. I'll also add a
>> workaround to my code (setting the mode line to "" or something). If
>> that turns out to be a permanent solution, it won't be so bad. ;-)
>
> The bug is now fixed in the repository.

Great, thanks!


-- 
Joost Kremers                                   joostkremers@fastmail.fm
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


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

end of thread, other threads:[~2014-07-03 13:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-30 15:57 emacs -nw display bug? Joost Kremers
2014-06-30 16:10 ` Eli Zaretskii
     [not found] ` <mailman.4590.1404144667.1147.help-gnu-emacs@gnu.org>
2014-06-30 16:22   ` Joost Kremers
2014-06-30 16:58     ` Eli Zaretskii
2014-06-30 17:04       ` Eli Zaretskii
2014-06-30 21:06   ` Stefan Monnier
2014-07-01  8:53     ` Joost Kremers
2014-07-01 14:32       ` Stefan Monnier
2014-07-01 17:21       ` Eli Zaretskii
     [not found]       ` <mailman.4669.1404235282.1147.help-gnu-emacs@gnu.org>
2014-07-03 13:42         ` Joost Kremers

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.