From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: The netsec thread Date: Mon, 23 Jul 2018 18:22:40 +0300 Message-ID: <83d0vevuwv.fsf@gnu.org> References: <83bmb214ez.fsf@gnu.org> <837elq13me.fsf@gnu.org> <83h8kqwukq.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1532359244 22412 195.159.176.226 (23 Jul 2018 15:20:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 23 Jul 2018 15:20:44 +0000 (UTC) Cc: wyuenho@gmail.com, emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 23 17:20:39 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fhcdZ-0005gQ-ID for ged-emacs-devel@m.gmane.org; Mon, 23 Jul 2018 17:20:37 +0200 Original-Received: from localhost ([::1]:35141 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhcfg-0000JP-ER for ged-emacs-devel@m.gmane.org; Mon, 23 Jul 2018 11:22:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhcfW-0000Iz-VM for emacs-devel@gnu.org; Mon, 23 Jul 2018 11:22:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhcfS-00068e-1I for emacs-devel@gnu.org; Mon, 23 Jul 2018 11:22:38 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40142) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhcfR-00068Z-TB; Mon, 23 Jul 2018 11:22:33 -0400 Original-Received: from [176.228.60.248] (port=1454 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fhcfR-000258-GJ; Mon, 23 Jul 2018 11:22:33 -0400 In-reply-to: (message from Lars Ingebrigtsen on Mon, 23 Jul 2018 14:46:44 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:227715 Archived-At: > From: Lars Ingebrigtsen > Cc: Jimmy Yuen Ho Wong , emacs-devel@gnu.org > Date: Mon, 23 Jul 2018 14:46:44 +0200 > > > lisp/international/mule-cmds.el, look at > > select-safe-coding-system-interactively, a subroutine of > > select-safe-coding-system. In a nutshell, it prepares and pops up a > > buffer with special content, then prompts the user to select one of > > several alternatives. > > Hm... I ran: > > (select-safe-coding-system-interactively 1 3 (find-coding-systems-region 1 3) nil) > > and it just popped up a buffer with some text and then called > `read-coding-system', which is kinda close to what the NSM prompt is > doing already. That's not the best demonstration of what it does. Try evaluating the below in *scratch*, and then play with the links it creates to point out characters that cannot be encoded: (find-file "try-select-safe-coding-system") (set-buffer-file-coding-system 'latin-1) (prefer-coding-system 'latin-1) (insert "text with smileys 😺 😇 😎") (save-buffer) I didn't mean to say you must copy what it does, just to point out an example where we ask a question, but let the user click or type RET on active parts of the buffer to see additional information. I also don't see any particular reason to avoid modal questions, as the user can always return to the minibuffer after looking at the additional info, as in the above demonstration. HTH