aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2013-02-22Stop using 'short' for line and allocation sizesHEADmasterLinus Torvalds2-8/+8
Yes, yes, it probably made sense 30 years ago as a way to save a tiny amount of memory, but especially when interspersed in structures that have pointers (aligned to 64 bits these days), it's not even saving memory today. And it makes us fail in nasty ways when looking at files with long lines. So just make them 'int'. And if you have a line that is longer than 2GB, you only have yourself to blame. I no longer care. In case anybody care, the "test-case" for this was a lovely UDDF file with a binary divecomputer dump encoded as an XML element. Resulting in a lovely 41kB single line. Not what poor micro-emacs was designed for, I'm afraid. I really should just learn another editor, rather than continue to polish this turd. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-22Avoid memory access errors if llength() overflowsLinus Torvalds1-1/+1
llength() is currently a 'short' which can overflow and result in signed numbers if line lengths are larger than 32k. We'll fix the overflow separately, but before we do that, just use a signed int to hold the value so that we don't overrun memory allocations when we converted that negative number to a large positive unsigned integer. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-09-24Fix the unicode character limit (0 .. 0x10ffff)Linus Torvalds2-1/+3
For some reason I had limited things to 0xffff, it really should be 0x10ffff. We don't actually support a full 32-bit unicode model anyway, since we use the high bits for the control/meta/^X/special bits, but there was no reason to limit things to 16 bits when we had 28 bits available. And the real limit for real Unicode characters is 0x10ffff. Add a silly example character past the 16-bit range to the UTF8 demo file: 'SMILING FACE WITH HALO' (U+1F607) from the 'emoticons' block. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-08-16uemacs: Remove unused 'lflag' variables from file.cPekka Enberg1-4/+0
GCC spotted the following unused variable: CC file.o file.c: In function ‘readin’: file.c:225:6: warning: variable ‘lflag’ set but not used [-Wunused-but-set-variable] file.c: In function ‘ifile’: file.c:553:6: warning: variable ‘lflag’ set but not used [-Wunused-but-set-variable] Signed-off-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-15Fix 'getccol()' and 'getgoal()' functions for multibyte UTF-8 charactersLinus Torvalds2-8/+22
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>
2012-07-11Fix vtputc() and simplify show_line by using it againLinus Torvalds1-24/+10
This re-introduces vtputc() as the way to show characters, which reinstates the control character handing, and simplifies show_line() in the process. vtputc now takes an "int" that is either a unicode character or a signed char (so negative values in the range [-1, -128] are considered to be the same as [128, 255]). This allows us to use it regardless of what the source of data is. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-11Start doing character removal properlyLinus Torvalds6-16/+48
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>
2012-07-11Start actually inserting full utf8 sequencesLinus Torvalds2-2/+21
This makes it possible to cut-and-paste the UTF8 testfile into a new buffer, and the end result looks correct. NOTE! We still do various things wrong while editing. For example, while the cursor movements were fixed, simple things like deleting a character still work on single bytes, rather than utf8 characters. So while this is getting much closer to actually editing UTF-8 data, it's not there yet. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-11Make 'show_line()' do proper TAB handlingLinus Torvalds1-4/+17
The TAB handling got broken by commit cee00b0efb86 ("Show UTF-8 input as UTF-8 output") when it stopped doing things one byte at a time. I'm sure the other special character cases are broken too. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-10Expand keycode to 'int' from 'short'Linus Torvalds1-5/+5
This uses the four high bits for the meta and control key sequences. This means that we will be limiting our Unicode space to 28 bits, but that's more than we really need. It *would* be nicer if we just used the sign bit to mark "we have meta character information") but that would require bigger changes. And we really don't need to worry about 30-bit unicode. Small steps, remember. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-10character input: make sure we have enough bytes for a full utf8 characterLinus Torvalds1-2/+19
.. but we do have that 0.1s delay, so if somebody feeds us non-utf8 sequences, we won't delay forever. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-10utf8: make sure to honor the array length properlyLinus Torvalds1-2/+2
Right now the input side can give partial utf8 input, and that showed that we didn't properly handle that case. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-10Make kbd macro save area use 'int' instead of shortLinus Torvalds2-6/+6
I'm starting to expand the input value from 'short' (with flags in the upper eight bytes) to 'int' (with negative values having flags). Small baby steps. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-10Use utf8 helper functions for keyboard inputLinus Torvalds1-49/+17
ttgetc() used some homebrew utf8 to unicode translation, limited to just the normal latin1 characters. Use the utf8 helper functions to get it right for the more complex cases. NOTE! We don't actually handle characters > 0xff right anyway. And we still end up doing Latin1 in the buffers on input. One small step at a time. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-10Make cursor movement (largely) understand UTF-8 character boundariesLinus Torvalds3-11/+31
Ok, so it may do odd things if it's not truly utf-8, and when moving up and down lines that have utf-8 the cursor moves oddly (because the byte offset within the line stays constant, rather than the character offset), but with this you can actually open the UTF8 example file and move around it, and at least some of the movement makes sense. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-10Split up the utf8 helper functions into a file of their ownLinus Torvalds5-67/+119
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-10Remove the old utf8_mode thing.Linus Torvalds2-18/+0
Let's just plan on being fully utf8 some day. We're not there yet, and maybe we'll never be, but having the halfway mode is not useful either. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-10Show UTF-8 input as UTF-8 outputLinus Torvalds1-3/+59
.. by doing the stupid "convert to unicode value and back" model. This actually populates the 'struct video' array with the unicode values, so UTF8 input actually shows correctly. In particular, the nice test-file (UTF-8-demo.txt) shows up not as garbage, but as the UTF-8 it is. HOWEVER! Since the *editing* doesn't know about UTF-8, and considers it just a stream of bytes, the end result is not actually a usable utf-8 editor. So don't get too excited yet: this is just a partial step to "actually edit utf8 data" NOTE NOTE NOTE! If the character buffer contains Latin1, we will transform that Latin1 to unicode, and then output it as UTF8. And we will edit it correctly as the character-by-character data. Also, we still do the "UTF8 to Latin1" translation on *input*, so with this commit we can actually continue to *edit* Latin1 text. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-10Make the 'struct video' contain an array of unicode characters rather than bytesLinus Torvalds2-37/+40
This is disgusting. And quite frankly, it's debatable whether this will ever work. The "line" structure is still just an array of characters, so that has to work with utf-8. But the 'struct video' thing is what represents the actual screen rectangle, and is fixed-size by the size of the screen. So making it contain actual 32-bit unicode characters *may* make sense. Right now we translate things the same way we always used to, though, so utf-8 in 'struct line' will not be translated to the proper unicode array, but to the bytes of the utf-8 representation. So this really doesn't improve anything per se yet, just expands the memory use of the video array. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-10Show lines with a single helper function, not one byte at a timeLinus Torvalds2-12/+17
Let's see how hard it is to show UTF-8 characters properly. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-26Make uemacs build on FreeBSD.Naohiro Aota2-1/+4
See <https://bugs.gentoo.org/show_bug.cgi?id=387135>. Signed-off-by: Ulrich Müller <ulm@gentoo.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-25spawn.c: do the "keyboard open/close" around shell invocationsLinus Torvalds1-0/+6
I'm not 100% sure we really should even be doing this whole "keyboard" open/close for termcap, but even if the right thing to do ends up being to just do everything in the TTopen/TTclose (and make TTkopen/TTkclose no-ops), it does seem to be the right thing to do. Reported-by: Bijan Soleymani <bijan@psq.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-25file.c: remove crazy keyboard open/close callsLinus Torvalds1-8/+0
It seems to have something to do with some old DOS mode, and not having keyboard translation on ("Insert floppy A:" questions while opening files? Whatever). But this is while doing normal file opens, and it is just insane to open/close a tty across a file open. The possible tty init/exit sequence would mess up some of the file read/write messages. Reported-by: Bijan Soleymani <bijan@psq.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-25Force a screen re-draw after tcap 'ti' on terminal openLinus Torvalds1-0/+7
The 'tcapkopen()' function re-initializes the terminal with the 'ti' sequence, which for most sane termcap entries is just empty. But for 'xterm', that seems to actually be a real control sequence (clear and reset?), and we'd better tell display.c that the screen is now garbage and needs to be re-drawn. Also, make tcapkclose() match the 'ti' (terminal init) with a 'te' (terminal exit). Maybe we should just stop playing games with ti/te, but this at least improves the situation a bit. Reported-by: Bijan Soleymani <bijan@psq.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-22uemacs: Add -g options to the output usage.Thiago Farina1-2/+3
While I'm here, improve the word of the above two options. Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-22Respect LDFLAGS when linking.Ulrich Müller1-1/+1
Signed-off-by: Ulrich Müller <ulm@gentoo.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-22Show xA0 (nbsp) as a non-printable characterLinus Torvalds1-1/+1
I want to see the difference between space and nbsp, and I consider nbsp to be a control character, so show it as such. Even if it is technically "printable". Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-12-16uemacs: display.c: Use the newly introduced xmalloc function.Thiago Farina1-19/+5
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-12-16uemacs: Add xmalloc as a wrapper function for malloc.Thiago Farina3-4/+12
xmalloc checks the returned pointer and dies if it failed to allocate the memory. Use this new function in window.c. More places will be converted to use xmalloc latter. Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-12-14uemacs: Make some magic variables private to search.c module.Thiago Farina3-25/+14
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-12-14uemacs: input.c: Fix mkstemp warning.Thiago Farina6-9/+61
Fix the following warning: input.c: In function ‘getstring’: input.c:590: warning: ignoring return value of ‘mkstemp’, declared with attribute warn_unused_result This add usage.c module for die function. This also add wrapper.c module for the xmkstemp that is wrapper function around the original mkstemp function. Both module codes was largelly based on git, linux and sparse codes. Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-30uemacs: convert typedef struct RMC to struct magic_replacement.Thiago Farina4-11/+12
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-28uemacs: Move MAXNLINE constant from estruct.h to file.cThiago Farina2-4/+5
This constant is used only there, so there is no reason for it to be in estruct.h Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-28uemacs: Move some constants from estruct.h to posix.cThiago Farina2-14/+15
These two constants are only needed/used by the posix.c file, so just define them there. Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-28uemacs: buffer.c: Fix uninitialized struct warning.Thiago Farina1-2/+2
This fix the following warning: buffer.c: In function ‘nextbuffer’: buffer.c:45: warning: ‘bp’ may be used uninitialized in this function Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-28uemacs: convert typedef struct MC to struct magic.Thiago Farina5-21/+21
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-24uemacs: Move uv variable into the eval.c source file.Thiago Farina2-5/+5
It's used only there. Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-18uemacs: add line.h in names.c to fix compiling errorLi Jie1-0/+1
I got following errors while compiling uemacs: names.c:132: error: ‘insspace’ undeclared here (not in a function) names.c:217: error: ‘yank’ undeclared here (not in a function) make: *** [names.o] Error 1 It looks like names.c needs line.h for function declarations. Signed-off-by: Li Jie <eltshanli@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-15uemacs: Move NBLOCK constant into line.cThiago Farina2-4/+5
This constant is only used in line.c. So just keep it there. Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-15uemacs: Move structure line and its functions to its own header file.Thiago Farina19-130/+160
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-14uemacs: Kill dead codePekka Enberg2-26/+0
This patch kills #ifdef'd code from display.c and file.c. Signed-off-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-06uemacs: convert typedef struct VDESC to struct variable_description.Thiago Farina3-36/+32
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-03uemacs: remove forward declaration of 'struct video' from edef.hThiago Farina1-2/+0
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-02Merge branch 'master' of git://git.kernel.org/pub/scm/editors/uemacs/uemacsLinus Torvalds3-14/+14
2010-11-02uemacs: get rid of BITMAP typedef.Thiago Farina2-19/+17
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-30uemacs: convert typedef struct WHBLOCK to struct while_block.Thiago Farina3-14/+14
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-25uemacs: Move function declarations from edef.h to efunc.h.Thiago Farina2-4/+5
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-09-13Fix a tiny typoChristian Faulhammer1-1/+1
Signed-off-by: Christian Faulhammer <christian@faulhammer.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-09-07uemacs/version.c: Add version function to output the version string information.Thiago Farina4-6/+16
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-09-07uemacs: Get rid of the CALLED macro.Thiago Farina4-35/+5
uemacs is not a subprogram and doesn't seem it will be, so there is no reason to leave this macro. And this macro is defined to 0, so we never reach the path where we test for this macro. Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-09-07uemacs: Remove more garbage emacs.* files from the tree.Thiago Farina3-56/+0
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-09-07uemacs: Remove two completly unused functions (fnclabel and spal).Thiago Farina9-135/+23
The implementation of these functions are doing anything at all at this moment. So cleanup a bit the code by removing fnclabel and spal functions completly. Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-29uemacs: Remove garbage from the treePekka Enberg6-263/+0
This patch removes bunch of ancient Makefiles and VMS scripts from uemacs source tree. If somebody really needs them, they can always look them up from git repository history. Signed-off-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-29uemacs: Clean up program executablePekka Enberg1-5/+7
This patch fixes Makefile 'clean' target to clean up program executable 'em'. Signed-off-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-29uemacs: Fix return statementsPekka Enberg28-760/+760
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>
2010-08-29uemacs: Kill unused lckhello functionPekka Enberg1-6/+0
This patch kills an unused 'lckhello' function and gets rid of the following GCC warning: CC lock.o lock.c:160: warning: ‘lckhello’ defined but not used Signed-off-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-29uemacs/efunc.h: Get rid of a duplicated exported type called "names".Thiago Farina3-10/+5
This type is already exported in edef.h Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-29uemacs: Add more two options to the usage output.Thiago Farina1-1/+3
Added + and +<n> to the usage output. Also fixed the following warning: main.c: In function ‘main’: main.c:121: warning: ‘gline’ may be used uninitialized in this function Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-28uemacs: Make getgoal function private to basic.c.Thiago Farina2-43/+41
This functions is only used internally by basic.c, so marking it static, to make it private. Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-28uemacs: Fix out-of-box build on Mac OS XPekka Enberg1-2/+8
This patch fixes out-of-box build on Mac OS X by using "uname -s" to detect the underlying OS and fixing up defines accordingly. Cc: Yong Luk Stanley Elijah Goh <stan@t0xt.com> Signed-off-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-24uemacs: Compiles on Mac OS X.Yong Luk Stanley Elijah Goh6-4/+12
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>
2010-08-21uemacs: basic.c: Add support to go to the end of the buffer.Thiago Farina1-62/+63
There is a case when the user can type something like this: em filename + or even em + Instead of saying "Bogus argument" when the uemacs start, just go to the end of the buffer like we can do in vim for example. Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-18uemacs: Add --help option.Thiago Farina5-86/+98
Add a basic usage() function to support the --help option. Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-13uemacs: Add --version option.Thiago Farina1-23/+27
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-10uemacs: convert typedef struct KILL to struct kill.Thiago Farina4-12/+12
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-04uemacs: evar.h: Add enum function_type.Thiago Farina1-53/+54
Replace four macros used to define integer constants with a enum. Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-02uemacs: ibmpc.c: Move the functions to the ANSI style declaration.Thiago Farina1-70/+79
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-01uemacs: convert typedef struct window_t to struct window.Thiago Farina12-63/+63
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-07-11uemacs: convert typedef struct TERM to struct terminal.Thiago Farina7-35/+39
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-07-10uemacs: convert typedef struct REGION to struct region.Thiago Farina4-11/+11
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-07-04uemacs: convert typedef struct NBIND to struct name_bind.Thiago Farina6-11/+11
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-06-30uemacs: convert typedef struct KEYTAB to struct key_tab.Thiago Farina4-30/+33
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-06-28uemacs/ansi.c: Convert the old functions style declarations to the new one.Thiago Farina1-28/+32
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-06-27uemacs: Convert typedef struct UVAR to struct user_variable.Thiago Farina2-10/+11
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-06-27uemacs: convert typedef struct UFUNC to struct user_function.Thiago Farina1-7/+6
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-06-11uemacs: Use ARRAY_SIZE in more places.Thiago Farina4-14/+18
Signed-off-by: Thiago Farina <thiago.farina@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-06-08uemacs: Add ARRAY_SIZE macro so we can get rid of some hard coded calculations.Thiago Farina3-12/+17
Signed-off-by: Thiago Farina <thiago.farina@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-06-01uemacs: convert typdef struct VIDEO to struct video.Thiago Farina2-22/+22
Signed-off-by: Thiago Farina <thiago.farina@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-04-28uemacs: rename 'readme' to 'README'Thiago Farina1-27/+27
Also removes some tabs and whitespaces. Cc: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-04-28uemacs: convert typdef struct LINE to struct line.Thiago Farina16-115/+115
Cc: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-02-27uemacs: enable -Wstrict-prototypesPekka Enberg6-6/+8
This patch enables the GCC '-Wstrict-prototypes' switch and fixes up broken prototypes. Cc: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-02-27uemacs: rename 'makefile' to 'Makefile'Pekka Enberg1-0/+0
I keep typoing 'Makefile' instead of 'makefile'. I guess it's hard-wired to the brain by now so just rename the damn thing. Cc: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-02-27uemacs: remove use of 'register' keywordPekka Enberg23-497/+497
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>
2010-02-26uemacs: remove unused functionsPekka Enberg4-25/+0
Commit 8fc7449 ("uemacs: fix sparse warnings, making file-local symbols static.") made some functions that are not used anywhere static. This patch removes them to kill the following compilation warnings: ansi.c:255: warning: ‘ansihello’ defined but not used ibmpc.c:505: warning: ‘ibmhello’ defined but not used vmsvt.c:521: warning: ‘hellovms’ defined but not used vt52.c:181: warning: ‘vt52hello’ defined but not used Cc: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-02-26uemacs: make build output more readablePekka Enberg1-3/+18
This patch makes the build output look like what we have in the linux kernel so that warnings stand out better: CC ansi.o CC basic.o CC bind.o CC buffer.o buffer.c: In function ‘nextbuffer’: buffer.c:43: warning: ‘bp’ may be used uninitialized in this function CC crypt.o CC display.o [...] Cc: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-02-15uemacs/line.c: remove two unused variables.Thiago Farina1-3/+0
line.c:21: warning: ‘ykbuf’ defined but not used line.c:22: warning: ‘ykboff’ defined but not used Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-02-15uemacs: remove typdef struct BUFFER -> struct buffer.Thiago Farina13-64/+64
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-01-29uemacs: fix sparse warnings, making file-local symbols static.Thiago Farina12-30/+30
ansi.c:255:6: warning: symbol 'ansihello' was not declared. Should it be static? epath.h:11:6: warning: symbol 'pathname' was not declared. Should it be static? display.c:36:7: warning: symbol 'vscreen' was not declared. Should it be static? display.c:38:7: warning: symbol 'pscreen' was not declared. Should it be static? display.c:927:5: warning: symbol 'updateline' was not declared. Should it be static? evar.h:20:6: warning: symbol 'uv' was not declared. Should it be static? evar.h:24:6: warning: symbol 'envars' was not declared. Should it be static? evar.h:128:7: warning: symbol 'funcs' was not declared. Should it be static? fileio.c:14:6: warning: symbol 'ffp' was not declared. Should it be static? fileio.c:15:5: warning: symbol 'eofflag' was not declared. Should it be static? ibmpc.c:505:6: warning: symbol 'ibmhello' was not declared. Should it be static? isearch.c:36:5: warning: symbol 'saved_get_char' was not declared. Should it be static? isearch.c:37:5: warning: symbol 'eaten_char' was not declared. Should it be static? isearch.c:41:5: warning: symbol 'cmd_buff' was not declared. Should it be static? isearch.c:42:5: warning: symbol 'cmd_offset' was not declared. Should it be static? isearch.c:43:5: warning: symbol 'cmd_reexecute' was not declared. Should it be static? line.c:21:6: warning: symbol 'ykbuf' was not declared. Should it be static? line.c:22:5: warning: symbol 'ykboff' was not declared. Should it be static? lock.c:17:6: warning: symbol 'lname' was not declared. Should it be static? lock.c:18:5: warning: symbol 'numlocks' was not declared. Should it be static? vmsvt.c:521:6: warning: symbol 'hellovms' was not declared. Should it be static? vt52.c:181:6: warning: symbol 'vt52hello' was not declared. Should it be static? Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-15Add ignore file for generated filesLinus Torvalds1-0/+2
At least the most obvious ones. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-15Add libcurses, remove ltermcapLinus Torvalds1-2/+2
That's how modern distributions roll (and have, for a long time. I just haven't committed this). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-06-07Turn ESC+'[' into a CSI characterLinus Torvalds2-34/+58
This avoids the annoying behavior where we're on the command line, waiting for an ESC, and any control character sequence ends up finishing the command line and eating the first ESC. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2006-11-19Clean up various compile warningsLinus Torvalds17-35/+41
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>
2006-11-19Make the sparse setup default to x86-64 rather than ppcLinus Torvalds1-1/+1
Hey, what can I say? Without Apple, ppc on the desktop? Not very likely. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-11-19Mark functions and variables local to display.c 'static'Linus Torvalds2-60/+52
Waste a few minutes occasionally on cleanup, and maybe we can make this thing look ok in a decade or two.. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-16Make "sparse" check target do a global sparseLinus Torvalds1-1/+1
Instead of iterating over all the source files, just check them all together since it works these days, and could potentially find cross-file issues.
2005-10-10Add a true UTF-8 demonstration fileLinus Torvalds1-0/+212
We obviously don't handle it, but it's a wonderful example if we ever do. Demo by Markus Kuhn from http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-02Add support for a "utf-8" modeLinus Torvalds4-5/+103
NOTE! MicroEmacs is very much a byte-based editor, and the new utf-8 support is purely an issue of terminal input and output. The file contents themselves are in the 8-bit space. In that space, Unicode is the same as Latin1. The new mode is called "utf-8", and is enabled automatically by the new emacs.rc when $LANG contains the substring "UTF-8". I'm sure people would like to some day also edit real UTF-8 contents, rather than just edit old 8-bit Latin1 contents in a UTF-8 terminal. However, that's an independent (and much bigger and thornier) issue. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-01[PATCH] Fix use of mktemp() in uemacsHorst von Brand1-1/+1
After your last round of changes it compiles without warnings here (Fedora rawhide, gcc-4.0.2), but the link complains. mktemp(3) isn't always secure, the problem is fixed in mkstemp(3) Signed-off-by: Horst H. von Brand <vonbrand@inf.utfsm.cl> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-01Handle 8-bit characters better in displayLinus Torvalds2-15/+36
This code still assumes a latin1 kind of "one byte, one character" setup. UTF-8 input/output (even if the data is encoded in latin-1) is a separate issue.
2005-10-01Make sources mostly sparse-cleanLinus Torvalds12-37/+9
Mainly an issue of taking care of a few remaining K&R function declarations.
2005-10-01Fix more compiler warningsLinus Torvalds11-63/+76
Better initializers, and more proper function types.
2005-10-01Fix ugly "definitions in header file" crudLinus Torvalds11-193/+174
Move various initializations into new "globals.c" file. Also mark some variables static, and fix up some trivial compiler and sparse warnings.
2005-10-01Avoid various name clashes with curses and termcap headersLinus Torvalds12-56/+47
This allows us to include the proper headers, instead of declaring things (badly) by hand.
2005-10-01Replace "WINDOW" type with "window_t"Linus Torvalds12-65/+65
Starting to try to avoid name clashes with curses and friends.
2005-09-30Fix up unused variable and ambiguous else in random.cLinus Torvalds1-13/+2
2005-09-30More warning avoidance and code cleanupLinus Torvalds6-27/+30
2005-09-30Fix up some trivial gcc -Wall warningsLinus Torvalds10-28/+22
Lots more to go.
2005-09-30Lots of ANSI'fication and cleanupsLinus Torvalds26-1140/+1152
Still tons of warnings with "-Wall", but now it's actually getting closer. It even compiles again.
2005-09-30Start using "-Wall" when compilingLinus Torvalds1-1/+1
Oh, and change the -O4 to a saner -O2 while at it
2005-09-30More ANSI'ficationLinus Torvalds3-60/+62
Next up: enabling "-Wall" in the makefile. Not because it's ready, but because it gets easier to track where we are in the process..
2005-09-30Yet more ANSI'ficationLinus Torvalds3-89/+126
Bored? Me? Why do you ask?
2005-09-30Move "input.c" towards ANSI function declarationsLinus Torvalds2-53/+53
2005-09-30More ANSI-fication of the sourcesLinus Torvalds4-68/+82
Ugh. Some of this is ugly. We should really include <curses.h> etc, but there are too many name clashes for that right now.
2005-09-30More function declarations: region.cLinus Torvalds2-6/+12
Hey, "word.c" is now sparse-clean.
2005-09-30First cut at turning things into proper modern ANSI CLinus Torvalds10-469/+617
Hey! Real declarations!
2005-09-30Fix up headers and bogus re-definitions to use <stdlib.h> and <string.h>Linus Torvalds8-78/+3
Hey, it's already compiling cleaner. Getting proper function declarations will be a bitch, though.
2005-09-30Very optimistically add a "sparse" makefile target.Linus Torvalds1-0/+6
Since sparse really wants clean ANSI C, we're not even _remotely_ close to being sparse-clean. But maybe some day...
2005-09-30Run "indent -kr -i8" on the sourcesLinus Torvalds34-6775/+6925
Let's see how nasty it is to clean things up. For real.
2005-05-31Up the limit on maximum lines.Linus Torvalds1-1/+1
Hey, get with the bloated new world.
2005-05-31Minimal patches to make uemacs compile in a modern environment.Linus Torvalds2-7/+5
make sure to include <errno.h>, and allow for the fact that newer gcc's don't allow function declarations in function scope (don't ask me why, but there you have it..)
2005-05-31Initial import of em-4.0.15-ltLinus Torvalds50-0/+24188
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.