From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@newcastle.ac.uk (Phillip Lord) Newsgroups: gmane.emacs.devel Subject: Re: Comment conventions, adding an explicit Header. Date: Mon, 03 Nov 2014 10:04:31 +0000 Message-ID: <87mw88ha6o.fsf@newcastle.ac.uk> References: <87d299eu1d.fsf@newcastle.ac.uk> <87a94dd5hi.fsf@newcastle.ac.uk> <87d2973f94.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1415009106 9585 80.91.229.3 (3 Nov 2014 10:05:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Nov 2014 10:05:06 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 03 11:04:59 2014 Return-path: Envelope-to: ged-emacs-devel@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 1XlEVO-0005mX-VU for ged-emacs-devel@m.gmane.org; Mon, 03 Nov 2014 11:04:59 +0100 Original-Received: from localhost ([::1]:33277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlEVO-0007GR-I0 for ged-emacs-devel@m.gmane.org; Mon, 03 Nov 2014 05:04:58 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlEV6-0007GJ-Cs for emacs-devel@gnu.org; Mon, 03 Nov 2014 05:04:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlEV1-0007wU-Gw for emacs-devel@gnu.org; Mon, 03 Nov 2014 05:04:40 -0500 Original-Received: from cheviot22.ncl.ac.uk ([128.240.234.22]:51312) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlEV1-0007wH-BJ for emacs-devel@gnu.org; Mon, 03 Nov 2014 05:04:35 -0500 Original-Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129] helo=smtpauth.ncl.ac.uk) by cheviot22.ncl.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1XlEUx-0006gC-Fj; Mon, 03 Nov 2014 10:04:31 +0000 Original-Received: from jangai.ncl.ac.uk ([10.66.67.223] helo=localhost) by smtpauth.ncl.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1XlEUx-0001I4-GK; Mon, 03 Nov 2014 10:04:31 +0000 In-Reply-To: <87d2973f94.fsf@uwakimon.sk.tsukuba.ac.jp> (Stephen J. Turnbull's message of "Sat, 1 Nov 2014 10:01:59 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 128.240.234.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:176256 Archived-At: "Stephen J. Turnbull" writes: > > True. Currently, I handle the first line specially (as does emacs) > > because otherwise you end up with level 1 header with, for example, the > > lexical-binding instruction in it. > > I don't really see why this is a problem. It may be a literate > programming style, but it's still a programming style. I don't see > what's wrong with including pragmas in the documentation. Well, I agree, it's not a particular disaster, and it is certainly one option that I considered. However, the problem remains that org-mode uses the lines before the first header to specify a set of variables, which is something that I cannot do if the first line is a header. > If you want them removed, feel free to do so -- they're code, they > have well-defined syntax. I personally think it a wart on such styles > when you need comments to mark a defun -- the format generators should > do that for you. I would agree with this also. It would be nice to change org-mode so that it recognises at lisp blocks as code automatically. > > Also, in the org-mode transformation I translate this into a org-mode > > comment. The reason for this is that org-mode also has a "start of file" > > semantics -- the lines before the first header is special. > > There aren't any in a Lisp file, and you're already treating this line > as special. Why not just treat it as a special-case header? As I said, because it prevents the full use of org-mode. > > Also, all the other headers that I see ("Commentary", "Status", "Code" > > and so forth) are single word and end with an ":". So, currently, I use > > this semantics also. > > That's not semantics, that's syntax, and it's ad hoc: we (Eric?) > happened to standardize on those and Eric codified them in lisp-mnt, > but nobody has ever defined headers as matching "^;;;;* [A-za-z]+:$". Yes, you are right, this is syntax. It can be changed. > > The ;;;; headers I could support, but there aren't that many > > files which use this consistently (calc does, so they are some). For > > section 2 headers I use > > > > ;; ** Header 2 > > Ugh. It's less ugly in the org-mode view of a file, where it just looks like a normal org-mode header. > > It's a work in progress, of course, but I am looking to DWIM with as > > many existing files as possible. > > I don't see why defining headers as matching "^;;;;*\s-+.*\S-" or > similar doesn't DWYM. Few files are long enough to really need > subsection headers; submit patches for the ones that do need them and > don't have them in the traditional format. I'll think on this. It is most likely possible. Phil