all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#11063: Window-start in the middle of a line with nhexl-mode
@ 2012-03-22  3:23 Stefan Monnier
  2012-03-24 19:32 ` Eli Zaretskii
  2012-03-31 17:22 ` Eli Zaretskii
  0 siblings, 2 replies; 5+ messages in thread
From: Stefan Monnier @ 2012-03-22  3:23 UTC (permalink / raw
  To: 11063

Package: Emacs
Version: 24.0.94

% src/emacs -Q -l .../elpa/packages/nhexl-mode/nhexl-mode.el README
M-x nhexl-mode RET
<page-down>

You'll see at the top of the screen that the window-start is in the
middle of one of the (display) lines, even though none of the display
lines are particularly long.


        Stefan




In GNU Emacs 24.0.94.1 (i386-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2012-03-10 on alfajor
Windowing system distributor `The X.Org Foundation', version 11.0.11104000
Configured using:
 `configure
 'CFLAGS=-Wall -Wno-pointer-sign -DUSE_LISP_UNION_TYPE -DSYNC_INPUT -DENABLE_CHECKING -DXASSERTS -DFONTSET_DEBUG -g -O1'
 '--enable-maintainer-mode' '--with-x-toolkit=lucid''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: fr_CH.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: InactiveMinibuffer

Minor modes in effect:
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  electric-pair-mode: t
  electric-indent-mode: t
  url-handler-mode: t
  global-reveal-mode: t
  reveal-mode: t
  auto-insert-mode: t
  savehist-mode: t
  minibuffer-electric-default-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<right> <right> <right> C-s C-w C-w C-w C-w C-s <M-backspace> 
c o u n t e r C-s C-s C-M-b C-M-k 0 <down-mouse-1> 
<mouse-movement> <mouse-1> <M-backspace> d e C-s C-s 
C-s C-s C-a C-M-k C-k C-x C-s C-s C-s <down-mouse-1> 
<mouse-1> C-s C-w C-w C-w C-w C-s C-s C-a <right> <right> 
<right> <right> <right> <right> <left> M-d k i l l 
- l o c <tab> C-d ' C-e <M-backspace> <backspace> ) 
C-s C-s C-s C-s C-s C-a C-x C-s <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <left> <right> C-SPC <down> 
<down> C-w <left> <right> <down> <left> <right> <down> 
<left> <right> C-x C-s C-c C-c M-x n o r - m o d <tab> 
<return> C-c C-c M-< C-e <right> <down> <down> <down> 
<down> <down> <left> <return> ; ; SPC V e r s i o n 
: SPC 0 . 1 <right> <up> <up> <left> <right> <down> 
<left> <right> <down> <left> <right> C-x C-s <down-mouse-1> 
<mouse-movement> <mouse-1> <M-backspace> w i t h <down-mouse-1> 
<mouse-1> C-e <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> C-l C-l M-< M-> M-< M-: 
( e r a s e - b u f f e r <return> M-: M-p ( l e t 
SPC ( ( i n h - r e - o n <M-tab> SPC t ) ) SPC C-e 
) <return> s <help-echo> C-x C-c <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> s M-x r e v - b u f <tab> 
<return> <up> <up> <up> <up> <up> <up> <up> <up> <switch-frame> 
s s <switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
C-x C-c <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> M-x r 
e p o - e m - b u <tab> <return>

Recent messages:
Mark set [3 times]
eval: Buffer is read-only: #<buffer *Help*>
nil
Warning: interactive-p is obsolete! [6 times]
...monnier/.emacs-history locked by monnier@alfaj... (pid 13705): (s, q, p, ?)? 
Warning: interactive-p is obsolete!
...monnier/.emacs-history locked by monnier@alfaj... (pid 13705): (s, q, p, ?)? 
Warning: interactive-p is obsolete!
...monnier/.emacs-history locked by monnier@alfaj... (pid 13705): (s, q, p, ?)? 
Warning: interactive-p is obsolete!

Load-path shadows:
/usr/share/emacs23/site-lisp/bbdb/bbdb-w3 hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-w3
/usr/share/emacs23/site-lisp/bbdb/bbdb-migrate hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-migrate
/usr/share/emacs23/site-lisp/bbdb/bbdb-snarf hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-snarf
/usr/share/emacs23/site-lisp/bbdb/bbdb-hooks hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-hooks
/usr/share/emacs23/site-lisp/bbdb/bbdb-sc hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-sc
/usr/share/emacs23/site-lisp/bbdb/bbdb-merge hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-merge
/usr/share/emacs23/site-lisp/bbdb/bbdb-print hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-print
/usr/share/emacs23/site-lisp/bbdb/bbdb-ftp hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-ftp
/usr/share/emacs23/site-lisp/bbdb/bbdb-mhe hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-mhe
/usr/share/emacs23/site-lisp/bbdb/bbdb-gnus hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-gnus
/usr/share/emacs23/site-lisp/bbdb/bbdb-whois hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-whois
/usr/share/emacs23/site-lisp/bbdb/bbdb-gui hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-gui
/usr/share/emacs23/site-lisp/bbdb/bbdb-vm hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-vm
/usr/share/emacs23/site-lisp/bbdb/bbdb-rmail hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-rmail
/usr/share/emacs23/site-lisp/bbdb/bbdb-com hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-com
/usr/share/emacs23/site-lisp/bbdb/bbdb hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb

Features:
(sort mail-extr emacsbug message format-spec rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev mailheader
sendmail rfc2047 rfc2045 ietf-drums mail-utils dabbrev crm descr-text
winmgr-mode nhexl-mode hexl epa-file epa derived epg epg-config cl-specs
smerge-mode log-edit pcvs-util vc-sccs vc-svn vc-cvs vc-rcs vc-dir
add-log newcomment whitespace diff-mode vc-annotate vc ediff-merg
ediff-diff ediff-wind ediff-help ediff-util ediff-mult ediff-init ediff
vc-dispatcher shell pcomplete grep compile xscheme trace testcover
scheme unsafep re-builder shadow inf-lisp ielm pp comint ansi-color ring
gmm-utils ert ewoc debug elp edebug cust-print cus-edit cus-start
cus-load find-func wid-edit cal-china lunar solar cal-dst cal-bahai
cal-islam cal-hebrew holidays hol-loaddefs cal-french diary-lib
diary-loaddefs mule-util cal-move cal-menu calendar cal-loaddefs
executable copyright multi-isearch vc-bzr filecache server noutline
outline easy-mmode flyspell ispell eldoc checkdoc regexp-opt thingatpt
help-mode easymenu view prog-mode electric url-handlers url-parse
auth-source warnings eieio byte-opt bytecomp byte-compile cconv macroexp
assoc gnus-util password-cache url-vars mm-util mail-prsvr reveal
autoinsert uniquify advice help-fns advice-preload time-date savehist
minibuf-eldef disp-table cl cl-loaddefs package tabulated-list
bbdb-autoloads agda2 tooltip ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face files text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote
make-network-process dbusbind dynamic-setting font-render-setting
x-toolkit x multi-tty emacs)





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

* bug#11063: Window-start in the middle of a line with nhexl-mode
  2012-03-22  3:23 bug#11063: Window-start in the middle of a line with nhexl-mode Stefan Monnier
@ 2012-03-24 19:32 ` Eli Zaretskii
  2012-03-31 17:22 ` Eli Zaretskii
  1 sibling, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2012-03-24 19:32 UTC (permalink / raw
  To: Stefan Monnier; +Cc: 11063

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Wed, 21 Mar 2012 23:23:05 -0400
> 
> % src/emacs -Q -l .../elpa/packages/nhexl-mode/nhexl-mode.el README
> M-x nhexl-mode RET
> <page-down>
> 
> You'll see at the top of the screen that the window-start is in the
> middle of one of the (display) lines, even though none of the display
> lines are particularly long.

Similar problems happen in Emacs 23.3, although there they are only
visible if you move cursor vertically with C-n until Emacs scrolls the
display.  So this is not a regression wrt Emacs 23.

I will look into this in a couple of days.





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

* bug#11063: Window-start in the middle of a line with nhexl-mode
  2012-03-22  3:23 bug#11063: Window-start in the middle of a line with nhexl-mode Stefan Monnier
  2012-03-24 19:32 ` Eli Zaretskii
@ 2012-03-31 17:22 ` Eli Zaretskii
  2012-03-31 19:07   ` Stefan Monnier
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2012-03-31 17:22 UTC (permalink / raw
  To: Stefan Monnier; +Cc: 11063

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Wed, 21 Mar 2012 23:23:05 -0400
> 
> % src/emacs -Q -l .../elpa/packages/nhexl-mode/nhexl-mode.el README
> M-x nhexl-mode RET
> <page-down>
> 
> You'll see at the top of the screen that the window-start is in the
> middle of one of the (display) lines, even though none of the display
> lines are particularly long.

The following one-liner fixes this.  Whether to install this now is up
to you; after all, nhexl-mode is not part of Emacs, and quite a corner
case at that.  OTOH, the current code is obviously wrong.

Note that there are still display problems after this change: except
when you are at BOB, the first screen line below the liner is almost
always empty (buffer contents is displayed starting from the second
line).  Also, there seem to be a miscalculation of the line width when
some character is displayed using a display table, e.g. where there
are ^L characters in README.  All these were there before the patch,
and I didn't investigate further what causes them.

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c	2012-03-31 17:18:00 +0000
+++ b/src/xdisp.c	2012-03-31 17:18:26 +0000
@@ -8973,7 +8973,20 @@
     {
       move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS);
       if (!IT_POS_VALID_AFTER_MOVE_P (it))
-	move_it_to (it, IT_CHARPOS (*it) + 1, -1, -1, -1, MOVE_TO_POS);
+	{
+	  /* Only move to the next buffer position if we ended up in a
+	     string from display property, not in an overlay string
+	     (before-string or after-string).  That is because the
+	     latter don't conceal the underlying buffer position, so
+	     we can ask to move the iterator to the exact position we
+	     are interested in.  Note that, even if we are already at
+	     IT_CHARPOS (*it), the call below is not a no-op, as it
+	     will detect that we are at the end of the string, pop the
+	     iterator, and compute it->current_x and it->hpos
+	     correctly.  */
+	  move_it_to (it, IT_CHARPOS (*it) + it->string_from_display_prop_p,
+		      -1, -1, -1, MOVE_TO_POS);
+	}
     }
   else
     {






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

* bug#11063: Window-start in the middle of a line with nhexl-mode
  2012-03-31 17:22 ` Eli Zaretskii
@ 2012-03-31 19:07   ` Stefan Monnier
  2012-03-31 19:32     ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2012-03-31 19:07 UTC (permalink / raw
  To: Eli Zaretskii; +Cc: 11063

>> % src/emacs -Q -l .../elpa/packages/nhexl-mode/nhexl-mode.el README
>> M-x nhexl-mode RET
>> <page-down>
>> You'll see at the top of the screen that the window-start is in the
>> middle of one of the (display) lines, even though none of the display
>> lines are particularly long.
> The following one-liner fixes this.  Whether to install this now is up
> to you;

The fix looks good, so you might as well install it.

> after all, nhexl-mode is not part of Emacs, and quite a corner
> case at that.

Agreed.

Thank you,


        Stefan





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

* bug#11063: Window-start in the middle of a line with nhexl-mode
  2012-03-31 19:07   ` Stefan Monnier
@ 2012-03-31 19:32     ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2012-03-31 19:32 UTC (permalink / raw
  To: Stefan Monnier; +Cc: 11063-done

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: 11063@debbugs.gnu.org
> Date: Sat, 31 Mar 2012 15:07:44 -0400
> 
> >> % src/emacs -Q -l .../elpa/packages/nhexl-mode/nhexl-mode.el README
> >> M-x nhexl-mode RET
> >> <page-down>
> >> You'll see at the top of the screen that the window-start is in the
> >> middle of one of the (display) lines, even though none of the display
> >> lines are particularly long.
> > The following one-liner fixes this.  Whether to install this now is up
> > to you;
> 
> The fix looks good, so you might as well install it.

Done as trunk revision 107714.





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

end of thread, other threads:[~2012-03-31 19:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-22  3:23 bug#11063: Window-start in the middle of a line with nhexl-mode Stefan Monnier
2012-03-24 19:32 ` Eli Zaretskii
2012-03-31 17:22 ` Eli Zaretskii
2012-03-31 19:07   ` Stefan Monnier
2012-03-31 19:32     ` Eli Zaretskii

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.