From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: html checkbox output Date: Mon, 06 Jan 2014 12:10:35 +0100 Message-ID: <87wqidcqms.fsf@gmail.com> References: <20131206215321.GA48654@eyeBook> <87siu5txkx.fsf@gmail.com> <87r48ot7g2.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W084d-00020Q-9p for emacs-orgmode@gnu.org; Mon, 06 Jan 2014 06:10:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W084X-0007H1-Qs for emacs-orgmode@gnu.org; Mon, 06 Jan 2014 06:10:23 -0500 In-Reply-To: <87r48ot7g2.fsf@bzg.ath.cx> (Bastien's message of "Sat, 04 Jan 2014 10:36:13 +0100") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: emacs-orgmode@gnu.org Hello, Bastien writes: > Hi Nicolas and Rick, > > Nicolas Goaziou writes: > >> A new buffer keyword (which needs to be documented in org.texi), >> a defcustom with a completely free sexp... Isn't it a bit too much for >> mere checkboxes? > > Personally I think the defcustom is enough, as this choice is likely > to be made for all Org documents. > >> Filters provide almost the same functionality: >> >> (defun my-checkbox-filter (item backend info) >> (when (org-export-derived-backend-p backend 'html) >> (replace-regexp-in-string "\\`.*\\(\\[\\(X\\| \\|-\\)\\]\\).*$" >> (lambda (rep) >> (let ((check (match-string 2 rep))) >> (cond ((equal check "X") "☑") >> ((equal check "-") "☐") >> (t "☐")))) >> item >> nil nil 1))) >> (add-to-list 'org-export-filter-item-functions 'my-checkbox-filter) > > Yes, but a defcustom would be easier. As long as it doesn't let you write completely free sexps. Otherwise, a function is equally complex. Regards, -- Nicolas Goaziou