hboetes / mg Goto Github PK
View Code? Open in Web Editor NEWPortable version of the OpenBSD maintained mg, micro emacs clone
Portable version of the OpenBSD maintained mg, micro emacs clone
I don't know who the original maintainers of "mg" (under OpenBSD) are, so writing to you with the hope that either you could consider providing the requested feature, or forward this request to the appropriate individual(s).
Would it be possible for "mg" to provide parentheses balancing and indentation support using the Parinfer mechanism/algorithm?
Description of Parinfer is available at https://shaunlebron.github.io/parinfer/
Hope I haven't overstepped my limits by requesting the above. Thank you.
Hi,
you may be interested in taking a look at my github. I'm keeping an mg clone alive that supports UTF-8
BR, /Pedro A Aranda
https://github.com/paaguti
Hi:
Do you plan to implement syntax highlight sometime. At least the most basic functionalities?
Here is a demonstration of the problem, using mg 20200723-1 as packaged in Debian testing:
% mg foo
# Edit buffer, save it, suspend mg.
zsh: suspended mg foo
% chmod 600 foo
% fg
[2] - continued mg foo
# Modify buffer, save it again, suspend mg.
zsh: suspended mg foo
% ls -l foo
-rw-rw-r-- 1 user user 9 Jan 5 17:24 foo
This behavior can be a problem if one edits configuration files that need specific permissions. This is how I got bitten by it.
Other editors I checked (GNU emacs and zile) preserve permissions that are modified while a file is open.
I have the following lines inside my ~/.mg
file
make-backup-files 0
Yet mg still makes backups. When i use make-backup-files
interactively, only then it says they're disabled.
From the manpage:
Many commands take an optional numerical
parameter, n. This parameter is set either by M- (where n is the numerical argument) before the
command, or by one or more invocations of the universal argument, usually bound to C-u. When in‐
voked in this manner, the value of the numeric parameter to be passed is displayed in the
minibuffer before the M-x. One common use of the parameter is in mode toggles (e.g. make-backup-
files). If no parameter is supplied, the mode is toggled to its alternate state. If a positive
parameter is supplied, the mode is forced to on. Otherwise, it is forced to off.
Does this also apply to the ~/.mg
file? Why is the configuration file not covered more in the manual?
Hello, we have an old version of mg in MacPorts which I'm trying to update to your latest version 20180927. I'm trying to build it on macOS High Sierra.
First, it told me to install libbsd. I tried to build libbsd, but it failed. I reported that to the developers of libbsd. Then, since macOS is based on BSD, I tried patching your makefile so that it would not require a separate libbsd.
That got me further, and now it fails to build for me with this error:
fileio.c:282:20: error: no member named 'st_atim' in 'struct stat'
new_times[0] = sb.st_atim;
~~ ^
fileio.c:283:20: error: no member named 'st_mtim' in 'struct stat'
new_times[1] = sb.st_mtim;
~~ ^
2 errors generated.
I've run into this problem with other projects as well. Seems this is just one of those things that different operating systems do differently: macOS doesn't use the names st_atim
, st_ctim
, st_mtim
, but instead uses st_atimespec
, st_ctimespec
, st_mtimespec
.
Since the last release, I see you've added cmake support. Maybe you could have cmake detect which time fields to use on the current OS.
Hi!
First, I noticed auto-fill-mode bug: one UTF-8 character counts as multiple characters. That is, it creates new line too early.
Second, just right after that I tried to delete characters at next line. When I delete that line, the last character at previous line is also removed.
mg 20180408 builds for Fedora 31, but not Fedora 32.
The relevant part of the build where it fails in Fedora 32:
/usr/bin/ld: basic.o:/builddir/build/BUILD/mg-20180408/def.h:757: multiple definition of `rptcount'; autoexec.o:/builddir/build/BUILD/mg-20180408/def.h:757: first defined here
/usr/bin/ld: basic.o:/builddir/build/BUILD/mg-20180408/def.h:756: multiple definition of `tcdell'; autoexec.o:/builddir/build/BUILD/mg-20180408/def.h:756: first defined here
/usr/bin/ld: basic.o:/builddir/build/BUILD/mg-20180408/def.h:755: multiple definition of `tcinsl'; autoexec.o:/builddir/build/BUILD/mg-20180408/def.h:755: first defined here
/usr/bin/ld: basic.o:/builddir/build/BUILD/mg-20180408/def.h:754: multiple definition of `tceeol'; autoexec.o:/builddir/build/BUILD/mg-20180408/def.h:754: first defined here
/usr/bin/ld: basic.o:/builddir/build/BUILD/mg-20180408/def.h:346: multiple definition of `winch_flag'; autoexec.o:/builddir/build/BUILD/mg-20180408/def.h:346: first defined here
/usr/bin/ld: bell.o:/builddir/build/BUILD/mg-20180408/def.h:757: multiple definition of `rptcount'; autoexec.o:/builddir/build/BUILD/mg-20180408/def.h:757: first defined here
/usr/bin/ld: bell.o:/builddir/build/BUILD/mg-20180408/def.h:756: multiple definition of `tcdell'; autoexec.o:/builddir/build/BUILD/mg-20180408/def.h:756: first defined here
/usr/bin/ld: bell.o:/builddir/build/BUILD/mg-20180408/def.h:755: multiple definition of `tcinsl'; autoexec.o:/builddir/build/BUILD/mg-20180408/def.h:755: first defined here
/usr/bin/ld: bell.o:/builddir/build/BUILD/mg-20180408/def.h:754: multiple definition of `tceeol'; autoexec.o:/builddir/build/BUILD/mg-20180408/def.h:754: first defined here
/usr/bin/ld: bell.o:/builddir/build/BUILD/mg-20180408/def.h:346: multiple definition of `winch_flag'; autoexec.o:/builddir/build/BUILD/mg-20180408/def.h:346: first defined here
The builds are:
The relevant logs are:
libbsd was upgraded form 0.9.1 in f31 to 0.10.0 in f32 if that is relevant.
I tried upgrading to 20180927 but it also failed to build in f32 with the same error. 20180927 builds fine in f31 though.
The relevant logs for 20180927 are:
Would it be possible to add a new tag, if the code is in a sufficiently stable state? This would help to release a new package for Debian.
I write in Portuguese and accentuated characters, such as ã
and á
do not work. They are not written at all.
Hi Han,
I am maintainer for mg in Debian. Problem is: Since 2018 there are no tagged new versions for mg on github anymore, even though mg in OpenBSD 6.6 appears to be pretty stable. Without version numbering it is very difficult to provide new Debian packages. I have no indication to tell a good from a bad version. You know much better.
Do you think it would be possible to tag a version from time to time? Following the version number schemer from the "pre-github" time would be sufficient.
Thanx in advance
Harri
Preamble: static binaries are great, but you can't really build them with glibc, to fix that problem I want to create a Containerfile
, so I can simply build a static binary:
Here is that Containerfile
:
FROM docker.io/library/alpine
RUN apk update
RUN apk add git libbsd-dev ncurses-dev musl-dev ncurses-static gcc make
RUN git clone https://github.com/hboetes/mg.git
WORKDIR mg
RUN TAG=$(git describe --tags); \
git checkout $TAG; \
make STATIC=1; \
strip mg; \
ln mg mg-$TAG-static-x86_64
You can create the static binary like this:
% sudo podman image build --rm -t mg-static .
[SNIP: lots of output]
% sudo podman image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/mg-static latest 93dc44a79f11 15 seconds ago 163 MB
docker.io/library/alpine latest 14119a10abf4 3 weeks ago 5.87 MB
% sudo podman run -it 93dc44a79f11
To get the binary out, open another terminal and run:
% sudo podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
f4e0aa32f16a localhost/mg-static:latest /bin/sh 34 seconds ago Up 33 seconds ago
% sudo podman exec f4e0aa32f16a sh -c "ls /mg/mg-*"
/mg/mg-20210609-1-g0b69dcc-static-x86_64
% sudo podman cp f4e0aa32f16a:/mg/mg-20210609-1-g0b69dcc-static-x86_64 .
What works:
What I don't like:
Containerfile
?I wonder if there is any way to change setting in .mg file to set tab as 4 spaces?
Thanks!
In other editors I often kill a whole line, for example, using dd in vi. It would be nice to be able to do that in mg.
How it is done in emacs (kill-whole-line):
https://www.gnu.org/software/emacs/manual/html_node/emacs/Killing-by-Lines.html
Hi there - I notice that Apple is now shipping mg
(whether it's part of the base MacOS install, or part of their optional "Command Line Tools for Xcode" package, I'm not sure, as I've already installed the latter on my machine).
I'm wondering which mg
codebase they're using, and went looking at https://opensource.apple.com , but could not find any trace of mg.
Do you know what the deal is?
The most recent one is patch from me that makes {beginning,end}-of-buffer less annoying.
Greetings. I found the following other OpenBSD mg ports:
https://github.com/ibara/mg (updated very recently, clean repo and simple custom configure script)
https://github.com/troglobit/mg (updated very recently, uses GNU autotools)
https://github.com/scott-parker/mg-openbsd (dead since 2015)
Considering that these are now 4 repos for the same purpose, would you be willing to contact their maintainers and merge your work with one of them? :) IMHO, ibara's version seems to be the best maintained. It "aggressively tracks upstream" and is "Tested on recent versions of Arch, Cygwin, Debian, DragonFly BSD, FreeBSD, Mac OS X (10.10 or later), NetBSD, Slackware, and Ubuntu." It would be great to have a single portable OpenBSD mg repo that could be added to all OS package managers.
Hi Han,
would you mind to add a tag to the version of March 31st? I would like to use it to provide a new Debian package.
Thank you very much
Harri
Hello, as I read in the tutorial file, it said To delete characters, use the backspace key.
But when I did backspace, it showed a b c:
. I am not sure if this has a different meaning, but it would be useful to have a backspace working rather than moving one letter forward and doing ^D.
Thanks
Hi,
The source tarball and ZIP archives for the 20200215 release are
https://github.com/hboetes/mg/archive/20180927.zip and https://github.com/hboetes/mg/archive/20180927.tar.gz
that's a bit confusing...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.