From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleh Krehel Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 9ffb6ce 5/5: Quoting fixes in lisp/international and lisp/leim Date: Thu, 03 Sep 2015 12:16:49 +0200 Message-ID: <87h9nbq032.fsf@gmail.com> References: <20150831061236.27796.57762@vcs.savannah.gnu.org> <55E3F434.2060507@yandex.ru> <55E496DC.1030608@cs.ucla.edu> <877foas9jh.fsf@gmail.com> <87vbbu4c5w.fsf@fencepost.gnu.org> <55E58F0B.4030006@yandex.ru> <87r3mi4a45.fsf@fencepost.gnu.org> <55E5B42F.3070806@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1441275409 17261 80.91.229.3 (3 Sep 2015 10:16:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Sep 2015 10:16:49 +0000 (UTC) Cc: David Kastrup , emacs-devel@gnu.org, Stefan Monnier , Paul Eggert To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 03 12:16:44 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 1ZXRZQ-0000fR-4E for ged-emacs-devel@m.gmane.org; Thu, 03 Sep 2015 12:16:40 +0200 Original-Received: from localhost ([::1]:46549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXRZP-0004Ge-FO for ged-emacs-devel@m.gmane.org; Thu, 03 Sep 2015 06:16:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40959) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXRZD-00045o-0A for emacs-devel@gnu.org; Thu, 03 Sep 2015 06:16:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXRZ9-0007wq-Qa for emacs-devel@gnu.org; Thu, 03 Sep 2015 06:16:26 -0400 Original-Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:34875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXRZ8-0007uT-O0; Thu, 03 Sep 2015 06:16:23 -0400 Original-Received: by wicge5 with SMTP id ge5so68348456wic.0; Thu, 03 Sep 2015 03:16:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=3kO+rAe/v1rGWYvbw8uHCJ/zlEwtoEfAXrf0l6JrE4w=; b=xOmpElcAeZKUYh3HVNz1+ixBNlEdHdu6mH1CmuM2UtYkxMSl1nB2xWuCmatFm9XLli 3o6FFTEYi1a1fCWbA+CO71XUBy3esuLoUp3FcgcYNnG+bIcZ1S8OVzAHonDxWmQsHdQu Eyq+V5/us0eZ3OqzS7Or5wh01Mze3z+QWSQYcMESwD31wgvVe63OXjEWi1WHxORqZIsl D6h1kwfPMJviDyDEOffeJ2ZZXoMj9VawoLWA01LTdEdatzlLewA0T2xSVT+GtAwthJ4Z ZbKHQBsipqK0nBdSRqIuRr7dV3gIUByJrAJyEBvKMohCh4+eDQVEpWwhEVOo/w/wL5kA rjjw== X-Received: by 10.180.182.40 with SMTP id eb8mr13305332wic.63.1441275381470; Thu, 03 Sep 2015 03:16:21 -0700 (PDT) Original-Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45]) by smtp.gmail.com with ESMTPSA id kl8sm24091027wjb.39.2015.09.03.03.16.20 (version=TLS1_2 cipher=AES128-SHA256 bits=128/128); Thu, 03 Sep 2015 03:16:20 -0700 (PDT) In-Reply-To: <55E5B42F.3070806@yandex.ru> (Dmitry Gutov's message of "Tue, 1 Sep 2015 17:20:31 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22d 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:189497 Archived-At: Dmitry Gutov writes: > On 09/01/2015 03:06 PM, David Kastrup wrote: > >>> We have \\= escaping syntax, see `substitute-command-keys'. >> >> Spells more or less death for cut&paste from some help buffer into the >> _source_ of a DOC string, doesn't it? Sure, backslashes already have >> that effect, but at least this is due to string syntax rather than some >> obscure markup processor. > > Like you said, any escaping syntax spells death for cut&paste. Cut and paste can still work: just add a `quote-last-yank' command and/or `quote-region' command. I've been using similar commands for posting copy-pasted code to Stack websites. Here's a snippet I use for quoting pasted code in Markdown: (defun ora-markdown-stack-block (beg end) (interactive "r") (let ((str (buffer-substring-no-properties beg end))) (delete-region beg end) (insert "\n\n " (mapconcat #'identity (split-string str "\n" t) "\n ")))) An issue that I have with \\= escaping syntax is that it's ugly. One reason for success of Markdown (also Org-mode) is that it looks good enough even in source form, i.e. not exported or rendered. Therefore, I propose we move from this: (defcustom auto-insert 'not-modified ... This variable is used when the function `auto-insert' is called, e.g. when you do (add-hook \\='find-file-hook \\='auto-insert). to this: This variable is used when the function `auto-insert' is called, e.g. when you do ``(add-hook 'find-file-hook 'auto-insert)''. Note how ``(add-hook 'find-file-hook 'auto-insert)'' looks good enough even in plain text form, with no extra highlighting. Much better than (add-hook \\='find-file-hook \\='auto-insert). And it's easy to copy paste and quote with a simple command that just adds 4 chars around a region. Also, it would be very easy to modify font-lock to add extra highlighting for ``...'' blocks, since they're so easy to parse. In the unlikely case when someone wants a code block with two consecutive apostrophes, the old \\=' approach can be used. The quoting function could even do this automatically, i.e. quote any apostrophes in the region appropriately. For code blocks, we could use an empty line followed by 4 spaces indent. I think there's value in having asymmetric delimiters, since that eases the job of font-lock by a lot. The current `markdown-mode' breaks highlighting very often because of symmetric delimiters. Oleh