From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Mastro Newsgroups: gmane.emacs.help Subject: Re: Newline-phobic text help. Date: Thu, 14 Jul 2016 18:43:41 -0700 Message-ID: References: <87d1mgt5tz.fsf@BanjaLuka.rclayton.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1468547078 25866 80.91.229.3 (15 Jul 2016 01:44:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 15 Jul 2016 01:44:38 +0000 (UTC) Cc: "R. Clayton" To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 15 03:44:34 2016 Return-path: Envelope-to: geh-help-gnu-emacs@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 1bNsB5-0003UM-02 for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Jul 2016 03:44:31 +0200 Original-Received: from localhost ([::1]:57804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNsB4-0000FQ-7c for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Jul 2016 21:44:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNsAd-0000F1-BR for help-gnu-emacs@gnu.org; Thu, 14 Jul 2016 21:44:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNsAc-0000v5-2p for help-gnu-emacs@gnu.org; Thu, 14 Jul 2016 21:44:03 -0400 Original-Received: from mail-qt0-x236.google.com ([2607:f8b0:400d:c0d::236]:36395) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNsAb-0000tt-UM for help-gnu-emacs@gnu.org; Thu, 14 Jul 2016 21:44:02 -0400 Original-Received: by mail-qt0-x236.google.com with SMTP id 52so52333583qtq.3 for ; Thu, 14 Jul 2016 18:44:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=TojtL9FgI58GH/6dKRUdjWDW4/2/VvMUJ7OWP4uEVYY=; b=upaQvk/dd7Mje3LZmi+XbfReg7FfbG6Ue5r/NoCRZ5NGDNWyR7q3piGUkbByYbU80a stdMy2UCQXC9psU0MriwJMrSS1dvjqftzeZt+1n22QN1JSHneW0oI01DLFMzRMnBYybY 0s/yb9t7r7wXJ5NNMO58y/LbuAy43CycYUm//TZ3CrkoHKN4yasJtGns6RielcnsXgwp b16hCulMSwBd+5Act9Z33Dnc23POBC+Flx1pFRyc7sdsujZrhO9EYnrEjbLbDTODTeIy OgPBtw6vRBKWx5t78bFXBEhI5lD6A/FffHiO4Et23JLXgS/DQOFJwQc1RSi4nU8x7mw9 Lklg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=TojtL9FgI58GH/6dKRUdjWDW4/2/VvMUJ7OWP4uEVYY=; b=F99tw/OVuORRpnJlpZqn0qdgIzCUnFiYT7TSLTKD9XA3ABP//qTIEh1t0/cCCeJfam Xt8DKVYSIJfpWeRuC7AhxPqVadAfSOOBNYe6vtLR7q16tSk5PlpzBBrsDI5a+yyjJxDr ZFE/77rDw6H9fH3WwLUtMFdkkxRB4CODkkAJJ53iDDcZPdb44OsrI2laHFl1YXPx3NL0 evvnUcxyYcgtV6zlsPSWeArwAt7odQUJEDZlC+idi9JKbMWu7ri2nHCzJyiBFP3xyOlp g388BgDIsVGl8aZz084vWX0T1dD/WcF2EUBwFb2fjGjzj+p57rwE5L2WKPv18Qyqq+i3 AOgA== X-Gm-Message-State: ALyK8tLPJSNKHWeiRO4Fh2c89KrXw02ZkoAXgYS8bxs3p4dN2iUB8cBRQtOzB4m5FHHlGuMR11GtBhCiIHdfng== X-Received: by 10.237.49.101 with SMTP id 92mr25690964qtg.56.1468547041289; Thu, 14 Jul 2016 18:44:01 -0700 (PDT) Original-Received: by 10.237.48.77 with HTTP; Thu, 14 Jul 2016 18:43:41 -0700 (PDT) In-Reply-To: <87d1mgt5tz.fsf@BanjaLuka.rclayton.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c0d::236 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110853 Archived-At: R. Clayton wrote: > I use emacs and firefox's it's all text add-on to fill in web text-entry forms. > Because those forms break text to the line width, I use the enriched-text minor > mode under the assumption that soft newlines don't show up in the resulting > text. That assumption seems to be incomplete: the soft newlines are gone, but > the text in the form has (hard) newlines at the places the text in the buffer > had soft newlines (resizing the form verifies this claim). > > Enriched text saved to a local disk file has the same property - > intra-paragraph soft newlines are replaced by hard newlines - which leads me to > believe I don't understand enriched text. What are the emacs incantations that > keep hard newlines out of paragraphs when the buffer's written to wherever? [ I think your scenario boils down to the fact that you don't want the intra-paragraph newlines in your buffer to end up in your web form; if I got that wrong, you can ignore what I wrote below. ] I don't know the answer to your question about controlling how newlines are written, but perhaps another approach would be to: (auto-fill-mode -1) (visual-line-mode) In the relevant buffers, so the unwanted newlines are never inserted at all. The only trick would be identifying when you've got an "It's All Text!" buffer so you can evaluate that code. If the buffers are text-mode buffers with somewhat predictable names as suggested here[1], it might work to do something like: (defun my-its-all-text-settings () (let ((file (buffer-file-name))) (when (and file (file-in-directory-p file "/tmp/") (string-match-p "\\.[A-Za-z0-9]\\{10\\}\\.txt\\'" file)) (auto-fill-mode -1) (visual-line-mode)))) (with-eval-after-load 'text-mode (add-hook 'text-mode-hook #'my-its-all-text-settings)) Of course, that regexp could easily match files other than those created by It's All Text!. But we're not doing anything dangerous, so unless you often edit text files in /tmp it's probably okay. Actually, I'm not sure that It's All Text! puts its temporary files in /tmp, so you should confirm that (and adjust the file-in-directory-p call if not). John [1] https://psung.blogspot.com/2009/05/using-itsalltext-with-emacsemacsclient.html