emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Changing [X] by something else
@ 2012-02-08 17:04 François Pinard
  2012-02-08 17:16 ` suvayu ali
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: François Pinard @ 2012-02-08 17:04 UTC (permalink / raw)
  To: emacs-orgmode

Hi, Org people.

I notice in org.el that [X] is hard-wired, while I would have liked the
possibility of changing it by [✓] in my things, which I find both softer
and cleaner.  Could these ([ ], [-] and [X]) be turned into variables?
The difficulty might be to recognize them properly, I guess.

While it would be nice that I could change it, it might also have a
negative effect, making Org files less interoperable between people.  On
the other hand, the TODO keywords are already changeable, so there is a
kind of precedent :-).

Just a thought.

François

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Changing [X] by something else
  2012-02-08 17:04 Changing [X] by something else François Pinard
@ 2012-02-08 17:16 ` suvayu ali
  2012-02-08 17:29   ` François Pinard
  2012-02-09 16:26 ` Nicolas Goaziou
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 16+ messages in thread
From: suvayu ali @ 2012-02-08 17:16 UTC (permalink / raw)
  To: François Pinard; +Cc: emacs-orgmode

Hi François,

2012/2/8 François Pinard <pinard@iro.umontreal.ca>:
> Hi, Org people.
>
> I notice in org.el that [X] is hard-wired, while I would have liked the
> possibility of changing it by [✓] in my things, which I find both softer
> and cleaner.  Could these ([ ], [-] and [X]) be turned into variables?
> The difficulty might be to recognize them properly, I guess.
>
> While it would be nice that I could change it, it might also have a
> negative effect, making Org files less interoperable between people.  On
> the other hand, the TODO keywords are already changeable, so there is a
> kind of precedent :-).
>

One has to draw the line at something. Although I am just a user I feel
this falls into the same category as the request from last year to make
the stars in a headline configurable. This is an integral part of org
syntax.

Last time during the customisable headline thread this was discussed
extensively and the core developers agreed that making org syntax
customisable defeats interoperability and breaks external tools written
to parse org files.

That said, I believe you can customise how these check boxes are
exported to various backends. AFAIR, there is a nice thread discussing
the case for latex export from the end of last year.

Hope this helps.

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Changing [X] by something else
  2012-02-08 17:16 ` suvayu ali
@ 2012-02-08 17:29   ` François Pinard
  2012-02-08 17:40     ` suvayu ali
  0 siblings, 1 reply; 16+ messages in thread
From: François Pinard @ 2012-02-08 17:29 UTC (permalink / raw)
  To: suvayu ali; +Cc: emacs-orgmode

suvayu ali <fatkasuvayu+linux@gmail.com> writes:

> Hi François,

Hi, Suvayu (or Ali?)

> 2012/2/8 François Pinard <pinard@iro.umontreal.ca>:
>> I notice in org.el that [X] is hard-wired, while I would have liked the
>> possibility of changing it by [✓] in my things

> One has to draw the line at something.

Granted. :-)

> Although I am just a user I feel this falls into the same category as
> the request from last year to make the stars in a headline
> configurable. This is an integral part of org syntax.

Well, Org mode is built over Outline mode, stars are coming from there.
While [?] are pure Org mode additions, so Org "owns" it better...

> making org syntax customisable defeats interoperability and breaks
> external tools written to parse org files.

Exactly my objection to my own suggestion.

> That said, I believe you can customise how these check boxes are
> exported to various backends. AFAIR, there is a nice thread discussing
> the case for latex export from the end of last year.

Oh, I was not at all thinking about export.  Just my own pleasure while
editing Org mode files within Emacs. :-)  Not a big deal, of course.

François

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Changing [X] by something else
  2012-02-08 17:29   ` François Pinard
@ 2012-02-08 17:40     ` suvayu ali
  0 siblings, 0 replies; 16+ messages in thread
From: suvayu ali @ 2012-02-08 17:40 UTC (permalink / raw)
  To: François Pinard; +Cc: emacs-orgmode

Hi François,

2012/2/8 François Pinard <pinard@iro.umontreal.ca>:
> suvayu ali <fatkasuvayu+linux@gmail.com> writes:
>
>> Hi François,
>
> Hi, Suvayu (or Ali?)
>

Which ever comes natural to you, I don't mind either. :)

>> Although I am just a user I feel this falls into the same category as
>> the request from last year to make the stars in a headline
>> configurable. This is an integral part of org syntax.
>
> Well, Org mode is built over Outline mode, stars are coming from there.
> While [?] are pure Org mode additions, so Org "owns" it better...
>

True, in the discussion about stars I believe the suggestion was to use
a regex for the headline marker in outline-mode. But the majority
opinion was it would be too fragile. Your argument that org owns this
better is probably correct, but I am no expert. Nicolas is the list
expert, he will be able to say how easy/feasible/difficult it would be
to make this customisable.

>> making org syntax customisable defeats interoperability and breaks
>> external tools written to parse org files.
>
> Exactly my objection to my own suggestion.
>

:)

>> That said, I believe you can customise how these check boxes are
>> exported to various backends. AFAIR, there is a nice thread discussing
>> the case for latex export from the end of last year.
>
> Oh, I was not at all thinking about export.  Just my own pleasure while
> editing Org mode files within Emacs. :-)  Not a big deal, of course.
>

Ah! Lets wait for the experts to comment.

> François

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Changing [X] by something else
  2012-02-08 17:04 Changing [X] by something else François Pinard
  2012-02-08 17:16 ` suvayu ali
@ 2012-02-09 16:26 ` Nicolas Goaziou
  2012-02-09 16:54   ` François Pinard
  2012-02-10 13:23   ` Allen S. Rout
  2012-02-11  9:40 ` Reiner Steib
  2012-02-11 15:39 ` Jambunathan K
  3 siblings, 2 replies; 16+ messages in thread
From: Nicolas Goaziou @ 2012-02-09 16:26 UTC (permalink / raw)
  To: François Pinard; +Cc: emacs-orgmode

Hello,

pinard@iro.umontreal.ca (François Pinard) writes:

> I notice in org.el that [X] is hard-wired, while I would have liked the
> possibility of changing it by [✓] in my things, which I find both softer
> and cleaner.  Could these ([ ], [-] and [X]) be turned into variables?
> The difficulty might be to recognize them properly, I guess.
>
> While it would be nice that I could change it, it might also have a
> negative effect, making Org files less interoperable between people.  On
> the other hand, the TODO keywords are already changeable, so there is a
> kind of precedent :-).

Allowing to configure TODO keywords is mandatory if we aim at providing
a decent tool for project planning. On the other hand, customizable
check-boxes is only icing on the cake and doesn't add any
functionality. Hence, I wouldn't call it a "kind of precedent".

I don't think that we should allow basic structural elements to
change. As you said, it will make Org documents less interoperable, but
also less _recognizable_. What would happen to Org if every user could
come up with its own syntax? Could we even talk about an "Org format"
anymore?

I'd rather keep it simple and consistent. It may be a bit ugly at times,
but don't we all feel at home with plain text?


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Changing [X] by something else
  2012-02-09 16:26 ` Nicolas Goaziou
@ 2012-02-09 16:54   ` François Pinard
  2012-02-10 13:24     ` Allen S. Rout
  2012-02-10 13:23   ` Allen S. Rout
  1 sibling, 1 reply; 16+ messages in thread
From: François Pinard @ 2012-02-09 16:54 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> It may be a bit ugly at times, but don't we all feel at home with
> plain text?

We surely do.  Yet, now that we all swim within Unicode -- aren't we?
:-) --, ASCII feels a bit constricted.

François

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Changing [X] by something else
  2012-02-09 16:26 ` Nicolas Goaziou
  2012-02-09 16:54   ` François Pinard
@ 2012-02-10 13:23   ` Allen S. Rout
  1 sibling, 0 replies; 16+ messages in thread
From: Allen S. Rout @ 2012-02-10 13:23 UTC (permalink / raw)
  To: emacs-orgmode

On 02/09/2012 11:26 AM, Nicolas Goaziou wrote:
> Hello,
>
> pinard@iro.umontreal.ca (François Pinard) writes:
>
>> I notice in org.el that [X] is hard-wired, while I would have liked the
>> possibility of changing it by [✓] in my things, which I find both softer
>> and cleaner.  Could these ([ ], [-] and [X]) be turned into variables?
>> The difficulty might be to recognize them properly, I guess.

> I don't think that we should allow basic structural elements to
> change. As you said, it will make Org documents less interoperable, but
> also less _recognizable_. What would happen to Org if every user could
> come up with its own syntax? Could we even talk about an "Org format"
> anymore?


M. Pinard may want to look into changing the way that glyph displays... 
  If we were to define a font face which was used for checkboxes, he 
could then specify for that font an edited font which displays his 
desired checkmark in the character formerly knows as  'X'.


- Allen S. Rout

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Changing [X] by something else
  2012-02-09 16:54   ` François Pinard
@ 2012-02-10 13:24     ` Allen S. Rout
  2012-02-12  4:06       ` François Pinard
  0 siblings, 1 reply; 16+ messages in thread
From: Allen S. Rout @ 2012-02-10 13:24 UTC (permalink / raw)
  To: emacs-orgmode

On 02/09/2012 11:54 AM, François Pinard wrote:
> Nicolas Goaziou<n.goaziou@gmail.com>  writes:
>
>> It may be a bit ugly at times, but don't we all feel at home with
>> plain text?
>
> We surely do.  Yet, now that we all swim within Unicode -- aren't we?

Nope.

- Allen S. Rout

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Changing [X] by something else
  2012-02-08 17:04 Changing [X] by something else François Pinard
  2012-02-08 17:16 ` suvayu ali
  2012-02-09 16:26 ` Nicolas Goaziou
@ 2012-02-11  9:40 ` Reiner Steib
  2012-02-11 15:39 ` Jambunathan K
  3 siblings, 0 replies; 16+ messages in thread
From: Reiner Steib @ 2012-02-11  9:40 UTC (permalink / raw)
  To: emacs-orgmode

On Wed, Feb 08 2012, François Pinard wrote:

> I notice in org.el that [X] is hard-wired, while I would have liked the
> possibility of changing it by [✓] in my things, which I find both softer
> and cleaner.  Could these ([ ], [-] and [X]) be turned into variables?
> The difficulty might be to recognize them properly, I guess.
>
> While it would be nice that I could change it, it might also have a
> negative effect, making Org files less interoperable between people.  On
> the other hand, the TODO keywords are already changeable, so there is a
> kind of precedent :-).

You probably could use display strings so the file on disk won't
change at all.

(info "(elisp)Display Property")
(info "(elisp)Replacing Specs")

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Changing [X] by something else
  2012-02-08 17:04 Changing [X] by something else François Pinard
                   ` (2 preceding siblings ...)
  2012-02-11  9:40 ` Reiner Steib
@ 2012-02-11 15:39 ` Jambunathan K
  2012-02-11 19:10   ` Jambunathan K
  2012-02-12  2:44   ` François Pinard
  3 siblings, 2 replies; 16+ messages in thread
From: Jambunathan K @ 2012-02-11 15:39 UTC (permalink / raw)
  To: François Pinard; +Cc: emacs-orgmode

pinard@iro.umontreal.ca (François Pinard) writes:

> I notice in org.el that [X] is hard-wired, while I would have liked the
> possibility of changing it by [✓] in my things, which I find both softer
> and cleaner.

How about a variation of this

#+begin_src emacs-lisp
  (font-lock-add-keywords
   'org-mode `(("\\[X\\]"
                (0 (progn (compose-region (match-beginning 0) (match-end 0)
                                          "✓")
                          nil)))))
#+end_src

along the lines of http://www.emacswiki.org/emacs/PrettyLambda

-- 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Changing [X] by something else
  2012-02-11 15:39 ` Jambunathan K
@ 2012-02-11 19:10   ` Jambunathan K
  2012-02-11 19:18     ` Jon Miller
  2012-02-12  2:44   ` François Pinard
  1 sibling, 1 reply; 16+ messages in thread
From: Jambunathan K @ 2012-02-11 19:10 UTC (permalink / raw)
  To: François Pinard; +Cc: emacs-orgmode

Jambunathan K <kjambunathan@gmail.com> writes:

> pinard@iro.umontreal.ca (François Pinard) writes:
>
>> I notice in org.el that [X] is hard-wired, while I would have liked the
>> possibility of changing it by [✓] in my things, which I find both softer
>> and cleaner.
>
> How about a variation of this
>
> #+begin_src emacs-lisp
>   (font-lock-add-keywords
>    'org-mode `(("\\[X\\]"
>                 (0 (progn (compose-region (match-beginning 0) (match-end 0)
>                                           "")
>                           nil)))))
> #+end_src
>
> along the lines of http://www.emacswiki.org/emacs/PrettyLambda

Btw, C-h f org-toggle-pretty-entities does composition and decomposition.
-- 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Changing [X] by something else
  2012-02-11 19:10   ` Jambunathan K
@ 2012-02-11 19:18     ` Jon Miller
  0 siblings, 0 replies; 16+ messages in thread
From: Jon Miller @ 2012-02-11 19:18 UTC (permalink / raw)
  To: Jambunathan K; +Cc: François Pinard, emacs-orgmode

I like the idea... Here is another alternative:
 (font-lock-add-keywords
  'org-mode `(("\\[X\\]"
               (0 (progn (compose-region (match-beginning 0) (match-end 0)
                                         "☑")
                         nil)))
	      ("\\[ \\]"
               (0 (progn (compose-region (match-beginning 0) (match-end 0)
                                         "☐")
                         nil)))))

-- Jon Miller

2012/2/11 Jambunathan K <kjambunathan@gmail.com>:
> Jambunathan K <kjambunathan@gmail.com> writes:
>
>> pinard@iro.umontreal.ca (François Pinard) writes:
>>
>>> I notice in org.el that [X] is hard-wired, while I would have liked the
>>> possibility of changing it by [✓] in my things, which I find both softer
>>> and cleaner.
>>
>> How about a variation of this
>>
>> #+begin_src emacs-lisp
>>   (font-lock-add-keywords
>>    'org-mode `(("\\[X\\]"
>>                 (0 (progn (compose-region (match-beginning 0) (match-end 0)
>>                                           "")
>>                           nil)))))
>> #+end_src
>>
>> along the lines of http://www.emacswiki.org/emacs/PrettyLambda
>
> Btw, C-h f org-toggle-pretty-entities does composition and decomposition.
> --
>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Changing [X] by something else
  2012-02-11 15:39 ` Jambunathan K
  2012-02-11 19:10   ` Jambunathan K
@ 2012-02-12  2:44   ` François Pinard
  2012-02-12  6:19     ` Jambunathan K
  1 sibling, 1 reply; 16+ messages in thread
From: François Pinard @ 2012-02-12  2:44 UTC (permalink / raw)
  To: Jambunathan K; +Cc: emacs-orgmode

Jambunathan K <kjambunathan@gmail.com> writes:

> pinard@iro.umontreal.ca (François Pinard) writes:

> along the lines of http://www.emacswiki.org/emacs/PrettyLambda

Thanks for this pointer, which I saved for later study.

>> I notice in org.el that [X] is hard-wired, while I would have liked the
>> possibility of changing it by [✓] in my things, which I find both softer
>> and cleaner.

> How about a variation of this

>   (font-lock-add-keywords
>    'org-mode `(("\\[X\\]"
>                 (0 (progn (compose-region (match-beginning 0) (match-end 0)
>                                           "")
>                           nil)))))

New concepts for me in this `compose-region'!  Handa-san strikes again! :-)

I confess I do not understand much of it.  Ctrl-S being turned into a
rectangle is mysterious.  Is it the standard way for Emacs to tell about
a non-printable character?  The documentation of font-lock-add-keywords
does not hint me at what may be those S-exprs which are not faces.

Moreover, the effect is a bit tiny or shy, at least compared to what I
expected.  The suggestions of John Miller yield tiny characters as well.
Presumably, I could try to see if I can force higher font sizes, but
that would be diving deeper into trickery, and away from other problems.
Despite the undoubtedly ingenious suggestion, I guess I'll merely stick
with what Org mode already offers, as it's the best I got so far! :-)

In any case, I'm grateful for your interest, and for sharing ideas.

François

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Changing [X] by something else
  2012-02-10 13:24     ` Allen S. Rout
@ 2012-02-12  4:06       ` François Pinard
  0 siblings, 0 replies; 16+ messages in thread
From: François Pinard @ 2012-02-12  4:06 UTC (permalink / raw)
  To: emacs-orgmode

"Allen S. Rout" <asr@ufl.edu> writes:

> On 02/09/2012 11:54 AM, François Pinard wrote:
>> Nicolas Goaziou<n.goaziou@gmail.com>  writes:
>>
>>> It may be a bit ugly at times, but don't we all feel at home with
>>> plain text?
>>
>> We surely do.  Yet, now that we all swim within Unicode -- aren't we?

> Nope.

:-).  Come on!  UTF-8 has been *designed* so all Americans could rightly
claim, out of the box, that they comply and are using it when they
write, without having to change the slightest iota in their work habits.

Reading UTF-8?  No problem either, given it has been written by other
Americans.  UTF-8 from other countries?  Oh!  That's another story... :-)

François

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Changing [X] by something else
  2012-02-12  2:44   ` François Pinard
@ 2012-02-12  6:19     ` Jambunathan K
  2012-02-12 14:12       ` François Pinard
  0 siblings, 1 reply; 16+ messages in thread
From: Jambunathan K @ 2012-02-12  6:19 UTC (permalink / raw)
  To: François Pinard; +Cc: emacs-orgmode


> Ctrl-S being turned into a rectangle is mysterious.  Is it the
> standard way for Emacs to tell about a non-printable character?

There is no Ctrl-S character only a tick mark in the compose-region
snippet that I shared.

You can see the tick mark if you follow this link:
http://article.gmane.org/gmane.emacs.orgmode/52281

The tickmark is produced by 
M-x ucs-insert RET CHECK MARK RET

If the above command doesn't yield a tick mark the issue is with your
setup. May be copy-paste from your Emacs client to your Elisp file
garbled the characters?
-- 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Changing [X] by something else
  2012-02-12  6:19     ` Jambunathan K
@ 2012-02-12 14:12       ` François Pinard
  0 siblings, 0 replies; 16+ messages in thread
From: François Pinard @ 2012-02-12 14:12 UTC (permalink / raw)
  To: Jambunathan K; +Cc: emacs-orgmode

Jambunathan K <kjambunathan@gmail.com> writes:

>> Ctrl-S being turned into a rectangle is mysterious.  Is it the
>> standard way for Emacs to tell about a non-printable character?

> You can see the tick mark if you follow this link:
> http://article.gmane.org/gmane.emacs.orgmode/52281

Oops, indeed!

Checking more closely on the message you originally sent to me (with a
Cc: to the mailing list)...  There were two check marks in the message.
If I open the message raw in Gnus (`C-u g' in the summary buffer), I see
both of them coded as =E2=9C=93.  But if I let Gnus to render the
message, while the first check mark is OK, the second gets mangled into
a Ctrl-S.  Could it be a problem with the Gnus rendering mechanics for
whatever sits between #+begin_src and #+end_src?

> If the above command doesn't yield a tick mark the issue is with your
> setup.

Changing the Ctrl-S by the check mark, within ~/.emacs, now makes much
more sense!  I'm getting exactly what I wanted through this writing,
inspired from yours (thanks, Jambunathan!):


(font-lock-add-keywords
 'org-mode
 '(("\\[\\(X\\)\\]"
    (0 (progn (compose-region (match-beginning 1) (match-end 1) "✔") nil)))
   ))


I'm being lucky here, as I only barely understand what the incantation
means! :-)

François

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-02-12 14:12 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-08 17:04 Changing [X] by something else François Pinard
2012-02-08 17:16 ` suvayu ali
2012-02-08 17:29   ` François Pinard
2012-02-08 17:40     ` suvayu ali
2012-02-09 16:26 ` Nicolas Goaziou
2012-02-09 16:54   ` François Pinard
2012-02-10 13:24     ` Allen S. Rout
2012-02-12  4:06       ` François Pinard
2012-02-10 13:23   ` Allen S. Rout
2012-02-11  9:40 ` Reiner Steib
2012-02-11 15:39 ` Jambunathan K
2012-02-11 19:10   ` Jambunathan K
2012-02-11 19:18     ` Jon Miller
2012-02-12  2:44   ` François Pinard
2012-02-12  6:19     ` Jambunathan K
2012-02-12 14:12       ` François Pinard

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).