From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dimitri Fontaine Newsgroups: gmane.emacs.bugs Subject: bug#6078: 23.1.90; switch-to-buffer does not redisplay until an event occurs Date: Fri, 30 Apr 2010 20:35:15 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1272816163 15456 80.91.229.12 (2 May 2010 16:02:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 2 May 2010 16:02:43 +0000 (UTC) To: 6078@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 02 18:02:42 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O8bcu-0006yo-A5 for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 May 2010 18:02:41 +0200 Original-Received: from localhost ([127.0.0.1]:46149 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8bct-0006Z8-R9 for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 May 2010 12:02:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O8XJ9-0001rI-UD for bug-gnu-emacs@gnu.org; Sun, 02 May 2010 07:25:59 -0400 Original-Received: from [140.186.70.92] (port=59386 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8XJ7-0001qk-3J for bug-gnu-emacs@gnu.org; Sun, 02 May 2010 07:25:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O8XJ5-0003JM-C5 for bug-gnu-emacs@gnu.org; Sun, 02 May 2010 07:25:56 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46335) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O8XJ5-0003JG-9h for bug-gnu-emacs@gnu.org; Sun, 02 May 2010 07:25:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1O8Wzp-0007NS-SD; Sun, 02 May 2010 07:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dimitri Fontaine Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 May 2010 11:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6078 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: emacs-pretest-bug@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.127279835328349 (code B ref -1); Sun, 02 May 2010 11:06:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 May 2010 11:05:53 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O8Wze-0007NC-G2 for submit@debbugs.gnu.org; Sun, 02 May 2010 07:05:52 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O8TMi-0005ip-4k for submit@debbugs.gnu.org; Sun, 02 May 2010 03:13:25 -0400 Original-Received: from mx10.gnu.org ([199.232.76.166]:46950) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O8TMe-0004XK-SQ for emacs-pretest-bug@gnu.org; Sun, 02 May 2010 03:13:21 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56141) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1O8TMe-0000kn-9d for emacs-pretest-bug@gnu.org; Sun, 02 May 2010 03:13:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O8TMX-0006Kd-IF for emacs-pretest-bug@gnu.org; Sun, 02 May 2010 03:13:18 -0400 Original-Received: from 89-158-241-71.rev.dartybox.com ([89.158.241.71]:49819 helo=DimIMac.local) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O8TMS-0006Go-F5 for emacs-pretest-bug@gnu.org; Sun, 02 May 2010 03:13:12 -0400 Original-Received: by DimIMac.local (Postfix, from userid 501) id B437E7AADB4; Fri, 30 Apr 2010 20:35:15 +0200 (CEST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Sun, 02 May 2010 07:05:50 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 02 May 2010 07:06:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Sun, 02 May 2010 12:00:01 -0400 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:36645 Archived-At: The following code, an attempt to have a visual window switching facility, is failing to provide the visual clue it's meant to give. That seems to be because switch-to-buffer won't redisplay until some event occurred, and neither using sit-for nor redisplay helps. Here's the code: (defun dim:switch-window-display-number (win num) "prepare a temp buffer to diplay in the window while choosing" (let ((buf (get-buffer-create (concat " *" (number-to-string num) "*")))) (with-current-buffer buf (insert (concat "\n\n " (number-to-string num))) (text-scale-adjust 12)) ;; when it works we'll choose one or the other (set-window-buffer win buf) (select-window win) (switch-to-buffer buf 'non-record) buf)) (defun dim:switch-window () "Display an overlay in each window showing a unique key, then ask user for the window where move to" (interactive) (let ((config (current-window-configuration)) (num 1) (redisplay-dont-pause t) key buffers) (dolist (win (window-list)) (setq buffers (cons (dim:switch-window-display-number win num) buffers)) (setq num (1+ num))) ;(redisplay 1) (sit-for 0) (while (not key) (let ((input (event-basic-type (read-event "Move to window: " nil 5)))) (when (and (not (symbolp input)) (<= 49 input) (>= 57 input)) (setq key (- input 48))))) (message "%S" key) (dolist (buf buffers) (kill-buffer buf)) (set-window-configuration config) (setq num 1) (dolist (win (window-list)) (when (eq num key) (select-window win)) (setq num (1+ num))))) In GNU Emacs 23.1.90.1 (x86_64-apple-darwin10.2.0, NS apple-appkit-1038.25) of 2010-03-25 on proton.local Windowing system distributor `Apple', version 10.3.1038 configured using `configure '--without-dbus' '--with-ns' 'CFLAGS=-pipe -O2 -march=nocona'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil value of $XMODIFIERS: nil locale-coding-system: nil default enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: savehist-mode: t desktop-save-mode: t nxhtml-global-minor-mode: t iswitchb-mode: t diff-auto-refine-mode: t global-hl-line-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t auto-fill-mode: 1 Recent input: a r y : : SPC t h e SPC o n y l y SPC c h a n g e SPC i s SPC h o w SPC t o SPC d o SPC i t , SPC n o t SPC w h a t SPC e r w e C-a M-f M-f M-f SPC p r o p o s e d C-e SPC c u r r e n d o . C-x C-s C-a C-c C-c q p M-` M-` C-n n M-` c o l u m n s , SPC s o r r y a h SPC o y s e s C-c C-b w g a t h a t s ' s SPC t h a t SPC l i n g SPC h a s M-b M-b M-b SPC h a s SPC C-e k SPC t SPC o SPC d o SPC h e r e ? SPC : ) M-` M-` i l k i k e SPC q a a SPC 1 0 SPC h o u r s SPC t p l a n e SPC t r p i p SPC f o r SPC t h a t ? SPC n o SPC t h a n s k s SPC : ) M-` SPC n SPC n M-1 M-` C-h C-g C-x h M-w M-x e m a s c s c s - r e r e p o r e m b Recent messages: Fetching headers for nnimap+hm.local:PostgreSQL.hackers...done Generating summary...done Auto-saving... 20:23 You were mentioned by yonkeltron in #emacs [2 times] 20:24 You were mentioned by yonkeltron in #emacs [2 times] Mark set [2 times] Saved text until "+ num))))) (provide 'dim-switch-window)" Making completion list... [2 times] Load-path shadows: /Users/dim/.emacs.d/elpa/emms-3.0/tq hides ~/.emacs.d/emms/lisp/tq /Users/dim/.emacs.d/elpa/emms-3.0/ogg-comment hides ~/.emacs.d/emms/lisp/ogg-comment /Users/dim/.emacs.d/elpa/emms-3.0/later-do hides ~/.emacs.d/emms/lisp/later-do /Users/dim/.emacs.d/elpa/emms-3.0/jack hides ~/.emacs.d/emms/lisp/jack /Users/dim/.emacs.d/elpa/emms-3.0/emms hides ~/.emacs.d/emms/lisp/emms /Users/dim/.emacs.d/elpa/emms-3.0/emms-volume hides ~/.emacs.d/emms/lisp/emms-volume /Users/dim/.emacs.d/elpa/emms-3.0/emms-volume-amixer hides ~/.emacs.d/emms/lisp/emms-volume-amixer /Users/dim/.emacs.d/elpa/emms-3.0/emms-url hides ~/.emacs.d/emms/lisp/emms-url /Users/dim/.emacs.d/elpa/emms-3.0/emms-tag-editor hides ~/.emacs.d/emms/lisp/emms-tag-editor /Users/dim/.emacs.d/elpa/emms-3.0/emms-streams hides ~/.emacs.d/emms/lisp/emms-streams /Users/dim/.emacs.d/elpa/emms-3.0/emms-stream-info hides ~/.emacs.d/emms/lisp/emms-stream-info /Users/dim/.emacs.d/elpa/emms-3.0/emms-source-playlist hides ~/.emacs.d/emms/lisp/emms-source-playlist /Users/dim/.emacs.d/elpa/emms-3.0/emms-source-file hides ~/.emacs.d/emms/lisp/emms-source-file /Users/dim/.emacs.d/elpa/emms-3.0/emms-setup hides ~/.emacs.d/emms/lisp/emms-setup /Users/dim/.emacs.d/elpa/emms-3.0/emms-score hides ~/.emacs.d/emms/lisp/emms-score /Users/dim/.emacs.d/elpa/emms-3.0/emms-playlist-sort hides ~/.emacs.d/emms/lisp/emms-playlist-sort /Users/dim/.emacs.d/elpa/emms-3.0/emms-playlist-mode hides ~/.emacs.d/emms/lisp/emms-playlist-mode /Users/dim/.emacs.d/elpa/emms-3.0/emms-playing-time hides ~/.emacs.d/emms/lisp/emms-playing-time /Users/dim/.emacs.d/elpa/emms-3.0/emms-player-xine hides ~/.emacs.d/emms/lisp/emms-player-xine /Users/dim/.emacs.d/elpa/emms-3.0/emms-player-simple hides ~/.emacs.d/emms/lisp/emms-player-simple /Users/dim/.emacs.d/elpa/emms-3.0/emms-player-mplayer hides ~/.emacs.d/emms/lisp/emms-player-mplayer /Users/dim/.emacs.d/elpa/emms-3.0/emms-player-mpg321-remote hides ~/.emacs.d/emms/lisp/emms-player-mpg321-remote /Users/dim/.emacs.d/elpa/emms-3.0/emms-player-mpd hides ~/.emacs.d/emms/lisp/emms-player-mpd /Users/dim/.emacs.d/elpa/emms-3.0/emms-mode-line hides ~/.emacs.d/emms/lisp/emms-mode-line /Users/dim/.emacs.d/elpa/emms-3.0/emms-mode-line-icon hides ~/.emacs.d/emms/lisp/emms-mode-line-icon /Users/dim/.emacs.d/elpa/emms-3.0/emms-metaplaylist-mode hides ~/.emacs.d/emms/lisp/emms-metaplaylist-mode /Users/dim/.emacs.d/elpa/emms-3.0/emms-mark hides ~/.emacs.d/emms/lisp/emms-mark /Users/dim/.emacs.d/elpa/emms-3.0/emms-lyrics hides ~/.emacs.d/emms/lisp/emms-lyrics /Users/dim/.emacs.d/elpa/emms-3.0/emms-lastfm hides ~/.emacs.d/emms/lisp/emms-lastfm /Users/dim/.emacs.d/elpa/emms-3.0/emms-last-played hides ~/.emacs.d/emms/lisp/emms-last-played /Users/dim/.emacs.d/elpa/emms-3.0/emms-info hides ~/.emacs.d/emms/lisp/emms-info /Users/dim/.emacs.d/elpa/emms-3.0/emms-info-ogginfo hides ~/.emacs.d/emms/lisp/emms-info-ogginfo /Users/dim/.emacs.d/elpa/emms-3.0/emms-info-ogg hides ~/.emacs.d/emms/lisp/emms-info-ogg /Users/dim/.emacs.d/elpa/emms-3.0/emms-info-mp3info hides ~/.emacs.d/emms/lisp/emms-info-mp3info /Users/dim/.emacs.d/elpa/emms-3.0/emms-info-libtag hides ~/.emacs.d/emms/lisp/emms-info-libtag /Users/dim/.emacs.d/elpa/emms-3.0/emms-i18n hides ~/.emacs.d/emms/lisp/emms-i18n /Users/dim/.emacs.d/elpa/emms-3.0/emms-history hides ~/.emacs.d/emms/lisp/emms-history /Users/dim/.emacs.d/elpa/emms-3.0/emms-compat hides ~/.emacs.d/emms/lisp/emms-compat /Users/dim/.emacs.d/elpa/emms-3.0/emms-cache hides ~/.emacs.d/emms/lisp/emms-cache /Users/dim/.emacs.d/elpa/emms-3.0/emms-browser hides ~/.emacs.d/emms/lisp/emms-browser /Users/dim/.emacs.d/elpa/emms-3.0/emms-bookmarks hides ~/.emacs.d/emms/lisp/emms-bookmarks /Users/dim/.emacs.d/nxhtml/util/htmlfontify hides /Applications/Emacs.app/Contents/Resources/lisp/htmlfontify /Users/dim/.emacs.d/elpa/emms-3.0/tq hides /Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/tq /Users/dim/.emacs.d/nxhtml/util/chart hides /Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/chart Features: (shadow emacsbug flow-fill multi-isearch bbdb-hooks w3m-form w3m-symbol w3m doc-view image-mode w3m-hist w3m-fb w3m-ems w3m-ccl ccl w3m-favicon w3m-image w3m-proc w3m-util dim-switch-window bbdb-gui gnus-cite smiley ansi-color gnus-agent gnus-srvr nnvirtual gnus-async gnus-bcklg gnus-score score-mode sort gnus-ml gnus-msg tar-mode face-remap ffap gnus-topic nndoc gnus-cache nnfolder utf-7 utf7 auth-source nnimap imap nndraft nnmh bbdb-gnus bbdb-snarf mail-extr bbdb-com warnings nnnil nntp bbdb-autoloads bbdb timezone gnus-art mm-uu mml2015 epg-config mm-view smime dig gnus-sum nnoo gnus-group gnus-undo nnmail mail-source format-spec dim-gnus-imap-count gnus-start gnus-spec gnus-int gnus-range gnus-win gnus gnus-ems flyspell ispell hideshow mlinks rx nxml-uchnm rng-nxml rng-xsd xsd-regexp rng-cmpct sgml-mode nxhtml-mumamo mumamo-fun mumamo nxhtml-mode popcmp url-expand url-util url-methods url-parse url-vars rngalt rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc xmltok loadhist make-mode doc-mode sql cc-mode cc-fonts cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs python-21 python muse-colors org-wl org-w3m org-vm org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html org-exp org-exp-blocks org-agenda org-info org-gnus org-bibtex org-bbdb bitlbee conf-mode newcomment jka-compr savehist desktop dim-tels-pro dim-modes dim-org org-clock org-remember org-datetree org byte-opt bytecomp byte-compile org-footnote org-src org-list org-faces org-compat org-macs noutline outline remember org-install dim-ack browse-kill-ring tramp-multi-sshx dictionary link connection emms-cache emms-info-ogginfo emms-info-mp3info emms-info later-do emms-playlist-mode emms-player-mplayer emms-player-simple emms-source-playlist emms-source-file emms-setup emms emms-compat dim-pgsql linum w3m-load nxhtml-autoload majmodpri nxhtml-menu nxhtml-autostart rst compile asciidoc apropos dim-keys dim-previous-message dim-mailrc message ecomplete rfc822 mml mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc mm-util mail-prsvr gmm-utils mailheader canlock sha1 hex-util hashcash mail-utils dim-input-method quail help-mode view dim-google browse-url hippie-exp comint iswitchb dired-details dired-x dired-aux dired winner buffer-move windmove dim-escreen escreen dim-splits dim-rcirc dim-rcirc-log growl rcirc-late-fix rcirc-color advice help-fns advice-preload rcirc-groups rcirc time-date dim-projects dim-projects-home projects ibuf-ext dim-muse dim-muse-hack muse-context muse-journal muse-book muse-latex muse-html muse-xml-common cus-edit cus-start cus-load muse-publish muse-project muse-protocols muse-regexps muse muse-nested-tags muse-mode dim-init-macosx dim-offlineimap magit diff-mode log-edit easy-mmode pcvs-util add-log parse-time cssh derived term disp-table ehelp electric ring ibuffer pcmpl-unix pcomplete woman man assoc color-theme-emacs23-default color-theme edmacro kmacro wid-edit cl cl-19 sendmail regexp-opt dim-visual-common hl-line dim-ports dim-lib dictionary-autoloads emms-autoloads full-ack-autoloads gist-autoloads htmlize-autoloads lisppaste-autoloads magit-autoloads muse-autoloads info xml-rpc-autoloads package reporter tooltip ediff-hook vc-hooks lisp-float-type mwheel ns-win easymenu tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag 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 loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process ns multi-tty emacs) -- Dimitri Fontaine