From: Keith David Bershatsky <esq@lawlist.com>
To: 22404@debbugs.gnu.org
Subject: bug#22404: 25.1.50; Forcing `window-scroll-functions` to run.
Date: Mon, 18 Jan 2016 21:49:40 -0800 [thread overview]
Message-ID: <m260yqdsp7.wl%esq@lawlist.com> (raw)
As a feature request, please consider adding an alternative method to force the `window-scroll-functions` hook to run -- but NOT more than it would normally run. [In other words, it shouldn't run 3 times.] I only found `(set-window-buffer (selected-window) (current-buffer))` as a viable means to achieve this goal. `run-window-scroll-functions` runs immediately and is not a viable substitute for this feature request. Some users may not wish to `set-window-buffer` or run the `window-configuration-change-hook` to achieve this feature request.
In my particular use case, I want to run a custom function only one time per command loop that is dependent upon the new `window-start` and `window-end`, which is only reliably available to the user after the `post-command-hook` has run its course. My function is too costly time-wise to run more than once each command loop. I have tried, to no avail, to come up with a test to ascertain with 100% accuracy (from the `post-command-hook`) to guess whether the `window-scroll-functions` hook will run and/or whether it will run more than one time (e.g., when cursor/point is partially visible). I played around with `(pos-visible-in-window-p nil nil t)` and whether it returned a length of 0, 2 or 6 -- however, from the `post-command-hook`, that is insufficient to ascertain with 100% accuracy whe
ther the `window-scroll-functions` hook will run once or twice or not at all. The solution, I believe, is to force the `window-scroll-functions` hook to run during every redisplay -- but not more than it would normally run.
In other words, I want the `window-scroll-functions` hook to run every command loop when my custom minor-mode is active -- or twice if point/cursor is only partially visible (at the bottom of the window) and needs to be moved up a smidgen by redisplay.
Background: my custom function is a cross-hairs created with overlays that works with `word-wrap` -- the vertical line is XPM that matches the character and color underneath.
Thanks,
Keith
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In GNU Emacs 25.1.50.1 (x86_64-apple-darwin10.8.0, NS appkit-1038.36 Version 10.6.8 (Build 10K549))
of 2016-01-03 built on server.local
Repository revision: e94b1799d4f4c57266bdbc4801b26fe0121b7c7a
Windowing system distributor 'Apple', version 10.3.1038
Configured using:
'configure --with-ns --without-imagemagick --enable-checking=glyphs
CPPFLAGS=-I/Users/HOME/.0.data/.0.emacs/macports/include
LDFLAGS=-L/Users/HOME/.0.data/.0.emacs/macports/lib'
Configured features:
JPEG RSVG DBUS NOTIFY ACL LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS
Important settings:
locale-coding-system: utf-8-unix
Major mode: Grep
Minor modes in effect:
tabbar-mode: t
sb-mode: t
ml-mode: t
hl-mode: t
kb-mode: t
sd-mode: t
fl-mode: t
bc-mode: t
buffer-read-only: t
Recent messages:
Load-path shadows:
None found.
Features:
(shadow emacsbug message mml mml-sec mm-decode mm-bodies mm-encode
gmm-utils mailheader sendmail lawlist-ztree lawlist-ys lawlist-ws
lawlist-wl elmo-imap4 elmo-localdir modb-standard modb-legacy
elmo-internal elmo-flag mmelmo-imap mmelmo-buffer elsp-generic mel-u
epg-config lawlist-w3m doc-view jka-compr image-mode ccl lawlist-vl
lawlist-view lawlist-undo lawlist-txt lawlist-tm lawlist-tex compare-w
diff-mode lawlist-tabbar lawlist-speedbar lawlist-shell info
esh-groups ehelp ange-ftp lawlist-sgml lawlist-sb lawlist-ruler
lawlist-replace lawlist-rectangle lawlist-re-builder lawlist-python
skeleton lawlist-profiler lawlist-print lawlist-php cl-seq cc-langs
lawlist-perl lawlist-parens lawlist-org lawlist-calendar org-agenda
org org-macro org-footnote org-pcomplete org-list org-faces
org-entities org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob
ob-table ob-exp org-src ob-keys ob-comint ob-core ob-eval org-compat
org-macs org-loaddefs find-func holidays hol-loaddefs cal-menu
calendar cal-loaddefs lawlist-neotree lawlist-movement lawlist-mouse
lawlist-ml lawlist-misc lawlist-messages lawlist-mc lawlist-markdown
noutline outline lawlist-lorem lawlist-linum lawlist-keymap lawlist-js
json map thingatpt cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs lawlist-ispell
lawlist-isearch lawlist-info lawlist-imenu lawlist-ibuffer lawlist-hl
lawlist-grep lawlist-git pcvs-util ido seq server conf-mode
lawlist-framebufs lawlist-frame lawlist-fm lawlist-files zeroconf dbus
xml lawlist-env lawlist-elscreen lawlist-elisp lawlist-dv
lawlist-image lawlist-ds lawlist-dired dired dired-loaddefs
format-spec lawlist-diff lawlist-desktop frameset lawlist-saveplace
lawlist-debug lawlist-window debug lawlist-css smie lawlist-compile rx
lawlist-color lawlist-cm lawlist-cc lawlist-font-lock cl-macs
lawlist-calc lawlist-calc+ lawlist-bk lawlist-bc lawlist-bbdb gnus
gnus-ems nnheader mail-utils wid-edit mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mailabbrev mail-extr rfc822 timezone
lawlist-minibuffer gv lawlist-auth gnus-util mm-util help-fns
mail-prsvr password-cache lawlist-as lawlist-archive lawlist-apropos
lawlist-+ lawlist-lcl byte-opt bytecomp byte-compile cl-extra cconv
lawlist-help disp-table easy-mmode edmacro kmacro quail help-mode
easymenu cl-loaddefs cl-lib pcase derived advice shell pcomplete
comint ansi-color ring savehist time-date mule-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win
ucs-normalize term/common-win tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode
register page menu-bar rfn-eshadow timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core 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 charscript 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 dbusbind kqueue cocoa
ns multi-tty make-network-process emacs)
Memory information:
((conses 16 2506629 211607)
(symbols 48 86281 0)
(miscs 40 1116 1187)
(strings 32 198663 21468)
(string-bytes 1 7537848)
(vectors 16 61491)
(vector-slots 8 1294267 27715)
(floats 8 3369 803)
(intervals 56 4477 414)
(buffers 976 17))
next reply other threads:[~2016-01-19 5:49 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-19 5:49 Keith David Bershatsky [this message]
2016-01-19 17:50 ` bug#22404: 25.1.50; Forcing `window-scroll-functions` to run Eli Zaretskii
2016-01-19 18:49 ` Keith David Bershatsky
2016-01-19 19:39 ` Eli Zaretskii
2016-01-19 18:53 ` John Wiegley
2016-01-19 19:26 ` Keith David Bershatsky
2016-01-19 20:35 ` Keith David Bershatsky
2016-01-20 13:34 ` Eli Zaretskii
2016-01-19 23:07 ` Keith David Bershatsky
2016-01-21 2:32 ` Keith David Bershatsky
2016-01-21 17:41 ` Eli Zaretskii
2016-01-21 19:54 ` Keith David Bershatsky
2016-01-21 20:28 ` Eli Zaretskii
2016-01-29 12:00 ` Michael Heerdegen
2016-01-29 14:37 ` Eli Zaretskii
2016-01-29 14:57 ` Michael Heerdegen
2016-01-29 15:33 ` Eli Zaretskii
2016-01-21 21:11 ` Keith David Bershatsky
2016-01-29 2:14 ` John Wiegley
2016-01-29 3:08 ` Keith David Bershatsky
2016-01-29 8:42 ` Eli Zaretskii
2016-01-29 15:54 ` Keith David Bershatsky
2016-02-01 3:50 ` Keith David Bershatsky
2016-02-01 19:54 ` Eli Zaretskii
2016-02-01 13:18 ` Keith David Bershatsky
2016-02-02 16:34 ` Eli Zaretskii
2016-02-02 5:58 ` Keith David Bershatsky
2016-02-02 18:16 ` Keith David Bershatsky
2016-02-02 18:43 ` Eli Zaretskii
2016-02-02 20:00 ` Keith David Bershatsky
2016-02-02 21:05 ` Keith David Bershatsky
2016-02-08 8:51 ` Keith David Bershatsky
2016-02-08 17:17 ` Eli Zaretskii
2016-02-09 16:00 ` Keith David Bershatsky
2016-02-09 17:48 ` Eli Zaretskii
2016-02-12 0:14 ` Keith David Bershatsky
2016-02-12 8:18 ` Eli Zaretskii
2016-02-16 3:39 ` Keith David Bershatsky
2016-02-22 6:05 ` Keith David Bershatsky
2016-03-11 16:21 ` Keith David Bershatsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m260yqdsp7.wl%esq@lawlist.com \
--to=esq@lawlist.com \
--cc=22404@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).