Coder Social home page Coder Social logo

tiny's Introduction

Build Status Coverage Status

Main idea:

This is an alternative to inserting numeric ranges with macros (i.e. F3 F3). The advantages are:

  1. Brevity: consider F3 F3 SPC M-1 M-0 F4 vs. m10 C-;.

  2. Much better undo context: a single C-_ will undo the whole thing and allow you to edit the code. With macros you'd have to undo multiple times and restart from scratch, instead of tweaking what you just invoked.

  3. The ability to insert the same number several times in a single iteration, and transform it with format-style expressions e.g. m6\n15%s=0%o=0x%x will expand to

     6=06=0x6
     7=07=0x7
     8=010=0x8
     9=011=0x9
     10=012=0xa
     11=013=0xb
     12=014=0xc
     13=015=0xd
     14=016=0xe
     15=017=0xf
    
  4. Last but not least, the ability to transform the number with lisp expressions. For instance:

    1. m5 10*xx -> 25 36 49 64 81 100
    2. m5 10*xx|0x%x -> 0x19 0x24 0x31 0x40 0x51 0x64
    3. m10+x?a%c -> a b c d e f g h i j k
    4. m10+x?A%c -> A B C D E F G H I J K
    5. m97,105stringx -> a,b,c,d,e,f,g,h,i
    6. m97,102stringxupcasex -> aA,bB,cC,dD,eE,fF
    7. m,3|%(+ x x) and %(* x x) and %s -> 0 and 0 and 0,2 and 1 and 1,4 and 4 and 2,6 and 9 and 3,8 and 16 and 4,10 and 25 and 5

Use in conjunction with org-mode:

m1\n14|*** TODO http://emacsrocks.com/e%02d.html

*** TODO http://emacsrocks.com/e01.html
*** TODO http://emacsrocks.com/e02.html
*** TODO http://emacsrocks.com/e03.html
*** TODO http://emacsrocks.com/e04.html
*** TODO http://emacsrocks.com/e05.html
*** TODO http://emacsrocks.com/e06.html
*** TODO http://emacsrocks.com/e07.html
*** TODO http://emacsrocks.com/e08.html
*** TODO http://emacsrocks.com/e09.html
*** TODO http://emacsrocks.com/e10.html
*** TODO http://emacsrocks.com/e11.html
*** TODO http://emacsrocks.com/e12.html
*** TODO http://emacsrocks.com/e13.html
*** TODO http://emacsrocks.com/e14.html

You can even schedule and deadline:

m\n8|**** TODO Learning from Data Week %(+ x 2) \nSCHEDULED: <%(date "Oct 7" (* x 7))> DEADLINE: <%(date "Oct 14" (* x 7))>

**** TODO Learning from Data Week 2
SCHEDULED: <2013-10-07 Mon> DEADLINE: <2013-10-14 Mon>
**** TODO Learning from Data Week 3
SCHEDULED: <2013-10-14 Mon> DEADLINE: <2013-10-21 Mon>
**** TODO Learning from Data Week 4
SCHEDULED: <2013-10-21 Mon> DEADLINE: <2013-10-28 Mon>
**** TODO Learning from Data Week 5
SCHEDULED: <2013-10-28 Mon> DEADLINE: <2013-11-04 Mon>
**** TODO Learning from Data Week 6
SCHEDULED: <2013-11-04 Mon> DEADLINE: <2013-11-11 Mon>
**** TODO Learning from Data Week 7
SCHEDULED: <2013-11-11 Mon> DEADLINE: <2013-11-18 Mon>
**** TODO Learning from Data Week 8
SCHEDULED: <2013-11-18 Mon> DEADLINE: <2013-11-25 Mon>
**** TODO Learning from Data Week 9
SCHEDULED: <2013-11-25 Mon> DEADLINE: <2013-12-02 Mon>
**** TODO Learning from Data Week 10
SCHEDULED: <2013-12-02 Mon> DEADLINE: <2013-12-09 Mon>

Here's how to schedule a task that repeats Monday through Friday at 10:00, every week:

m0\n4|** TODO Something work-related\nSCHEDULED: <%(date "mon" x) 10:00 +1w>

** TODO Something work-related
SCHEDULED: <2013-11-04 Mon 10:00 +1w>
** TODO Something work-related
SCHEDULED: <2013-11-05 Tue 10:00 +1w>
** TODO Something work-related
SCHEDULED: <2013-11-06 Wed 10:00 +1w>
** TODO Something work-related
SCHEDULED: <2013-11-07 Thu 10:00 +1w>
** TODO Something work-related
SCHEDULED: <2013-11-08 Fri 10:00 +1w>

Setup

In ~/.emacs:

(require 'tiny)
(tiny-setup-default)

tiny's People

Contributors

abo-abo avatar kaushalmodi avatar nverno avatar sachac avatar monnier avatar

Stargazers

 avatar Zaki Si-Lounis avatar Pavinberg avatar  avatar xy.wang avatar  avatar Bharath avatar Semen avatar  avatar Philip Ye avatar JunghanKim avatar  avatar Richard D Boyce, PhD avatar 杨睿 avatar Andy Shevchenko avatar Space avatar  avatar Justin Silverman avatar  avatar Benjamin avatar João Fernandes avatar Case Duckworth avatar Jason TIAN avatar Dong Yinghua avatar Lancelot Zhang avatar Justin Garcia avatar Jeremy O. avatar Yigit Emre Sahinoglu avatar Taylor Allen avatar Qingshui Zheng avatar Pavel Popov avatar Billy.Zheng avatar Raj avatar Luis Miguel Castañeda avatar Jumpei KAWAMI avatar Jorge Gomez avatar Enis Özgen avatar Owain West avatar Ye Zhaoliang avatar Rice Wine avatar Mateusz Berezecki avatar  avatar Allen Dang avatar Sriram avatar Eduardo V. avatar Skurikhin Alexandr avatar DengQi avatar tianshu avatar Ken Huang avatar  avatar  avatar Adam Schaefers avatar tg-z avatar Jonathan McHugh avatar  avatar William Carroll avatar  avatar Diwank Singh Tomer avatar wu avatar tomyli avatar Clemens Radermacher avatar Yuan Fu avatar Ryan Pilgrim avatar Troy Pracy avatar Thais Minet avatar  avatar  avatar sonn-gamm avatar Moritz Gnisia avatar Rangi Lin avatar showgood avatar Mostafa Hajizadeh avatar  avatar Ronaldo Lima avatar Torgeir Thoresen avatar  avatar  avatar Steve Lemuel avatar  avatar  avatar Stan avatar Jimmy Yuen Ho Wong avatar Keifer Furzland avatar eggcaker avatar Narendra Joshi avatar Takaaki ISHIKAWA avatar Sam Anderson avatar Oleg Pykhalov avatar Radon Rosborough avatar Filipe Silva avatar Alireza Rafiei avatar Steven Lumos avatar irtg avatar Paprika avatar Chutian Yang avatar Kyle avatar kostafey avatar  avatar Chakravarthy Raghunandan avatar Arturs Meinarts avatar

Watchers

Richard D Boyce, PhD avatar James Cloos avatar Ye Zhaoliang avatar  avatar  avatar  avatar  avatar

tiny's Issues

m97,102stringxupcasex not works

Based on Read me, when expand m97,102stringxupcasex should got aA,bB,cC,dD,eE,fF

m97,102stringxupcasex -> aA,bB,cC,dD,eE,fF

but when I expand this i got
97,98,99,100,101,102

Emacs version: 26.0.91
tiny version: 20170903.249

Would you consider accepting the tiny-helper function?

Hello,

I have been using tiny for many years. I though use it through a tiny-helper function sitting in my config. I use tiny.el but at times there are huge time gaps in-between and I forget the exact tiny syntax. That's where this helper has come to a great use.

https://github.com/kaushalmodi/.emacs.d/blob/master/setup-files/setup-tiny.el

Would you accept that for inclusion in tiny.el? If so, I can start work on refactoring it to make it PR-ready.

Nesting tiny expressions

I was trying to make this matrix:

  1   2   3   4   5   6   7   8   9  10
  2   4   6   8  10  12  14  16  18  20
  3   6   9  12  15  18  21  24  27  30
  4   8  12  16  20  24  28  32  36  40
  5  10  15  20  25  30  35  40  45  50
  6  12  18  24  30  36  42  48  54  60
  7  14  21  28  35  42  49  56  63  70
  8  16  24  32  40  48  56  64  72  80
  9  18  27  36  45  54  63  72  81  90
 10  20  30  40  50  60  70  80  90 100

and I ended up using m1\n10 to get

1
2
3
4
5
6
7
8
9
10

then with multiple-cursors, making

m1 10*x1|%3d
m1 10*x2|%3d
m1 10*x3|%3d
m1 10*x4|%3d
m1 10*x5|%3d
m1 10*x6|%3d
m1 10*x7|%3d
m1 10*x8|%3d
m1 10*x9|%3d
m1 10*x10|%3d

which expands to the matrix.

But what I wanted was to nest tiny-expand expressions, so I could do this without multiple-cursors. I couldn't figure out how to do it, trying expressions like

m1\n10|m1 10*x%x|%3d
which expands to
m1\n10|1| 1 2| 2 3| 3 4| 4 5| 5 6| 6 7| 7 8| 8 9| 9 a| 10

Is this currently possible in tiny? Is there a way to make tiny-expressions nested?

how to include % character?

How can I include the % character in an expression I want to expand, as in

* TODO today's tasks [0%]

Here's a sample expression that throws an error when I expand:

m0\n5|\n\n*** today's tasks <%(date "today" x)> [0%]\n***** TODO exercise 

Allow the empty string as separator

Maybe this is already possible, but I couldn't figure out how to do it. Omitting the separator altogether yields a space, of course, which is the most useful default so I don't suggest you change that, but I'd like some other way of making the separator empty.

bounty on coveralls.io in ensime-emacs

I just read your article http://sachachua.com/blog/2015/02/continuous-integration-code-coverage-emacs-packages-travis-coveralls/ 😄 thank you.

We actually have a $50 on getting coveralls working on our emacs client, see https://github.com/ensime/ensime-server/issues/448

The repo is https://github.com/ensime/ensime-emacs

You're welcome to claim the bounty if you can send us a pull request, which sounds like it will be trivial for you! 😉

Incidentally, we also have a few open bounties on the emacs code: at least three are just improving the build and CI:

https://github.com/ensime/ensime-server/issues?q=is%3Aopen+is%3Aissue+label%3AEmacs+label%3ABounty

Question: Creating sequence of english day names

I wanted to use tiny to create a sequence of english day (of week) names, i.e. "Monday, Tuesday, etc". English day names are available in Emacs e.g. in the variable calendar-day-name-array. However, when I try to tiny-expand this

m0,6(elt calendar-day-name-array x)

I only get

0,1,2,3,4,5,6

What am I doing wrong?

Edit

When I tiny-expand this

m0, 6|%(elt calendar-day-name-array x)

I get the desired result. Please help me understand why the first tiny-expression didn't work as I expected.

"Not enough arguments for format string" when calling TINY-HELPER...

Thanks so much for this awesome package! It helps me to quickly input some items with number-serious!

And I tried to learn more of this by calling TINY-HELPER with the example below from tiny.el,

tiny/tiny.el

Line 416 in fd8a6b0

Call TINY-HELPER, 15↵1↵↵-30*2x↵%x↵ -> 1c 1a 18 16 14 12 10 e c a 8 6 4 2 0"

but failed and got the error that,

Not enough arguments for format string

Emacs version: 27.1
tiny version: 20190722.1212

Can you please kindly help with this issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.