From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: nXML mode indentation Date: Tue, 08 May 2018 04:55:35 +0000 Message-ID: References: <87a7tedxyb.fsf@gmail.com> <8736z2ydeq.fsf@gmail.com> 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 1525755254 18421 195.159.176.226 (8 May 2018 04:54:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 8 May 2018 04:54:14 +0000 (UTC) To: nyraghu27132@gmail.com, help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 08 06:54:10 2018 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 1fFudd-0004fg-4N for geh-help-gnu-emacs@m.gmane.org; Tue, 08 May 2018 06:54:09 +0200 Original-Received: from localhost ([::1]:49333 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fFufk-0001B5-2C for geh-help-gnu-emacs@m.gmane.org; Tue, 08 May 2018 00:56:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fFufD-0001Ak-SS for help-gnu-emacs@gnu.org; Tue, 08 May 2018 00:55:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fFufD-0007Uc-1V for help-gnu-emacs@gnu.org; Tue, 08 May 2018 00:55:47 -0400 Original-Received: from mail-oi0-x22f.google.com ([2607:f8b0:4003:c06::22f]:33686) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fFufC-0007UP-Sd for help-gnu-emacs@gnu.org; Tue, 08 May 2018 00:55:46 -0400 Original-Received: by mail-oi0-x22f.google.com with SMTP id k5-v6so20428385oiw.0 for ; Mon, 07 May 2018 21:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=nRlKUpYFmNY61eZJVzkJN9d7TPOb7gFBBAsXTrxOn00=; b=e0pXudu8AHjko7L45CikVSqY7x6ICmGeG0tCQ41tEZP35zGcj+3aCNjOanPnkTwR9z 4y1l1ZRxdVakEK76/voivVQG8Utrtr0yDzVl+P3tnon7Lm8QMvBwoMexg+ARfg+Xlhah d5a+SMGPp1tX2E7sA7teTY78TgJeuFRgg/O5LPnw88xZBEWD6Ir6rIYFoo66YxluCNBm 8zcs+l1Uj1/529o9IP8pJ1zD6YhOVv28FgDDZb3KzWepeIKOk5J3FfyYNOTidJ4G2H+K IQG4jHJdEmXsjPlO86biUB6vUoMCDLay93WAtdiypy3pEt9jTGBjaWIDVg3bqusZ5K9k jOdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=nRlKUpYFmNY61eZJVzkJN9d7TPOb7gFBBAsXTrxOn00=; b=nfF1CvcEOqSAnq0z/ocYq2t15xC21DlOnx18nkymvK/RxKrWGiy/f67h8DTK9/z9s2 j1DrfeeRcQA+E900Z369yyXnOBEh+MPz2MlvPTqKi5X79fjMnrAybwdtASrU9rIl70Qv /LSlMVrnJv11RtbU8iha8epGWPELFj0vS2tMSWCxDw+kilfberRYVyp+SWWtV0O22fMH v1rqwb9RmykW0VaVgEeD4Ql0kOD3yoHJ8V806eUirAEi13Z6AniwB1Ifg4hvQDMwmfX0 0X936ZDALp1RaymMzPX5ZgAKBublazhbg2VUzgjS+ajBokEHKqRHRXb9//yCKfxZi48A IFXw== X-Gm-Message-State: ALKqPwfW+xHsMVYcmiPCxRUoCCnSL639mWe7eHo7DV63ImydcDKORb8Z d2UkULrngFkDN7MJRH5I3VN2GAkZMc0P3M5b/2jU7A== X-Google-Smtp-Source: AB8JxZob/6EzWzosu06a6gm96iIqNCo3s761WlKW339HkPNGNK5NwDq70lZ2l7LG1GzzqtlUWqMb9pTk2bz9bnEcDjk= X-Received: by 2002:aca:c108:: with SMTP id r8-v6mr8417207oif.68.1525755346132; Mon, 07 May 2018 21:55:46 -0700 (PDT) In-Reply-To: <8736z2ydeq.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::22f 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:116686 Archived-At: On Tue, May 8, 2018 at 11:34 AM N. Raghavendra wrote: > > I request help regarding indentation of text that is directly inside > > elements in nXML mode. > I am trying to follow the XML style guidelines of the FreeBSD > Documentation Project, https://www.freebsd.org/doc/en_US.ISO8859-1/books/fdp-primer/writing-style-= guide.html#writing-style-indentation > and I would indeed like to use nXML mode. > It looks like `nxml-compute-indent-from-previous-line' in nxml-mode.el > is relevant, but I can't see how to modify or advise it. I have customized indentation in nXML for XHTML documents. The exact indentation rules I use are not relevant to your case but here=E2=80=99s ho= w I activate it. See the documentation on =E2=80=98indent-line-function=E2=80=99 and the sou= rce of =E2=80=98nxml-indent-line=E2=80=99 for implementation details. (defun yk-xhtml-indent-line () "Indent the current line suitably for XHTML." ) (defun yk-xhtml-indent--maybe-enable () "Set the current buffer=E2=80=99s indentation function to `yk-xhtml-indent-line' if the current schema is =E2=80=9Chtml=E2=80=9D." (pcase (caddr rng-current-schema) ("html" (setq-local indent-line-function 'yk-xhtml-indent-line)))) (with-eval-after-load 'nxml-mode (add-hook 'nxml-mode-hook 'yk-xhtml-indent--maybe-enable))