From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= Newsgroups: gmane.emacs.devel Subject: Re: Entering emojis Date: Fri, 29 Oct 2021 17:30:38 +0200 Message-ID: <87pmrnc0gx.fsf@gmail.com> References: <87cznths5j.fsf@gnus.org> <87ee87cwju.fsf@gnus.org> <83sfwmwubd.fsf@gnu.org> <875ytid54b.fsf@gnus.org> <877ddx5j9k.fsf@gmail.com> <878ryd5j5c.fsf@gnus.org> <874k915igp.fsf@gnus.org> <87y26d42qf.fsf@gmail.com> <87mtmt42lf.fsf@gnus.org> <87o87941ae.fsf@gmail.com> <87h7d03jvz.fsf@gnus.org> <87pmroi3b2.fsf@gmail.com> <87sfwkyodq.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10444"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Oct 29 17:32:36 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mgTrw-0002Yg-7J for ged-emacs-devel@m.gmane-mx.org; Fri, 29 Oct 2021 17:32:36 +0200 Original-Received: from localhost ([::1]:37962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgTru-0003oQ-KO for ged-emacs-devel@m.gmane-mx.org; Fri, 29 Oct 2021 11:32:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgTqA-0002Ic-2d for emacs-devel@gnu.org; Fri, 29 Oct 2021 11:30:46 -0400 Original-Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:39784) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgTq6-00088G-Oj for emacs-devel@gnu.org; Fri, 29 Oct 2021 11:30:45 -0400 Original-Received: by mail-wm1-x329.google.com with SMTP id b2-20020a1c8002000000b0032fb900951eso4647777wmd.4 for ; Fri, 29 Oct 2021 08:30:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Pfu12d9b2f60mwrhFYcdRh7V2A/sCZDmhR+FJZgJPnA=; b=hP2eNueIwXfFWVk2fMMmDK59OEg/1fgUxyzQFefnJcx8a4YZCwpcuzKoOMRP4MPIyj 4/S6HDvsMcwWMgbkm+4KgLROhuc3ZuuF4oRufljpmvxn42pi0DZ5w0wvmtrzNkq4lvpD KBYH+FbrAkM05jR4DX3ALytBDHlPIloIwJProtjn81fZGbfGcrO/m60xx/Zrpgu06Lnx eMYFgXc6Us3bbrQCluYpTo84lMHXBTlCbhLKBjEbbEvti+pONsCQUoTALwU0VLyscv9Y WJktFfIZ3TNaKaQsMVGL4R0UaKSH3npVitbSjnPTTp1YenIgiuHIEysHnZUEez7fU+bQ 0HsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Pfu12d9b2f60mwrhFYcdRh7V2A/sCZDmhR+FJZgJPnA=; b=v9bXA5DvQCmNbtSKFsAaRY5wIzTOLujhMhCUlKJooqaLX4uAlTVQtih45XMFe6dnTY O+WuO3+GSOA89fPCH0cXylsNrxIQFxcJC1ZMylIo0DFUMppHjyst1UKEYsKlIMrDguDx MEaXfqLxsflFOWPgoGIHbuewQw+sR82HgAtqNqsFClOXu1hyRcgIUuWugU8rsWX3j+U8 72mwvne41La5y45oaCBbpPC8XYzITe1wWaM2VGo6+ASUMA1LmC9FZkdGfFQRMmh2KZmX Wprz5d0v4evoP3wXceAJ+M740n7b1g8jyPoLaONXphnvI0Zr3T9dlwfHrtQ7WQwCkKKe n1Iw== X-Gm-Message-State: AOAM532H4oludQVGxTt5E4/WF/Aw7qQOTU1EQq7Fh3IzkEDMIkGvJCyT Q6ADpvcoOLFz0w6nkX/ml8E7+rTNgi0= X-Google-Smtp-Source: ABdhPJxET40jhjCm804YFBzaRerfHffC6frQQ8PPyQXD+ZHQqLpB7jNBg3bQy2K6f8AGYhxv1RUlgA== X-Received: by 2002:a05:600c:cd:: with SMTP id u13mr19940379wmm.162.1635521440539; Fri, 29 Oct 2021 08:30:40 -0700 (PDT) Original-Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49]) by smtp.gmail.com with ESMTPSA id s3sm8877106wmh.30.2021.10.29.08.30.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Oct 2021 08:30:39 -0700 (PDT) In-Reply-To: <87sfwkyodq.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 29 Oct 2021 15:03:13 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=kevin.legouguec@gmail.com; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:278201 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Lars Ingebrigtsen writes: > K=C3=A9vin Le Gouguec writes: > >> OK, see attached. With M-x emoji-pick, you can now >> >> - hit "-s" to pick your favourite skin tone, >> - hit "C-x C-s" to save it (to ~/.emacs.d/transient/values.el), >> - insert emoji, >> - on subsequent M-x emoji-pick, you no longer need to pick a skin tone, >> - you can still hit "-s" occasionally to unset the tone, and a second >> time to pick a different one, >> - you get minibuffer history with M-p. > > Oh, that sounds pretty nice... Yes, and pretty orthogonal to emoji-recent AFAICT: saving the transient argument allows it to be applied by default for emoji that you haven't used yet. >> Note that I have never written transients in my life before (not with >> that level of complexity anyway), so I'm sure my implementation is all >> manners of uncouth. > > Unfortunately, it doesn't seem to work. I just get > > transient-infix-read: Lisp nesting exceeds =E2=80=98max-lisp-eval-depth= =E2=80=99 > > when evalling (emoji-pick:--skin-tone). Mmm. I've tweaked the file; with the tip of the master branch (2021-10-29 "Add some gnus-short-group-name tests" (8ada213b87)), things seem to work on my end? I'm starting Emacs with emacs -Q -l transient-arguments.el then hitting M-x emoji-pick. --=-=-= Content-Type: text/x-emacs-lisp; charset=utf-8 Content-Disposition: attachment; filename=transient-arguments.el Content-Transfer-Encoding: quoted-printable (require 'transient) (defun emoji-pick-read-affixation (names) (mapcar (lambda (name) (list name (char-to-string (char-from-name (concat "EMOJI MODIFIER FITZPATRICK TYPE-" name))))) names)) (defun emoji-pick-read-tone (prompt initial-input history) (let* ((names '("1-2" "3" "4" "5" "6")) (str (completing-read prompt (lambda (string pred action) (if (eq action 'metadata) `(metadata (affixation-function . ,'emoji-pick-read-affixation)) (complete-with-action action names string pred))) nil t initial-input history))) (char-to-string (char-from-name (concat "EMOJI MODIFIER FITZPATRICK TYPE-" str))))) (transient-define-infix emoji-pick:--skin-tone () :description "Skin tone" :class 'transient-option :shortarg "-s" :argument "" :prompt "Skin tone: " :reader 'emoji-pick-read-tone) (transient-define-prefix emoji-pick () ["Variations" (emoji-pick:--skin-tone)] [["Emoji" ("s" "=F0=9F=A4=B7" emoji-shrug) ("y" "=F0=9F=91=8D" emoji-yes)]] (interactive) (transient-setup 'emoji-pick)) (defun emoji-shrug (&optional variation) (interactive (transient-args 'emoji-pick)) (insert (concat "=F0=9F=A4=B7" variation))) (defun emoji-yes (&optional variation) (interactive (transient-args 'emoji-pick)) (insert (concat "=F0=9F=91=8D" variation))) --=-=-=--