all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* display/encoding issue from python-code
@ 2024-08-12 12:45 Andreas Röhler
  2024-08-12 13:03 ` Stephen Berman
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Röhler @ 2024-08-12 12:45 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

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

Hi,

got a display and encoding issue from some python-code:

day = [
     r'\d{2}',    #  "DD"
]

In a plain python-file all seems fine.

See attached align-day.py

But, check with the following snippet:

(defun my-test()
   (interactive)
   (set-buffer (get-buffer-create "my-test-buffer"))
   (switch-to-buffer (current-buffer))
   (python-mode)
   (insert "day = [
     r'\d{2}',    #  \"DD\"
]"))

In my-test-buffer instead of

r'\d

appears

r'^?

See attached my-test.png

Not only that it looks strange, ‘\d’ now seems to count as one character 
in buffer, so ‘string-match’ for example doesn't return the correct 
position any more.

Setting ‘buffer-file-coding-system’ to ‘utf-8-unix’ explicitly didn't help.

Any suggestion?

Thanks,
Andreas

GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, 
cairo version 1.16.0) of 2024-08-12

[-- Attachment #2: align-day.py --]
[-- Type: text/x-python, Size: 35 bytes --]

day = [
    r'\d{2}'    #  "DD" 
]

[-- Attachment #3: my-test.png --]
[-- Type: image/png, Size: 123187 bytes --]

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

end of thread, other threads:[~2024-08-12 18:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-12 12:45 display/encoding issue from python-code Andreas Röhler
2024-08-12 13:03 ` Stephen Berman
2024-08-12 18:22   ` Andreas Röhler

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.