* bug#36494: 27.0.50; [Proposition] New option to scroll up regardless of eob
[not found] ` <<83d0iqaqvh.fsf@gnu.org>
@ 2019-07-04 15:50 ` Drew Adams
2019-07-04 18:59 ` Noam Postavsky
0 siblings, 1 reply; 13+ messages in thread
From: Drew Adams @ 2019-07-04 15:50 UTC (permalink / raw)
To: Eli Zaretskii, marcowahlsoft; +Cc: 36494
> How about if we bind S-DOWN and S-UP to commands that scroll to EOB
> without introducing any new option? That would mimic pages like Less
> which stop at EOB with an unshifted key, but continue scrolling with a
> shifted key.
Yes. Some of us have been doing that individually (and not
using `scroll-lock-mode').
E.g.:
(global-set-key [S-down] (lambda () (interactive) (scroll-up 1)))
(global-set-key [S-up] (lambda () (interactive) (scroll-down 1)))
(But named functions are better than anonymous ones, for key binding.
And yes, it would be good to let a numeric prefix arg scroll that
many lines.)
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#36494: 27.0.50; [Proposition] New option to scroll up regardless of eob
2019-07-04 15:50 ` bug#36494: 27.0.50; [Proposition] New option to scroll up regardless of eob Drew Adams
@ 2019-07-04 18:59 ` Noam Postavsky
2019-07-04 22:28 ` Drew Adams
0 siblings, 1 reply; 13+ messages in thread
From: Noam Postavsky @ 2019-07-04 18:59 UTC (permalink / raw)
To: Drew Adams; +Cc: marcowahlsoft, 36494
Drew Adams <drew.adams@oracle.com> writes:
> (global-set-key [S-down] (lambda () (interactive) (scroll-up 1)))
> (global-set-key [S-up] (lambda () (interactive) (scroll-down 1)))
>
> (But named functions are better than anonymous ones, for key binding.
> And yes, it would be good to let a numeric prefix arg scroll that
> many lines.)
I think you're looking for scroll-up-line and scroll-down-line
(introduced in 24.1).
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#36494: 27.0.50; [Proposition] New option to scroll up regardless of eob
2019-07-04 18:59 ` Noam Postavsky
@ 2019-07-04 22:28 ` Drew Adams
0 siblings, 0 replies; 13+ messages in thread
From: Drew Adams @ 2019-07-04 22:28 UTC (permalink / raw)
To: Noam Postavsky; +Cc: marcowahlsoft, 36494
> > (global-set-key [S-down] (lambda () (interactive) (scroll-up 1)))
> > (global-set-key [S-up] (lambda () (interactive) (scroll-down 1)))
> >
> > (But named functions are better than anonymous ones, for key binding.
> > And yes, it would be good to let a numeric prefix arg scroll that
> > many lines.)
>
> I think you're looking for scroll-up-line and scroll-down-line
> (introduced in 24.1).
Exactly. (I use the above also with old Emacs releases,
and didn't bother to define a named command for it.)
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#36494: 27.0.50; [Proposition] New option to scroll up regardless of eob
@ 2019-07-04 11:03 marcowahlsoft
2019-07-04 13:09 ` Eli Zaretskii
2019-07-04 20:13 ` Juri Linkov
0 siblings, 2 replies; 13+ messages in thread
From: marcowahlsoft @ 2019-07-04 11:03 UTC (permalink / raw)
To: 36494
[-- Attachment #1: Type: text/plain, Size: 24106 bytes --]
Most of the time I find it useful to scroll up in scroll-lock-mode also
in the case when the end of the buffer is in sight. With this behavior
it's possible to scroll up until there is literally (almost) nothing
left in the buffer.
This is in opposition to the current behavior of scroll-lock-mode which
always switches to forward-line if the end of buffer is in sight.
Find attached a concrete realization.
Thanks for consideration and best regards!
In GNU Emacs 27.0.50 (build 5, x86_64-pc-linux-gnu, GTK+ Version 3.24.9)
of 2019-06-28 built on tm6592
Repository revision: d58fc4e8ece8ccafd5ef430a57c2a8b417c8e038
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12005000
System Description: Arch Linux
Recent messages:
Type "q" to restore previous buffer, <mouse-5> to scroll help.
Mark saved where search started [2 times]
funcall-interactively: Buffer is read-only: #<buffer *Help*>
Mark saved where search started
user-error: Not defining or executing kbd macro
user-error: Only diff buffers can be saved as patches
Directory has changed on disk; type g to update Dired
Delete 0001-Document-bookmark-annotations-in-Emacs-Manual-bug-36.patch (y or n) y
Deleting...done
Pause over at 12:50:36. What about another tomato?
Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY
ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LIBSYSTEMD JSON PDUMPER
LCMS2 GMP
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: Dired by name
Minor modes in effect:
semantic-minor-modes-format: ((:eval (if (or semantic-highlight-edits-mode semantic-show-unmatched-syntax-mode) S)))
gnus-dired-mode: t
global-magit-file-mode: t
magit-auto-revert-mode: t
global-git-commit-mode: t
async-bytecomp-package-mode: t
pdf-occur-dired-minor-mode: t
pdf-occur-global-minor-mode: t
shell-dirtrack-mode: t
winner-mode: t
timeclock-mode-line-display: t
show-paren-mode: t
global-undo-tree-mode: t
display-time-mode: t
auto-insert-mode: t
beginend-global-mode: t
beginend-dired-mode: t
global-company-mode: t
company-mode: t
wrap-region-global-mode: t
ido-hacks-mode: t
ido-everywhere: t
straight-use-package-mode: t
straight-package-neutering-mode: t
dired-hide-details-mode: t
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
global-prettify-symbols-mode: t
file-name-shadow-mode: t
jit-lock-debug-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
line-number-mode: t
transient-mark-mode: t
abbrev-mode: t
Load-path shadows:
/home/b/.emacs.d/straight/build/debbugs/debbugs hides /home/b/.emacs.d/elpa/debbugs-0.18/debbugs
/home/b/.emacs.d/straight/build/debbugs/debbugs-gnu hides /home/b/.emacs.d/elpa/debbugs-0.18/debbugs-gnu
/home/b/.emacs.d/straight/build/debbugs/debbugs-org hides /home/b/.emacs.d/elpa/debbugs-0.18/debbugs-org
/home/b/.emacs.d/straight/build/debbugs/debbugs-autoloads hides /home/b/.emacs.d/elpa/debbugs-0.18/debbugs-autoloads
/home/b/.emacs.d/straight/build/debbugs/debbugs-browse hides /home/b/.emacs.d/elpa/debbugs-0.18/debbugs-browse
/home/b/p/org/org-mode/lisp/org-inlinetask hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-inlinetask
/home/b/p/org/org-mode/lisp/ob-picolisp hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-picolisp
/home/b/p/org/org-mode/lisp/ox-ascii hides /home/b/p/emacs/emacs-a/clone/lisp/org/ox-ascii
/home/b/p/org/org-mode/lisp/ob-table hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-table
/home/b/p/org/org-mode/lisp/ob-ruby hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-ruby
/home/b/p/org/org-mode/lisp/ob-C hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-C
/home/b/p/org/org-mode/lisp/ob-hledger hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-hledger
/home/b/p/org/org-mode/lisp/ox-md hides /home/b/p/emacs/emacs-a/clone/lisp/org/ox-md
/home/b/p/org/org-mode/lisp/org-mouse hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-mouse
/home/b/p/org/org-mode/lisp/ob-lilypond hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-lilypond
/home/b/p/org/org-mode/lisp/ob-scheme hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-scheme
/home/b/p/org/org-mode/lisp/ox-beamer hides /home/b/p/emacs/emacs-a/clone/lisp/org/ox-beamer
/home/b/p/org/org-mode/lisp/ob-gnuplot hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-gnuplot
/home/b/p/org/org-mode/lisp/ob-core hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-core
/home/b/p/org/org-mode/lisp/ox-odt hides /home/b/p/emacs/emacs-a/clone/lisp/org/ox-odt
/home/b/p/org/org-mode/lisp/ob-comint hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-comint
/home/b/p/org/org-mode/lisp/ob-lua hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-lua
/home/b/p/org/org-mode/lisp/org-mobile hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-mobile
/home/b/p/org/org-mode/lisp/ob-java hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-java
/home/b/p/org/org-mode/lisp/ob-js hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-js
/home/b/p/org/org-mode/lisp/ob-lob hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-lob
/home/b/p/org/org-mode/lisp/ob-R hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-R
/home/b/p/org/org-mode/lisp/org-lint hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-lint
/home/b/p/org/org-mode/lisp/org-datetree hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-datetree
/home/b/p/org/org-mode/lisp/ob-shen hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-shen
/home/b/p/org/org-mode/lisp/ob-clojure hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-clojure
/home/b/p/org/org-mode/lisp/org-capture hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-capture
/home/b/p/org/org-mode/lisp/ob-sqlite hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-sqlite
/home/b/p/org/org-mode/lisp/org-entities hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-entities
/home/b/p/org/org-mode/lisp/ob-python hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-python
/home/b/p/org/org-mode/lisp/org-id hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-id
/home/b/p/org/org-mode/lisp/ob-abc hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-abc
/home/b/p/org/org-mode/lisp/org-habit hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-habit
/home/b/p/org/org-mode/lisp/org-protocol hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-protocol
/home/b/p/org/org-mode/lisp/ob-ebnf hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-ebnf
/home/b/p/org/org-mode/lisp/ob-makefile hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-makefile
/home/b/p/org/org-mode/lisp/ob-ditaa hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-ditaa
/home/b/p/org/org-mode/lisp/ob-org hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-org
/home/b/p/org/org-mode/lisp/ox hides /home/b/p/emacs/emacs-a/clone/lisp/org/ox
/home/b/p/org/org-mode/lisp/ob-stan hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-stan
/home/b/p/org/org-mode/lisp/org-element hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-element
/home/b/p/org/org-mode/lisp/org-colview hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-colview
/home/b/p/org/org-mode/lisp/ox-html hides /home/b/p/emacs/emacs-a/clone/lisp/org/ox-html
/home/b/p/org/org-mode/lisp/ox-man hides /home/b/p/emacs/emacs-a/clone/lisp/org/ox-man
/home/b/p/org/org-mode/lisp/org-install hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-install
/home/b/p/org/org-mode/lisp/ob-sed hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-sed
/home/b/p/org/org-mode/lisp/ob-io hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-io
/home/b/p/org/org-mode/lisp/ox-icalendar hides /home/b/p/emacs/emacs-a/clone/lisp/org/ox-icalendar
/home/b/p/org/org-mode/lisp/ob-vala hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-vala
/home/b/p/org/org-mode/lisp/org-compat hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-compat
/home/b/p/org/org-mode/lisp/ob-eval hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-eval
/home/b/p/org/org-mode/lisp/ox-latex hides /home/b/p/emacs/emacs-a/clone/lisp/org/ox-latex
/home/b/p/org/org-mode/lisp/org-footnote hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-footnote
/home/b/p/org/org-mode/lisp/ob-ledger hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-ledger
/home/b/p/org/org-mode/lisp/org-timer hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-timer
/home/b/p/org/org-mode/lisp/ob-asymptote hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-asymptote
/home/b/p/org/org-mode/lisp/org-list hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-list
/home/b/p/org/org-mode/lisp/ox-org hides /home/b/p/emacs/emacs-a/clone/lisp/org/ox-org
/home/b/p/org/org-mode/lisp/org-duration hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-duration
/home/b/p/org/org-mode/lisp/ob-sql hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-sql
/home/b/p/org/org-mode/lisp/org-table hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-table
/home/b/p/org/org-mode/lisp/ob-matlab hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-matlab
/home/b/p/org/org-mode/lisp/org-crypt hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-crypt
/home/b/p/org/org-mode/lisp/ob-haskell hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-haskell
/home/b/p/org/org-mode/lisp/org-macs hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-macs
/home/b/p/org/org-mode/lisp/org-attach hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-attach
/home/b/p/org/org-mode/lisp/ob-shell hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-shell
/home/b/p/org/org-mode/lisp/ob-css hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-css
/home/b/p/org/org-mode/lisp/ob-ocaml hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-ocaml
/home/b/p/org/org-mode/lisp/ob-plantuml hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-plantuml
/home/b/p/org/org-mode/lisp/ob-dot hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-dot
/home/b/p/org/org-mode/lisp/org-faces hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-faces
/home/b/p/org/org-mode/lisp/ob-calc hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-calc
/home/b/p/org/org-mode/lisp/ob-mscgen hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-mscgen
/home/b/p/org/org-mode/lisp/ob-forth hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-forth
/home/b/p/org/org-mode/lisp/ob-ref hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-ref
/home/b/p/org/org-mode/lisp/ob-awk hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-awk
/home/b/p/org/org-mode/lisp/org-agenda hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-agenda
/home/b/p/org/org-mode/lisp/org hides /home/b/p/emacs/emacs-a/clone/lisp/org/org
/home/b/p/org/org-mode/lisp/org-macro hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-macro
/home/b/p/org/org-mode/lisp/ob-J hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-J
/home/b/p/org/org-mode/lisp/ob-emacs-lisp hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-emacs-lisp
/home/b/p/org/org-mode/lisp/ob-maxima hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-maxima
/home/b/p/org/org-mode/lisp/ob-tangle hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-tangle
/home/b/p/org/org-mode/lisp/ob hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob
/home/b/p/org/org-mode/lisp/ox-publish hides /home/b/p/emacs/emacs-a/clone/lisp/org/ox-publish
/home/b/p/org/org-mode/lisp/ox-texinfo hides /home/b/p/emacs/emacs-a/clone/lisp/org/ox-texinfo
/home/b/p/org/org-mode/lisp/org-src hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-src
/home/b/p/org/org-mode/lisp/org-loaddefs hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-loaddefs
/home/b/p/org/org-mode/lisp/ob-processing hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-processing
/home/b/p/org/org-mode/lisp/ob-sass hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-sass
/home/b/p/org/org-mode/lisp/org-pcomplete hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-pcomplete
/home/b/p/org/org-mode/lisp/ob-exp hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-exp
/home/b/p/org/org-mode/lisp/ob-coq hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-coq
/home/b/p/org/org-mode/lisp/ob-groovy hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-groovy
/home/b/p/org/org-mode/lisp/ob-lisp hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-lisp
/home/b/p/org/org-mode/lisp/ob-perl hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-perl
/home/b/p/org/org-mode/lisp/org-feed hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-feed
/home/b/p/org/org-mode/lisp/ob-octave hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-octave
/home/b/p/org/org-mode/lisp/org-clock hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-clock
/home/b/p/org/org-mode/lisp/ob-screen hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-screen
/home/b/p/org/org-mode/lisp/org-plot hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-plot
/home/b/p/org/org-mode/lisp/org-archive hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-archive
/home/b/p/org/org-mode/lisp/ob-fortran hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-fortran
/home/b/p/org/org-mode/lisp/org-indent hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-indent
/home/b/p/org/org-mode/lisp/org-version hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-version
/home/b/p/org/org-mode/lisp/org-ctags hides /home/b/p/emacs/emacs-a/clone/lisp/org/org-ctags
/home/b/p/org/org-mode/lisp/ob-latex hides /home/b/p/emacs/emacs-a/clone/lisp/org/ob-latex
/home/b/.emacs.d/straight/build/soap-client/soap-client hides /home/b/p/emacs/emacs-a/clone/lisp/net/soap-client
/home/b/.emacs.d/straight/build/soap-client/soap-inspect hides /home/b/p/emacs/emacs-a/clone/lisp/net/soap-inspect
/home/b/.emacs.d/straight/build/cl-lib/cl-lib hides /home/b/p/emacs/emacs-a/clone/lisp/emacs-lisp/cl-lib
/home/b/.emacs.d/straight/build/let-alist/let-alist hides /home/b/p/emacs/emacs-a/clone/lisp/emacs-lisp/let-alist
/home/b/.emacs.d/straight/build/faceup/faceup hides /home/b/p/emacs/emacs-a/clone/lisp/emacs-lisp/faceup
/home/b/.emacs.d/straight/build/seq/seq hides /home/b/p/emacs/emacs-a/clone/lisp/emacs-lisp/seq
Features:
(shadow bbdb-message mailalias emacsbug whitespace magit-patch macros
iedit iedit-lib flycheck gnus-fun wdired compare-w tramp-cmds rfc2104
tramp-cache dired-aux pdf-sync pdf-annot pdf-outline pdf-links
pdf-history em-unix em-term term ehelp em-script em-prompt em-ls em-hist
em-pred em-glob em-dirs esh-var em-cmpl em-basic em-banner em-alias
esh-mode shr-color color url-cache expand-region text-mode-expansions
cc-mode-expansions the-org-mode-expansions python-el-fgallina-expansions
js-mode-expansions er-basic-expansions expand-region-core
expand-region-custom js iso-transl misearch multi-isearch gnus-dired
go-up ledger-mode ledger-check ledger-texi ledger-test ledger-sort
ledger-report ledger-reconcile ledger-occur ledger-fonts ledger-fontify
ledger-state ledger-complete ledger-schedule ledger-init ledger-xact
ledger-post ledger-exec ledger-navigate eshell esh-cmd esh-ext esh-opt
esh-proc esh-io esh-module esh-groups ledger-context ledger-commodities
esh-arg esh-util ledger-regex python tramp-sh tramp tramp-loaddefs
trampver tramp-integration files-x tramp-compat ls-lisp bug-reference
magit-extras magit-bookmark magit-submodule magit-obsolete magit-blame
magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch
magit-clone magit-remote magit-commit magit-sequence magit-notes
magit-worktree magit-tag magit-merge magit-branch magit-reset
magit-files magit-refs magit-status magit magit-repos magit-apply
magit-wip magit-log which-func magit-diff smerge-mode magit-core
magit-autorevert autorevert filenotify magit-margin magit-transient
magit-process magit-mode transient git-commit magit-git magit-section
magit-utils log-edit pcvs-util eieio-opt speedbar sb-image ezimage
dframe herald-the-mode-line cal-move flyspell ispell sh-script smie
executable org-attach-screenshot tabify org-capture password-store
with-editor async-bytecomp async f s smiley gnus-cite qp mm-archive
mail-extr gnus-async gnus-bcklg gnus-kill gnus-ml disp-table
cursor-sensor nndir nnml nndraft nnmh nndoc utf-7 epa-file gnutls
network-stream nnfolder bbdb-gnus nnnil gnus-agent gnus-srvr gnus-score
score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime
smime dig gnus-cache gnus-demon nntp smtpmail sendmail hl-line
org-duration rase view cal-china lunar cal-islam cal-hebrew holidays
hol-loaddefs bbdb-anniv cal-iso appt diary-lib diary-loaddefs server
pinentry pdf-occur ibuf-ext ibuffer ibuffer-loaddefs tablist
tablist-filter semantic/wisent/comp semantic/wisent
semantic/wisent/wisent semantic/util-modes semantic/util semantic
semantic/tag semantic/lex semantic/fw mode-local cedet pdf-isearch
let-alist pdf-misc imenu pdf-tools compile cus-edit pdf-view bookmark
pdf-cache pdf-info pdf-util paredit elec-pair scroll-lock solar cal-dst
org-element avl-tree org-velocity dabbrev org-learn org-invoice
org-depend org-w3m org-tempo tempo org-rmail org-mhe org-irc
org-inlinetask org-info org-habit org-agenda org-gnus nnir gnus-sum
gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source
utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range message rfc822
mml mml-sec epa epg gmm-utils mailheader gnus-win org-eww org-docview
doc-view jka-compr image-mode org-crypt org-bibtex bibtex org-bbdb
ob-lua ob-sed ob-octave ob-makefile ob-forth ob-R ob-haskell ob-maxima
ob-java ob-plantuml ob-sqlite ob-sql ob-screen ob-J ob-io ob-shell shell
ob-clojure ob-scheme geiser-impl help-fns radix-tree geiser-custom
geiser-base geiser ob-gnuplot ob-dot ob-ditaa ob-lisp ob-css ob-js
ob-org ob-ledger ob-latex ob-calc calc-store calc-trail calc-ext calc
calc-loaddefs calc-macs ob-C cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs ob-python ob-awk winner
timeclock paren selectric-mode avoid image-file icomplete hack-time-mode
undo-tree diff time desktop frameset autoinsert cus-start cus-load
.emacs-custom hydra lv mw-private org-insert-context-dependent
postbank-to-ledger org-attach-embedded-images org-attach vc-git
diff-mode org-id ariadne-marks deadgrep-autoloads fit-text-scale
face-remap org-timer org-clock foldout ffap pdf-tools-autoloads
tablist-autoloads auxies-eww little-helpers mw-mark auxies-rest rect
dictionary link connection seclusion-mode seclusion-mode-autoloads
emr-autoloads iedit-autoloads clang-format-autoloads
projectile-autoloads list-utils-autoloads popup-autoloads emacsshot
emms-librefm-stream emms-librefm-scrobbler emms-playlist-limit
emms-volume emms-volume-amixer emms-i18n emms-history emms-score
emms-stream-info emms-metaplaylist-mode emms-bookmarks emms-cue
emms-mode-line-icon emms-browser sort emms-playlist-sort
emms-last-played emms-player-xine emms-player-mpd tq emms-playing-time
emms-lyrics emms-url emms-streams emms-show-all emms-tag-editor
emms-mark emms-mode-line emms-cache emms-info-opusinfo emms-info-ogginfo
emms-info-mp3info emms-info later-do emms-playlist-mode emms-player-vlc
emms-player-mpv emms-player-mplayer emms-player-simple
emms-source-playlist emms-source-file emms-setup emms emms-compat
page-ext eww mm-url gnus nnheader gnus-util rmail rmail-loaddefs
mail-utils wid-edit thingatpt url-queue date-at-point skeleton
major-mode-stack reverse-words carry-region rase-autoloads
flycheck-package-autoloads package-lint-autoloads flycheck-autoloads
let-alist-autoloads md4rd-autoloads tree-mode-autoloads
request-autoloads hierarchy-autoloads debbugs-autoloads
soap-client-autoloads lyrics-autoloads supercite regi rx ed
org-section-numbers keystrokes gopher derived shr text-property-search
svg dom bbdb-mua bbdb-com crm mailabbrev bbdb bbdb-site timezone
bbdb-loaddefs beginend org-bullets cider-autoloads sesman-autoloads
seq-autoloads spinner-autoloads queue-autoloads pkg-info-autoloads
epl-autoloads parseedn-autoloads parseclj-autoloads a-autoloads
clojure-mode-autoloads finder-inf hack-time-mode-autoloads
evil-autoloads goto-chg-autoloads undo-tree-autoloads deft-autoloads
magit-autoloads transient-autoloads git-commit-autoloads company-oddmuse
company-keywords company-etags etags fileloop generator xref project
company-gtags company-dabbrev-code company-dabbrev company-files
company-capf company-cmake company-xcode company-clang company-semantic
company-eclim company-template company-bbdb company pcase
company-autoloads ztree-autoloads form-feed-autoloads wrap-region dash
wrap-region-autoloads underline-with-char-autoloads ert pp ewoc debug
backtrace paredit-autoloads go-up-autoloads rope-read-mode-autoloads
herald-the-mode-line-autoloads pass-autoloads
password-store-otp-autoloads password-store-autoloads
with-editor-autoloads async-autoloads f-autoloads s-autoloads
racket-mode-autoloads faceup-autoloads mastodon-autoloads
lua-mode-autoloads gited-autoloads quarter-plane-autoloads
auto-correct-autoloads dired-narrow-autoloads
dired-hacks-utils-autoloads filladapt-autoloads ido-hacks ido
ido-hacks-autoloads geiser-autoloads hydra-autoloads lv-autoloads
key-chord key-chord-autoloads pinentry-autoloads expand-region-autoloads
ledger-mode-autoloads dictionary-autoloads link-autoloads
connection-autoloads avy avy-autoloads haskell-mode-autoloads
evil-numbers-autoloads impatient-mode-autoloads htmlize-autoloads
simple-httpd-autoloads aurel-autoloads bui-autoloads dash-autoloads
org-attach-screenshot-autoloads markdown-mode-autoloads
selectric-mode-autoloads org-pretty-tags elpher-autoloads chronos
notifications dbus chronos-autoloads sly-autoloads dired-du-autoloads
cl-lib-autoloads folding-isearch folding cl straight-autoloads cl-extra
help-mode straight hyperbole hinit hibtypes hib-doc-id hsys-www klink
hib-kbd hib-social hib-debbugs debbugs-gnu add-log debbugs soap-client
mm-decode mm-bodies mm-encode url-http url-auth mail-parse rfc2231
rfc2047 rfc2045 mm-util ietf-drums mail-prsvr url-gw nsm rmc puny url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap warnings rng-xsd rng-dt rng-util xsd-regexp
xml hsys-org hactypes hui-mini hui hui-mouse hmouse-key hargs hui-menu
hyrolo-menu hyrolo hmail hui-jmenu hmouse-sh hmouse-drv hypb locate
dired dired-loaddefs hui-window pulse hycontrol hsettings hui-em-but
hbut hact hpath hhist hbdata htz cal-julian hbmap hmoccur browse-url
hui-select hvar set hversion hload-path org-protocol ob-keys edmacro
kmacro org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro
org-footnote org-src ob-comint org-pcomplete pcomplete comint ansi-color
ring org-list org-faces org-entities time-date noutline outline
easy-mmode org-version ob-emacs-lisp ob-core ob-eval org-table ol
org-keys org-compat advice org-macs org-loaddefs format-spec find-func
cal-menu calendar cal-loaddefs mule-util info kotl-autoloads package
easymenu epg-config url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)
Memory information:
((conses 16 1278117 187138)
(symbols 48 62299 1)
(strings 32 355262 31866)
(string-bytes 1 13502087)
(vectors 16 176600)
(vector-slots 8 2735975 260200)
(floats 8 2139 1926)
(intervals 56 45668 415)
(buffers 992 181))
--
Marco Wahl
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Option-to-allow-scroll-up-at-eob.patch --]
[-- Type: text/x-patch, Size: 1328 bytes --]
From fd1d67b159439717e46b6697f8443f5504412896 Mon Sep 17 00:00:00 2001
From: Marco Wahl <marcowahlsoft@gmail.com>
Date: Thu, 4 Jul 2019 12:42:18 +0200
Subject: [PATCH] Option to allow scroll up at eob
* lisp/scroll-lock.el (scroll-lock-switch-to-forward-line-at-eob): New
customizable variable.
* lisp/scroll-lock.el (scroll-lock-next-line): Respect setting of
`scroll-lock-switch-to-forward-line-at-eob'.
---
lisp/scroll-lock.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lisp/scroll-lock.el b/lisp/scroll-lock.el
index 8281edb172..506bf53727 100644
--- a/lisp/scroll-lock.el
+++ b/lisp/scroll-lock.el
@@ -30,6 +30,10 @@
;;; Code:
+(defcustom scroll-lock-switch-to-forward-line-at-eob
+ t
+ "If set then don't scroll if the end of buffer is visible.")
+
(defvar scroll-lock-mode-map
(let ((map (make-sparse-keymap)))
(define-key map [remap next-line] 'scroll-lock-next-line)
@@ -86,7 +90,8 @@ scroll-lock-next-line
(interactive "p")
(or arg (setq arg 1))
(scroll-lock-update-goal-column)
- (if (pos-visible-in-window-p (point-max))
+ (if (and scroll-lock-switch-to-forward-line-at-eob
+ (pos-visible-in-window-p (point-max)))
(forward-line arg)
(scroll-up arg))
(scroll-lock-move-to-column scroll-lock-temporary-goal-column))
--
2.22.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* bug#36494: 27.0.50; [Proposition] New option to scroll up regardless of eob
2019-07-04 11:03 marcowahlsoft
@ 2019-07-04 13:09 ` Eli Zaretskii
2019-07-04 13:33 ` Marco Wahl
2019-07-04 20:13 ` Juri Linkov
1 sibling, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2019-07-04 13:09 UTC (permalink / raw)
To: marcowahlsoft; +Cc: 36494
> From: marcowahlsoft@gmail.com
> Date: Thu, 04 Jul 2019 13:03:40 +0200
>
> Most of the time I find it useful to scroll up in scroll-lock-mode also
> in the case when the end of the buffer is in sight. With this behavior
> it's possible to scroll up until there is literally (almost) nothing
> left in the buffer.
>
> This is in opposition to the current behavior of scroll-lock-mode which
> always switches to forward-line if the end of buffer is in sight.
>
> Find attached a concrete realization.
How about if we bind S-DOWN and S-UP to commands that scroll to EOB
without introducing any new option? That would mimic pages like Less
which stop at EOB with an unshifted key, but continue scrolling with a
shifted key.
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#36494: 27.0.50; [Proposition] New option to scroll up regardless of eob
2019-07-04 13:09 ` Eli Zaretskii
@ 2019-07-04 13:33 ` Marco Wahl
2019-07-04 16:28 ` Eli Zaretskii
0 siblings, 1 reply; 13+ messages in thread
From: Marco Wahl @ 2019-07-04 13:33 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: marcowahlsoft, 36494
Eli Zaretskii <eliz@gnu.org> writes:
>> From: marcowahlsoft@gmail.com
>> Date: Thu, 04 Jul 2019 13:03:40 +0200
>>
>> Most of the time I find it useful to scroll up in scroll-lock-mode also
>> in the case when the end of the buffer is in sight. With this behavior
>> it's possible to scroll up until there is literally (almost) nothing
>> left in the buffer.
>>
>> This is in opposition to the current behavior of scroll-lock-mode which
>> always switches to forward-line if the end of buffer is in sight.
>>
>> Find attached a concrete realization.
>
> How about if we bind S-DOWN and S-UP to commands that scroll to EOB
> without introducing any new option? That would mimic pages like Less
> which stop at EOB with an unshifted key, but continue scrolling with a
> shifted key.
That sounds good to me. Also the mimicing of similar features elsewhere.
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#36494: 27.0.50; [Proposition] New option to scroll up regardless of eob
2019-07-04 13:33 ` Marco Wahl
@ 2019-07-04 16:28 ` Eli Zaretskii
2019-07-04 20:59 ` Marco Wahl
2019-07-04 21:07 ` Marco Wahl
0 siblings, 2 replies; 13+ messages in thread
From: Eli Zaretskii @ 2019-07-04 16:28 UTC (permalink / raw)
To: Marco Wahl; +Cc: 36494
> From: Marco Wahl <marcowahlsoft@gmail.com>
> Cc: marcowahlsoft@gmail.com, 36494@debbugs.gnu.org
> Date: Thu, 04 Jul 2019 15:33:38 +0200
>
> > How about if we bind S-DOWN and S-UP to commands that scroll to EOB
> > without introducing any new option? That would mimic pages like Less
> > which stop at EOB with an unshifted key, but continue scrolling with a
> > shifted key.
>
> That sounds good to me. Also the mimicing of similar features elsewhere.
Would you like to submit a patch along those lines?
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#36494: 27.0.50; [Proposition] New option to scroll up regardless of eob
2019-07-04 16:28 ` Eli Zaretskii
@ 2019-07-04 20:59 ` Marco Wahl
2019-07-04 21:07 ` Marco Wahl
1 sibling, 0 replies; 13+ messages in thread
From: Marco Wahl @ 2019-07-04 20:59 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Marco Wahl, 36494
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Marco Wahl <marcowahlsoft@gmail.com>
>> Cc: marcowahlsoft@gmail.com, 36494@debbugs.gnu.org
>> Date: Thu, 04 Jul 2019 15:33:38 +0200
>>
>> > How about if we bind S-DOWN and S-UP to commands that scroll to EOB
>> > without introducing any new option? That would mimic pages like Less
>> > which stop at EOB with an unshifted key, but continue scrolling with a
>> > shifted key.
>>
>> That sounds good to me. Also the mimicing of similar features elsewhere.
>
> Would you like to submit a patch along those lines?
Please see the attempt in the attachment.
There is one new function `scroll-lock-next-line-always-scroll' which
gets bound to S-down. Further there are a few tests for this function.
AFAICS the up command needs no special handling with regards to
scroll-lock-mode.
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#36494: 27.0.50; [Proposition] New option to scroll up regardless of eob
2019-07-04 16:28 ` Eli Zaretskii
2019-07-04 20:59 ` Marco Wahl
@ 2019-07-04 21:07 ` Marco Wahl
2019-07-13 7:37 ` Eli Zaretskii
1 sibling, 1 reply; 13+ messages in thread
From: Marco Wahl @ 2019-07-04 21:07 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Marco Wahl, 36494
[-- Attachment #1: Type: text/plain, Size: 54 bytes --]
Ok, sorry for the patch missing. Here is the patch.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-New-function-for-scroll-lock-mode-to-always-scroll.patch --]
[-- Type: text/x-patch, Size: 4603 bytes --]
From baf7c0cd4c095d283a9d418dda4e6d1e5f565d24 Mon Sep 17 00:00:00 2001
From: Marco Wahl <marcowahlsoft@gmail.com>
Date: Thu, 4 Jul 2019 22:32:44 +0200
Subject: [PATCH] New function for scroll-lock-mode to always scroll
* lisp/scroll-lock.el (scroll-lock-next-line-always-scroll): New
function. Opposed to scroll-lock-next-line it does not switch to
forward-line at eob. S-down is the default key binding for this
function.
* test/lisp/scroll-lock-tests.el: A few tests for
scroll-lock-next-line-always-scroll.
---
lisp/scroll-lock.el | 11 +++++
test/lisp/scroll-lock-tests.el | 73 ++++++++++++++++++++++++++++++++++
2 files changed, 84 insertions(+)
create mode 100644 test/lisp/scroll-lock-tests.el
diff --git a/lisp/scroll-lock.el b/lisp/scroll-lock.el
index 8281edb172..5b7a69a17c 100644
--- a/lisp/scroll-lock.el
+++ b/lisp/scroll-lock.el
@@ -36,6 +36,7 @@ scroll-lock-mode-map
(define-key map [remap previous-line] 'scroll-lock-previous-line)
(define-key map [remap forward-paragraph] 'scroll-lock-forward-paragraph)
(define-key map [remap backward-paragraph] 'scroll-lock-backward-paragraph)
+ (define-key map [S-down] 'scroll-lock-next-line-always-scroll)
map)
"Keymap for Scroll Lock mode.")
@@ -81,6 +82,16 @@ scroll-lock-move-to-column
(move-to-column column)
(forward-char (min column (- (line-end-position) (point))))))
+(defun scroll-lock-next-line-always-scroll (&optional arg)
+ "Scroll up ARG lines keeping point fixed."
+ (interactive "p")
+ (or arg (setq arg 1))
+ (scroll-lock-update-goal-column)
+ (condition-case nil
+ (scroll-up arg)
+ (end-of-buffer (scroll-up (1- (count-screen-lines (point) (point-max))))))
+ (scroll-lock-move-to-column scroll-lock-temporary-goal-column))
+
(defun scroll-lock-next-line (&optional arg)
"Scroll up ARG lines keeping point fixed."
(interactive "p")
diff --git a/test/lisp/scroll-lock-tests.el b/test/lisp/scroll-lock-tests.el
new file mode 100644
index 0000000000..590ab4518c
--- /dev/null
+++ b/test/lisp/scroll-lock-tests.el
@@ -0,0 +1,73 @@
+;;; scroll-lock-tests.el --- Test suite for scroll-lock -*- lexical-binding: t -*-
+
+;; Copyright (C) 2019 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'ert)
+(require 'scroll-lock)
+
+\f
+(defun point-in-window-line-p (n)
+ "Return if point is in window line N. Counting starts with 0.
+Precondition: the line N must be available."
+ (save-excursion
+ (let ((point (progn (beginning-of-line) (point))))
+ (let ((moved-to-line (move-to-window-line n)))
+ (cl-assert (= n moved-to-line) t "precondition violation"))
+ (= point (progn (beginning-of-line) (point))))))
+
+\f
+(ert-deftest scroll-lock-next-line-always-scroll-1 ()
+ (with-temp-buffer
+ (insert "\n\n\n")
+ (goto-char (point-min))
+ (switch-to-buffer (current-buffer))
+ (scroll-lock-next-line-always-scroll)
+ (should (point-in-window-line-p 0))))
+
+(ert-deftest scroll-lock-next-line-always-scroll-2 ()
+ (with-temp-buffer
+ (scroll-lock-mode)
+ (insert "\n\n\n")
+ (goto-char (1+ (point-min)))
+ (switch-to-buffer (current-buffer))
+ (scroll-lock-next-line-always-scroll)
+ (should (point-in-window-line-p 1))))
+
+(ert-deftest scroll-lock-next-line-always-scroll-3 ()
+ (with-temp-buffer
+ (scroll-lock-mode)
+ (insert "\n\n\n")
+ (goto-char (1+ (point-min)))
+ (switch-to-buffer (current-buffer))
+ (scroll-lock-next-line-always-scroll 1234)
+ (should (point-in-window-line-p 1))))
+
+(ert-deftest scroll-lock-next-line-always-scroll-4 ()
+ (with-temp-buffer
+ (scroll-lock-mode)
+ (insert (make-string 1000 ?\n))
+ (goto-char (1+ (point-min)))
+ (switch-to-buffer (current-buffer))
+ (scroll-lock-next-line-always-scroll 1234)
+ (should (point-in-window-line-p 1))))
+
+(provide 'scroll-lock-tests)
+
+;;; scroll-lock-tests.el ends here
--
2.22.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* bug#36494: 27.0.50; [Proposition] New option to scroll up regardless of eob
2019-07-04 21:07 ` Marco Wahl
@ 2019-07-13 7:37 ` Eli Zaretskii
2019-07-13 20:10 ` Marco Wahl
0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2019-07-13 7:37 UTC (permalink / raw)
To: Marco Wahl; +Cc: 36494
> From: Marco Wahl <marcowahlsoft@gmail.com>
> Cc: Marco Wahl <marcowahlsoft@gmail.com>, 36494@debbugs.gnu.org
> Date: Thu, 04 Jul 2019 23:07:15 +0200
>
> Ok, sorry for the patch missing. Here is the patch.
Thanks.
This seems to work well, but when there's only the single last line
visible in the window, and the cursor is at EOB, S-DOWN scrolls back,
i.e. after pressing it Emacs now shows 2 last lines. I don't think
this is intended, is it?
Also, this is a user-visible change, so it needs to be called out in
NEWS.
Could you please resubmit with these minor nits fixed?
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#36494: 27.0.50; [Proposition] New option to scroll up regardless of eob
2019-07-13 7:37 ` Eli Zaretskii
@ 2019-07-13 20:10 ` Marco Wahl
2019-07-14 6:25 ` Eli Zaretskii
0 siblings, 1 reply; 13+ messages in thread
From: Marco Wahl @ 2019-07-13 20:10 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 36494
[-- Attachment #1: Type: text/plain, Size: 901 bytes --]
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Marco Wahl <marcowahlsoft@gmail.com>
>> Cc: Marco Wahl <marcowahlsoft@gmail.com>, 36494@debbugs.gnu.org
>> Date: Thu, 04 Jul 2019 23:07:15 +0200
>>
>> Ok, sorry for the patch missing. Here is the patch.
>
> Thanks.
>
> This seems to work well, but when there's only the single last line
> visible in the window, and the cursor is at EOB, S-DOWN scrolls back,
> i.e. after pressing it Emacs now shows 2 last lines. I don't think
> this is intended, is it?
No.
Thanks for your review and your finding.
The scroll back behavior was due to a counting issue. With the new
patch the counting has gone away entirely.
> Also, this is a user-visible change, so it needs to be called out in
> NEWS.
>
> Could you please resubmit with these minor nits fixed?
Okay. Find a respective proposition in the attachment section, please.
Best regards, Marco
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-New-function-for-scroll-lock-to-almost-always-scroll.patch --]
[-- Type: text/x-patch, Size: 5101 bytes --]
From e8d3ee812716daa932a62c1ae40e37b3cb326a77 Mon Sep 17 00:00:00 2001
From: Marco Wahl <marcowahlsoft@gmail.com>
Date: Thu, 4 Jul 2019 22:32:44 +0200
Subject: [PATCH] New function for scroll-lock to almost always scroll
* lisp/scroll-lock.el (scroll-lock-next-line-always-scroll): New
function. Opposed to scroll-lock-next-line it does not switch to
forward-line at eob. S-down is the default key binding for this
function.
* test/lisp/scroll-lock-tests.el: A few tests for
scroll-lock-next-line-always-scroll.
* etc/NEWS: Add a respective note.
---
etc/NEWS | 7 ++++
lisp/scroll-lock.el | 11 ++++++
test/lisp/scroll-lock-tests.el | 68 ++++++++++++++++++++++++++++++++++
3 files changed, 86 insertions(+)
create mode 100644 test/lisp/scroll-lock-tests.el
diff --git a/etc/NEWS b/etc/NEWS
index abbece374a..efa76fe356 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1644,6 +1644,13 @@ This runs after changing the dictionary and could be used to
automatically spellcheck a buffer when changing language without
needing to advice 'ispell-change-dictionary'.
+** scroll-lock
+
+---
+*** New command 'scroll-lock-next-line-always-scroll'.
+This command is bound to 'S-down' and scrolls the buffer up in
+particular when the end of the buffer is visible in the window.
+
\f
* New Modes and Packages in Emacs 27.1
diff --git a/lisp/scroll-lock.el b/lisp/scroll-lock.el
index 8281edb172..3a74c11b7a 100644
--- a/lisp/scroll-lock.el
+++ b/lisp/scroll-lock.el
@@ -36,6 +36,7 @@ scroll-lock-mode-map
(define-key map [remap previous-line] 'scroll-lock-previous-line)
(define-key map [remap forward-paragraph] 'scroll-lock-forward-paragraph)
(define-key map [remap backward-paragraph] 'scroll-lock-backward-paragraph)
+ (define-key map [S-down] 'scroll-lock-next-line-always-scroll)
map)
"Keymap for Scroll Lock mode.")
@@ -81,6 +82,16 @@ scroll-lock-move-to-column
(move-to-column column)
(forward-char (min column (- (line-end-position) (point))))))
+(defun scroll-lock-next-line-always-scroll (&optional arg)
+ "Scroll up ARG lines keeping point fixed."
+ (interactive "p")
+ (or arg (setq arg 1))
+ (scroll-lock-update-goal-column)
+ (condition-case nil
+ (scroll-up arg)
+ (end-of-buffer (goto-char (point-max)) (recenter 1)))
+ (scroll-lock-move-to-column scroll-lock-temporary-goal-column))
+
(defun scroll-lock-next-line (&optional arg)
"Scroll up ARG lines keeping point fixed."
(interactive "p")
diff --git a/test/lisp/scroll-lock-tests.el b/test/lisp/scroll-lock-tests.el
new file mode 100644
index 0000000000..f1ffeed265
--- /dev/null
+++ b/test/lisp/scroll-lock-tests.el
@@ -0,0 +1,68 @@
+;;; scroll-lock-tests.el --- Test suite for scroll-lock -*- lexical-binding: t -*-
+
+;; Copyright (C) 2019 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'ert)
+(require 'scroll-lock)
+
+\f
+(defun point-in-window-line-p (n)
+ "Return if point is in window line N.
+Meaning of N as in `move-to-window-line'.
+Precondition: the line N must be available in the window."
+ (save-excursion
+ (let ((point (progn (beginning-of-line) (point))))
+ (let ((moved-to-line (move-to-window-line n)))
+ (cl-assert (= n moved-to-line) t "precondition violation"))
+ (= point (progn (beginning-of-line) (point))))))
+
+\f
+(ert-deftest scroll-lock-next-line-always-scroll-1 ()
+ "Point stays in top line."
+ (with-temp-buffer
+ (insert "\n\n\n")
+ (goto-char (point-min))
+ (switch-to-buffer (current-buffer))
+ (scroll-lock-next-line-always-scroll)
+ (should (point-in-window-line-p 0))))
+
+(ert-deftest scroll-lock-next-line-always-scroll-2 ()
+ "Point stays in second line."
+ (with-temp-buffer
+ (scroll-lock-mode)
+ (insert "\n\n\n")
+ (goto-char (1+ (point-min)))
+ (switch-to-buffer (current-buffer))
+ (scroll-lock-next-line-always-scroll)
+ (should (point-in-window-line-p 1))))
+
+(ert-deftest scroll-lock-next-line-always-scroll-3 ()
+ "Point stays in second line when scrolling beyond the number of buffer lines."
+ (with-temp-buffer
+ (scroll-lock-mode)
+ (insert (make-string 1000 ?\n))
+ (goto-char (1+ (point-min)))
+ (switch-to-buffer (current-buffer))
+ (scroll-lock-next-line-always-scroll 1234)
+ (should (point-in-window-line-p 1))))
+
+(provide 'scroll-lock-tests)
+
+;;; scroll-lock-tests.el ends here
--
2.22.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* bug#36494: 27.0.50; [Proposition] New option to scroll up regardless of eob
2019-07-13 20:10 ` Marco Wahl
@ 2019-07-14 6:25 ` Eli Zaretskii
0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2019-07-14 6:25 UTC (permalink / raw)
To: Marco Wahl; +Cc: 36494-done
> From: Marco Wahl <marcowahlsoft@gmail.com>
> Cc: 36494@debbugs.gnu.org
> Date: Sat, 13 Jul 2019 22:10:19 +0200
>
> > Could you please resubmit with these minor nits fixed?
>
> Okay. Find a respective proposition in the attachment section, please.
Thanks, pushed to the master branch.
One minor comment: in the future please mention the bug number in the
commit log message (I added that this time).
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#36494: 27.0.50; [Proposition] New option to scroll up regardless of eob
2019-07-04 11:03 marcowahlsoft
2019-07-04 13:09 ` Eli Zaretskii
@ 2019-07-04 20:13 ` Juri Linkov
1 sibling, 0 replies; 13+ messages in thread
From: Juri Linkov @ 2019-07-04 20:13 UTC (permalink / raw)
To: marcowahlsoft; +Cc: 36494
> +(defcustom scroll-lock-switch-to-forward-line-at-eob
> + t
> + "If set then don't scroll if the end of buffer is visible.")
Please avoid such long names. A variable name doesn't require
completeness like in a doc string. scroll-lock-forward-line-at-eob
is enough, or maybe even scroll-lock-at-eob to define behavior
at the end of the buffer - that opens a possibility of adding
more options in the future.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2019-07-14 6:25 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <<84ftnmjc37.fsf@gmail.com>
[not found] ` <<83d0iqaqvh.fsf@gnu.org>
2019-07-04 15:50 ` bug#36494: 27.0.50; [Proposition] New option to scroll up regardless of eob Drew Adams
2019-07-04 18:59 ` Noam Postavsky
2019-07-04 22:28 ` Drew Adams
2019-07-04 11:03 marcowahlsoft
2019-07-04 13:09 ` Eli Zaretskii
2019-07-04 13:33 ` Marco Wahl
2019-07-04 16:28 ` Eli Zaretskii
2019-07-04 20:59 ` Marco Wahl
2019-07-04 21:07 ` Marco Wahl
2019-07-13 7:37 ` Eli Zaretskii
2019-07-13 20:10 ` Marco Wahl
2019-07-14 6:25 ` Eli Zaretskii
2019-07-04 20:13 ` Juri Linkov
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.