From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.help Subject: Re: How to avoid newline insertion / reindentation by sgml-tag (C-c C-t) in html-mode Date: Wed, 02 Jan 2019 14:14:48 +0100 Message-ID: <874lar9p6f.fsf@gmx.net> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1546434798 11558 195.159.176.226 (2 Jan 2019 13:13:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 2 Jan 2019 13:13:18 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: David Madore Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 02 14:13:14 2019 Return-path: Envelope-to: geh-help-gnu-emacs@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 1gegKf-0002tN-Ap for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Jan 2019 14:13:13 +0100 Original-Received: from localhost ([127.0.0.1]:44625 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gegMm-0007Ca-4r for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Jan 2019 08:15:24 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:34323) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gegML-0007CU-2n for help-gnu-emacs@gnu.org; Wed, 02 Jan 2019 08:14:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gegMG-0002TZ-2n for help-gnu-emacs@gnu.org; Wed, 02 Jan 2019 08:14:57 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:38877) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gegMF-0002So-Qj for help-gnu-emacs@gnu.org; Wed, 02 Jan 2019 08:14:52 -0500 Original-Received: from rosalinde ([88.74.20.117]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lk7fW-1hC5Qp28hG-00c8sx; Wed, 02 Jan 2019 14:14:49 +0100 In-Reply-To: (David Madore's message of "Wed, 2 Jan 2019 01:18:45 +0100") X-Provags-ID: V03:K1:tCEouD/+1nCieDkErYDwOGM4x2PglrQRfJTwfXM4D5wPMLJ8VNa 2H+6kd3yjtlLjHa70ulcTp25grdsIZPTOkykmyzJ7+ZQufJ09fhhCqsG/fA2fmRXEStRZkK 3dMhhHqFCWjIzKfAzdn+LUQwAUF63TJchAEgeY48pAhGFFsuzhCjnbW68InvTGCkrAkXgdg 4605JJkbKXuD8ExJSrkCw== X-UI-Out-Filterresults: notjunk:1;V03:K0:QZ4xSM9zRPg=:pj1SQ28dvKczQTVVF3Nrmf ldkNAz48Av6CylchJ46Yv+IKSOiNv3RLl4T3xXMaE0R1KmFuYx/jXF01WjUQKxOwuAYdHm3eX suIHvmzwhAg4jPalbr1kJp4WH6VfK36YBzSzO1gT+1oCFEGPOYI1f3lB14wtl4ClWqbMOwzGY K4N0uNgOkz40R0BuE1MYz7FUKMeJ1E94oGJlXDR5uIcZjlaOzfbKNl11C2rrw70doTX4NYRxX oAtouJspdm87scYk/wiVU1yszjo0u9IOor4fNoz9BSDC2LHfe9V2sUOC71oqU6ER+qYKgwVlT +XgoGU+ZX777AZgUD+Uk1nB0i5vJi6/FOdK7JAsiyWYdGqTr3kuCMxWAt4yviSdZGR8wIGMbt FbNtuDYTrW2fmRdNFDwOwzTkWsuqDLM7mD5l0CE+pKdFStR8y+unwp6zst/OFr959qSxgVODG eXx0V7+UjudMQHOr2nz06WAbVJKDXnFSTE42jE3oYs/qdTUK1PxGV+nZl0xmR/W4cwuoyzZ2n SnxkFDN39G8ADgMwPnyakOb7D6TEtuGm0ZXnVIVkv79J/3N/QvdBcSud87UhatcFO7Ka8oUx/ 6gs7CFKgwHdk4rx1SYQS5Tvu3tscijNmVq/E8Ua+DZY18x3m6xl4NzfZpnyPwmqeF4R5clgjm vd8Jf6phYAvt9TJeZjoiDxU3A+1K3duLa2SIIjy21YQtCSLEqqlKeULMcVnwNY7dQandHV23G VSZtUf8tmv3TeeTB9EZx13dhE+yikfzhyH+0m5GCb79CaKrm20KeByjcuAAbl9rTJc0JFZBi X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.15 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:119065 Archived-At: On Wed, 2 Jan 2019 01:18:45 +0100 David Madore wrote: > Dear group, > > I only recently upgraded from Emacs 24.5 to 25.1. One of the changes which is > causing me considerable pain is that the html-mode (which I use a lot to edit > XHTML files) now tries to perform some kind of reindentation whenever a tag is > inserted by the sgml-tag (C-c C-t) function. In particular, a line break > appears to be inserted whenever there is a following closed tag. > > I would like no such reindentation to occur. For example, if I type "C-c C-t > em" between

and

(say), I would just like for "" to be inserted > before the point and "" after, with no changes to indentation or anything > else, and certainly no extra newline character. > > I tried understanding sgml-mode.el but it is way beyond my knowledge of Emacs > Lisp; and I don't see in the diff between the 24.5 and 25.1 versions anything > pertaining to identation that would explain the difference. I even tried > using the 24.5 version of sgml-mode.el but it did not revert to the previous > behavior (so I assume the difference comes from somewhere else but I don't > even know where to start looking). > > Does anybody know how I can revert to the previous behaviour and avoid the > spurious insertion of newlines by the sgml-tag function? You can suppress the line break by setting skeleton-end-newline to nil. To have this work for any file in html-mode you should add a corresponding function to sgml-mode-hook in your init file, e.g.: (add-hook 'sgml-mode-hook (lambda nil (setq skeleton-end-newline nil))) You can also do this via `M-x customize RET sgml-mode-hook RET'. Steve Berman