GNU bug report logs -
#55704
29.0.50; Wishlist: Add a command to use XKB "Compose" sequences in Emacs
Previous Next
Reported by: Lars Ingebrigtsen <larsi <at> gnus.org>
Date: Sun, 29 May 2022 13:40:02 UTC
Severity: wishlist
Tags: notabug
Found in version 29.0.50
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 55704 in the body.
You can then email your comments to 55704 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#55704
; Package
emacs
.
(Sun, 29 May 2022 13:40:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Lars Ingebrigtsen <larsi <at> gnus.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 29 May 2022 13:40:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
This spins out of bug#43866.
Juri posted the code below, and Eli then made the point that we should
pre-generate this data from the two files that are being parsed.
I think that sounds like a good idea (i.e., we'd include the two files
and then have a Lisp snippet that transforms it into an .el file, as we
do with other similar data files).
And I think using `C-+' sounds fine, too.
--------
Here's is a working implementation. It binds all key sequences to the key
'C-+' that has the mnemonics of adding a character. 'C-+' is free because
it can't be used to zoom text since its counterpart key 'C--' is already
taken to input numeric arguments. 'C-+ C-+' is bound to 'insert-char'
like the current longer key sequence 'C-x 8 RET' that is hard to type.
;;; x-compose.el --- Compose input method from X11 -*- lexical-binding: t; -*-
(defvar x-compose-keymap
(let ((map (make-sparse-keymap)))
(let ((keysymdef (make-hash-table :test 'equal)))
(with-temp-buffer
(insert-file-contents "/usr/include/X11/keysymdef.h")
(while (re-search-forward "^#define XK_\\(\\S-+\\).+/\\* U\\+\\(\\w+\\)" nil t)
(puthash (match-string 1) (match-string 2) keysymdef)))
(with-temp-buffer
(insert-file-contents "/usr/share/X11/locale/en_US.UTF-8/Compose")
(while (re-search-forward "^<Multi_key> \\([^:]+\\): \"\\([^\"]+\\)\"" nil t)
(let* ((to-char (string-to-char (match-string 2)))
(from-keys (match-string 1))
(from-chars
(mapcar (lambda (s)
(if (string-match "^U\\([[:xdigit:]]+\\)" s)
(string-to-number (match-string 1 s) 16)
(string-to-number (gethash s keysymdef "0000") 16)))
(split-string from-keys "[<> \t]+" t))))
(unless (memq 0 from-chars)
(define-key map (apply 'vector from-chars) (vector to-char)))))))
map)
"Keymap for keys of the Compose input method.")
(define-key key-translation-map [(control ?+)] x-compose-keymap)
(global-set-key [(control ?+) (control ?+)] 'insert-char)
(provide 'x-compose)
;;; x-compose.el ends here
In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0)
of 2022-05-17 built on xo
Repository revision: 803041e01474f2a522170c9f388068e8460be2ae
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Debian GNU/Linux bookworm/sid
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#55704
; Package
emacs
.
(Sun, 29 May 2022 14:13:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 55704 <at> debbugs.gnu.org (full text, mbox):
[ஞாயிறு மே 29, 2022] Lars Ingebrigtsen wrote:
> This spins out of bug#43866.
>
> Juri posted the code below, and Eli then made the point that we should
> pre-generate this data from the two files that are being parsed.
>
> I think that sounds like a good idea (i.e., we'd include the two files
> and then have a Lisp snippet that transforms it into an .el file, as we
> do with other similar data files).
>
> And I think using `C-+' sounds fine, too.
>
If I'm not mistaken, isn't this already done by the compose input
method? The commentary says,
;;; Commentary:
;; This input method supports the same key sequences as defined by the
;; standard X Multi_key: https://en.wikipedia.org/wiki/Compose_key
;; You can enable this input method transiently with `C-u C-x \ compose RET'.
;; Then typing `C-x \' will enable this input method temporarily, and
;; after typing a key sequence it will be disabled. So typing
;; e.g. `C-x \ E =' will insert the Euro sign character, and disable
;; this input method automatically afterwards.
>[...]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#55704
; Package
emacs
.
(Sun, 29 May 2022 14:19:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 55704 <at> debbugs.gnu.org (full text, mbox):
Visuwesh <visuweshm <at> gmail.com> writes:
> If I'm not mistaken, isn't this already done by the compose input
> method? The commentary says,
>
> ;;; Commentary:
>
> ;; This input method supports the same key sequences as defined by the
> ;; standard X Multi_key: https://en.wikipedia.org/wiki/Compose_key
Oh, so it is.
I guess the only question is whether to parse the XKB files
automatically and possibly add the `C-+' command...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#55704
; Package
emacs
.
(Sun, 29 May 2022 16:14:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 55704 <at> debbugs.gnu.org (full text, mbox):
>> If I'm not mistaken, isn't this already done by the compose input
>> method? The commentary says,
>>
>> ;;; Commentary:
>>
>> ;; This input method supports the same key sequences as defined by the
>> ;; standard X Multi_key: https://en.wikipedia.org/wiki/Compose_key
>
> Oh, so it is.
>
> I guess the only question is whether to parse the XKB files
> automatically and possibly add the `C-+' command...
I don't see the need to parse the XKB files - they are not changed
too often. And the key was already added as `C-x \'.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#55704
; Package
emacs
.
(Sun, 29 May 2022 16:34:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 55704 <at> debbugs.gnu.org (full text, mbox):
Juri Linkov <juri <at> linkov.net> writes:
> I don't see the need to parse the XKB files - they are not changed
> too often. And the key was already added as `C-x \'.
Okidoke; I'm closing this bug report, then. 😀
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) notabug.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sun, 29 May 2022 16:34:02 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
55704 <at> debbugs.gnu.org and Lars Ingebrigtsen <larsi <at> gnus.org>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sun, 29 May 2022 16:34:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 27 Jun 2022 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 363 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.