From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#17678: 24.4.50; Feature Request -- calculate new `window-start` & `window-end` before visual redisplay Date: Tue, 03 Jun 2014 10:48:54 -0700 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by - "") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1401817835 10960 80.91.229.3 (3 Jun 2014 17:50:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Jun 2014 17:50:35 +0000 (UTC) To: 17678@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 03 19:50:29 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wrsqy-0005x0-TI for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Jun 2014 19:50:29 +0200 Original-Received: from localhost ([::1]:55012 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wrsqp-0000Iz-3A for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Jun 2014 13:50:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wrsqf-00006z-Mk for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2014 13:50:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrsqZ-0001XJ-Cw for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2014 13:50:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43604) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrsqZ-0001WU-7L for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2014 13:50:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WrsqX-0004x7-So for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2014 13:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Jun 2014 17:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17678 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.140181776518959 (code B ref -1); Tue, 03 Jun 2014 17:50:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Jun 2014 17:49:25 +0000 Original-Received: from localhost ([127.0.0.1]:42481 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wrspw-0004vi-7E for submit@debbugs.gnu.org; Tue, 03 Jun 2014 13:49:25 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60803) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wrsps-0004vJ-KA for submit@debbugs.gnu.org; Tue, 03 Jun 2014 13:49:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wrspg-0000wT-Vc for submit@debbugs.gnu.org; Tue, 03 Jun 2014 13:49:15 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:37328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wrspg-0000wP-Rh for submit@debbugs.gnu.org; Tue, 03 Jun 2014 13:49:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wrspb-00081Z-62 for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2014 13:49:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrspV-0000tR-HQ for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2014 13:49:03 -0400 Original-Received: from cobb.liquidweb.com ([50.28.13.150]:58630) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrspV-0000tF-83 for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2014 13:48:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com; s=default; h=Content-Type:MIME-Version:Subject:To:From:Message-ID:Date; bh=OqDUSxByyRAEznRw/PkiSkB57C6vdNpBWQ3dSpt3LHA=; b=4PhqyoiAP1I5lWy0RF9jy5EJAU6Y7x2IpkIQ/7sAEqA7aBNqxbU17V09mrlwPJhEHNa0uubXWwgpat9TI4kXrwJMM25IqTch6Vqpbb0hDHgkN515BpmonywUzOYpANVb; Original-Received: from cpe-75-85-5-102.socal.res.rr.com ([75.85.5.102]:50256 helo=MP.local) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from ) id 1WrspR-0008Nd-DS for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2014 13:48:53 -0400 User-Agent: / () / () APEL/10.8 Emacs/24.4.50 (x86_64-apple-darwin10.8.0) MULE/6.0 (HANACHIRUSATO) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cobb.liquidweb.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-Get-Message-Sender-Via: cobb.liquidweb.com: acl_c_relayhosts_text_entry: lawlist|lawlist.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:89947 Archived-At: At the present time, I do not believe that Emacs has the ability to calculate a new `window-start` and a new `window-end` without a redisplay occurring, because it needs to take into account things like the new cursor position, `visual-line-mode`, `linenum-mode`, etc. Functions assigned to the `post-command-hook` use the `window-start` and `window-end` positions that were previously visible before a new redisplay occurs. Example: * Long buffer of text that exceeds the `window-height`. * Jump interactively from `beginning-of-buffer` to `ending-of-buffer`, or visa-versa. * In the `post-command-hook`, have the following two elements: ** Remove overlays xyz between the *old* `window-start` and *old* `window-end`. ** Add overlays xyz between the *new* `window-start` and *new* `window-end`. The final component above (i.e., ** Add overlays xyz between the *new* . . .) cannot be done correctly without a forced `redisplay` occurring. The result of a forced redisplay is that the user will see a momentary visual representation of the buffer *without* overlays xyz. The forced redisplay permits Emacs to correctly calculate the *new* `window-start` and *new* `window-end`. In a stackoverflow thread regarding this issue, @Stefan suggested that I take a look at the `jit-lock-register`. After combing through the code in `jit-lock.el` and trying some experiments, I believe that `jit-lock.el` is more suited to a situation when buffer *modification* occurs -- it is also suited for situations where one may wish to incrementially act upon an entire buffer in small chunks at a time to increase efficiency of avaialble resources. http://stackoverflow.com/questions/23923371/emacs-calculating-new-window-start-end-without-redisplay I believe that the solution may be to have a `sneak-preview-redisplay` whereby the *new* `window-start` and *new* `window-end` could be correctly calculated without the visual buffer actually being redisplayed. Thanks, Keith ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; In GNU Emacs 24.4.50.1 (x86_64-apple-darwin10.8.0, NS appkit-1038.36 Version 10.6.8 (Build 10K549)) of 2014-06-01 on MP.local Repository revision: 117215 lekktu@gmail.com-20140601162519-4dacx2w0ak528z2r Windowing system distributor `Apple', version 10.3.1038 Configured using: `configure --with-ns' Configured features: ACL LIBXML2 ZLIB Important settings: locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: lawlist-scroll-bar-mode: t lawlist-delete-selection-mode: t lawlist-linum-mode: t lawlist-visual-line-mode: t vr-mode: t hr-mode: t flyspell-mode: t desktop-save-mode: t tabbar-mode: t font-lock-mode: t blink-cursor-mode: t transient-mark-mode: t Recent input: s-N s-w k s-N s-w k x e m a c s - b u g r e p o r t - e m a c s - b u g Recent messages: Saving...done Mark set [k]ill or [s]ave draft? Loading msgdb for +/Users/HOME/.0.data/.0.emacs/.0.mail/msgdb/imap/mail.lawlist.com/lawlist/INBOX.Drafts/spool...done Type C-c C-x C-z to exit MIME mode, and type C-c C-x ? to get help. Saving...done Mark set [k]ill or [s]ave draft? Loading msgdb for +/Users/HOME/.0.data/.0.emacs/.0.mail/msgdb/imap/mail.lawlist.com/lawlist/INBOX.Drafts/spool...done *beep* Load-path shadows: /Users/HOME/.0.data/.0.emacs/.0.flim/md4 hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/md4 /Users/HOME/.0.data/.0.emacs/.0.flim/hex-util hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/hex-util /Users/HOME/.0.data/.0.emacs/.0.flim/sasl hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/net/sasl /Users/HOME/.0.data/.0.emacs/.0.flim/sasl-ntlm hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/net/sasl-ntlm /Users/HOME/.0.data/.0.emacs/.0.flim/sasl-digest hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/net/sasl-digest /Users/HOME/.0.data/.0.emacs/.0.flim/sasl-cram hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/net/sasl-cram /Users/HOME/.0.data/.0.emacs/.0.flim/ntlm hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/net/ntlm /Users/HOME/.0.data/.0.emacs/.0.flim/hmac-md5 hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/net/hmac-md5 /Users/HOME/.0.data/.0.emacs/.0.flim/hmac-def hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/net/hmac-def /Users/HOME/.0.data/.0.emacs/.0.wl/rfc2368 hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/mail/rfc2368 /Users/HOME/.0.data/.0.emacs/.0.wl/utf7 hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/gnus/utf7 /Users/HOME/.0.data/.0.emacs/.0.simi/smime hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/gnus/smime /Users/HOME/.emacs.d/elpa/tabulated-list-20120406.1351/tabulated-list hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/emacs-lisp/tabulated-list /Users/HOME/.0.data/.0.emacs/.0.simi/pgg hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/obsolete/pgg /Users/HOME/.0.data/.0.emacs/.0.simi/pgg-pgp5 hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/obsolete/pgg-pgp5 /Users/HOME/.0.data/.0.emacs/.0.simi/pgg-pgp hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/obsolete/pgg-pgp /Users/HOME/.0.data/.0.emacs/.0.simi/pgg-parse hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/obsolete/pgg-parse /Users/HOME/.0.data/.0.emacs/.0.simi/pgg-gpg hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/obsolete/pgg-gpg /Users/HOME/.0.data/.0.emacs/.0.simi/pgg-def hides /Users/HOME/.0.data/.0.emacs/Emacs_06_01_2014.app/Contents/Resources/lisp/obsolete/pgg-def Features: (shadow emacsbug modb-legacy wl-mime mime-edit pgg-parse pccl pccl-20 signature mime-setup mail-mime-setup semi-setup mime-pgp pgg-def mime-play filename mime-image modb-standard elmo-imap4 disp-table bbdb-autoloads lawlist-wl wl-demo wl-draft eword-encode wl-template sendmail elmo-net elmo-cache elmo-map elmo-dop wl-news wl-address wl-thread wl-folder wl wl-e21 wl-spam wl-action wl-summary wl-refile wl-util pp elmo-flag elmo-localdir wl-message elmo-mime mmelmo-buffer mmelmo-imap mime-view mime-conf calist semi-def mmimap mime-parse mmbuffer mmgeneric elmo-multi elmo-spam elsp-header elsp-generic elmo elmo-signal wl-highlight wl-vars wl-version elmo-msgdb modb modb-generic modb-entity luna mime elmo-util emu invisible inv-23 poem poem-e20 poem-e20_3 eword-decode std11 elmo-date elmo-vars elmo-version w3m-load mime-w3m w3m browse-url doc-view jka-compr image-mode w3m-hist w3m-fb bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon w3m-image w3m-proc w3m-util smiley gnus-art mm-uu mml2015 mm-view mml-smime smime savehist lawlist-vr-hr lawlist-whitespace lawlist-github conf-mode log-edit add-log find-lisp package esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg eldoc esh-groups eshell esh-module esh-mode esh-util dired-x view tramp tramp-compat tramp-loaddefs trampver server grep epa epg epg-config diff-mode autorevert filenotify log-view pcvs-util ido time-stamp vc-git vc vc-dispatcher ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff rx ert ewoc debug eieio-base lawlist-calculator ps-print ps-def lpr flyspell ispell bbdb timezone find-func dired-aux lawlist-yasnippet help-mode multiple-cursors mc-separate-operations rectangular-region-mode mc-mark-more thingatpt mc-cycle-cursors mc-edit-lines multiple-cursors-core rect saveplace lawlist-tex-mode pcase compile shell pcomplete comint ansi-color ring skeleton compare-w desktop frameset lawlist-tabbar lawlist-org lawlist-calendar edmacro kmacro derived lawlist-toodledo advice url-http url-auth url-gw url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse auth-source eieio byte-opt bytecomp byte-compile cconv eieio-core password-cache url-vars mailcap json xml noutline outline easy-mmode gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls utf7 mel path-util mime-def alist mcharset mcs-20 mcs-e20 pcustom pces pces-e20 pces-20 broken poe pym static apel-ver product netrc nnoo parse-time gnus-spec gnus-int gnus-range message cl-macs dired format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus gnus-ems nnheader gnus-util mail-utils mm-util help-fns mail-prsvr wid-edit cl gv cl-loaddefs cl-lib time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu 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 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 make-network-process cocoa ns multi-tty emacs) Memory information: ((conses 16 736782 78749) (symbols 48 55597 0) (miscs 40 501 2390) (strings 32 116279 16804) (string-bytes 1 3864862) (vectors 16 42181) (vector-slots 8 741196 80204) (floats 8 1011 262) (intervals 56 778 234) (buffers 960 13))