adamyg / grief Goto Github PK
View Code? Open in Web Editor NEWGRIEF - BRIEF clone
Home Page: http://grief.sourceforge.net/
License: Other
GRIEF - BRIEF clone
Home Page: http://grief.sourceforge.net/
License: Other
Support control-character using associated Unicode characters, u2400 .. u240C.
Furthermore, special line-feed handling; note: original Brief displayed in the buffer as the female symbol.
Was reading the documentation and it says grief builds on AIX, so I thought I'd give it a try. I'm using AIX 7.2. I use the AIX Toolbox utilities including GNU gcc and related GNU build tools.
Tried running auto/configure. Got the error:
configure: error: cannot find sources (include/edheaders.h) in auto or ..
Ended up having to run support/config_withncurses instead.
First error I hit was in edendian.h.
Error message was:
In file included from bsd_endian.h:30,
from bsd_cdbr.c:54:
/home/michaelsl/opt/src/grief/aix32/tmp/grief-master/include/edendian.h:104:2: error: #error BYTE_ORDER and HIST_XXX_ENDIAN differ ...
#error BYTE_ORDER and HIST_XXX_ENDIAN differ ...
^~~~~
I don't see a place where HOST_BIG__ENDIAN is set in the grief code and I don't see it set in the AIX include files either.
Worked around that.
Next error I hit was:
charseticonv.c: In function 'dlmod_error':
charseticonv.c:691:28: error: 'L_GETMESSAGE' undeclared (first use in this function); did you mean 'L_GETMESSAGES'?
if ((n = loadquery(L_GETMESSAGE, msgs, sizeof(msgs))) > 0) {
^~~~~~~~~~~~
L_GETMESSAGES
charseticonv.c:691:28: note: each undeclared identifier is reported only once for each function it appears in
charseticonv.c:694:19: warning: implicit declaration of function 'strpush'; did you mean 'r_push'? [-Wimplicit-function-declaration]
len = strpush(0, buffer, "dlopen: ");
^~~~~~~
r_push
I commented out the AIX specific loadquery related code and it compiled.
Hit the following error message:
libtool --mode=compile gcc -DMODULE_LOADABLE --param max-inline-insns-single=1200 -pthread -O1 -DNDEBUG -I. -I/home/michaelsl/opt/src/grief/aix32/tmp/grief-master/include -DHAVE_CONFIG_H -o /home/michaelsl/opt/src/grief/aix32/tmp/grief-master/objects.gcc/release/libchartable/cxCP932.lo -c cnvtables/cxCP932.c
/home/michaelsl/opt/src/grief/aix32/tmp/grief-master/libtool: line 900: print: command not found
/home/michaelsl/opt/src/grief/aix32/tmp/grief-master/libtool: line 900: print: command not found
/home/michaelsl/opt/src/grief/aix32/tmp/grief-master/libtool: line 971: print: command not found
/home/michaelsl/opt/src/grief/aix32/tmp/grief-master/libtool: line 973: print: command not found
/home/michaelsl/opt/src/grief/aix32/tmp/grief-master/libtool: line 907: print: command not found
make[3]: *** [Makefile:215: cxCP932.lo] Error 1
Not sure how to proceed from there.
Would be nice to get this running on AIX, but I'm not having much luck so far.
I did get the latest grief code to build using an older version of MinGW from mingw.org on Windows. However, I did have to make some modifications to the code to get it to compile. It didn't work out of the box. I think the biggest issue for MinGW was that a lot of the code in libw32 checks for _MSC_VER or WATCOMC. MinGW doesn't set _MSC_VER and it's not Watcom, so it doesn't include that code. Defined a dummy _MSV_VER as a work-around, but there are some areas where that doesn't work and I have to #undef _MSC_VER again.
Just wanted to let you know my results trying to build the latest version of grief on a few platforms.
The INSTALL file says:
f. Build the entire tree with:
make
or make release
However, make
does not work. You must type make release
6.9.9
auto configure, minimal setup on first run
deprecated
First, thank you for both Grief and the Windows version of Midnight Commander!
Using the Win32 version 3.2.2 of Grief, if the file has been changed, but not saved with Alt-W, nothing happens if Alt-X is entered. Furthermore, F10 followed by exit doesn't work either (but abort does).
Is this the behavior you intended? I would have thought a message such as "File changed but not saved; reply W (save then exit), X (exit), Enter (continue Grief session)." would be appropriate.
Reference: https://sourceforge.net/p/grief/tickets/17/
maxcolors=16 limit is applicable when running in 256-color emulation mode; checks reordered.
if (GetModuleHandleA("ConEmuHk.dll") ||
GetModuleHandleA("ConEmuHk64.dll")) {
printf("Running under ConEmu, disabling 256 support\n");
vio.maxcolors = 16;
}
'vfork' is deprecated: Use posix_spawn or fork [-Wdeprecated-declarations]
#define _GNU_SOURCE /*top*/
#if defined(POSIX_SPAWN_USEVFORK) || defined(__GLIBC__) /* force USEVFORK on GNU libc */
flags |= POSIX_SPAWN_USEVFORK;
#endif
posix_spawn_file_actions_t fops;
posix_spawnattr_t attr;
sigset_t mask;
posixspawn_file_actions_init(&fops, options);
posix_spawnattr_init(&attr);
flags |= POSIX_SPAWN_SETSIGMASK; /* child does not block any signals */
sigemptyset(&mask);
posix_spawnattr_setsigmask(&attr, &mask);
flags |= POSIX_SPAWN_SETSIGDEF; /* child reverts SIGPIPE handler to the default. */
sigaddset(&mask, SIGPIPE);
posix_spawnattr_setsigdefault(&attr, &mask);
posixspawn_set_pgroup(options, &attr, &flags);
posix_spawnattr_setflags(&attr, flags);
posix_spawnp(&pid, file, &fops, &attr, argv, envp ? envp : environ /*global*/);
chdir(cwd) [optional]
posix_spawn_file_actions_destroy(&fops);
posix_spawnattr_destroy(&attr);
mc/vio merge
Greetings,
If I run gr
, type some text, and then exist with alt-x
, gr asks me if I want to exit without saving the unsaved text. However, if I type gr ""
it does not. Why?
Please, add to INSTALL document:
export GRPATH=/usr/local/share/gr/macros
export GRHELP=/usr/local/share/gr/help
And how to exit: Alt-X
As we know there are several end-of-line termination conventions:
Grief defaults to LF which it uses in new files. However it is smart enough to detect the other conventions in existing files and follows it thereafter in that file. However, the LF default is not convenient for those of us working in non-Unix environments. Manually using "F10 bufinfo" is possible but not convenient especially since one has to do it every new file.
I have 2 alternatives to suggest:
Ref: sourceforge
$ ./configure_new
[...]
config.status: creating hlpdoc/Makefile
config.status: creating macsrc/Makefile
config.status: creating util/Makefile
config.status: creating include/config.h
config.status: executing libtool commands
/usr/bin/rm: cannot remove 'libtoolT': No such file or directory
$
You may want to use rm -f
Review COLORTERM/TERM effects, as recent usage has evolved.
https://no-color.org/ ??
Extend mouse support, see: set_mouse_action()
Review <80 column clip logic; note: 81x24 (or greater) current requirement
On build-27 of INSTALL.md I am seeing:
[...]
?configure --prefix=/home/user/grief?
[...]
?make release? - build software.
[...]
?sudo make release install? - install for common/system usage; or │
│ or ?make release install? - local installation.
What are all of the question marks?
# git checkout build-25
# ./configure
bash: ./configure: Permission denied
# chmod 755 configure
# ./configure
[...]
# make release
[...]
gcc --param max-inline-insns-single=1200 -pthread -O1 -DNDEBUG -I/home/blake/Backup/grief.git/include -DHAVE_CONFIG_H -o /home/blake/Backup/grief.git/obj.gcc/release/libvfs/vfs_curl.o -c vfs_curl.c
gcc --param max-inline-insns-single=1200 -pthread -O1 -DNDEBUG -I/home/blake/Backup/grief.git/include -DHAVE_CONFIG_H -o /home/blake/Backup/grief.git/obj.gcc/release/libvfs/vfs_handle.o -c vfs_handle.c
gcc --param max-inline-insns-single=1200 -pthread -O1 -DNDEBUG -I/home/blake/Backup/grief.git/include -DHAVE_CONFIG_H -o /home/blake/Backup/grief.git/obj.gcc/release/libvfs/vfs_lookup.o -c vfs_lookup.c
gcc --param max-inline-insns-single=1200 -pthread -O1 -DNDEBUG -I/home/blake/Backup/grief.git/include -DHAVE_CONFIG_H -o /home/blake/Backup/grief.git/obj.gcc/release/libvfs/vfs_mount.o -c vfs_mount.c
gcc --param max-inline-insns-single=1200 -pthread -O1 -DNDEBUG -I/home/blake/Backup/grief.git/include -DHAVE_CONFIG_H -o /home/blake/Backup/grief.git/obj.gcc/release/libvfs/vfs_node.o -c vfs_node.c
vfs_node.c: In function ‘vfs_node_new’:
vfs_node.c:46:18: error: implicit declaration of function ‘time’ [-Wimplicit-function-declaration]
46 | time_t now = time(NULL);
| ^~~~
vfs_node.c:40:1: note: ‘time’ is defined in header ‘<time.h>’; this is probably fixable by adding ‘#include <time.h>’
39 | #include "vfs_node.h"
+++ |+#include <time.h>
40 |
make[2]: *** [Makefile:149: /home/blake/Backup/grief.git/obj.gcc/release/libvfs/vfs_node.o] Error 1
make[2]: Leaving directory '/home/blake/Backup/grief.git/libvfs'
make[1]: *** [Makefile:532: lib.gcc/release/libvfs] Error 2
make[1]: Leaving directory '/home/blake/Backup/grief.git'
make: *** [Makefile:197: release] Error 2
#
I fixed the problem but had several other issues. You should probably test on a Linux box. 😄
configure require bison or byacc/yacc, not both
Macro Tutorial Page has several references to "crunch", but the compiler name is "grunch.exe".
deprecated-declarations archive_read_open_file/‘archive_read_finish
AC_TRY_LINK and AC_LANG_C, AC_HEADER_STDC, AC_HEADER_TIME, AC_FUNC_WAIT3, usage
issetugid tweaks, yet should consider options: https://gist.github.com/nicowilliams/4daf74a3a0c86848d3cbd9d0cdb5e26e
I used to have Brief, and wrote lots of macros for it and loved it...
Now I'm trying to build Grief for Linux. Maybe I'm just missing something simple...
Here is what I did:
./configure_new
no errors
make
loading: ./makelib.in
make -C libmisc
make[1]: Entering directory '/home/bobc/source/grief/libmisc'
gcc -g -O2 --param max-inline-insns-single=1200 -pthread -g -Og -I/home/bobc/source/grief/include -DHAVE_CONFIG_H -o /home/bobc/source/grief/objects.gcc/debug/libmisc/edthreads_win32.o -c edthreads_win32.c
In file included from edthreads_win32.c:42:
/home/bobc/source/grief/include/edthreads.h:126:15: error: expected ';' before 'extern'
__CBEGIN_DECLS
^
;
/home/bobc/source/grief/include/edthreads.h:128:1:
extern struct timespec timespec_diff(const struct timespec end, const struct timespec start);
/home/bobc/source/grief/include/edthreads.h:131:13: error: expected ';' before 'extern'
__CEND_DECLS
^
;
make[1]: *** [Makefile:216: /home/bobc/source/grief/objects.gcc/debug/libmisc/edthreads_win32.o] Error 1
make[1]: Leaving directory '/home/bobc/source/grief/libmisc'
make: *** [Makefile:375: /home/bobc/source/grief/lib.gcc/debug/libmisc] Error 2
It seemed to build okay but when I did make release install
I get:
[...]
mkdir -p /usr/local/bin
mkdir -p /usr/local/share/gr
for d in help macros macros/demos macros/kbd macros/tty src src/demos src/kbd src/tty; do \
mkdir -p /usr/local/share/gr/${d}; \
done
/usr/bin/install -c -m 0755 /home/blake/Backup/grief.git/bin.gcc/release/gr.exe /usr/local/bin
/usr/bin/install: cannot stat '/home/blake/Backup/grief.git/bin.gcc/release/gr.exe': No such file or directory
make[1]: *** [Makefile:519: install] Error 1
make[1]: Leaving directory '/home/blake/Backup/grief.git'
make: *** [Makefile:152: release] Error 2
Which makes sense because on Linux, I wouldn't have a .exe file.
$ ls -l bin.gcc/release/
total 7004
-rwxr-xr-x. 1 blake blake 49400 Nov 21 16:57 bstdio
-rw-r--r--. 1 blake blake 51277 Nov 21 16:57 bstdio.map
drwxr-xr-x. 1 blake blake 16 Nov 21 16:57 ctbl
-rwxr-xr-x. 1 blake blake 6499 Nov 21 16:57 duk
-rw-r--r--. 1 blake blake 27903 Nov 21 16:57 duk.map
-rwxr-xr-x. 1 blake blake 166328 Nov 21 16:57 gm
-rw-r--r--. 1 blake blake 65705 Nov 21 16:57 gm.map
-rwxr-xr-x. 1 blake blake 1977200 Nov 21 16:57 gr
-rwxr-xr-x. 1 blake blake 107592 Nov 21 16:57 grcpp
-rw-r--r--. 1 blake blake 42289 Nov 21 16:57 grcpp.map
-rwxr-xr-x. 1 blake blake 224728 Nov 21 16:57 grdemandoc
-rw-r--r--. 1 blake blake 89931 Nov 21 16:57 grdemandoc.map
-rwxr-xr-x. 1 blake blake 995216 Nov 21 16:57 grman.cgi
-rwxr-xr-x. 1 blake blake 1143296 Nov 21 16:57 grmandoc
-rw-r--r--. 1 blake blake 174481 Nov 21 16:57 grmandoc.map
-rw-r--r--. 1 blake blake 140650 Nov 21 16:57 grman.map
-rw-r--r--. 1 blake blake 616722 Nov 21 16:57 gr.map
-rwxr-xr-x. 1 blake blake 717960 Nov 21 16:57 grsoelim
-rw-r--r--. 1 blake blake 52463 Nov 21 16:57 grsoelim.map
-rwxr-xr-x. 1 blake blake 285280 Nov 21 16:57 grunch
-rw-r--r--. 1 blake blake 112193 Nov 21 16:57 grunch.map
-rwxr-xr-x. 1 blake blake 40424 Nov 21 16:55 trie_test
-rw-r--r--. 1 blake blake 43974 Nov 21 16:55 trie_test.map
On a win32 system without a K: drive, add the following to $env:AppData/.grief/_grinit
.
restore: save=full cache=k:/devl/.restore savehist=yes scrapper=yes
backup: dir=k:/devl/.backup version=9
now edit and save an existing file then reopen it in grief. The first two lines (maybe more) will be corrupted.
When a directory contains one or more opening square brackets, implied wild card expansion is being attempted, resulting in an expansion failure and an inability to open.
Note:
Generally ~, *, ?, and [...] all have special meaning and I would avoid brackets within paths, escaping these within a win environment is problematic as '' is a valid directory separator.
Just ran a git clone on a PopOS (Ubuntu derivative) and ran:
./configure_new
make release
sudo make release install
and is failing with:
/usr/bin/install -c -m 0755 /home/user/grief/bin.gcc/release/gr.exe /usr/local/bin /usr/bin/install: cannot stat '/home/user/grief/bin.gcc/release/gr.exe': No such file or directory
I did have to add a few more packages than just build-essential but didn't have any other issues.
$ sudo make release install
[...]
for d in help macros macros/demos macros/kbd macros/tty src src/demos src/kbd src/tty; do \
mkdir -p /usr/local/share/gr/${d}; \
done
/usr/bin/install -c -m 0755 /home/blake/Backup/grief.git/bin.gcc/release/gr.exe /usr/local/bin
/usr/bin/install: cannot stat '/home/blake/Backup/grief.git/bin.gcc/release/gr.exe': No such file or directory
make[1]: *** [Makefile:519: install] Error 1
make[1]: Leaving directory '/home/blake/Backup/grief.git'
make: *** [Makefile:152: release] Error 2
$
Notice the .exe file extension.
No terminals without function keys (or only partial as they are consumed by the emulator)
allow ESC-x as an alternative; aka Midnight Commander.
Support busybox as as only coreutils requirement
Might have missed it, but it would be good to mention that (on Windows), $env:AppData/.grief/_grinit
is the config file, and a sample is provided in /win32/_grinit.example
Macros source is missing from the binary installer.
a) edit + save, then undo; buffer is not marked a dirty, hence wont be auto-saved.
b) undo can be performed prior to last save point; should optionally prompt
Merge latest Free-BSD citrus/iconv framework
build-27 fixed the problem I was having building on my Fedora Linux box. Thank you.
However, I noticed the following problem. If I do the following:
$ gr
abcde
alt-X
I get a blank message at the bottom of the screen. I assume it's asking me something has changed; do I really want to quit? But instead it just displays about 60 spaces. I presume it's a text color or font issue.
Thanks!
Reference: https://sourceforge.net/p/grief/tickets/34/
When editing a batch (.bat) file.
EXIST is a keyword, but is NOT highlighted
EXISTS is not a keyword, but IS highlighted.
Update to reflect current make/installation interface.
Not really sure if this is actually a problem with the majority of the terminal programs...
Have tried several different terminals and when a dark theme is used you cannot read the command field. The main issue is that many terminals do not honor the system color theme (at least in Gnome).
Gnome Terminal has to have theme set to light in Preferences (or leave it default if the system theme is light).
Rxvt defaults to a light theme so no issues out of the box.
Terminator defaults to dark, can't read.
Terminology defaults to dark, can't read.
Alacritty defaults to dark, can't read.
Kitty defaults to dark, can't read.
Funnily enough Cool Retro Term gets it right even tho it defaults to dark... and with the amber default it looks pretty much like Brief did back in the day on my Ericsson PC...
And another thing I noticed while trying out the terminals is that in many of them Grief tended to put the horizontal scroll bar one third of the screen up and with some odd line lengths, this corrected itself when resizing the window.
Reference: https://sourceforge.net/p/grief/tickets/36/
1 | Use Alt+a and mark a fragment of text in a line.
| keypad +
| move the cursor to elsewhere in the buffer.
| keypad ins
? the last marked and copied character is erroneously missing.
? a blank line is erroneously inserted.
2 | With the cursor at the beginning of a line.
| use Alt+a and down arrow to mark one or more lines of text.
| keypad -
? the first character of a following, UNMARKED line, is erroneously deleted.
| move the cursor to elsewhere in the buffer.
| keypad +
? an extra blank line is erroneously inserted.
ALT+A = MK_NONINC, which shall include any trailing new-line from the previous if the cursor is positioned at col=1, whereas ALT+L = MK_LINE, behavior is line aware.
Changing MK_NONINC semantics is not practical; new mode would be needed or replacement macro required which behaves like MK_NONINC2 (aka back2 if col=1)
If F6 is used, the "O" choice for "One", changes all matching texts to the end of the file, like the "G" option does.
Certain file extensions, e.g. .c, invoke color highlighting of various C language objects. I tried to extend that to other file extensions I use, e.g. .sub, by adding them to BPACKAGES:
set BPACKAGES=.c.cc.CC.cpp.dec.def.h.H.hpp.pro.sub.tag-c:hilite,t;.default:hilite,template,regular;
which I set in the environment before calling Grief ver3.2.2. Sadly that had no effect. Is there something else required or is there a bug?
binutils 2.34 changed the name of a function and guarded it with a macro.
The corresponding macros of binutils changed slightly.
You have to drop the _get from the section macros and remove the fobj.handle.get() parameter manually: bfd_get_section_flags(fobj.handle.get(), section) to bfd_section_flags(section).
libunwind support?
EXIST is a keyword, but is NOT highlighted
EXISTS is not a keyword, but IS highlighted.
upgrade; gcc memory usage warnings
configure rework
I wrote a scoop manifest to download and install grief.
So far the build numbers are:
3.2.3-Build26 : grwin32-build25-setup.exe
3.2.3 - build-25 : (no setup)
3.2.2 - build-24 : grwin32-build24-setup.exe
3.2.2 - build-23 : grwin32-build23-setup.exe
would be nice to follow a consistent semantic versioning pattern and setup filenaming, see e.g. https://github.com/jjazzboss/JJazzLab/tags`
4.0.2 : JJazzLab-4.0.2-win-x64-setup.exe
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.