From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yasushi SHOJI Subject: Re: [RFC] Moving "manual.org" into core Date: Fri, 26 Jan 2018 17:52:20 +0900 Message-ID: References: <87bmhooaj9.fsf@nicolasgoaziou.fr> <87tvveqi7u.fsf@bzg.fr> <87y3kqyp6m.fsf@gmx.us> <87y3kncx6x.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eezqB-0000tL-21 for emacs-orgmode@gnu.org; Fri, 26 Jan 2018 03:58:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eezqA-0006Z5-2s for emacs-orgmode@gnu.org; Fri, 26 Jan 2018 03:58:31 -0500 Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]:43678) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eezq9-0006Xm-SF for emacs-orgmode@gnu.org; Fri, 26 Jan 2018 03:58:30 -0500 Received: by mail-lf0-x230.google.com with SMTP id o89so13255548lfg.10 for ; Fri, 26 Jan 2018 00:58:29 -0800 (PST) In-Reply-To: <87y3kncx6x.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: emacs-org list Hi Nicolas, On Wed, Jan 24, 2018 at 8:28 PM, Nicolas Goaziou wrote: > Org Lint is not a formatter. It detects common mistakes or hypothetical > mistakes in an Org document, e.g., invalid links. In particular, it > doesn't detect stylistic issues like those discussed above. Oh, OK. > It doesn't mean we couldn't run it automatically. However, it also emits > warnings (see `trust' property) on perfectly valid syntax. > > As a side note, writing an Org formatter is trivial: > > (when (yes-or-no-p "Really format current buffer ? ") > (let ((document (org-element-interpret-data (org-element-parse-buffer)))) > (erase-buffer) > (insert document) > (goto-char (point-min)))) You know, this is a mind-blowing. Org already has everything it needs ;-) Anyway, I tried the code and it took 2.4 second to reformat the whole document on my i5-3360M 2.80GHz CPU. It's a bit long for every commit, i guess. But, could be installed on received hook, perhaps? Also, the code converts all lower case "#+title", "+begin_src" and other "#+"s to the UPCASE. Is this intended? I thought we are moving away from CAP to lower? -- yashi