GNU bug report logs - #58193
29.0.50; Screen flickers on with-locale-environment

Previous Next

Package: emacs;

Reported by: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>

Date: Fri, 30 Sep 2022 13:07:01 UTC

Severity: normal

Tags: moreinfo

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 58193 in the body.
You can then email your comments to 58193 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Fri, 30 Sep 2022 13:07:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 30 Sep 2022 13:07:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; Screen flickers on with-locale-environment
Date: Fri, 30 Sep 2022 15:05:34 +0200
[Message part 1 (text/plain, inline)]
Include the following code in *scratch*

(with-locale-environment "C"
  (insert (format-time-string ";; %a, %d %b %Y %H:%m:%S %z")))

Evaluate with C-c C-e and experience a screen flicker


In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.20, cairo version 1.16.0) of 2022-09-25 built on emacs29
Repository revision: d98ee767765032acc7f8f14c86dcbbfb67dbcaee
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Ubuntu 20.04.5 LTS

Configured using:
 'configure --prefix=/usr --program-suffix=29 --with-json --with-x
 --with-x-toolkit=gtk3 --with-cairo --with-compress-install
 --with-modules=yes --with-threads --with-included-regex --with-zlib
 --with-native-compilation 'CFLAGS=-g -O2
 -fdebug-prefix-map=/home/paag/emacs=. -fstack-protector-strong -Wformat
 -Werror=format-security' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'
 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG
SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM
GTK3 ZLIB

Important settings:
  value of $LC_MONETARY: es_ES.UTF-8
  value of $LC_NUMERIC: es_ES.UTF-8
  value of $LC_TIME: es_ES.UTF-8
  value of $LANG: en_GB.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-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
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date cl-loaddefs
comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra
help-mode bytecomp byte-compile cconv cl-lib rmc iso-transl tooltip
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode 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 lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine 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 emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
faces cus-face macroexp files window text-properties overlay sha1 md5
base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 78797 7326)
 (symbols 48 7139 0)
 (strings 32 19737 1932)
 (string-bytes 1 573331)
 (vectors 16 15678)
 (vector-slots 8 321210 11742)
 (floats 8 29 58)
 (intervals 56 402 1)
 (buffers 1000 12))

-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Fri, 30 Sep 2022 13:51:02 GMT) Full text and rfc822 format available.

Message #8 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Cc: 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Fri, 30 Sep 2022 16:50:19 +0300
> From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
> Date: Fri, 30 Sep 2022 15:05:34 +0200
> 
> Include the following code in *scratch*
> 
> (with-locale-environment "C"
>   (insert (format-time-string ";; %a, %d %b %Y %H:%m:%S %z")))
> 
> Evaluate with C-c C-e and experience a screen flicker

with-locale-environment calls set-terminal-coding-system, which calls
redraw-frame.  That's the reason you see the flicker.

I see no bug here, FWIW.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Fri, 30 Sep 2022 14:15:02 GMT) Full text and rfc822 format available.

Message #11 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Cc: 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Fri, 30 Sep 2022 16:14:49 +0200
Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com> writes:

> Include the following code in *scratch*
>
> (with-locale-environment "C"
>   (insert (format-time-string ";; %a, %d %b %Y %H:%m:%S %z")))
>
> Evaluate with C-c C-e and experience a screen flicker

I think I've now fixed this -- can you test?  (I don't see the flicker
myself.)




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 30 Sep 2022 14:16:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Fri, 30 Sep 2022 15:44:01 GMT) Full text and rfc822 format available.

Message #16 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Fri, 30 Sep 2022 17:43:01 +0200
[Message part 1 (text/plain, inline)]
It doesn't flicker... but it doesn't seem to change the locale either...
I tried

(message

 (with-locale-environment "es_ES.utf8"

   (format-time-string ";; %a, %d %b %Y %H:%m:%S %z")))

and

(message

 (with-locale-environment "C"

   (format-time-string ";; %a, %d %b %Y %H:%m:%S %z")))

And in both cases I get the "C" locale :(
Before the strings were correctly generated

Thanks for the patience, /PA

On Fri, 30 Sept 2022 at 16:14, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com> writes:
>
> > Include the following code in *scratch*
> >
> > (with-locale-environment "C"
> >   (insert (format-time-string ";; %a, %d %b %Y %H:%m:%S %z")))
> >
> > Evaluate with C-c C-e and experience a screen flicker
>
> I think I've now fixed this -- can you test?  (I don't see the flicker
> myself.)
>


-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Fri, 30 Sep 2022 16:32:01 GMT) Full text and rfc822 format available.

Message #19 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Cc: 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Fri, 30 Sep 2022 18:31:36 +0200
Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com> writes:

> It doesn't flicker... but it doesn't seem to change the locale either... 
> I tried
>
> (message                                                                     
>  (with-locale-environment "es_ES.utf8"                                                
>    (format-time-string ";; %a, %d %b %Y %H:%m:%S %z"))) 
>
> and
>
> (message                                                                     
>  (with-locale-environment "C"                                                
>    (format-time-string ";; %a, %d %b %Y %H:%m:%S %z"))) 
>
> And in both cases I get the "C" locale :(
> Before the strings were correctly generated

Does

(message                                                                     
 (with-locale-environment "es_ES.UTF-8"
   (format-time-string ";; %a, %d %b %Y %H:%m:%S %z"))) 

work better?  If not, do you have the "es_ES.UTF-8" locale in your
environment?

In any case, with this recipe (i.e., the `message' around the
`with-locale--' I can reproduce the flashing, even after the fix.  :-/
But I get

;; vie, 30 sep 2022 18:09:18 +0200




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Fri, 30 Sep 2022 17:33:01 GMT) Full text and rfc822 format available.

Message #22 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 58193 <at> debbugs.gnu.org, paaguti <at> gmail.com
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Fri, 30 Sep 2022 20:31:37 +0300
> Cc: 58193 <at> debbugs.gnu.org
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Fri, 30 Sep 2022 16:14:49 +0200
> 
> Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com> writes:
> 
> > Include the following code in *scratch*
> >
> > (with-locale-environment "C"
> >   (insert (format-time-string ";; %a, %d %b %Y %H:%m:%S %z")))
> >
> > Evaluate with C-c C-e and experience a screen flicker
> 
> I think I've now fixed this -- can you test?  (I don't see the flicker
> myself.)

I'd rather leave the decision whether to redraw or not to the caller.
I don't see how we can safely assume that the caller never wants to
actually use the locale's settings for something display-oriented.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Fri, 30 Sep 2022 17:35:01 GMT) Full text and rfc822 format available.

Message #25 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 58193 <at> debbugs.gnu.org, paaguti <at> gmail.com
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Fri, 30 Sep 2022 19:34:17 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> I'd rather leave the decision whether to redraw or not to the caller.
> I don't see how we can safely assume that the caller never wants to
> actually use the locale's settings for something display-oriented.

That's what this does.  If the caller wants to redraw, the caller should
call `redraw-frame' in the body of that macro.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Fri, 30 Sep 2022 17:42:02 GMT) Full text and rfc822 format available.

Message #28 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 58193 <at> debbugs.gnu.org, paaguti <at> gmail.com
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Fri, 30 Sep 2022 20:40:38 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: paaguti <at> gmail.com,  58193 <at> debbugs.gnu.org
> Date: Fri, 30 Sep 2022 19:34:17 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > I'd rather leave the decision whether to redraw or not to the caller.
> > I don't see how we can safely assume that the caller never wants to
> > actually use the locale's settings for something display-oriented.
> 
> That's what this does.  If the caller wants to redraw, the caller should
> call `redraw-frame' in the body of that macro.

IMO, that assumes to much knowledge on the part of the caller.  I'd
prefer a variable that would tell the macro that the body does include
display.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Fri, 30 Sep 2022 17:44:01 GMT) Full text and rfc822 format available.

Message #31 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 58193 <at> debbugs.gnu.org, paaguti <at> gmail.com
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Fri, 30 Sep 2022 19:43:11 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> IMO, that assumes to much knowledge on the part of the caller.  I'd
> prefer a variable that would tell the macro that the body does include
> display.

It's a macro that changes the locale.  It doesn't say anything about
doing redisplay at all, so anybody that wants to do redisplay (for
whatever reason) will use the normal ways of doing that.

I.e., there's no particular knowledge needed.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Fri, 30 Sep 2022 18:36:02 GMT) Full text and rfc822 format available.

Message #34 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 58193 <at> debbugs.gnu.org, paaguti <at> gmail.com
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Fri, 30 Sep 2022 21:34:43 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: paaguti <at> gmail.com,  58193 <at> debbugs.gnu.org
> Date: Fri, 30 Sep 2022 19:43:11 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > IMO, that assumes to much knowledge on the part of the caller.  I'd
> > prefer a variable that would tell the macro that the body does include
> > display.
> 
> It's a macro that changes the locale.  It doesn't say anything about
> doing redisplay at all, so anybody that wants to do redisplay (for
> whatever reason) will use the normal ways of doing that.
> 
> I.e., there's no particular knowledge needed.

Many Lisp programmers don't realize what the macro does, in enough
detail to understand that it might affect the display.  Suppressing
redrawing of the frame by default is IMO the wrong default: the
flicker in case redrawing wasn't needed is just an annoyance, whereas
failure to redraw when it is needed is a much more serious problem.

So if we want to make the caller responsible for whether the frame
should be redrawn, the default should to redraw it, and callers that
want to avoid that would need to take some measures to that end.
Which is the opposite of what we have now.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Sat, 01 Oct 2022 06:16:01 GMT) Full text and rfc822 format available.

Message #37 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Sat, 1 Oct 2022 08:14:36 +0200
[Message part 1 (text/plain, inline)]
Hi Eli, Lars

I fear in my case it's the other way round. IMHO, I think I have a minimal
clue of what it does ;-)
Let me expand a bit:

My use case is that of a multi-lingual writer/programmer who needs the date
to appear in the language used in the text which is currently being edited.
My default locale is "C" because it fits my needs when programming, but
then I also produce 'text documents' (.tex, .org, .md, .txt) in 3-4
languages.
I'm lucky, because most of "my multi-linguality" can be handled by changing
ispell-dictionary and with \date in LaTEX. But in a couple of
cases, I need the date to appear 'burnt in fire' in the text.

My questioning the way with-locale-environment works comes from my use
case.
I need the date to adhere to a 'temporary' locale which only needs to be
valid when I generate a string that I then insert into the buffer.
And to have the screen flickering because I have generated a string is not
a 'nice' UI design principle IMvvHO.

Maybe we should leave this macro as-is because of the legacy and work
towards something in the line of the cl-setlocale function in Common LISP.
If you look at 'man setlocale' as an inspiration of what I would be
dreaming of...

My .001 c, /PA

On Fri, 30 Sept 2022 at 20:34, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Lars Ingebrigtsen <larsi <at> gnus.org>
> > Cc: paaguti <at> gmail.com,  58193 <at> debbugs.gnu.org
> > Date: Fri, 30 Sep 2022 19:43:11 +0200
> >
> > Eli Zaretskii <eliz <at> gnu.org> writes:
> >
> > > IMO, that assumes to much knowledge on the part of the caller.  I'd
> > > prefer a variable that would tell the macro that the body does include
> > > display.
> >
> > It's a macro that changes the locale.  It doesn't say anything about
> > doing redisplay at all, so anybody that wants to do redisplay (for
> > whatever reason) will use the normal ways of doing that.
> >
> > I.e., there's no particular knowledge needed.
>
> Many Lisp programmers don't realize what the macro does, in enough
> detail to understand that it might affect the display.  Suppressing
> redrawing of the frame by default is IMO the wrong default: the
> flicker in case redrawing wasn't needed is just an annoyance, whereas
> failure to redraw when it is needed is a much more serious problem.
>
> So if we want to make the caller responsible for whether the frame
> should be redrawn, the default should to redraw it, and callers that
> want to avoid that would need to take some measures to that end.
> Which is the opposite of what we have now.
>


-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Sat, 01 Oct 2022 07:11:02 GMT) Full text and rfc822 format available.

Message #40 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Cc: larsi <at> gnus.org, 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Sat, 01 Oct 2022 10:10:03 +0300
> From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
> Date: Sat, 1 Oct 2022 08:14:36 +0200
> Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 58193 <at> debbugs.gnu.org
> 
> I fear in my case it's the other way round. IMHO, I think I have a minimal clue of what it does ;-)
> Let me expand a bit:
> 
> My use case is that of a multi-lingual writer/programmer who needs the date to appear in the language used
> in the text which is currently being edited. 
> My default locale is "C" because it fits my needs when programming, but then I also produce 'text
> documents' (.tex, .org, .md, .txt) in 3-4 languages.
> I'm lucky, because most of "my multi-linguality" can be handled by changing ispell-dictionary and with \date in
> LaTEX. But in a couple of
> cases, I need the date to appear 'burnt in fire' in the text.
> 
> My questioning the way with-locale-environment works comes from my use case. 
> I need the date to adhere to a 'temporary' locale which only needs to be valid when I generate a string that I
> then insert into the buffer. 
> And to have the screen flickering because I have generated a string is not a 'nice' UI design principle
> IMvvHO.

I understand your use case.  I'm arguing about the default, not about
the need to support your use case.  The default should be to redraw
the frame, and your use case should be supported by having some
variable that you could bind around the call of the macro, to prevent
redrawing.

> Maybe we should leave this macro as-is because of the legacy and work towards something in the line of the
> cl-setlocale function in Common LISP.

Common Lisp is just a programming language, it is not a display
editor.  In Emacs, certain operations that affect the display should
be immediately reflected on display.

> If you look at 'man setlocale' as an inspiration of what I would be dreaming of...

setlocale is a low-level function that is called by Emacs as part of
this macro.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Sat, 01 Oct 2022 07:24:02 GMT) Full text and rfc822 format available.

Message #43 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Sat, 1 Oct 2022 09:23:12 +0200
[Message part 1 (text/plain, inline)]
On Sat, 1 Oct 2022 at 09:10, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
> > Date: Sat, 1 Oct 2022 08:14:36 +0200
> > Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 58193 <at> debbugs.gnu.org
>
> I understand your use case.  I'm arguing about the default, not about
> the need to support your use case.  The default should be to redraw
> the frame, and your use case should be supported by having some
> variable that you could bind around the call of the macro, to prevent
> redrawing.
>

Good, I could live with that


> > Maybe we should leave this macro as-is because of the legacy and work
> towards something in the line of the
> > cl-setlocale function in Common LISP.
>
> Common Lisp is just a programming language, it is not a display
> editor.  In Emacs, certain operations that affect the display should
> be immediately reflected on display.
>

So, one implication of my question is whether all operations that need a
specific locale to be set need the display redrawn...

> If you look at 'man setlocale' as an inspiration of what I would be
> dreaming of...
>
> setlocale is a low-level function that is called by Emacs as part of
> this macro.


I know, and I was wondering if we could create an Elisp construct that
*only* uses setlocate if we are sure that we do not need to redraw the
screen

I think we are approaching 'violent agreement' :-)

Thx, /PA


-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Sat, 01 Oct 2022 07:28:02 GMT) Full text and rfc822 format available.

Message #46 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, 58193 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Sat, 1 Oct 2022 09:26:28 +0200
[Message part 1 (text/plain, inline)]
That seems to work. And I don't see any flicker on a text mode screen
(inside a VM)...
checking on a graphic screen I do see the flickering :( but it works.

Yesterday was a long day ...
Best, /PA

On Fri, 30 Sept 2022 at 18:31, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com> writes:
>
> > It doesn't flicker... but it doesn't seem to change the locale either...
> > I tried
> >
> > (message
>
> >  (with-locale-environment "es_ES.utf8"
>
> >    (format-time-string ";; %a, %d %b %Y %H:%m:%S %z")))
> >
> > and
> >
> > (message
>
> >  (with-locale-environment "C"
>
> >    (format-time-string ";; %a, %d %b %Y %H:%m:%S %z")))
> >
> > And in both cases I get the "C" locale :(
> > Before the strings were correctly generated
>
> Does
>
> (message
>
>  (with-locale-environment "es_ES.UTF-8"
>    (format-time-string ";; %a, %d %b %Y %H:%m:%S %z")))
>
> work better?  If not, do you have the "es_ES.UTF-8" locale in your
> environment?
>
> In any case, with this recipe (i.e., the `message' around the
> `with-locale--' I can reproduce the flashing, even after the fix.  :-/
> But I get
>
> ;; vie, 30 sep 2022 18:09:18 +0200
>


-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Sat, 01 Oct 2022 07:34:02 GMT) Full text and rfc822 format available.

Message #49 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Cc: larsi <at> gnus.org, 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Sat, 01 Oct 2022 10:33:07 +0300
> From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
> Date: Sat, 1 Oct 2022 09:23:12 +0200
> Cc: larsi <at> gnus.org, 58193 <at> debbugs.gnu.org
> 
>  > Maybe we should leave this macro as-is because of the legacy and work towards something in the
>  line of the
>  > cl-setlocale function in Common LISP.
> 
>  Common Lisp is just a programming language, it is not a display
>  editor.  In Emacs, certain operations that affect the display should
>  be immediately reflected on display.
> 
> So, one implication of my question is whether all operations that need a specific locale to be set need the
> display redrawn... 

If all you want is to have time displayed per a certain locale's
conventions, maybe it's enough to set system-time-locale?  Did you try
that?  set-locale-environment (which is what with-locale-environment
uses) does much more than just adjusts the locale's time format.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Sat, 01 Oct 2022 08:20:01 GMT) Full text and rfc822 format available.

Message #52 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Sat, 1 Oct 2022 10:19:19 +0200
Eli
This is just an example. But there are other… currency being one of them.
Best /PA

Enviado desde mi iPhone

> El 1 oct 2022, a las 9:33, Eli Zaretskii <eliz <at> gnu.org> escribió:
> 
> 
>> 
>> From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
>> Date: Sat, 1 Oct 2022 09:23:12 +0200
>> Cc: larsi <at> gnus.org, 58193 <at> debbugs.gnu.org
>> 
>>> Maybe we should leave this macro as-is because of the legacy and work towards something in the
>> line of the
>>> cl-setlocale function in Common LISP.
>> 
>> Common Lisp is just a programming language, it is not a display
>> editor.  In Emacs, certain operations that affect the display should
>> be immediately reflected on display.
>> 
>> So, one implication of my question is whether all operations that need a specific locale to be set need the
>> display redrawn... 
> 
> If all you want is to have time displayed per a certain locale's
> conventions, maybe it's enough to set system-time-locale?  Did you try
> that?  set-locale-environment (which is what with-locale-environment
> uses) does much more than just adjusts the locale's time format.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Sat, 01 Oct 2022 09:11:02 GMT) Full text and rfc822 format available.

Message #55 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Cc: larsi <at> gnus.org, 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Sat, 01 Oct 2022 12:10:39 +0300
> From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
> Date: Sat, 1 Oct 2022 10:19:19 +0200
> Cc: larsi <at> gnus.org, 58193 <at> debbugs.gnu.org
> 
> Eli
> This is just an example. But there are other… currency being one of them.

For each example its solution.  For currency, I don't think Emacs
currently have any solution, and with-locale-environment would not
help you for that reason.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Sat, 01 Oct 2022 09:57:02 GMT) Full text and rfc822 format available.

Message #58 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 58193 <at> debbugs.gnu.org, paaguti <at> gmail.com
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Sat, 01 Oct 2022 11:56:00 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> Many Lisp programmers don't realize what the macro does, in enough
> detail to understand that it might affect the display.

I added this macro about a month ago, and I did not have redisplay in
mind -- redisplay is as irrelevant to this macro as it is to macros like
`when-let'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Sat, 01 Oct 2022 09:58:01 GMT) Full text and rfc822 format available.

Message #61 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 58193 <at> debbugs.gnu.org, paaguti <at> gmail.com
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Sat, 01 Oct 2022 11:57:03 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I added this macro about a month ago

I mean, a year and a month ago.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Sat, 01 Oct 2022 09:58:02 GMT) Full text and rfc822 format available.

Message #64 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Sat, 01 Oct 2022 11:57:41 +0200
Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com> writes:

> That seems to work. And I don't see any flicker on a text mode screen
> (inside a VM)...  checking on a graphic screen I do see the flickering
> :( but it works.

Do you still see flickering on the current trunk (I pushed some
additional fixes after the first one).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Sat, 01 Oct 2022 10:03:02 GMT) Full text and rfc822 format available.

Message #67 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 58193 <at> debbugs.gnu.org, paaguti <at> gmail.com
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Sat, 01 Oct 2022 13:01:48 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: paaguti <at> gmail.com,  58193 <at> debbugs.gnu.org
> Date: Sat, 01 Oct 2022 11:56:00 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Many Lisp programmers don't realize what the macro does, in enough
> > detail to understand that it might affect the display.
> 
> I added this macro about a month ago, and I did not have redisplay in
> mind -- redisplay is as irrelevant to this macro as it is to macros like
> `when-let'.

Fair enough, but if this macro is not intended for BODYs that include
visual appearance, the restriction should be mentioned in the doc
string, I think.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Sat, 01 Oct 2022 10:13:02 GMT) Full text and rfc822 format available.

Message #70 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Sat, 1 Oct 2022 12:12:13 +0200
[Message part 1 (text/plain, inline)]
@ Eli, +1
@ Lars I'll test and let you know

/PA

On Sat, 1 Oct 2022 at 12:02, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Lars Ingebrigtsen <larsi <at> gnus.org>
> > Cc: paaguti <at> gmail.com,  58193 <at> debbugs.gnu.org
> > Date: Sat, 01 Oct 2022 11:56:00 +0200
> >
> > Eli Zaretskii <eliz <at> gnu.org> writes:
> >
> > > Many Lisp programmers don't realize what the macro does, in enough
> > > detail to understand that it might affect the display.
> >
> > I added this macro about a month ago, and I did not have redisplay in
> > mind -- redisplay is as irrelevant to this macro as it is to macros like
> > `when-let'.
>
> Fair enough, but if this macro is not intended for BODYs that include
> visual appearance, the restriction should be mentioned in the doc
> string, I think.
>


-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Sat, 01 Oct 2022 10:48:02 GMT) Full text and rfc822 format available.

Message #73 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Sat, 1 Oct 2022 12:46:56 +0200
[Message part 1 (text/plain, inline)]
Thanks for the idea...I came up with a macro that mimics
with-locale-environment (because it is heavily based on it):

(defmacro with-time-locale (locale-name &rest body)
    (declare (indent 1) (debug (sexp def-body)))
    (let ((current (gensym)))
      `(let ((,current system-time-locale))
       (unwind-protect
           (progn
             (setq system-time-locale ,locale-name)
             ,@body)
         (setq system-time-locale ,current)))))

With a quick test that seems to produce what I want:

(with-time-locale "C"
  (message (format "%s -> %s" system-time-locale (format-time-string "%d %b
%Y"))))
(with-time-locale "it_IT.UTF8"
  (message (format "%s -> %s" system-time-locale (format-time-string "%d %b
%Y"))))
(message (format "%s -> %s" system-time-locale (format-time-string "%d %b
%Y")))

And no flickers...

Would that be something to contribute to Emacs ?

Best, /PA

On Sat, 1 Oct 2022 at 09:33, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
> > Date: Sat, 1 Oct 2022 09:23:12 +0200
> > Cc: larsi <at> gnus.org, 58193 <at> debbugs.gnu.org
> >
> >  > Maybe we should leave this macro as-is because of the legacy and work
> towards something in the
> >  line of the
> >  > cl-setlocale function in Common LISP.
> >
> >  Common Lisp is just a programming language, it is not a display
> >  editor.  In Emacs, certain operations that affect the display should
> >  be immediately reflected on display.
> >
> > So, one implication of my question is whether all operations that need a
> specific locale to be set need the
> > display redrawn...
>
> If all you want is to have time displayed per a certain locale's
> conventions, maybe it's enough to set system-time-locale?  Did you try
> that?  set-locale-environment (which is what with-locale-environment
> uses) does much more than just adjusts the locale's time format.
>


-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Sat, 01 Oct 2022 12:06:01 GMT) Full text and rfc822 format available.

Message #76 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Sat, 01 Oct 2022 14:05:26 +0200
Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com> writes:

> And no flickers...
>
> Would that be something to contribute to Emacs ?

There should be no flickers with with-locale-environment, either, so it
seems redundant.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Sat, 01 Oct 2022 13:34:01 GMT) Full text and rfc822 format available.

Message #79 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Sat, 1 Oct 2022 15:33:05 +0200
[Message part 1 (text/plain, inline)]
And, at least in my initial test it doesn't

Thanks,
/PA

On Sat, 1 Oct 2022 at 14:05, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com> writes:
>
> > And no flickers...
> >
> > Would that be something to contribute to Emacs ?
>
> There should be no flickers with with-locale-environment, either, so it
> seems redundant.
>


-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Sun, 02 Oct 2022 12:02:01 GMT) Full text and rfc822 format available.

Message #82 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 58193 <at> debbugs.gnu.org, paaguti <at> gmail.com
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Sun, 02 Oct 2022 13:57:58 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> Fair enough, but if this macro is not intended for BODYs that include
> visual appearance, the restriction should be mentioned in the doc
> string, I think.

It's a macro that sets the locale, evaluates the body, and restores the
previous locale.  I can't for the life of me understand why somebody
would think that it has something to do with the visual appearance of
anything, one way or another.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Sun, 02 Oct 2022 12:03:01 GMT) Full text and rfc822 format available.

Message #85 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Sun, 02 Oct 2022 13:58:42 +0200
Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com> writes:

> And, at least in my initial test it doesn't 

[...]

>  There should be no flickers with with-locale-environment, either, so it
>  seems redundant.

Does this mean that `with-locale-environment' doesn't flicker the screen
for you any more?  I'm not sure how to parse that response...




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Mon, 03 Oct 2022 05:39:01 GMT) Full text and rfc822 format available.

Message #88 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Mon, 3 Oct 2022 07:37:56 +0200
[Message part 1 (text/plain, inline)]
Sorry for the "telegram" ;-)

I have been working all day yesterday using my functions using
'with-locale-environment' and I didn't experience any flicker.
On that side good. On the other hand, I still think that a macro only
controlling the system-locale for the time functions may be useful despite,
I admit, being somehow redundant. My feeling is that many of the settings
changed in with-locale-environment don't need to be changed for
format-time-string.

Digression: What about adding a third (optional) parameter to
format-time-string to set the locale for a specific call? This could be an
alternative which might be more-lightweight than with-locale-environment,
wouldn't it?

Best, /PA

On Sun, 2 Oct 2022 at 14:00, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com> writes:
>
> > And, at least in my initial test it doesn't
>
> [...]
>
> >  There should be no flickers with with-locale-environment, either, so it
> >  seems redundant.
>
> Does this mean that `with-locale-environment' doesn't flicker the screen
> for you any more?  I'm not sure how to parse that response...
>


-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Mon, 03 Oct 2022 09:04:02 GMT) Full text and rfc822 format available.

Message #91 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Mon, 03 Oct 2022 11:03:32 +0200
Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com> writes:

> I have been working all day yesterday using my functions using
> 'with-locale-environment' and I didn't experience any flicker. 

OK; closing this bug report.

> On that side good. On the other hand, I still think that a macro only controlling the
> system-locale for the time functions may be useful despite, I admit, being somehow
> redundant. My feeling is that many of the settings changed in
> with-locale-environment don't need to be changed for format-time-string. 

I don't think there's much need for finer granularity here.

> Digression: What about adding a third (optional) parameter to
> format-time-string to set the locale for a specific call? This could
> be an alternative which might be more-lightweight than
> with-locale-environment, wouldn't it?

It would still have to change the locale, so it wouldn't be more
lightweight.




bug marked as fixed in version 29.1, send any further explanations to 58193 <at> debbugs.gnu.org and Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 03 Oct 2022 09:04:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Mon, 03 Oct 2022 16:39:01 GMT) Full text and rfc822 format available.

Message #96 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Cc: larsi <at> gnus.org, 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Mon, 03 Oct 2022 19:38:28 +0300
> From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
> Date: Mon, 3 Oct 2022 07:37:56 +0200
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 58193 <at> debbugs.gnu.org
> 
> On that side good. On the other hand, I still think that a macro only controlling the system-locale for the time
> functions may be useful despite, I admit, being somehow redundant. My feeling is that many of the settings
> changed in with-locale-environment don't need to be changed for format-time-string. 

What's wrong with

  (let ((system-time-local SOME-LOCALE))
     DO-SOMETHING)

> Digression: What about adding a third (optional) parameter to format-time-string to set the locale for a
> specific call?

How is that different from

   (let ((system-time-local SOME-LOCALE))
     (format-time-string ....))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Mon, 03 Oct 2022 16:49:01 GMT) Full text and rfc822 format available.

Message #99 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Mon, 3 Oct 2022 18:47:45 +0200
[Message part 1 (text/plain, inline)]
HI Eli,

there's nothing wrong, really. The thing is that you may want to change it
just for one call of format-time-string
(or at least I wanted it) without having to change it permanently.

BTW am I missing something .. would your let just change the value of
system-time-locale in the body of the let and then restore it to its
original value?

/PA

Best, /PA

On Mon, 3 Oct 2022 at 18:38, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
> > Date: Mon, 3 Oct 2022 07:37:56 +0200
> > Cc: Eli Zaretskii <eliz <at> gnu.org>, 58193 <at> debbugs.gnu.org
> >
> > On that side good. On the other hand, I still think that a macro only
> controlling the system-locale for the time
> > functions may be useful despite, I admit, being somehow redundant. My
> feeling is that many of the settings
> > changed in with-locale-environment don't need to be changed for
> format-time-string.
>
> What's wrong with
>
>   (let ((system-time-local SOME-LOCALE))
>      DO-SOMETHING)
>
> > Digression: What about adding a third (optional) parameter to
> format-time-string to set the locale for a
> > specific call?
>
> How is that different from
>
>    (let ((system-time-local SOME-LOCALE))
>      (format-time-string ....))
>
>

-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Mon, 03 Oct 2022 17:32:02 GMT) Full text and rfc822 format available.

Message #102 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Cc: larsi <at> gnus.org, 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Mon, 03 Oct 2022 20:30:55 +0300
> From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
> Date: Mon, 3 Oct 2022 18:47:45 +0200
> Cc: larsi <at> gnus.org, 58193 <at> debbugs.gnu.org
> 
> BTW am I missing something .. would your let just change the value of system-time-locale in the body of the
> let and then restore it to its original value?

Yes, that's the general feature of let-binding.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58193; Package emacs. (Tue, 04 Oct 2022 06:12:01 GMT) Full text and rfc822 format available.

Message #105 received at 58193 <at> debbugs.gnu.org (full text, mbox):

From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, 58193 <at> debbugs.gnu.org
Subject: Re: bug#58193: 29.0.50; Screen flickers on with-locale-environment
Date: Tue, 4 Oct 2022 08:10:57 +0200
[Message part 1 (text/plain, inline)]
Hmmm.... that is not what I understand from 3.6 in the Introduction to
Emacs Lisp Programming.
If you read the section, it talks about 'local variables'.
Depending on you programming background, local may be different from
local...
I have always understood local as variable that has a meaning within a
context and if I happen to use the name of a global variable that is used
in the system, then bad luck. It would be nice to say that when you put a
variable like system-time-locale in a let, the global variable's value is
'pushed' and will be recovered once you leave the let-binding. Just to make
sure there is no misunderstanding.

I'll try to see how to tackle this in the elisp Introduction and will
propose a patch.

Anyhow, better late than never :-) that's what I like, always learning
something new.

Best, /PA

On Mon, 3 Oct 2022 at 19:31, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
> > Date: Mon, 3 Oct 2022 18:47:45 +0200
> > Cc: larsi <at> gnus.org, 58193 <at> debbugs.gnu.org
> >
> > BTW am I missing something .. would your let just change the value of
> system-time-locale in the body of the
> > let and then restore it to its original value?
>
> Yes, that's the general feature of let-binding.
>


-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 01 Nov 2022 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 283 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.