R-mode: Support prettify-symbols-mode. #65

Merged
merged 1 commit into from Oct 28, 2013

Conversation

Projects
None yet
2 participants
@ruediger
Contributor

ruediger commented Oct 27, 2013

Prettify-symbols-mode is new in the upcoming Emacs release. It can
convert symbols into unicode representation, e.g., <- to ←. This patch
sets the prettify-symbols-alist. The user can then activate the
prettify mode by calling prettify-symbols-mode.

  • lisp/ess-r-d.el (R-mode--prettify-symbols-alist): New constant.
    (R-mode): Set prettify-symbols-alist.

Signed-off-by: Rüdiger Sonderfeld ruediger@c-plusplus.de

@vspinu

This comment has been minimized.

Show comment
Hide comment
@vspinu

vspinu Oct 27, 2013

Member

Thanks for this.
Thanks.

Why to make it const and --? People might want to customize it, right?

Could you please rename it into ess-R-prettify-symbols-alist and then instead of directly setting prettify-symbols-alist add it to R-editing-alist in ess-s-l.el. This is how we set dialect specific variables in ess.

Member

vspinu commented Oct 27, 2013

Thanks for this.
Thanks.

Why to make it const and --? People might want to customize it, right?

Could you please rename it into ess-R-prettify-symbols-alist and then instead of directly setting prettify-symbols-alist add it to R-editing-alist in ess-s-l.el. This is how we set dialect specific variables in ess.

@ruediger

This comment has been minimized.

Show comment
Hide comment
@ruediger

ruediger Oct 27, 2013

Contributor

Why to make it const and --? People might want to customize it, right?

From the prettify-symbols-mode description

To add further customizations
for a given major mode, you can modify `prettify-symbols-alist' thus:

(add-hook 'emacs-lisp-mode-hook
(lambda ()
(push '("<=" . ?≤) prettify-symbols-alist)))

The user is supposed to change prettify-symbols-alist in the mode hook directly. I think it's best if we follow that suggestion and treat ess-R--prettify-symbols-alist as a constant not customizable by the user.

Contributor

ruediger commented Oct 27, 2013

Why to make it const and --? People might want to customize it, right?

From the prettify-symbols-mode description

To add further customizations
for a given major mode, you can modify `prettify-symbols-alist' thus:

(add-hook 'emacs-lisp-mode-hook
(lambda ()
(push '("<=" . ?≤) prettify-symbols-alist)))

The user is supposed to change prettify-symbols-alist in the mode hook directly. I think it's best if we follow that suggestion and treat ess-R--prettify-symbols-alist as a constant not customizable by the user.

@vspinu

This comment has been minimized.

Show comment
Hide comment
@vspinu

vspinu Oct 27, 2013

Member

That way of customisation will be available anyhow, whether ess-R version is customizable or not. We can avoid creating new symbol altogether by adding prettify-symbols-alist in R-editing-alist or R-customize-alist (the second one will make them work in inferior buffers as well, I am not sure if that is also needed.)

Member

vspinu commented Oct 27, 2013

That way of customisation will be available anyhow, whether ess-R version is customizable or not. We can avoid creating new symbol altogether by adding prettify-symbols-alist in R-editing-alist or R-customize-alist (the second one will make them work in inferior buffers as well, I am not sure if that is also needed.)

R-mode: Support prettify-symbols-mode.
Prettify-symbols-mode is new in the upcoming Emacs release.  It can
convert symbols into unicode representation, e.g., <- to ←.  This patch
sets the `prettify-symbols-alist'.  The user can then activate the
prettify mode by calling `prettify-symbols-mode'.

* lisp/ess-r-d.el (R-customize-alist): Set `prettify-symbols-alist'.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
@ruediger

This comment has been minimized.

Show comment
Hide comment
@ruediger

ruediger Oct 28, 2013

Contributor

I think support in inferior buffers makes sense. I changed the commit to set prettify-symbols-alist in R-customize-alist.

Contributor

ruediger commented Oct 28, 2013

I think support in inferior buffers makes sense. I changed the commit to set prettify-symbols-alist in R-customize-alist.

vspinu added a commit that referenced this pull request Oct 28, 2013

Merge pull request #65 from ruediger/prettify-mode
R-mode: Support prettify-symbols-mode.

@vspinu vspinu merged commit 7e61ba2 into emacs-ess:master Oct 28, 2013

@ruediger ruediger deleted the ruediger:prettify-mode branch Oct 28, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment