emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* how to best make characters invisible in a org-derived mode
@ 2013-04-27  3:29 Christian Wittern
  2013-04-30 19:37 ` John Hendy
  2013-05-01  7:43 ` Andreas Röhler
  0 siblings, 2 replies; 5+ messages in thread
From: Christian Wittern @ 2013-04-27  3:29 UTC (permalink / raw)
  To: Org Mode Mailing List

Hi orgers,

In a mode derived from org-mode, I would like to hide some characters with a 
special function to make the display cleaner. There are two cases:
  - special characters that should be always invisible
  - strings matched by a regex that should be invisible

I would be glad for any pointers or ideas on how to implement this, either 
by piggy-packing on org-mode code or by using generic Emacs features.

All the best,

Christian

-- 
Christian Wittern, Kyoto

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

* Re: how to best make characters invisible in a org-derived mode
  2013-04-27  3:29 how to best make characters invisible in a org-derived mode Christian Wittern
@ 2013-04-30 19:37 ` John Hendy
  2013-05-01  7:43 ` Andreas Röhler
  1 sibling, 0 replies; 5+ messages in thread
From: John Hendy @ 2013-04-30 19:37 UTC (permalink / raw)
  To: Christian Wittern; +Cc: Org Mode Mailing List

On Fri, Apr 26, 2013 at 10:29 PM, Christian Wittern <cwittern@gmail.com> wrote:
> Hi orgers,
>
> In a mode derived from org-mode, I would like to hide some characters with a
> special function to make the display cleaner. There are two cases:
>  - special characters that should be always invisible
>  - strings matched by a regex that should be invisible
>
> I would be glad for any pointers or ideas on how to implement this, either
> by piggy-packing on org-mode code or by using generic Emacs features.

Meant to respond to this earlier. Reading this brought to mind the
setting =org-hide-leading-stars=. See this for more:
- http://orgmode.org/manual/Clean-view.html

Perhaps check out some of those variables, or at least the hiding of
leading stars, as it might at least give you some ideas of how this is
implemented in Org. I'm no elisper, so that's about the best I can
provide and I have no idea of Org's implementation will match your
goals, but it was worth a shot.


Best regards,
John

>
> All the best,
>
> Christian
>
> --
> Christian Wittern, Kyoto
>
>

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

* Re: how to best make characters invisible in a org-derived mode
  2013-04-27  3:29 how to best make characters invisible in a org-derived mode Christian Wittern
  2013-04-30 19:37 ` John Hendy
@ 2013-05-01  7:43 ` Andreas Röhler
  2013-05-01 22:58   ` Christian Wittern
  1 sibling, 1 reply; 5+ messages in thread
From: Andreas Röhler @ 2013-05-01  7:43 UTC (permalink / raw)
  To: emacs-orgmode

Am 27.04.2013 05:29, schrieb Christian Wittern:
> Hi orgers,
>
> In a mode derived from org-mode, I would like to hide some characters with a special function to make the display cleaner. There are two cases:
>   - special characters that should be always invisible
>   - strings matched by a regex that should be invisible
>
> I would be glad for any pointers or ideas on how to implement this, either by piggy-packing on org-mode code or by using generic Emacs features.
>
> All the best,
>
> Christian
>

Hi,

maybe have a look how

ar-hide-bracketed-in-line-atpt

for example is implemented.

https://launchpad.net/s-x-emacs-werkstatt/
https://launchpad.net/s-x-emacs-werkstatt/trunk/1.3/+download/S-X-Emacs-Werkstatt-1.3.tar.gz

This provides a framework for tasks like this.

HTH,

Andreas

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

* Re: how to best make characters invisible in a org-derived mode
  2013-05-01  7:43 ` Andreas Röhler
@ 2013-05-01 22:58   ` Christian Wittern
  2013-05-02  5:49     ` Andreas Röhler
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Wittern @ 2013-05-01 22:58 UTC (permalink / raw)
  To: emacs-orgmode

Hi Andreas, Hi John

Thank both of you for trying to get me on track.

On 2013-05-01 16:43, Andreas Röhler wrote:
> maybe have a look how
>
> ar-hide-bracketed-in-line-atpt
>
> for example is implemented. 
I can't actually find this function, but I get the general point from the 
files in Emacs Werkstatt.

What tripped me up originally that simply setting a region to 'invisible 
worked in fundamental mode, but not in org-mode.

I found the solution after I finally understood what
(info "(elisp) Invisible Text")
was trying to tell me:
- first set the desired region(s) to an arbitrary symbol, like my-symbol:
      (overlay-put (make-overlay beginning end)   'invisible 'my-symbol)
- next add this symbol to 'invisibility' spec :
      (add-to-invisibility-spec 'my-symbol)

After straighting this out I am now a happy camper, enjoying my uncluttered 
display.

All the best,

Christian



-- 
Christian Wittern, Kyoto

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

* Re: how to best make characters invisible in a org-derived mode
  2013-05-01 22:58   ` Christian Wittern
@ 2013-05-02  5:49     ` Andreas Röhler
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Röhler @ 2013-05-02  5:49 UTC (permalink / raw)
  To: emacs-orgmode

Am 02.05.2013 00:58, schrieb Christian Wittern:
> Hi Andreas, Hi John
>
> Thank both of you for trying to get me on track.
>
> On 2013-05-01 16:43, Andreas Röhler wrote:
>> maybe have a look how
>>
>> ar-hide-bracketed-in-line-atpt
>>
>> for example is implemented.
> I can't actually find this function, but I get the general point from the files in Emacs Werkstatt.
>
> What tripped me up originally that simply setting a region to 'invisible worked in fundamental mode, but not in org-mode.
>
> I found the solution after I finally understood what
> (info "(elisp) Invisible Text")
> was trying to tell me:
> - first set the desired region(s) to an arbitrary symbol, like my-symbol:
>       (overlay-put (make-overlay beginning end)   'invisible 'my-symbol)
> - next add this symbol to 'invisibility' spec :
>       (add-to-invisibility-spec 'my-symbol)
>
> After straighting this out I am now a happy camper, enjoying my uncluttered display.
>
> All the best,
>
> Christian
>
>
>

ar-hide-bracketed-in-line-atpt seems vanished indeed, something got broken. Thanks pointing at.

Andreas

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

end of thread, other threads:[~2013-05-02  5:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-27  3:29 how to best make characters invisible in a org-derived mode Christian Wittern
2013-04-30 19:37 ` John Hendy
2013-05-01  7:43 ` Andreas Röhler
2013-05-01 22:58   ` Christian Wittern
2013-05-02  5:49     ` Andreas Röhler

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).