unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* can emacs do this
@ 2015-01-15  7:24 Rusi
  2015-01-15  7:57 ` Pascal J. Bourguignon
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Rusi @ 2015-01-15  7:24 UTC (permalink / raw)
  To: help-gnu-emacs

Here is a vi plugin to show python with more unicode-goodness than the default

https://github.com/yawaramin/vim-cute-python

Specifically here is a syntax file
https://github.com/yawaramin/vim-cute-python/blob/moresymbols/after/syntax/python.vim

What facilities of emacs can be used for this?


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

* Re: can emacs do this
  2015-01-15  7:24 can emacs do this Rusi
@ 2015-01-15  7:57 ` Pascal J. Bourguignon
  2015-01-15 14:10   ` Drew Adams
  2015-01-15 15:25   ` Ted Zlatanov
  2015-01-15  8:01 ` Charles Philip Chan
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 9+ messages in thread
From: Pascal J. Bourguignon @ 2015-01-15  7:57 UTC (permalink / raw)
  To: help-gnu-emacs


Of course.  

Any question starting by "Can emacs do …" has a positive answer.  So
what's the purpose of asking?


> What facilities of emacs can be used for this?

Just use emacs, there's no need for anything special!

    (defun √ (x) (sqrt x))
    (√ 42) --> 6.48074069840786
    (defmacro λ (λ-list &rest body) `(lambda ,λ-list ,@body))λ
    (mapcar (λ (x) (* x x)) '(1 2 3 4)) --> (1 4 9 16)


There's also an alternative, where emacs displays eg. λ when there is
lambda in the file:

http://www.emacswiki.org/emacs/PrettySymbol
http://www.emacswiki.org/emacs/PrettyGreek

-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


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

* Re: can emacs do this
  2015-01-15  7:24 can emacs do this Rusi
  2015-01-15  7:57 ` Pascal J. Bourguignon
@ 2015-01-15  8:01 ` Charles Philip Chan
  2015-01-15 14:22 ` Stefan Monnier
       [not found] ` <mailman.17951.1421331793.1147.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 9+ messages in thread
From: Charles Philip Chan @ 2015-01-15  8:01 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

On 15 Jan 2015, rustompmody@gmail.com wrote:

> Here is a vi plugin to show python with more unicode-goodness than the
> default
>
> https://github.com/yawaramin/vim-cute-python
>
> Specifically here is a syntax file
> https://github.com/yawaramin/vim-cute-python/blob/moresymbols/after/syntax/python.vim
>
> What facilities of emacs can be used for this?

Personally, I use pretty-mode:

  https://github.com/akatov/pretty-mode

However, there are many different options:

  http://www.emacswiki.org/emacs/PrettySymbol

Charles

-- 
Running Windows on a Pentium is like having a brand new Porsche but only
be able to drive backwards with the handbrake on.
(Unknown source)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 180 bytes --]

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

* RE: can emacs do this
  2015-01-15  7:57 ` Pascal J. Bourguignon
@ 2015-01-15 14:10   ` Drew Adams
  2015-01-15 15:25   ` Ted Zlatanov
  1 sibling, 0 replies; 9+ messages in thread
From: Drew Adams @ 2015-01-15 14:10 UTC (permalink / raw)
  To: Pascal J. Bourguignon, help-gnu-emacs

>     (defmacro λ (λ-list &rest body) `(lambda ,λ-list ,@body))λ
> 
> There's also an alternative, where emacs displays eg. λ when there is
> lambda in the file:
> 
> http://www.emacswiki.org/emacs/PrettySymbol
> http://www.emacswiki.org/emacs/PrettyGreek

For just lambda:
http://www.emacswiki.org/emacs/PrettyLambda



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

* Re: can emacs do this
  2015-01-15  7:24 can emacs do this Rusi
  2015-01-15  7:57 ` Pascal J. Bourguignon
  2015-01-15  8:01 ` Charles Philip Chan
@ 2015-01-15 14:22 ` Stefan Monnier
       [not found] ` <mailman.17951.1421331793.1147.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2015-01-15 14:22 UTC (permalink / raw)
  To: help-gnu-emacs

> What facilities of emacs can be used for this?

The standard facility for that in recent Emacsen is
`prettify-symbols-mode', which you can set up with something like

   (add-hook 'python-mode-hook
             (lambda ()
               (setq-local prettify-symbols-alist
                           '(("lambda" . ?λ)
                             ("math.sqrt" . ?√)
                             ("math.pi" . ?π)
                             ("sum" . ?Σ)))
               (prettify-symbols-mode 1)))


– Stefan




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

* Re: can emacs do this
  2015-01-15  7:57 ` Pascal J. Bourguignon
  2015-01-15 14:10   ` Drew Adams
@ 2015-01-15 15:25   ` Ted Zlatanov
  1 sibling, 0 replies; 9+ messages in thread
From: Ted Zlatanov @ 2015-01-15 15:25 UTC (permalink / raw)
  To: help-gnu-emacs

On Thu, 15 Jan 2015 08:57:17 +0100 "Pascal J. Bourguignon" <pjb@informatimago.com> wrote: 

PJB> Any question starting by "Can emacs do …" has a positive answer.  So
PJB> what's the purpose of asking?

Related: https://www.reddit.com/r/programming/comments/675jj/richard_stallman_is_the_new_chuck_norris

Ted


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

* Re: can emacs do this
       [not found] ` <mailman.17951.1421331793.1147.help-gnu-emacs@gnu.org>
@ 2015-01-15 17:27   ` Rusi
  2015-01-15 17:52     ` Dan Espen
  0 siblings, 1 reply; 9+ messages in thread
From: Rusi @ 2015-01-15 17:27 UTC (permalink / raw)
  To: help-gnu-emacs

On Thursday, January 15, 2015 at 7:53:14 PM UTC+5:30, Stefan Monnier wrote:
> > What facilities of emacs can be used for this?
> 
> The standard facility for that in recent Emacsen is
> `prettify-symbols-mode', which you can set up with something like
> 
>    (add-hook 'python-mode-hook
>              (lambda ()
>                (setq-local prettify-symbols-alist
>                            '(("lambda" . ?λ)
>                              ("math.sqrt" . ?√)
>                              ("math.pi" . ?π)
>                              ("sum" . ?Σ)))
>                (prettify-symbols-mode 1)))


Doesn't work in 24.3.1 does it?


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

* Re: can emacs do this
  2015-01-15 17:27   ` Rusi
@ 2015-01-15 17:52     ` Dan Espen
  2015-01-15 23:41       ` Alexis
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Espen @ 2015-01-15 17:52 UTC (permalink / raw)
  To: help-gnu-emacs

Rusi <rustompmody@gmail.com> writes:

> On Thursday, January 15, 2015 at 7:53:14 PM UTC+5:30, Stefan Monnier wrote:
>> > What facilities of emacs can be used for this?
>> 
>> The standard facility for that in recent Emacsen is
>> `prettify-symbols-mode', which you can set up with something like
>> 
>>    (add-hook 'python-mode-hook
>>              (lambda ()
>>                (setq-local prettify-symbols-alist
>>                            '(("lambda" . ?λ)
>>                              ("math.sqrt" . ?√)
>>                              ("math.pi" . ?π)
>>                              ("sum" . ?Σ)))
>>                (prettify-symbols-mode 1)))
>
>
> Doesn't work in 24.3.1 does it?

Looks like 24.4:

http://emacsredux.com/blog/2014/08/25/a-peek-at-emacs-24-dot-4-prettify-symbols-mode/

-- 
Dan Espen


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

* Re: can emacs do this
  2015-01-15 17:52     ` Dan Espen
@ 2015-01-15 23:41       ` Alexis
  0 siblings, 0 replies; 9+ messages in thread
From: Alexis @ 2015-01-15 23:41 UTC (permalink / raw)
  To: help-gnu-emacs


Dan Espen writes:

> Rusi <rustompmody@gmail.com> writes:
>
>> On Thursday, January 15, 2015 at 7:53:14 PM UTC+5:30, Stefan Monnier wrote:
>>> > What facilities of emacs can be used for this?
>>> 
>>> The standard facility for that in recent Emacsen is
>>> `prettify-symbols-mode', which you can set up with something like
>>> 
>>>    (add-hook 'python-mode-hook
>>>              (lambda ()
>>>                (setq-local prettify-symbols-alist
>>>                            '(("lambda" . ?λ)
>>>                              ("math.sqrt" . ?√)
>>>                              ("math.pi" . ?π)
>>>                              ("sum" . ?Σ)))
>>>                (prettify-symbols-mode 1)))
>>
>>
>> Doesn't work in 24.3.1 does it?
>
> Looks like 24.4:
>
> http://emacsredux.com/blog/2014/08/25/a-peek-at-emacs-24-dot-4-prettify-symbols-mode/

Perhaps the `pretty-symbols` package, available from MELPA, might work
for those using Emacs < 24.4?

http://github.com/drothlis/pretty-symbols


Alexis.



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

end of thread, other threads:[~2015-01-15 23:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-15  7:24 can emacs do this Rusi
2015-01-15  7:57 ` Pascal J. Bourguignon
2015-01-15 14:10   ` Drew Adams
2015-01-15 15:25   ` Ted Zlatanov
2015-01-15  8:01 ` Charles Philip Chan
2015-01-15 14:22 ` Stefan Monnier
     [not found] ` <mailman.17951.1421331793.1147.help-gnu-emacs@gnu.org>
2015-01-15 17:27   ` Rusi
2015-01-15 17:52     ` Dan Espen
2015-01-15 23:41       ` Alexis

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