mg: replace-regexp

2021-04-20 Thread Mark Lumsden
This diff adds a non-interactive version of mg's query-replace-regexp function called replace-regexp. Unfortunately query-replace-regexp can't be used in a startup file. Ok? Index: def.h === RCS file: /cvs/src/usr.bin/mg/def.h,v

mg list-buffers

2021-03-25 Thread Mark Lumsden
This is the current format of the output of the mg 'list-buffer' command: MR Buffer Size File -- -- *Buffer List* 0 .** file1.c 6810 /tmp/file1.c file2.c

mg: interactive evaluation

2021-03-23 Thread Mark Lumsden
This diff gives mg the ability to have an interactive session with interpreter.c via the 'eval-current-buffer' command. With this diff the interactive mode is switched off by default of course. So if you are in the habit of evaluting startup files you won't see any difference. With this diff

mg: buffer pointer change after eread()

2021-03-23 Thread Mark Lumsden
When reading in from the modeline in buffer.c, mg uses a pointer called bufp pointing to a buffer called bufn. It would seem to make sense to use bufp in any further processing. These functions don't: switch-to-buffer-other-window (poptobuffer()) kill-buffer

Re: mg(1): dired-jump

2021-03-19 Thread Mark Lumsden
Should this be "if (fname != NULL)"? Some other callers of adjustname() check for a NULL pointer. strlen(NULL) would crash by SIGSEGV; strlen("") would return 0, because "" is a non-NULL pointer to an ASCII NUL '\0'. I agree. Amended diff below. Index: def.h

mg(1): dired-jump

2021-03-18 Thread Mark Lumsden
This diff was first seen on the tech list just under a year ago. It is from Philip K. and was tested by George Koehler. I have modified it slightly. From Philips original post: this patch implements "dired-jump" for mg. For those not familiar with what dired-jump does in GNU Emacs, here's it's

mg(1): regress tests and pty

2021-03-18 Thread Mark Lumsden
I am currently writing regress tests for mg which use an mg startup file's capabilities to process mg commands to test mg's internal functions. In order to facilitate mg fitting into the OpenBSD regress test framework and be able to run via a cron job I have amended mg to be able to run with a

Re: mg: Fix Coverity Scan warning: Insecure data handling

2021-03-09 Thread Mark Lumsden
Thanks Todd. I'll pass your analysis on to Joachim. Date: Tue, 09 Mar 2021 14:14:33 -0700 From: Todd C. Miller To: Mark Lumsden Cc: tech@openbsd.org Subject: Re: mg: Fix Coverity Scan warning: Insecure data handling On Tue, 09 Mar 2021 20:14:19 +, Mark Lumsden wrote: Here is a diff

mg: Fix Coverity Scan warning: Insecure data handling

2021-03-09 Thread Mark Lumsden
Here is a diff from Joachim Wiberg's version of mg. "The strlcpy() function is guaranteed to never copy more than 'len - 1' bytes, so there is no need to check if we copied more. This is a bogus warning since the introduction of strlcpy()." Tested and seems reasonable. ok? Index: cinfo.c

Clear status line after killing or switching buffers

2021-03-09 Thread Mark Lumsden
From Joachim Wiberg's version of mg. "This patch makes sure to clear the status/echo line after killing and switching buffers by name. Otherwise the kill/switch prompt lingers" ok? It also adds back a CVS tag on the first line of buffer.c that I inadvertantly removed a while back. Index:

mg: Dired opening directory error

2021-03-01 Thread Mark Lumsden
If invoking 'M-x dired' and an error is encountered opening a directory, mg isn't very helpful. Though it will display a message on an EACCES problem. This diff doesn't go into the specifcs of which other error access(2) has encountered but does display an error msg: "Error opening:

Variablise \n and some regression tests

2021-02-26 Thread Mark Lumsden
This diff puts the hardcoded '\n' character which is found throughout mg into a buffer specific variable. The diff should not produce any behavourial difference in mg, it is only to facilitate other work I am doing on mg. In order for me to validate that there is no behavioural difference I

mg: minibuffer anomaly

2021-02-25 Thread Mark Lumsden
I was testing mg's goto-line function via the minibuffer (M-x goto-line) and I just kept my finger on the '0' key. After a brief time '0's started appearing in the main buffer, where the cursor had been. For a second I thought there had been an issue with memory allocation but after looking at

mg: fix direction of mark-paragraph

2021-02-23 Thread Mark Lumsden
The current direction of marking paragraphs using 'mark-paragraph' in mg is the opposite of emacs. Emacs goes backwards, mg goes forwards. This diff brings mg inline with emacs, and also simplifies the code, and fixes another bug with the current code. ok? Index: paragraph.c

mg: specify a different startup file

2021-02-21 Thread Mark Lumsden
This diff allows mg(1) to specify an alternative startup file on the fly when starting mg: $ mg -u ~/.mg2 I decided to use "u" since that is what emacs uses to load another user's init file: https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html Perhaps "f" would be better

mg(1) list evaluation

2019-07-15 Thread Mark Lumsden
This diff introduces lists to the startup file of mg. With this diff applied you could have something similar to: (define y(list b.txt c.txt)) (define z(list d.txt e.txt)) (find-file a.txt y f.txt z) in your .mg file, and when you opened mg, there would be 7 buffers opened (a.txt, b.txt,

Re: mg(1) evaluate multi-argument commands

2019-07-09 Thread Mark Lumsden
This is a modified diff of the previous evaluate multi-argument diff. The main difference is that all functions are given a number of parameters in the function map, this number represents how many arguments are required for the function to work. This extra column indicates to multiarg() how it

Re: mg(1) evaluate multi-argument commands

2019-07-05 Thread Mark Lumsden
I should add, I meant to put checks in for the calls to strlcpy and strlcat, but was pushed for time and forgot.. but of course they would be put in.

mg(1) evaluate multi-argument commands

2019-07-05 Thread Mark Lumsden
I was finding it a bit tedious with long evaluation buffers so I wrote a function that would translate these three (or more) lines: find-file a.txt find-file b.txt find-file c.txt into this one line: (find-file a.txt b.txt c.txt) There are a few commands that can be used like this: insert,

startup file - error message

2019-07-03 Thread Mark Lumsden
If you have something like this in your .mg file: find-file /home/lum/test imaginary-command When you open mg you will see an error: Error loading file /home/lum/test at line 2 If you open files in your .mg file, but then have any kind of error with the evaluation of lines afterwards (even

mg(1) self-insert-char

2019-07-02 Thread Mark Lumsden
In order to test certain aspects of mg, I use the eval-current-buffer function. However, that doesn't let me insert a character like 'a' unless mg is getting that character from another file or previously existing text, somewhere on disk, or in RAM. This diff allows eval-current-buffer (or an

Re: mg(1) M-x blink-and-insert

2019-07-01 Thread Mark Lumsden
I totally forgot about the instance where blink-and-insert can be 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 (and comment). ok? Index: def.h

mg(1) dired-goto-file

2019-06-29 Thread Mark Lumsden
This add dired-goto-file to mg. Comments/ok? Mark Index: dired.c === RCS file: /cvs/src/usr.bin/mg/dired.c,v retrieving revision 1.90 diff -u -p -u -p -r1.90 dired.c --- dired.c 28 Jun 2019 13:35:02 - 1.90 +++ dired.c

mg(1) copy file in dired mode

2019-06-25 Thread Mark Lumsden
In dired mode, if you try to copy a file without giving the new path a file name, similar to: cp /xdir/ydir/filname /xdir/ mg fails silently and doesn't copy the file into 'xdir' by using the existing filename as the copied filename. This diff uses the existing filename as the new filename if

mg(1) M-x blink-and-insert

2019-06-24 Thread Mark Lumsden
The man page for mg says this about blink-and-insert: blink-and-insert Self-insert a character, then search backwards and blink its matching delimiter. For delimiters other than parenthesis, brackets, and braces, the character itself is used as its own match. However, if you do 'M-x

mg(1): don't withold data indefinitely.

2019-06-20 Thread Mark Lumsden
Currently if you have a file 'test' and cat it: $ cat test abc def ghk $ Then open 'test' in mg and remove the newline at the end of the buffer and try to save it, mg will offer the opportunity to add a newline at the end of the buffer: "No newline at end of file, add one? (y or n)" Before

Re: About transient mark mode

2019-06-13 Thread Mark Lumsden
Leonid's diff would seem to be an improvement on current behaviour, any objections to adding it to mg? Or comments/ok? Mark From openbsd-tech Tue Jun 11 15:16:29 2019 From: Leonid Bobrov Date: Tue, 11 Jun 2019 15:16:29 + To: openbsd-tech Subject: About transient mark mode Message-Id:

mg(1) log internals to file

2019-06-07 Thread Mark Lumsden
macro[macrocount++].m_funct = funct; Index: log.c === RCS file: log.c diff -N log.c --- /dev/null 1 Jan 1970 00:00:00 - +++ log.c 7 Jun 2019 14:42:39 - @@ -0,0 +1,121 @@ +/* $OpenBSD$ */ + +/* + * This file is

mg(1): {beginning,end}-of-buffer numeric argument

2019-05-31 Thread Mark Lumsden
This diff gives the commands beginning-of-buffer and end-of-buffer the ability to take a numeric argument and move n/10th of the way from the top or bottom of the current buffer respectively. Any comments/testers/oks? Mark Index: basic.c

Re: ssh-keygen: interactive comment change

2019-05-22 Thread Mark Lumsden
On Wed, 22 May 2019, Mark Lumsden wrote: Date: Wed, 22 May 2019 18:49:23 + (UTC) From: Mark Lumsden To: tech@openbsd.org Subject: ssh-keygen: interactive comment change I used the -C command line option of ssh-keygen to change the comment of a public key and got confused with the output

ssh-keygen: interactive comment change

2019-05-22 Thread Mark Lumsden
I used the -C command line option of ssh-keygen to change the comment of a public key and got confused with the output. For example, if the original comment was 'mark@home', this is what would happen trying to amend the comment to 'mark@work' via -C: $ ssh-keygen -f test_rsa -c -C mark@work

Re: mg: Delete region

2018-12-23 Thread Mark Lumsden
On Sun, 23 Dec 2018, Hiltjo Posthuma wrote: Date: Sun, 23 Dec 2018 13:43:32 +0100 From: Hiltjo Posthuma To: Mark Lumsden Cc: Leonid Bobrov , tech@openbsd.org Subject: Re: mg: Delete region On Thu, Dec 20, 2018 at 06:44:15AM +, Mark Lumsden wrote: hmm, you are correct. I'm trying

Re: mg: Delete region

2018-12-19 Thread Mark Lumsden
hmm, you are correct. I'm trying to remember which machine I tested on that made me come to that conclusion. On Thu, 20 Dec 2018, Leonid Bobrov wrote: Date: Thu, 20 Dec 2018 06:43:02 +0200 From: Leonid Bobrov To: Mark Lumsden , tech@openbsd.org Subject: Re: mg: Delete region I tried

mg: Delete region

2018-12-17 Thread Mark Lumsden
Currently in mg, if the cursor is in a region and the 'delete' or 'backspace' keys are pressed mg will not behave any differently than if the cursor wasn't in a region. The diff below makes mg behave like emacs and kills the region and places it into the kill buffer. ok? Mark Index: mg.1

mg: toggle-read-only-all

2018-11-27 Thread Mark Lumsden
Allow all non-ephemeral buffers to be toggled write/read-only. This toggle works while mg is running, unlike the -R option which is only during mg startup. ok? Index: buffer.c === RCS file: /cvs/src/usr.bin/mg/buffer.c,v retrieving

mg and \n char

2018-11-15 Thread Mark Lumsden
Hi, I'm trying to work out a way of progressing mg to be 8 bit clean. Not being 100% sure of the scope of the problem and solution, attached is a diff that is trying to remove the implied or faked '\n' character from mg's buffers. I'm taking the approach of loading the '\n' char from disk to

mg: fix undo transpose-paragraph

2018-11-13 Thread Mark Lumsden
Currently undoing transpose-paragraph doesn't work as expected. This diff fixes that. ok? Index: paragraph.c === RCS file: /cvs/src/usr.bin/mg/paragraph.c,v retrieving revision 1.45 diff -u -p -r1.45 paragraph.c --- paragraph.c 6

Re: mg docs ownership

2016-09-11 Thread Mark Lumsden
> Maybe we should just not install it? Mark? A couple of years ago when the tutorial started being installed there were no dissenting voices, so unless there are objections, I'd carry on doing that. And Martin's diff makes sense I think. Mark

mg: region.c:preadin() - Also check for read() error

2016-09-08 Thread Mark Lumsden
Source Joachim Nilsson: Coverity Scan found this interesting buglet. If read() fails the code, before this patch, would trigger a "Negative array index write". ok? Index: region.c === RCS file: /cvs/src/usr.bin/mg/region.c,v

mg - Check pointer before calling showbuffer()

2016-09-06 Thread Mark Lumsden
Source Joachim Nilsson: Found by Coverity Scan. The popbuf() function iterated over a list to find a wp pointer, then sent it to showbuffer() which immediately went ahead and dereferenced it. This patch simply adds a NULL pointer check before calling showbuffer(), if NULL then

mg: goto end of para @ end of buffer problem

2016-09-05 Thread Mark Lumsden
Currently in mg, if you have a paragraph: 123 456 With the cursor on either the 4, 5 or 6 and no newline after the '6', and then execute forward-paragraph (M-}), the cursor sits still and does not move to the end of second line (after the 6), which is in effect the end of parapraph. This diff

mg(1) Initialize stack variables to zero before memmove()

2016-09-02 Thread Mark Lumsden
Source Joachim Nilsson: Coverity Scan reported these two stack variables as uninitialized, in particular the .r_lineno struct member was uninitialized. This patch clears the 'struct region' rather than setting .r_lineno because if any more struct members are added in the future

Re: mg - sentence-end-double-space

2016-04-12 Thread Mark Lumsden
Hi Ingo, On Tue, Apr 12, 2016 at 08:39:07PM +0200, Ingo Schwarze wrote: > Hi Mark, > > Mark Lumsden wrote on Tue, Apr 12, 2016 at 06:47:40PM +: > > > This diff allows a single space for sentence delimitation. > > ok/comments/objections? > > No objection, bu

mg - sentence-end-double-space

2016-04-12 Thread Mark Lumsden
This diff allows a single space for sentence delimitation. ok/comments/objections? The default of a double space is left as is. mark Index: def.h === RCS file: /cvs/src/usr.bin/mg/def.h,v retrieving revision 1.154 diff -u -p -u -p

Bug#812810: fill-paragraph: Leaves a space at the end of the paragraph

2016-04-10 Thread Mark Lumsden
This diff changes mg's behaviour to not put a space at the end of a paragraph when using the fill-paragraph function as reported by Harald Dunkel. ok/comments? Index: paragraph.c === RCS file: /cvs/src/usr.bin/mg/paragraph.c,v

mg(1) dired-find-alternate-file

2015-12-30 Thread Mark Lumsden
By shuffling find-alternate-file around we have dired-find-alternate-file as well. ok? -lum Index: def.h === RCS file: /cvs/src/usr.bin/mg/def.h,v retrieving revision 1.153 diff -u -p -u -p -r1.153 def.h --- def.h 29 Dec 2015

mg(1) tranpose-words

2015-12-24 Thread Mark Lumsden
This diff adds transpose-words to mg. It behaves slightly differently from emacs when it comes to muliple iterations. Take this text for example: abc def ghi jkl mno pqr If the cursor is on the 'd', then you do C-u 3 M-t, in emacs the result will be: abc ghi jkl mno def pqr The attached diff

mg - set read-only from command line

2015-12-23 Thread Mark Lumsden
If I am opening a lot of files into an editor but with the intention of not changing the contents (or more usually only amending a couple of files), a la: > mg * I like to open them all read-only, then change the ones I want to edit to read-write as required, that way I know when I close them

mg(1) dired sort

2015-10-13 Thread Mark Lumsden
This diff allows dired mode to sort directory contents alphabetically or by date order. It uses the same key as emacs: 's', though the extended command name is 'dired-sort'. Comments/ok? -lum Index: dired.c === RCS file:

mg(1) make dired-flag-file-deletion file more accurate

2015-10-12 Thread Mark Lumsden
Instead of just seeing if a line in a dired buffer is longer than 0 before marking it for deletion, check if a filename has the potential to be extracted from a line. ok? -lum Index: dired.c === RCS file:

mg(1) Change onlywind() params

2015-10-09 Thread Mark Lumsden
Calling onlywind() in this way should use FFRAND and 1 as the repective parameters. ok? -lum Index: buffer.c === RCS file: /cvs/src/usr.bin/mg/buffer.c,v retrieving revision 1.99 diff -u -p -u -p -r1.99 buffer.c --- buffer.c26

mg(1) onlywind() line number anomaly

2015-10-08 Thread Mark Lumsden
If you open mg with only the *scratch* buffer loaded (no file names given on command line), and press enter 5 times, take a note of the line number in the status bar then open theo mode (M-x theo). Then move back to the *scratch* buffer via switch-to-buffer (C-x b). You'll notice the line number

mg(1) honour C-u 0

2015-10-07 Thread Mark Lumsden
Calling an mg command with zero iterations (C-u 0) seems non-sensical but what should happen if you did? Currently some commands honour the 0 [ie. do nothing], others do not, they partially complete or complete as if 1 had been passed. For example try and insert 0 characters via: C-u 0 a The

mg(1) keep 'D' marked files across dired refreshes

2015-10-06 Thread Mark Lumsden
Hi, Currently, in mg dired mode, if you mark a file as deleted, if the dired buffer is refreshed (using 'dired-revert' for example) the marking of files is lost. This diff fixes that by saving the marked files before they are lost, then remarking them once the buffer is refreshed. Comments/oks?

mg(1) filevisit and dired mode

2015-09-25 Thread Mark Lumsden
hi, If you find-file (C-x C-f) and select a directory instead of a file, mg will eventually call dired but due to the current location of the call to dired in mg, find-file calls showbuffer() multiple times. Apart from being wastefull, doing this results in the cursor ending up on the wrong line

mg(1) transpose-paragraph

2015-09-24 Thread Mark Lumsden
While I am 'paragraph' mode, here is the useful 'transpose-paragraph' command. Comments/ok? mark Index: def.h === RCS file: /cvs/src/usr.bin/mg/def.h,v retrieving revision 1.148 diff -u -p -u -p -r1.148 def.h --- def.h 24 Sep

mg(1) dired-do-flagged-delete warpdot

2015-09-23 Thread Mark Lumsden
In dired mode, I noticed that if the cursor is on a file marked for deletion when dired-do-flagged-delete (x) is called, the cursor is placed on the left hand side of the window. This diff makes d_expunge behave like other delete functions and calls d_warpdot to() place the cursor on the first

mg(1) - kill-paragraph tidy up

2015-09-21 Thread Mark Lumsden
Hi, The kill-buffer command in mg doesn't behave quite as I would expect, if you invoke it multiple times via C-u #, then follow with M-_ (undo) or C-y (paste), only the last buffer killed (re)appears and not the multiple paragraphs that I think should. This diff changes that behaviour. Also,

mg(1) startup file comments

2014-04-02 Thread Mark Lumsden
ok to indicate a comment in an mg startup file with the '#' char? I can't see how this will break anybodys current startup files... -lum Index: extend.c === RCS file: /cvs/src/usr.bin/mg/extend.c,v retrieving revision 1.54 diff -u

mg(1) find-file - missing directory

2014-04-01 Thread Mark Lumsden
Currently, if you use find-file (C-x C-f) to find a file in a non- existant directory, mg (and emacs - coincidentally) suggest you create the directory manually with the make-directory command. This diff offers to create the missing directory by pressing 'y'. If mg cannot create the missing the

mg(1) dired-unmark-backward

2013-12-19 Thread Mark Lumsden
Make 'dired-unmark-backward' behave the same as emacs. Any objections? -lum Index: dired.c === RCS file: /cvs/src/usr.bin/mg/dired.c,v retrieving revision 1.63 diff -u -p -u -p -r1.63 dired.c --- dired.c 3 Jun 2013 05:10:59

mg(1) rename dired commands

2013-06-02 Thread Mark Lumsden
This diff renames the dired-* command names to be in line with emacs. Any objections? mark Index: dired.c === RCS file: /cvs/src/usr.bin/mg/dired.c,v retrieving revision 1.59 diff -u -p -r1.59 dired.c --- dired.c 30 May 2013

mg(1) 'g' dired refresh buffer

2013-06-02 Thread Mark Lumsden
This diff uses 'g' to refresh the dired buffer. mark Index: dired.c === RCS file: /cvs/src/usr.bin/mg/dired.c,v retrieving revision 1.62 diff -u -p -r1.62 dired.c --- dired.c 2 Jun 2013 10:09:21 - 1.62 +++ dired.c

mg(1) 'q' for quit-window in dired mode

2013-06-01 Thread Mark Lumsden
This diff adds the key binding 'q' and function 'quit-window' to mg's dired mode. Comments/oks? mark Index: buffer.c === RCS file: /cvs/src/usr.bin/mg/buffer.c,v retrieving revision 1.90 diff -u -p -r1.90 buffer.c --- buffer.c

[m...@showcomplex.com: mg(1) 'q' for quit-window in dired mode]

2013-06-01 Thread Mark Lumsden
The man page has an error... it should read: .It q quit-window - Forwarded message from Mark Lumsden m...@showcomplex.com - Date: Sat, 1 Jun 2013 15:05:16 + From: Mark Lumsden m...@showcomplex.com To: tech@openbsd.org Subject: mg(1) 'q' for quit-window in dired mode User-Agent

mg(1) M-} forward para diff

2013-05-31 Thread Mark Lumsden
A while back, I committed a diff that fixed scrolling backwards by paragraph in mg. I thought I would give it a while before writing the corresponding diff for going forwards, just to make sure there were no problems with the first diff. So here it is. Before you compile this diff, (and if you

mg(1) visible/audible bell control

2013-05-30 Thread Mark Lumsden
This diff adds the capability to toggle on and off the system bell within mg via the 'audible-bell' command. It also introduces the 'visible-bell' command: the modeline will flash instead. However, both can be used together, if so desired. Comments/oks? -lum Index: Makefile

mg(1) dired opening ~/

2013-05-29 Thread Mark Lumsden
Currently dired mode doesn't use the adjustname() function early enough when passed ~. For example typing 'M-x dired', then: Dired: ~ Doesn't open your home directory. However, with this diff mg behaves like emacs. ok? mark Index: dired.c

mg(1) - use more adjustname() in dired

2013-05-29 Thread Mark Lumsden
The dired-copy-file and dired-rename-file commands do not use adjustname() for the new path. Hence 'M-x dired-copy-file': Dired: ~/filename will not work. This diff fixes that behaviour. ok? mark Index: dired.c === RCS file:

mg(1) dired warpdot

2013-05-28 Thread Mark Lumsden
The mg dired commands: dired-flag-file-deleted dired-backup-unflag dired-unflag behave more like emacs when the cursor stays on the first character of the file name. ok? mark Index: dired.c === RCS file:

mg(1) dired buffer refresh

2013-05-27 Thread Mark Lumsden
In mg dired mode, if you execute these commands: dired-copy-file dired-rename-file dired-create-directory The dired buffer is not refreshed with the updated action. This diff fixes that. Comments/oks? -lum Index: dired.c === RCS

mg(1) dired buffer refresh

2013-05-27 Thread Mark Lumsden
In mg dired mode, if you execute these commands: dired-copy-file dired-rename-file dired-create-directory The dired buffer is not refreshed with the updated action. This diff fixes that. Comments/oks? -lum Index: dired.c === RCS

mg(1) dired-create-directory

2013-05-27 Thread Mark Lumsden
dired-create-directory is missing from the function maps. ok? -lum Index: dired.c === RCS file: /cvs/src/usr.bin/mg/dired.c,v retrieving revision 1.52 diff -u -p -r1.52 dired.c --- dired.c 3 Nov 2012 15:36:03 - 1.52

mg.1 dired commands

2013-05-27 Thread Mark Lumsden
I realised the dired commands are not in the mg man page. ok? -lum Index: mg.1 === RCS file: /cvs/src/usr.bin/mg/mg.1,v retrieving revision 1.76 diff -u -p -r1.76 mg.1 --- mg.122 May 2013 19:23:45 - 1.76 +++ mg.1

Re: mg(1): shell-command

2013-05-22 Thread Mark Lumsden
To make the shell-command-on-region and this command behave like that requires another diff. mark On Wed, May 22, 2013 at 09:32:45AM +0200, Jasper Lievisse Adriaanse wrote: On Tue, May 21, 2013 at 07:54:31PM +, Mark Lumsden wrote: This diff modifies the shell-command-on-region function

Re: mg(1): shell-command

2013-05-22 Thread Mark Lumsden
I am glad to say, 3 of you are on your toes today. I sent the wrong diff, and to be honest I wasn't sure if any one would notice. Gold Stars to you all On Wed, May 22, 2013 at 09:07:56AM +, Florian Obser wrote: On Tue, May 21, 2013 at 07:54:31PM +, Mark Lumsden wrote: This diff

mg(1): shell-command

2013-05-21 Thread Mark Lumsden
This diff modifies the shell-command-on-region function and gives us shell-command. It makes getting output from other commands into mg really easy. Comments/oks? -lum Index: def.h === RCS file: /cvs/src/usr.bin/mg/def.h,v

adduser default blowfish rounds

2013-05-13 Thread Mark Lumsden
Shouldn't the default rounds for blowfish in adduser.perl be the same as login.conf? ok? mark Index: adduser.perl === RCS file: /cvs/src/usr.sbin/adduser/adduser.perl,v retrieving revision 1.58 diff -u -p -u -p -r1.58 adduser.perl

Re: adduser default blowfish rounds

2013-05-13 Thread Mark Lumsden
On Mon, May 13, 2013 at 08:24:43PM +0100, Stuart Henderson wrote: On 2013/05/13 18:35, Mark Lumsden wrote: Shouldn't the default rounds for blowfish in adduser.perl be the same as login.conf? ok? mark Index: adduser.perl

mg(1) M-{} line number fix

2013-02-14 Thread Mark Lumsden
Fix forward-paragraph and backward-paragraph's handling of line numbers. ok? -lum Index: paragraph.c === RCS file: /cvs/src/usr.bin/mg/paragraph.c,v retrieving revision 1.22 diff -u -p -r1.22 paragraph.c --- paragraph.c 29 Nov

Re: (Fwd) last(1) nit

2013-02-10 Thread Mark Lumsden
Printing just the file name (as opposed to the full path) is how NetBSD and linux behave. FreeBSD has the same behaviour as OpenBSD. I'd follow the first 2. Any objections? -lum Might I suggest using basename()? --- last.c.orig 2009-10-27 23:59:39.0 + +++ last.c 2013-02-09

lost user error message

2012-08-30 Thread Mark Lumsden
There is an check when closing mg via C-x C-c, that if a file name is too long, the user should receive an error message Error: filename too long!, however, currently that message gets lost due to that check returning ABORT. This diff changes the return value to UERROR which allows the message to

mg(1) - closing buffer behaviour

2012-08-29 Thread Mark Lumsden
If you C-x C-c out of emacs and there are unsaved buffers, emacs asks if you want to save them (mg behaves the same). If there is a write error (permissions or non-existant parent directory) emacs stops exiting. This allows the user to decide what to do with these buffers. In mg, the contents of

Re: tinyscheme + mg

2012-06-28 Thread Mark Lumsden
Here is an updated diff for mg with tinyscheme integration. It's based on tedu's original diff with various tweaks and changes. For those worried about mg being too bloated, rest assured, it's still small and lean and a big part smaller than vi ;-) It's not fully possible to turn mg into your

Re: tinyscheme + mg

2012-06-28 Thread Mark Lumsden
I'm all for adding support for scripting into mg, though I would be tempted to rip out all nonessential functionality first (ng? ;) and add it back via the scripting language. I would think the goal should be to make mg significantly *smaller* any such change Could you clarify what you mean

Re: tinyscheme + mg

2012-06-28 Thread Mark Lumsden
I'd be a lot happier voicing an opinion in support of something like this if I also saw diffs and interest in *using* them to extend functionality later or replace some things easier to do with scheme to make the code simpler - something kjell was alluding to. I think we can work

mg - end-of-buffer diff

2012-06-15 Thread Mark Lumsden
Currently, if you are at the start of a buffer that is longer than the window and press M-, you will move to the end of the buffer. There is a difference between mg and emacs' behaviour though. In emacs, your cursor will be placed at the bottom of the window (minus 3 lines) which means most of the

mg - another ~file bug

2012-06-14 Thread Mark Lumsden
Currently, in mg, if you try to open a file that doesn't exist and has a name longer than LOGIN_NAME_MAX and also has a tilde at the front e.g. $ mg ~01234567890123456789012345678901 you will receive a msg: Login name too long Since the filename cannot be a user name (it is too long),

mg - save backup files to homedir (diff v3)

2012-06-13 Thread Mark Lumsden
If you use mg as the editor with mutt, any backup files mutt creates are kept in /tmp. However, with backup-to-home-directory enabled all backup files are moved to ~/.mg.d. Personally, I'd rather not move these backups but keep them in the /tmp dir. This modified diff allows backup files that

Re: mg - save backup files to homedir (diff v2)

2012-06-09 Thread Mark Lumsden
So perhaps it is better for mg to behave more like emacs when it comes to saving backup files in a single directory. Especially if a user has two files open with the same name and are working on them simultaneously. In this diff I've added the path to the backup file name. Like emacs, it

mg - Another corner-case scrolling fix

2012-06-08 Thread Mark Lumsden
Bit difficult to explain this one. If you have a file open that is 3 or 4 times longer than the length of the viewable window and are at the bottom of the buffer then scroll up to the top using M-v, your cursor should remain at the bottom left of the window once you reach the top of the buffer.

Re: mg - corner-case backward scrolling

2012-06-07 Thread Mark Lumsden
There is a corner case when the screen buffer is only 1 line long where the loop that looks for the current dot line goes through the whole buffer until it finds the correct line. This means the line number decrement is way over what it should be. This diff accounts for that corner case. ok?

mg - save backup files to homedir (diff v2)

2012-06-07 Thread Mark Lumsden
[note: I've modifed this diff from the first version with comments from eric@ and Sunil Nimmagadda.] I find the backup files mg creates scattered around a pain but then again I don't want to switch backups off since they can be useful. Also, I don't feel the need to implement something in mg as

mg - corner-case backward scrolling

2012-06-05 Thread Mark Lumsden
There is a corner case when the screen buffer is only 1 line long where the loop that looks for the current dot line goes through the whole buffer until it finds the correct line. This means the line number decrement is way over what it should be. This diff accounts for that corner case. ok? -lum

Re: cscope support in mg

2012-06-01 Thread Mark Lumsden
Here is an updated diff with following changes... Manpage update. Remove conditional compilation of cscope functionality. Fixed a memory leak in csexists function. Treat current word at cursor as default input for cscope commands. Comments? I like it. I'm using your previous diffs

mg - scrolling back diff

2012-05-31 Thread Mark Lumsden
Currently, mg's cursor jumps from top to bottom of the screen as you scroll upwards, I find this behaviour confusing at times. This diff makes mg's scroll back the same as emacs. Comments/ok? mark Index: basic.c === RCS file:

mg - more emacs scroll compatibility

2012-05-31 Thread Mark Lumsden
Show a message and beep when you reach either end of a buffer. ok? -lum Index: basic.c === RCS file: /cvs/src/usr.bin/mg/basic.c,v retrieving revision 1.33 diff -u -p -r1.33 basic.c --- basic.c 31 May 2012 10:55:53 -

mg - remove *init* buffer

2012-05-28 Thread Mark Lumsden
After a recent commit (http://marc.info/?l=openbsd-techm=133787310204563w=2) I realised the *init* buffer could be removed since we went back and updated modes after scratch was created. There is a side effect to this diff; theo mode now works from the command line: $ mg -f theo [it had been

mg end of buffer page down diff

2012-05-25 Thread Mark Lumsden
When you page down a document and get to the last page, mg doesn't stop, it keeps going until the last line is at the top of the window. This diff makes mg stop paging down when the end of the text is visible. Comments/ok? -lum ps some whitespace for readability added. Index: basic.c

mg history and window relocation

2012-05-25 Thread Mark Lumsden
Move the windows section in the tutorial to a more sensible place (next to buffers) and move the mg history into the README file which seems a more sensible place as well. ok? -lum Index: README === RCS file:

  1   2   >