unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#27479:
@ 2017-06-25  3:37 John Beck
  2017-06-25 11:37 ` bug#27479: npostavs
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: John Beck @ 2017-06-25  3:37 UTC (permalink / raw)
  To: 27479

[-- Attachment #1: Type: text/plain, Size: 5085 bytes --]

(progn (insert "side effect 1")
       (message "side effect 2")
       (sleep-for 10)
       (insert "side effect 3"))

AFAIK progn should execute lisp comands sequentially.

However in this instance it does not. First we get the message
"side effect 2" Then we insert "side effect 1" and "side effect 3"
at the same time.

AFAIK this should not be happening. We can debug it a little here.

If you remove the progn and put it in an empty file then m-x load-file
you will discover the same issue, meaning it is not an issue with progn.

This little bit of code may also prove useful in debugging it

(progn
 (progn
  (insert
   (progn
    (sleep-for 5)
    "hello")))
    (progn
    (sleep-for 10))
    (message "side effect"))

Anywho I do not know how to use gnus so I am going to include my contact
info in this spot.

My email is john.morris.beck@gmail.com

My #emacs irc nick is John[Lisbeth]

Thank you for creating a great editor.




In GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
 of 2016-04-17 on lgw01-04, modified by Debian
System Description: Ubuntu 16.04.2 LTS

Configured using:
 `configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.5/site-lisp:/usr/share/emacs/site-lisp
 --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.5/site-lisp:/usr/share/emacs/site-lisp
 --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat
 -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  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 messages:
goodbye
"goodbye"
No match
Beginning of buffer
nil
Beginning of buffer
Mark set
Auto-saving...done
nil
hello
nil

Load-path shadows:
/usr/share/emacs/24.5/site-lisp/debian-startup hides
/usr/share/emacs/site-lisp/debian-startup

Features:
(shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mail-utils debug dabbrev etags
eieio-opt speedbar sb-image ezimage dframe find-func vc-git term
disp-table ehelp help-mode network-stream starttls tls erc-list erc-menu
easymenu erc-join erc-ring erc-networks erc-pcomplete pcomplete comint
ansi-color ring erc-track erc-match erc-button wid-edit erc-fill
erc-stamp erc-netsplit erc-goodies erc erc-backend erc-compat
format-spec auth-source eieio byte-opt bytecomp byte-compile cl-extra
cl-loaddefs cl-lib cconv eieio-core gnus-util mm-util help-fns
mail-prsvr password-cache thingatpt pp xterm server time-date tooltip
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
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
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 176407 7111)
 (symbols 48 24009 0)
 (miscs 40 89 447)
 (strings 32 29477 5801)
 (string-bytes 1 797802)
 (vectors 16 15519)
 (vector-slots 8 429276 2495)
 (floats 8 98 307)
 (intervals 56 5095 1)
 (buffers 960 21)
 (heap 1024 39446 831))

-- 
Sincerely,
Rev. John M. Beck
Ordained Dudeist Priest

[-- Attachment #2: Type: text/html, Size: 51677 bytes --]

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

* bug#27479:
  2017-06-25  3:37 bug#27479: John Beck
@ 2017-06-25 11:37 ` npostavs
  2017-06-25 18:08 ` bug#27479: Buffer text not repainted after `insert' npostavs
  2017-06-30  3:14 ` npostavs
  2 siblings, 0 replies; 5+ messages in thread
From: npostavs @ 2017-06-25 11:37 UTC (permalink / raw)
  To: John Beck; +Cc: 27479

John Beck <john.morris.beck@gmail.com> writes:

> (progn (insert "side effect 1")
>        (message "side effect 2")
>        (sleep-for 10)
>        (insert "side effect 3"))
>
> AFAIK progn should execute lisp comands sequentially.
>
> However in this instance it does not. First we get the message
> "side effect 2" Then we insert "side effect 1" and "side effect 3"
> at the same time.

Actually they do run sequentially, but the minibuffer text is repainted
directly after the 'message' call, while the buffer text is only
repainted at the end.  Try this:

(progn (insert "side effect 1")
       (message "side effect 2 %s" (buffer-string))
       (sleep-for 10)
       (insert "side effect 3"))

or this:

(progn (insert "side effect 1")
       (redisplay)
       (message "side effect 2")
       (sleep-for 10)
       (insert "side effect 3"))





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

* bug#27479: Buffer text not repainted after `insert'
  2017-06-25  3:37 bug#27479: John Beck
  2017-06-25 11:37 ` bug#27479: npostavs
@ 2017-06-25 18:08 ` npostavs
  2017-06-25 18:21   ` npostavs
  2017-06-30  3:14 ` npostavs
  2 siblings, 1 reply; 5+ messages in thread
From: npostavs @ 2017-06-25 18:08 UTC (permalink / raw)
  To: 27479, John Beck

[-- Attachment #1: Type: text/plain, Size: 62 bytes --]

[Please use "Reply All" to keep 27479@debbugs.gnu.org on Cc]


[-- Attachment #2: Type: message/rfc822, Size: 1164 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 459 bytes --]

I would say that is a *huge* wat.

For now I have resolved to use this:

(sequential-insert (arg) (progn (insert arg) (redisplay)))

This avoids backwards compatibility issues and and allows the user to be
explicit about whether or not they are inserting "sequentially."

I feel that something along the lines of this sequential-insert should be
included in mainline emacs though that is entirely your call.

Thank you for the help!

Sincerely,
John M. Beck


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

* bug#27479: Buffer text not repainted after `insert'
  2017-06-25 18:08 ` bug#27479: Buffer text not repainted after `insert' npostavs
@ 2017-06-25 18:21   ` npostavs
  0 siblings, 0 replies; 5+ messages in thread
From: npostavs @ 2017-06-25 18:21 UTC (permalink / raw)
  To: 27479; +Cc: John Beck


> From: John Beck <john.morris.beck@gmail.com>
> Subject: Re: bug#27479:
> To: npostavs@users.sourceforge.net, 27479@debbugs.gnu.org
> Date: Sun, 25 Jun 2017 10:19:43 -0700 (49 minutes, 40 seconds ago)
>
> I would say that is a *huge* wat.
>
> For now I have resolved to use this:
>
> (sequential-insert (arg) (progn (insert arg) (redisplay)))
>
> This avoids backwards compatibility issues and and allows the user to be
> explicit about whether or not they are inserting "sequentially."
>
> I feel that something along the lines of this sequential-insert should be
> included in mainline emacs though that is entirely your call.

Apart from simulating a human typing I don't see a need for this
function.  It could go in lisp/play/animation.el perhaps.  Did you have
some other use case in mind?

By the way, `sit-for' triggers redisplay, so you might want to use that
instead of `sleep-for'.





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

* bug#27479: Buffer text not repainted after `insert'
  2017-06-25  3:37 bug#27479: John Beck
  2017-06-25 11:37 ` bug#27479: npostavs
  2017-06-25 18:08 ` bug#27479: Buffer text not repainted after `insert' npostavs
@ 2017-06-30  3:14 ` npostavs
  2 siblings, 0 replies; 5+ messages in thread
From: npostavs @ 2017-06-30  3:14 UTC (permalink / raw)
  To: 27479, John Beck

[-- Attachment #1: Type: text/plain, Size: 26 bytes --]

[Forwarding to bug list]


[-- Attachment #2: Type: message/rfc822, Size: 1346 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 668 bytes --]

Well the reason I had wanted to have a sequential-insert in mainline  emacs
was just so that you could simulate user-input.

There was a person in #emacs by the nick of dizzzylizzy who was trying to
simulate user input only that it was not quite so obvious to either of us
that the lisp function redisplay was necessary to do that. The advent of a
sequential-insert creates a more standard way of doing it and thus
experienced #emacsers can solve it by telling them to use sequential insert
if insert is not working.

I would understand though if you do not want to include it. Consider this
support question solved you need not respond. Thank you for your hard work.

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

end of thread, other threads:[~2017-06-30  3:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-25  3:37 bug#27479: John Beck
2017-06-25 11:37 ` bug#27479: npostavs
2017-06-25 18:08 ` bug#27479: Buffer text not repainted after `insert' npostavs
2017-06-25 18:21   ` npostavs
2017-06-30  3:14 ` npostavs

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).