From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Quoting yank/diff prefixes (was: [Emacs-diffs] master 9ffb6ce 5/5: Quoting fixes in lisp/international and lisp/leim) Date: Wed, 02 Sep 2015 13:52:22 +0200 Message-ID: <87pp21yr61.fsf_-_@fencepost.gnu.org> References: <20150831061236.27796.57762@vcs.savannah.gnu.org> <55E3F434.2060507@yandex.ru> <55E496DC.1030608@cs.ucla.edu> <877foas9jh.fsf@gmail.com> <55E5FD79.3060309@yandex.ru> <55E6DA8C.1030403@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1441196533 19331 80.91.229.3 (2 Sep 2015 12:22:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Sep 2015 12:22:13 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 02 14:22:12 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZX73M-0007YD-2e for ged-emacs-devel@m.gmane.org; Wed, 02 Sep 2015 14:22:12 +0200 Original-Received: from localhost ([::1]:37165 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZX73L-0003Qh-Pz for ged-emacs-devel@m.gmane.org; Wed, 02 Sep 2015 08:22:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZX72t-0003Mm-Up for emacs-devel@gnu.org; Wed, 02 Sep 2015 08:21:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZX72t-0008DW-1N for emacs-devel@gnu.org; Wed, 02 Sep 2015 08:21:43 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34104) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZX72s-0008DQ-VD for emacs-devel@gnu.org; Wed, 02 Sep 2015 08:21:42 -0400 Original-Received: from localhost ([127.0.0.1]:47923 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1ZX72s-0004mK-5E for emacs-devel@gnu.org; Wed, 02 Sep 2015 08:21:42 -0400 Original-Received: by lola (Postfix, from userid 1000) id 4AF29E12D9; Wed, 2 Sep 2015 13:52:22 +0200 (CEST) In-Reply-To: <55E6DA8C.1030403@yandex.ru> (Dmitry Gutov's message of "Wed, 2 Sep 2015 14:16:28 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:189458 Archived-At: Dmitry Gutov writes: > On 09/02/2015 05:34 AM, Stefan Monnier wrote: > >> W.r.t ambiguity, the main problem I see is that we currently can never >> be sure that when we see a ` followed by a ' the two actually form a pair. >> A human usually can tell, but a program can't get it right 100% of the time. > > Okay. But then, there's no problem in using the same quoting for key > sequences, aside from the quote-matching algorithm. Moving passages into some sort of string container or else needing some sort of specific quotation style in order to preserve literal content seems like a frequent problem. How about defining some prefix to be used right before C-w or C-y and related commands that will then strip/interpret the respective suspected quote sequences going into the kill buffer, and add them when going out? It would likely need some well-defined mode-specific hooks providing the string-packing and unpacking, defaulting to something working reasonably sanely with the union of C and Elisp strings but hopefully taken up by most mode providers eventually. Having a standardized mode-specific view into stringizing and unstringifying passages (prefix arg for specifying the particular quote style defaulting to " (2) in most modes? Something like an input method selector for that?) might be useful for other generic functionality and keybindings. But at the very least a standard for "-quoted strings seems like a good idea. -- David Kastrup