[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
hscroll-snap-threshold
From: |
Roland Winkler |
Subject: |
hscroll-snap-threshold |
Date: |
Thu, 24 May 2001 23:06:01 +0200 |
In GNU Emacs 20.4.1 (i686-pc-linux-gnu, X toolkit)
of Fri Oct 29 1999 on tfkp02
configured using `configure --prefix=/nfs/common --libexecdir=/nfs/common/lib
--bindir=/nfs/common/lib/emacs/bin/i686-Linux --with-gcc --with-pop --with-x
--with-x-toolkit=athena'
Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:
In hscroll-mode the default value of hscroll-snap-threshold is 30.
However, if the window-width is smaller than 30 the columns with
column numbers between window-width and hscroll-snap-threshold are
completely invisible, even scroll-left and scroll-right cannot be
used to make them visible.
Well, there is also auto-show-mode. However, there is a similar
problem: it is possible to have a window-width smaller than
auto-show-show-left-margin-threshold (default: 50). Then if point is
moved from the right to column window-width, the point is on the `$'
indicating a continuation line, whereas one would expect to see the
character in column window-width.
(Though I use emacs 20.4.1 there is the same code in 20.4.1 and 20.7.
What about emacs 21? ...Don't want to reinvent the wheel and make a
patch if possibly there is already one available.)
...Actually, I encountered these problems while I was hacking a
function my-recenter that centers point horizontally and vertically.
In my opinion such a feature is missing in these packages (though
my-recenter is essentially independent of these packages).
Roland
(defun my-recenter ()
"Center point in window horizontally and vertically."
(interactive)
(recenter)
(if truncate-lines
(let ((eol (save-excursion (end-of-line) (current-column)))
(col (current-column))
(ww (window-width)))
(when (> eol ww)
(scroll-right eol)
(cond ((< (- eol col (/ ww 2)) 0)
(scroll-left (- (+ eol auto-show-shift-amount 1) ww)))
((> col (/ ww 2))
(scroll-left (- col (/ ww 2) -1)))
)))))
- hscroll-snap-threshold,
Roland Winkler <=