From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: Re: Variable-width font indentation: pasting outside Emacs Date: Wed, 7 Mar 2018 02:09:20 +0700 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1520363280 24038 195.159.176.226 (6 Mar 2018 19:08:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 6 Mar 2018 19:08:00 +0000 (UTC) Cc: =?UTF-8?Q?Cl=C3=A9ment_Pit=2DClaudel?= , Paul Eggert , Emacs developers To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 06 20:07:55 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 1etHw5-0004Cg-PF for ged-emacs-devel@m.gmane.org; Tue, 06 Mar 2018 20:07:41 +0100 Original-Received: from localhost ([::1]:57689 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etHy8-0001ql-K9 for ged-emacs-devel@m.gmane.org; Tue, 06 Mar 2018 14:09:48 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etHy2-0001qT-SS for emacs-devel@gnu.org; Tue, 06 Mar 2018 14:09:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etHy1-0002pc-OC for emacs-devel@gnu.org; Tue, 06 Mar 2018 14:09:42 -0500 Original-Received: from mail-oi0-x231.google.com ([2607:f8b0:4003:c06::231]:38300) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etHy1-0002pR-Hs for emacs-devel@gnu.org; Tue, 06 Mar 2018 14:09:41 -0500 Original-Received: by mail-oi0-x231.google.com with SMTP id h23so502061oib.5 for ; Tue, 06 Mar 2018 11:09:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=/VADPXgMjRrk9pChmyaqcei9HLe0c5uj5WucpSRc1Oc=; b=AxOnD3D2GtQBpgP19yaMb7JInJQ1eivbUG+SmVgSyeF96aqsytx5sOuebQUVyc6JAK JU4CxQ23Fj9K3srRNUVLXOJ1VV70sz024po6Kc/rv6oEor/I0CoGKOiyYZ6pvxt9ESIu SEEuBdD8/ZHjbJRqUNy/0ciKwinGTt5OLphSBZ8IGhdbd/Bgi5avomSy/03N7RTcVeYV r8UR+qouSZGjYfK+sT4YmvROO571m9CCP0hoTlO8GoA6TfyPZ2R6cFs+qUsVTGD+Hg/m EGAQxO5VIYSpdKEHHZud3B7LONLMfIj4/S3TRYN6Aud5BCx94IWTkDDOx0izHXwPNFMX aoNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=/VADPXgMjRrk9pChmyaqcei9HLe0c5uj5WucpSRc1Oc=; b=W2Eaj+xQElvwRu3WXDr+tTxSmMI2fxvN24Tj62R+62gpa9ZlG2zAW1cRSzKV/Sq2hf VelAJlla3UQAf3J/5zW/bvDJoTxAr+lLn8WyciIW/UPYBnh+2LBsNIi1vyuPVPpUXetm PsjSdqeLcqU4Cxwt5MS5nI5hbgAL1OFVv6rtVF8aBnGVGBT9qGnghFNETL8BWy7KJnnR kb+FPWU5uvyTZrFWml/ZCPntOKLoWX22/+kUqnqS8U0lDfHCzZWEnqiLAInxoc/q1lt+ EBsAGs1KbhxlzxE583/UmGV4WHcceTNBlPllCHQEUNglA25mADg3BOL0IjugBlxfhrwA ga4Q== X-Gm-Message-State: APf1xPBZDJNragXO+AcdoMnwF44CkeIjmkUoOsMfO7JXlRmVzm+qHY5D YHJGGfSDrvKt+gMrE7dNbmdpllQJwPS8EOBkpP4= X-Google-Smtp-Source: AG47ELtf/TW9NwunZl/Njf0J544xspXyveSXJgnIj0Tr8Ajep635m7mxzDPV54d5spo7y8Z35rUrqpwngidTtb47jNs= X-Received: by 10.202.199.18 with SMTP id x18mr11850324oif.68.1520363380707; Tue, 06 Mar 2018 11:09:40 -0800 (PST) Original-Received: by 10.74.211.77 with HTTP; Tue, 6 Mar 2018 11:09:20 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: lLWcmUdkWG6xCc_V458UtDiZO98 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::231 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:223358 Archived-At: On Wed, Mar 7, 2018 at 1:21 AM, Drew Adams wrote: > Could we, for example, (optionally) affect copy or paste > operations, to automatically try to compensate by inserting > the (more or less) right number of SPC chars of the > variable-width font (of the first non-whitespace char on the > line)? You mean changing the number of spaces used as indentation, depending on what font the receiving application uses? > People communicate about code and other text in more and more > ways, many of which are and will remain outside Emacs. Can we > try to DTRT for variable-width text, so that the result of > pasting into another app gives indentation and alignment that > at least approximates what one would want/expect? If so, > should we try to do that? Oh please don=E2=80=99t. Why? Because the widget where the text is going to be pasted from Emacs is not the widget that will ultimately display the text. How is that? Imagine a chat application such as Mattermost. Its UI is a web page with a text input widget on the bottom. That widget normally uses a variable width font, and accepts Markdown syntax. The user will normally type three grave accent characters ``` and a hard newline, then paste a snippet of code from clipboard, then close with another ```. On the server, Markdown will be interpreted and the recipient will receive a syntax-highlighted, fixed-width-formatted fragment of code. With your suggestion, that fragment will have the wrong amount of indentation. (Where =E2=80=9Cwrong=E2=80=9D denotes =E2=80=9Cother than the= sender intended or expected=E2=80=9D.) Relatedly, I have worked with several applications that support copying and pasting HTML markup. In their striving to make the result =E2=80=9Cintuitive=E2=80=9D, they introduce abominations on the receiving s= ide. Example: You are reading a web page. You copy a fragment of text. The source page is styled with CSS that specifies a blue-black foreground color and a fancy font for the body text. When you paste that into a blog post, the receiving widget attempts to preserve that color. But, since the body text style of the target article specifies dark gray foreground color and a different fancy font, it applies direct formatting to the pasted text: Lorem ipsum=E2=80=A6. Now the post text is tainted. It will appear in blue-black and in Proxima Nova for every viewer, regardless of their preferred color scheme and font. A user who prefers green text on a dark gray background will break his/her eyes trying to read that. Copying and pasting WYSIWYG formatting: Just say no. Doing things behind the user=E2=80=99s back on copy/paste: Just say no.