These functions convert the byte offset into the column number
(getccol()) and vice versa (getgoal()).
Getting this right means that moving up and down the text gets us the
right columns, rather than moving randomly left and right when you move
up and down. We also won't end up in the middle of a utf-8 character,
because we're not just moving into some random byte offset, we're moving
into a proper column.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This makes actual basic editing work. Including things like
justify-paragraph etc, so lines get justified by number of UTF8
characters rather than bytes.
There are probably tons of broken stuff left, but this actually seems to
get the basics working right.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Return statement is not a function so remove superfluous use of parenthesis.
Cc: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Compiles on Mac OS X 10.6.4.
setmode() is renamed to setemode() to avoid conflict with OS X's unistd.h's
setmode().
Modify Makefile to enable the appropriate DEFINES to compile on Mac OS X.
Signed-off-by: Yong Luk Stanley Elijah Goh <stan@t0xt.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Lets welcome uEmacs/PK to the year 2010! As expected, the patch has no effect
on the generated code:
text data bss dec hex filename
106002 8864 18616 133482 2096a em
106002 8864 18616 133482 2096a em.new
Cc: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Most of them were harmless: gcc not being smart enough to realize that
an uninitialized variable was never used if it wasn't initialized etc.
Some of them were name clashes ("crypt()" is a standard library
function, so rename it to "myencrypt()") etc.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This is a slightly updated version of uemacs-PK (PK is Pekka
Kutvonen) which was used at Helsinki University a long time
ago. My fingers cannot be retrained.