summaryrefslogtreecommitdiffstats
path: root/usr.bin/mg (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Invert the 'R' indicator which seems rather unintuitive at the moment,lum2021-03-262-5/+10
| | | | | | currently a '*' next to a file's name indicates it is writable. With this diff it now means it is read-only. Also make the active buffer indicator more visible:'.'->'>'.
* Add 'get-environment-variable', in a fashion:lum2021-03-261-6/+32
| | | | | | | | (define curdir(get-environment-variable CURDIR)) (insert curdir) Should now print the value of the environment variable CURDIR's value, or error if it is not set.
* Change the regex for define names. Make more characters available.lum2021-03-261-13/+14
| | | | | Keep the same regex for mg function names. Though perhaps for user-defined functions other characters could be ok....
* Change two more bool counters to pointer NULL checks.lum2021-03-261-23/+11
|
* Move the expression list create item code into a single function.lum2021-03-251-35/+60
|
* Add an (exit) method.lum2021-03-251-1/+20
|
* User a pointer's value (!NULL) instead of a boolean to indicate somelum2021-03-251-11/+11
| | | | kind of data being found.
* Use length of line to indicate end of characters to process inlum2021-03-253-22/+34
| | | | | foundparen(). No intended functional change. regress tests ok and they all use excline().
* Use a pointer called bufp to point to a buffer called bufnlum2021-03-231-4/+4
| | | | consistantly.
* Correct how many arguments some functions take for interpreter.c.lum2021-03-231-31/+31
|
* Make a parameter to an mg function not throw an error justlum2021-03-231-3/+12
| | | | because it is numerical.
* Start the move to TAILQ for expressions instead of an SLIST.lum2021-03-221-10/+33
|
* Add quoted strings capability in list values, no special charslum2021-03-213-46/+95
| | | | | | | detection in between them though. Add limitation to characters allowed in symbol names, equivalent to mg function names (A-Za-z-), quite restrictive but can grow of course. If value is not quoted and is not a variable, give an error.
* Looking at loading all expressions initially, working towards multilum2021-03-201-202/+271
| | | | | | line. Next to look at "values" (quotes around values). Current regress tests pass.
* Add a 'batch' mode to mg via the '-b' command line option which willlum2021-03-205-11/+74
| | | | | | | initialise a pty, run the specified file of mg commands and then exit. This is to facilitate mg fitting into the OpenBSD regress test framework and be able to run via a cron job.
* From Joachim Wiberg's version of mg.lum2021-03-181-3/+11
| | | | | "This patch makes sure to clear the status/echo line after killing and switching buffers by name. Otherwise the kill/switch prompt lingers"
* Start looking at parsing text to find separators.lum2021-03-081-5/+26
|
* Put regex tests into a function.lum2021-03-081-40/+32
|
* If there is a problem with opening a directory via M-x dired, let thelum2021-03-051-2/+5
| | | | user know. EACCESS is currently accounted for, but nothing else.
* It is now possible to define single value variables in the startup file:lum2021-03-021-24/+24
| | | | | | | | (define myfile d.txt) And use them like: (find-file myfile)
* This diff soaks up the user input while the the maximum characterlum2021-03-021-5/+8
| | | | | | length boundary is crossed in the minbuffer and allows the user to see the error message and respond accordingly. The goto named "null" changed to "skipkey" as per Emil Engler's suggestion on tech@.
* Update logging with comments made by florian@ some time ago (i've notlum2021-03-022-158/+102
| | | | | updated logging to $HOME, but will do so). Also include mglog_misc() which takes formatted input from Joachim Wiberg's mg. Thankyou both.
* Put the hardcoded '\n' character which is found throughout mg into alum2021-03-0116-42/+50
| | | | | buffer specific variable. The diff should not produce any behavourial changes in mg.
* Add dobeep functions that take messages to buffer.c and cscope.clum2021-02-282-107/+55
| | | | No functional change intended.
* Add dobeep functions that take messages to basic.c.lum2021-02-271-47/+26
| | | | No functional change intended.
* Some more improvements from Joachim Wiberg's version of mg.lum2021-02-261-7/+10
| | | | | | | check before using variable in list remove unnecessary variable declaration check value of adjustname() add a '< 0' return value of snprintf
* Some improvements from Joachim Wiberg's version of mg.lum2021-02-261-4/+8
| | | | | check value of adjustname() use int for return value of snprintf
* Various fixes from emails Joachim Nilsson sent to tech@ many moonslum2021-02-241-4/+9
| | | | | | | | ago. Sorry for the delay. - Make sure we don't deref NULL ptr in skipwhite() - Only deref vendp if not NULL - Strings must be at least 2 chars for terminating NUL character
* snprintf() does indeed return an int. From an email Joachim Nilssonlum2021-02-241-3/+3
| | | | sent to tech@ many moons ago. Sorry for the delay.
* Move -u to alphabetically correct place in options. As spotted by jmc@lum2021-02-231-5/+5
|
* Allow the user to specify a path to the mg startup file on the command line.lum2021-02-235-14/+27
|
* Avoid running out of memory with query-replace-regex ^tb2020-07-221-5/+9
| | | | | | | | | | | | | | | | Choosing ! (replace rest) never advances beyond the current line and keeps inserting the replacement test, and mg eventually runs out of memory. Patch from Mark Willson with minor stylistic tweaks. Looks good to Hiltjo Posthuma who would have preferred making forward replacing on empty lines work. Mark argued that this makes it behave consistently with the current behaviour when searching for ^ and the point at the beginning of a non-empty line in which case the cursor does not move either. Also tested by krw
* Prevent mg segfault with query-replace-regex replacing ^tb2020-07-221-1/+3
| | | | Patch from Mark Willson with a minor tweak
* Avoid NULL deref in regexec when searching for empty lines.tb2020-07-091-9/+10
| | | | Report & tweak from Hiltjo Posthuma
* Do not define variables in def.h since this will lead to duplicate definitionsflorian2020-02-093-17/+18
| | | | | | | in every source file that includes def.h Found by gcc10 in portable in gentoo and fedora. Patch from Ulrich Mueller (ulm AT gentoo.org) via Han Boetes, thanks! Ok tb
* Add that make-backup-files variable is enabled by defaultsolene2019-11-081-2/+3
| | | | | | | make-backup-files toggles backup, so when you add it in your ~/.mg this disables backup. ok benno@
* Missed a free.lum2019-07-201-1/+2
|
* Move a bit of code to where it is called only if needed.lum2019-07-201-5/+5
|
* Previously I left the ')' on the end of a list to indicate the end.lum2019-07-191-14/+24
| | | | | Just to get things working. Best get rid of that nonsense sooner rather than later.
* The 'list' diff I committed this morning, was missing a couple oflum2019-07-181-2/+5
| | | | calls to a clean-up variable function.
* Make indentation consistent. This has been bugging me for a while now.lum2019-07-181-20/+20
|
* Add logging to interpreter.clum2019-07-183-19/+119
|
* Add some more basic interpreter functionality to mg. Needs a lot morelum2019-07-184-114/+407
| | | | work, including a proper parser.
* Add BUFSIZE define.lum2019-07-171-7/+8
|
* Add two dobeep functions to make calls to the system bell requirelum2019-07-173-97/+71
| | | | | fewer lines. While working in extend.c change relevant calls to dobeep.
* Allow functions that have 1 or more parameters receive and processlum2019-07-116-221/+378
| | | | | | | | | | | | | multiple arguments when evaluated in a startup file or via one of the 'eval' commands. This diff does treat the '(' and ')' chars differently during evaluation than previously, in-so-far as they are not ignored if they are at the end or start of a line now. However, even though these characters are not ignored, this diff should not change the behaviour of an extant .mg file, with '(' and ')' chars at the end and start of a line. This situation is accomodated for in this diff (with limited testing though).
* Make mg display the correct file name in the minibuffer if you loadlum2019-07-051-3/+5
| | | | | another file in a startup file (e.g via find-file), then experience another unrelated error with one of the lines being evaluated.
* selfinsert() can't be called directly from a startup file or bylum2019-07-033-3/+28
| | | | | | | 'eval-current-buffer' since it is by design, meant to be called interactively as characters are typed in a buffer. ask_selfinsert() allows selfinsert() to be used by excline(). Having ask_selfinsert() helps with regression testing. No manual page entry since use case is a bit obscure. See 'insert' command.
* snprintf/vsnprintf return < 0 on error, rather than -1.deraadt2019-07-031-2/+2
|
* I totally forgot about the instance where blink-and-insert can belum2019-07-024-30/+11
| | | | | | | | | called from the mg startup file. My previous diff broke that instance. So this diff reverts my change but adds a man page line to blink-and-insert in case someone should try to use it interactively, again. Also, should anyone ever want to add an interactive version of blink-and-insert in the future, the code is there. And the code could be useful in another, related instance.