<feed xmlns='http://www.w3.org/2005/Atom'>
<title>readline-incdec/incdec, branch master</title>
<subtitle>Readline bindings to increment and decrement numbers on the command line</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/readline-incdec/'/>
<entry>
<title>Rename `incdec` to `incdec.bash`</title>
<updated>2021-08-24T22:32:09+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-08-24T22:32:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/readline-incdec/commit/?id=353315bc5369a078f9ac70e5007db630c7fcb749'/>
<id>353315bc5369a078f9ac70e5007db630c7fcb749</id>
<content type='text'>
Add a ".bash" extension to the main include script make explicit the
intent for it to be used with Bash.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a ".bash" extension to the main include script make explicit the
intent for it to be used with Bash.
</pre>
</div>
</content>
</entry>
<entry>
<title>incdec: Move bindings to a new file</title>
<updated>2021-08-24T22:11:13+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-08-24T22:11:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/readline-incdec/commit/?id=ff00a3c613570c5460a420c5882da41ed2e09142'/>
<id>ff00a3c613570c5460a420c5882da41ed2e09142</id>
<content type='text'>
Split the bindings from the function definitions. This will allow users
to source the functions and define their own bindings. The bindings file
can be sourced to get the default bindings.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Split the bindings from the function definitions. This will allow users
to source the functions and define their own bindings. The bindings file
can be sourced to get the default bindings.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add license (GNU GPLv3+)</title>
<updated>2021-08-24T21:22:58+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-08-24T21:22:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/readline-incdec/commit/?id=ee898b113f54911e9e2719c3f6b73dcf42139a0e'/>
<id>ee898b113f54911e9e2719c3f6b73dcf42139a0e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>incdec: Change default bindings to `C-x a` and `C-x x`</title>
<updated>2021-08-24T19:24:11+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-08-24T19:03:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/readline-incdec/commit/?id=3865ae0be693bf32278a05ce661724ce4c382b24'/>
<id>3865ae0be693bf32278a05ce661724ce4c382b24</id>
<content type='text'>
I had used `C-x +` and `C-x -` during testing because I had an existing
non-"-x" binding that was prefixed with `C-x a`, and when I tried to add
the `C-x a` "-x" binding, it caused the following error:

    bash_execute_unix_command: cannot find keymap for command

Switch the default bindings to `C-x a` and `C-x x` because those are the
ones I originally wanted, since they don't appear to conflict with any
existing default Readline bindings, and they're similar to the Vim
increment and decrement commands.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I had used `C-x +` and `C-x -` during testing because I had an existing
non-"-x" binding that was prefixed with `C-x a`, and when I tried to add
the `C-x a` "-x" binding, it caused the following error:

    bash_execute_unix_command: cannot find keymap for command

Switch the default bindings to `C-x a` and `C-x x` because those are the
ones I originally wanted, since they don't appear to conflict with any
existing default Readline bindings, and they're similar to the Vim
increment and decrement commands.
</pre>
</div>
</content>
</entry>
<entry>
<title>incdec: Add comments to describe Bash functions</title>
<updated>2021-08-24T18:38:32+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-08-24T18:34:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/readline-incdec/commit/?id=067086adff7134f970a141269856f65ef195f2db'/>
<id>067086adff7134f970a141269856f65ef195f2db</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>incdec: Remove old code</title>
<updated>2021-08-24T18:29:58+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-08-24T18:17:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/readline-incdec/commit/?id=d5b6179e47d71ab5ce151fe1af9a5288bab418df'/>
<id>d5b6179e47d71ab5ce151fe1af9a5288bab418df</id>
<content type='text'>
Now that we have this working, remove the old functions, binding
definitions, and TODOs.

All TODOs here are handled. The old Bash functions and bindings were for
a Bash-only implementation. The point-moving code in
`__readline_incdec_decrement` wasn't applicable to decrementing numbers.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that we have this working, remove the old functions, binding
definitions, and TODOs.

All TODOs here are handled. The old Bash functions and bindings were for
a Bash-only implementation. The point-moving code in
`__readline_incdec_decrement` wasn't applicable to decrementing numbers.
</pre>
</div>
</content>
</entry>
<entry>
<title>Turn off strict and warnings in final `perl -e` script</title>
<updated>2021-08-23T21:24:08+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-08-23T21:22:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/readline-incdec/commit/?id=1072cc0c7e92b28abfb23f7d878b97f30be29522'/>
<id>1072cc0c7e92b28abfb23f7d878b97f30be29522</id>
<content type='text'>
Those caused the following errors:

    Variable "$line" is not imported at -e line 45.
    Variable "$increment_by" is not imported at -e line 45.
    Variable "$point_position" is not imported at -e line 45.
    Variable "$backward" is not imported at -e line 45.
    Global symbol "$line" requires explicit package name (did you forget to declare "my $line"?) at -e line 45.
    Global symbol "$increment_by" requires explicit package name (did you forget to declare "my $increment_by"?) at -e line 45.
    Global symbol "$point_position" requires explicit package name (did you forget to declare "my $point_position"?) at -e line 45.
    Global symbol "$backward" requires explicit package name (did you forget to declare "my $backward"?) at -e line 45.
    Execution of -e aborted due to compilation errors.

I suppose I could have kept warnings, as only strict caused the errors,
but decided to remove it anyway. Not sure what makes the most sense.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Those caused the following errors:

    Variable "$line" is not imported at -e line 45.
    Variable "$increment_by" is not imported at -e line 45.
    Variable "$point_position" is not imported at -e line 45.
    Variable "$backward" is not imported at -e line 45.
    Global symbol "$line" requires explicit package name (did you forget to declare "my $line"?) at -e line 45.
    Global symbol "$increment_by" requires explicit package name (did you forget to declare "my $increment_by"?) at -e line 45.
    Global symbol "$point_position" requires explicit package name (did you forget to declare "my $point_position"?) at -e line 45.
    Global symbol "$backward" requires explicit package name (did you forget to declare "my $backward"?) at -e line 45.
    Execution of -e aborted due to compilation errors.

I suppose I could have kept warnings, as only strict caused the errors,
but decided to remove it anyway. Not sure what makes the most sense.
</pre>
</div>
</content>
</entry>
<entry>
<title>Generate `incdec` from `incdec.m4`</title>
<updated>2021-08-23T20:47:02+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-08-23T20:47:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/readline-incdec/commit/?id=c25e99c1c795450c0f792fdadbff37d3de078099'/>
<id>c25e99c1c795450c0f792fdadbff37d3de078099</id>
<content type='text'>
Include the built `incdec.pl` code in the Bash file by generating it
from `incdec.pm`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Include the built `incdec.pl` code in the Bash file by generating it
from `incdec.pm`.
</pre>
</div>
</content>
</entry>
<entry>
<title>incdec: Move point if negative hyphen is added or removed</title>
<updated>2021-08-22T19:16:42+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-08-22T19:16:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/readline-incdec/commit/?id=392554df943a23099d788d0f04e1cf13b66e910f'/>
<id>392554df943a23099d788d0f04e1cf13b66e910f</id>
<content type='text'>
Previously, point would stay in the same position, causing it to look
like it moved when incrementing or decrementing between a negative
number and a positive number. This moves point by one to the right when
decrementing to a negative integer, or by one to the left when
incrementing to a positive integer. That makes the point seem like it
hasn't moved and making it look more natural.

For example, now point behaves like this:

    $ test 12 0
              ^
    _decrement_

    $ test 12 -1
               ^

    $ test 12 -1
               ^
    _increment_

    $ test 12 0
              ^

Before, it would do:

    $ test 12 0
              ^
    _decrement_

    $ test 12 -1
              ^

    $ test 12 -1
               ^
    _increment_

    $ test 12 0
               ^
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, point would stay in the same position, causing it to look
like it moved when incrementing or decrementing between a negative
number and a positive number. This moves point by one to the right when
decrementing to a negative integer, or by one to the left when
incrementing to a positive integer. That makes the point seem like it
hasn't moved and making it look more natural.

For example, now point behaves like this:

    $ test 12 0
              ^
    _decrement_

    $ test 12 -1
               ^

    $ test 12 -1
               ^
    _increment_

    $ test 12 0
              ^

Before, it would do:

    $ test 12 0
              ^
    _decrement_

    $ test 12 -1
              ^

    $ test 12 -1
               ^
    _increment_

    $ test 12 0
               ^
</pre>
</div>
</content>
</entry>
<entry>
<title>incdec: Idea for point moving when changing from positive to negative</title>
<updated>2021-08-22T18:40:42+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-08-22T18:40:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/readline-incdec/commit/?id=a37e4cc946d2948d19040722fc5e6ea2f6e3bc17'/>
<id>a37e4cc946d2948d19040722fc5e6ea2f6e3bc17</id>
<content type='text'>
If we change between negative and positive numbers, point moves:

    $ test 12 0
               ^
    _decrement_

    $ test 12 -1
               ^

I think point should instead be

    $ test 12 -1
                ^

Not sure that we should be moving point when changing from negative to
positive, though.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If we change between negative and positive numbers, point moves:

    $ test 12 0
               ^
    _decrement_

    $ test 12 -1
               ^

I think point should instead be

    $ test 12 -1
                ^

Not sure that we should be moving point when changing from negative to
positive, though.
</pre>
</div>
</content>
</entry>
</feed>
