Re: [netmod] [Tools-discuss] reflow of YANG descriptions, and general YANG format annoyances

William Lupton <> Mon, 09 November 2020 09:38 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 159FD3A0DAB for <>; Mon, 9 Nov 2020 01:38:42 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 2d4u0wx9tRBr for <>; Mon, 9 Nov 2020 01:38:40 -0800 (PST)
Received: from ( [IPv6:2a00:1450:4864:20::52b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id B61893A0DB4 for <>; Mon, 9 Nov 2020 01:38:39 -0800 (PST)
Received: by with SMTP id o20so7997434eds.3 for <>; Mon, 09 Nov 2020 01:38:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9WoG6s0OpPVZ1niNFg30zcpj45hn2WLZl0fURt9+58U=; b=I+HnFvTcMu1dpwKil3C4Ruwpqmrt4r6FgYE4vPqkRqQv30M37HPrzc+W/Y2Hwwd6z9 8jT1992Ptlc3/+48nj4KJessLZLWRWKRAE49CIZ6PMsKEBoREEElIsibfN1pNf/k02er M4tDoiZxyLQFeQCjONZdcQV7LFaOcI+n2O2wiPSAFweOfjc+P25qbqr4jB20iLMgxj7+ 3lQmvqZPPfYSoQpVCEGkU2CRSpIlid05bzZhmcmKYe7tkucuWd52jc+7ki1P7PMEgUFX oGXR0NISI8nbsWKUNRJ6ONvcJjY9HUvUvsH9cQaGezrbsEUmRqYwIzAFda4omTnipOuh IChg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9WoG6s0OpPVZ1niNFg30zcpj45hn2WLZl0fURt9+58U=; b=iv1F8qakbartO7DmewnzuzBZxnoawcY3jE2/+Mzrc5F8o279l208Si9/2KhV+4CXPV tYRWmwOB22YhFtI34fT/SN+uFWqBOIdvvi0vUQWRPsCvrMIoHKm0Re7FdXvBiuzap1+6 m4/ZnEGN9+k7kf4eM89VZE4F2LSvRfRrTOgFskNcUN/2dbd5QcXbUyTN+xpQWxIBRJU5 A04Eew2DKW2YggnPKheFBHPUNwfVfGjLmX8ZdAYfr6lL00Ii8QKZ1PMBoqCFaQrQP6pN rx7TwX1qd4CUht1MOt8zMlJBuBBB6w34u3dNVKB7yFIB4hQqAsaR6Rk33VEcwRbktzdE hArw==
X-Gm-Message-State: AOAM532tgP1IMnB+Y0dLpsNbZDKZa3v1OOgaQvO5x5vIz9igO3LbXlFN R1SDWjqZyhQSgo1g6m4P70h0e6RVytZDMaRAgmNGm653WKnlKaOt
X-Google-Smtp-Source: ABdhPJywqj9vqFmkByuLrkH5lDRcBJAMXr8dsAyaSXcg9XmIdx9hfWnFcdcyFCYDVE+06q4WKk30WmZ6oNBUQXnZdyQ=
X-Received: by 2002:a05:6402:b68:: with SMTP id cb8mr14386716edb.198.1604914717829; Mon, 09 Nov 2020 01:38:37 -0800 (PST)
MIME-Version: 1.0
References: <29950.1604697852@localhost> <> <6712.1604707568@localhost> <>
In-Reply-To: <>
From: William Lupton <>
Date: Mon, 9 Nov 2020 09:38:26 +0000
Message-ID: <>
To: NetMod WG <>
Content-Type: multipart/alternative; boundary="000000000000a6c5ca05b3a953fe"
Archived-At: <>
Subject: Re: [netmod] [Tools-discuss] reflow of YANG descriptions, and general YANG format annoyances
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 09 Nov 2020 09:38:42 -0000

I ensured that I have the latest version of the Emacs YANG mode, and find
that M-q works well to wrap description strings, but...

   1. Should I expect intelligent behaviour of RET and TAB when within a
   description (or other) string? I find that (in this context) RET positions
   the cursor at the start of the line, and TAB does nothing. Ideally RET
   might position the cursor at the indentation point of the previous line, or
   one character past the opening quote if this was the first line.
   2. Wrapping (quite reasonably) can't handle cases where the author
   didn't in fact intend line breaks to be inserted. The most common cases are
   probably (a) not using a blank line as a paragraph break, (b) text was
   further indented (which often implies literal text), or (c) text started
   with * (or -, ...) and was to be interpreted as a list item.

I don't believe that RFCs 7950 and 8407 say anything about paragraph
formatting, but most NETMOD YANG does seem to adhere to the convention that
paragraphs should be separated by blank lines. Perhaps this could be made
into a stronger convention?

As for the other cases (further indentation -> literal, and */- mean list
items), of course this is getting back to the markdown discussion. I
believe that when this has come up before the discussion has died for want
of clear standards. However I do believe that it would be very useful to
define some layout conventions (or rules) that allow automated reflow and
other formatting, and personally I would take it further than just the
three points that I have mentioned! It doesn't have to be called


On Sat, 7 Nov 2020 at 05:07, Carsten Bormann <> wrote:

> On 2020-11-07, at 01:06, Michael Richardson <> wrote:
> >
> > M-q reflowed a paragraph, but made it too long with 76 columns wide.
> Is your .emacs setting fill-column to a non-standard value?
> C-x f 69 RET
> or put
> // -*- fill-column: 69 -*-
> into the first line of your YANG file (in a comment)
> or better
> (add-hook 'yang-mode-hook
>           '(lambda () (set-fill-column 69)))
> in your .emacs.
> Grüße, Carsten
> _______________________________________________
> netmod mailing list