summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BUGS2
-rw-r--r--Makefile.am58
-rw-r--r--Makefile.in63
-rw-r--r--NEWS31
-rw-r--r--NEWS.in55
-rw-r--r--README4
-rw-r--r--README.md2
-rw-r--r--VERSION2
-rw-r--r--config.h.in5
-rwxr-xr-xconfigure377
-rw-r--r--configure.ac121
-rw-r--r--debian/changelog11
-rw-r--r--debian/patches/disable-readline-tests.patch18
-rw-r--r--debian/patches/fim-exe-version-sh.patch16
-rw-r--r--debian/patches/gtk-32bit-string-size-type.patch35
-rw-r--r--debian/patches/hardening-flags.patch49
-rw-r--r--debian/patches/series3
-rw-r--r--distros/Makefile.in1
-rw-r--r--doc/FIM.TXT18
-rw-r--r--doc/FIM.html20
-rw-r--r--doc/Makefile.am24
-rw-r--r--doc/Makefile.in18
-rw-r--r--doc/fim.man7
-rw-r--r--doc/fim.man.html18
-rw-r--r--doc/fim.man.in7
-rw-r--r--doc/fimgs.man.html2
-rw-r--r--doc/fimrc.man42
-rw-r--r--doc/fimrc.man.html100
-rw-r--r--doc/fimrc.man.in42
-rw-r--r--media/Makefile.in1
-rw-r--r--media/multipage/Makefile.in1
-rw-r--r--scripts/Makefile.in1
-rwxr-xr-xscripts/tests/font.sh2
-rwxr-xr-xscripts/tests/version.sh2
-rw-r--r--src/Browser.cpp19
-rw-r--r--src/Browser.h3
-rw-r--r--src/CommandConsole-help.cpp3
-rw-r--r--src/CommandConsole-init.cpp12
-rw-r--r--src/CommandConsole.cpp36
-rw-r--r--src/DisplayDevice.h4
-rw-r--r--src/FbiStuffDjvu.cpp16
-rw-r--r--src/FbiStuffQoi.cpp9
-rw-r--r--src/GTKDevice.cpp9
-rw-r--r--src/Image.h14
-rw-r--r--src/Makefile.am11
-rw-r--r--src/Makefile.in17
-rw-r--r--src/SDLDevice.cpp13
-rw-r--r--src/defaultConfiguration.cpp6
-rw-r--r--src/fim.cpp35
-rw-r--r--src/fim.h21
-rw-r--r--src/fimrc15
-rw-r--r--src/help.cpp4
-rw-r--r--src/readline.cpp32
-rw-r--r--src/testdir/test20.in21
-rw-r--r--src/testdir/test20.ok37
-rw-r--r--src/version.h6
56 files changed, 1011 insertions, 490 deletions
diff --git a/BUGS b/BUGS
index f66cff5..6e95b86 100644
--- a/BUGS
+++ b/BUGS
@@ -1,4 +1,4 @@
-$LastChangedDate: 2024-04-02 21:01:17 +0200 (Tue, 02 Apr 2024) $
+$LastChangedDate: 2024-05-11 14:46:02 +0200 (Sat, 11 May 2024) $
==== BUG REPORTING
diff --git a/Makefile.am b/Makefile.am
index 1f19224..7918792 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-# $Id: Makefile.am 2177 2024-04-09 19:08:29Z dezperado $
+# $Id: Makefile.am 2255 2024-05-16 07:58:17Z dezperado $
# no-dependencies was due to problems with conditional sources
# nostdinc disables the standard -I. include which breaks a correct string.h include
@@ -73,6 +73,7 @@ TESTS_TMPFILE=file.tmp
# mhmhmhm
# CLEANFILES = autom4te.cache
+CLEANFILES = media/icon_smile.bmp src/testdir/test.log src/testdir/*.out
srcdir = src
@@ -203,6 +204,7 @@ endif
# called from aatests and cacatests
.PHONY: autodevtests
+autodevtests: all
test "`SSH_TTY=1 $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -c 'stderr _device_string' -kq 2>&1 > /dev/null`" = $(FIM_USE_ASCII_ART_DEFAULT) # may want to test for TERMUX_VERSION, too
test "`(unset SSH_TTY; $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -t --no-framebuffer -c 'stderr _device_string' -kq ) 2>&1 > /dev/null`" = $(FIM_USE_ASCII_ART_DEFAULT) #
test "`( SSH_TTY= $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -t --no-framebuffer -c 'stderr _device_string' -kq ) 2>&1 > /dev/null`" = $(FIM_USE_ASCII_ART_DEFAULT) #
@@ -270,7 +272,7 @@ sdltests: all
$(NO_ASAN) $(TIMEOUT_LARGE) \
$(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl=hhMR20:10% -K ' ' -c 'while(0){1;}quit;' ; # cover: draw help grid, unlock, input poll, misc
$(NO_ASAN) $(TIMEOUT_LARGE) \
- $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl=0:-1 ; test $$? = 252
+ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl=0:-1 ; test $$? = 252 # don't be scared of error messages -- we're testing error handling here
if FIM_HAVE_ANY_CONSOLEFONT
$(NO_ASAN) FBFONT='' \
$(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl -c quit # TODO: this is only a coverage test
@@ -288,7 +290,7 @@ imlib2tests: all
$(NO_ASAN) $(TIMEOUT_LARGE) \
$(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o imlib2=20:10% -K ' ' -c 'while(0){1;}quit;' ; # cover: draw help grid, unlock, input poll, misc
# $(NO_ASAN) $(TIMEOUT_LARGE) \
-# $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o imlib2=0:-1 ; test $$? = 252
+# $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o imlib2=0:-1 ; test $$? = 252 # don't be scared of error messages -- we're testing error handling here
if FIM_HAVE_ANY_CONSOLEFONT
$(NO_ASAN) FBFONT='' \
$(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o imlib2 -c quit # TODO: this is only a coverage test
@@ -337,6 +339,8 @@ if WITH_SHELLCHECK
$(SHELLCHECK) -e SC2235,SC1117,SC2230,SC2086,SC2006,SC2001 $(top_srcdir)/src/fimgs
endif
! grep '^#' NEWS
+ grep GNU.Linux var/index.html.in # wording check
+ ( ! test -r $(INPUTRC) ) || test `wc -c < $(INPUTRC)` = 0 # must either not exist or deliver zero bytes
! grep -n '^[^ ].\{107,\}' doc/FIM.TXT
! grep -n '^[^ ].\{83,\}' README
! grep -n '^[^ ].\{175,\}' README.md test `grep '[^=]==[^=]' $(top_srcdir)/configure.ac | grep -v ^dnl | wc -l` = 0 # look out for bashisms
@@ -350,6 +354,7 @@ endif
! grep '\<'$(USER)'\>' doc/*man* # against namespace leaks
! grep '\.o\>' $(top_srcdir)/src/Makefile.am
! grep '\<OBJECT\>' $(top_srcdir)/src/Makefile.am
+ for p in `grep '^\.PHONY:.*' Makefile.am | sed 's/.PHONY..//g'`; do grep "^$$p:" Makefile.am -q || exit 1 ; done # ensure each .PHONY target exists
if WITH_PERL
test -s doc/FIM.html
if WITH_MAN2HTML
@@ -371,8 +376,8 @@ if HAVE_VALGRIND
endif
endif
-.PHONY: multipagetests
-multipagetests: all
+.PHONY: multipagetests_ps
+multipagetests_ps: all
if ENABLE_PS
$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/multipage/sample.ps -c 'list "sort";a=page; goto;b=page; goto "2p";c=page; goto "1p";d=page; goto _lastpageindex;e=page; stdout a.".".b.".".c.".".d.".".e;quit' | grep 0.0.1.0.0;
$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/multipage/sample.ps -c 'list "sort";a=page; goto;b=page; goto "+1p+1p";c=page; goto "+1p+1p";d=page; goto "+1p+1p";e=page; stdout a.".".b.".".c.".".d.".".e;quit' | grep 0.0.1.2.0;
@@ -380,6 +385,23 @@ if ENABLE_PS
$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/multipage/sample.ps -c 'list "sort";a=page; goto;b=page; goto "+1f+1f";c=page; goto "+1f+1f";d=page; goto "+1f+1f";e=page; stdout a.".".b.".".c.".".d.".".e;quit' | grep 0.0.0.0.0;
endif
+..PHONY: multipagetests_pdf
+multipagetests_pdf: all
+if ENABLE_POPPLER
+if ENABLE_PDF
+if ENABLE_PCX
+ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/multipage/sample.pdf -c 'goto "+1p" "+1f"; stdout _fileindex.".".page;quit' | grep -F 1.1 # page jump has precedence over file jump (good)
+endif
+endif
+endif
+
+.PHONY: multipagetests
+multipagetests: all
+ if test -f $(top_srcdir)/media/multipage/sample.ps ; then \
+ make multipagetests_ps; fi
+ if test -f $(top_srcdir)/media/multipage/sample.pdf ; then \
+ make multipagetests_pdf; fi
+
# this is the official way of testing fim
.PHONY: tests
tests: all
@@ -455,6 +477,7 @@ endif
$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c 'list "sort_fsize"; goto 0; reload; stdout i:_filename; quit' | grep 1.pcx
endif
if ENABLE_PCX
+ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ -c 'quit (i:_filename=~ "//")'
$(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort"; list;l1=_last_cmd_output;list "random_shuffle";list;l2=_last_cmd_output;if(l1==l2)quit 255; quit'
$(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort"; next;f=i:_filename;list "swap"; reload;if(f==i:_filename)quit 255; quit'
$(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx $(top_srcdir)/media/numbers_pcx/*.pcx --sort -c 'list "pop"; if(_filelistlen!= 9) quit 255;quit'
@@ -512,15 +535,15 @@ endif
if ENABLE_BMP
if which convert; then \
convert $(top_srcdir)/media/icon_smile.gif -monochrome $(top_srcdir)/media/icon_smile.bmp && \
- test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/icon_smile.bmp && \
+ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/media/icon_smile.bmp && \
if which ppmtobmp ; then \
convert $(top_srcdir)/media/icon_smile.gif ppm:- | ppmtobmp -bpp 8 > $(top_srcdir)/media/icon_smile.bmp && \
- test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/icon_smile.bmp && \
+ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/media/icon_smile.bmp && \
convert $(top_srcdir)/media/icon_smile.gif ppm:- | ppmtobmp -bpp 4 > $(top_srcdir)/media/icon_smile.bmp && \
- test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/icon_smile.bmp ; \
+ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/media/icon_smile.bmp ; \
fi && \
convert $(top_srcdir)/media/icon_smile.gif -depth 8 -alpha Disassociate $(top_srcdir)/media/icon_smile.bmp && \
- test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/icon_smile.bmp; \
+ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/media/icon_smile.bmp; \
fi
endif
if which convert; then \
@@ -600,10 +623,10 @@ if ENABLE_PCX
test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c '3;list "mark";6;list "mark"; 1,2 stdout "marked {}";q' | grep 'marked.*[01].pcx' | wc -l` = 2
test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c '3;list "mark";6;list "mark"; toggleLimitMarked;1,2 stdout "marked {}";q' | grep 'marked.*[25].pcx' | wc -l` = 2
cd $(top_srcdir)/media/numbers_pcx/; $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-file ../special/images.list -c 'if(_filelistlen!=2)quit 255; quit'
+ $(TIMEOUT_SMALL) $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-file ../special/collated-NON-EXISTING.list ; test $$? = 248
if WANT_READ_STDIN_IMAGE
cd $(top_srcdir)/media/numbers_pcx/; $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-stdin-elds '!' --read-from-file ../special/images.list -c 'if(_filelistlen!=0)quit 255; quit'
cd $(top_srcdir)/media/numbers_pcx/; $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-stdin-elds '!' --read-from-file ../special/collated.list -c 'if(_filelistlen!=2)quit 255; quit'
- $(TIMEOUT_SMALL) $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-file ../special/collated-NON-EXISTING.list ; test $$? = 248
cat $(top_srcdir)/media/numbers_pcx/1.pcx | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --image-from-stdin -c 'quit !(i:width>0 && i:height>0)'
echo | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --image-from-stdin -kq
echo | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-stdin ; test $$? = 248
@@ -643,7 +666,7 @@ endif
$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ -c 'desc "load" "$(top_srcdir)/media/special/images.desc" "\t"; desc "reload" "$(top_srcdir)/media/special/images.desc" "\t"; desc "-append" "save" "tmp.desc" "X"; quit;' && test `grep X tmp.desc | wc -w` = 20 && rm tmp.desc # need proper 'load' with separator test
if WANT_RECURSIVE_DIRS
if $(CXX11TEST); then $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-shadow-directory $(top_srcdir)/media/../ -c 'scale "shadow"; if (_last_cmd_output =~ "image substituted")quit 0; else quit 255;'; fi
- if $(CXX11TEST); then $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-shadow-directory $(top_srcdir)/var/ -c 'scale "shadow"; if (_last_cmd_output =~ "image substituted")quit 0; else quit 255;'; test $$? = 255; fi
+ if $(CXX11TEST); then $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-shadow-directory $(top_srcdir)/var/ -c 'scale "shadow"; if (_last_cmd_output =~ "image substituted")quit 0; else quit 255;'; test $$? = 255; fi # don't be scared of error messages -- we're testing error handling here
endif
$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* -k n -k q -K n -K n -K q -F 'stdout _fileindex;if(_fileindex!=2){quit 255}quit' # -k executes intermingled with -K
$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* -k n -k n -k q -K n -K q -F 'stdout _fileindex;if(_fileindex!=3){quit 255}quit' # -k executes intermingled with -K
@@ -755,8 +778,9 @@ endif
if ENABLE_HISTORY_TEST_DISABLED_FOR_DEBIAN
$(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb --no-history --no-history-load --no-history-save -kq # FIXME: bogus test
rm -f .fim_history && HOME=`pwd` $(FIM_EXE) -N --no-etc-fimrc-file $(top_srcdir)/media/ -o dumb -C 'next;next' -c quit && grep -q '^next;next' .fim_history && rm .fim_history # note: history file may contain spaces newlines etc
-else
- rm -f .fim_history && HOME=`pwd` $(FIM_EXE) -N --no-etc-fimrc-file $(top_srcdir)/media/ -o dumb -C 'next;' -c quit && test -n .fim_history
+endif
+if ENABLE_NO_HISTORY_TESTS
+ rm -f .fim_history && HOME=`pwd` $(FIM_EXE) -N --no-etc-fimrc-file $(top_srcdir)/media/ -o dumb -C 'next;' -c quit && ! test -s .fim_history
endif
if ENABLE_PNG
$(FIM_EXE) $(FIMNORCOPTS) -V | grep upported.file.formats | grep png
@@ -792,10 +816,12 @@ if ENABLE_JPEG
cp $(top_srcdir)/media/image.jpg $(abs_srcdir)/media/upc_abs.JPG && $(FIM_EXE) $(FIMNORCOPTS) -o dumb --no-stat-push $(abs_srcdir)/media/upc_abs.JPG -c 'quit !(i:width>0 && i:height>0)' && rm -f $(abs_srcdir)/media/upc_abs.JPG # not really jpg-specific, exploits regexps & co
endif
if ENABLE_POPPLER
+if ENABLE_PDF
if which epstopdf && which epstopdf; then \
epstopdf $(top_srcdir)/media/special/postscript.eps && \
$(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/media/special/postscript.pdf -c 'quit !(i:width>0 && i:height>0)' ; fi # libpoppler
endif
+endif
if ENABLE_PS
$(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/media/special/postscript.eps -c 'quit !(i:width>0 && i:height>0)'
$(FIM_EXE) $(FIMNORCOPTS) -o dumb -X -C '_downscale_huge_at_load=-1;_preferred_rendering_dpi=100' $(top_srcdir)/media/special/postscript.eps -c 'quit !(i:width>0 && i:height>0)'
@@ -943,6 +969,8 @@ if ENABLE_PNG
$(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "-0.5"; w2=i:swidth; quit !(w1 > w2)'
$(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "-10%"; w2=i:swidth; quit !(w1 > w2)'
endif
+ test ! -f nonexistent.desc && ! $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file nonexistent.desc # ensure error on missing description file
+ test ! -f nonexistent.desc && ! $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --mark-from-image-descriptions-file nonexistent.desc # ensure error on missing description file
if ENABLE_MOUSE
if $(FIM_EXE) --help crop | grep -q is.a.command; then make croptests; fi
endif
@@ -964,7 +992,7 @@ endif
if ENABLE_GTK
@if test -n "$(DISPLAY)"; then make gtktests; fi
endif
- @if test -n "$(DISPLAY)" && $(FIM_EXE) -V | grep ' \(gtk\|sdl\)' ; then make anyxtests; fi # space is there to avoid confusion with e.g. --disable-sdl
+ @if test -n "$(DISPLAY)" -a -z "$(SSH_TTY)" && $(FIM_EXE) -V | grep ' \(gtk\|sdl\)' ; then make anyxtests; fi # space is there to avoid confusion with e.g. --disable-sdl
if HAVE_FIMGS
make fimgstests
endif
@@ -994,7 +1022,7 @@ endif
.PHONY: fimgstests
fimgstests:
- $(FIMGS_EXE) --help -- $(FIMNORCOPTS) >/dev/null 2>&1 ; echo $$? = 255 # no fimgs --help option yet
+ $(FIMGS_EXE) --help -- $(FIMNORCOPTS) >/dev/null 2>&1 ; echo $$? = 255 # no fimgs --help option yet (so we make sure it ends with error)
test `$(FIMGS_EXE) -h -- $(FIMNORCOPTS) | wc -l` -gt 14
test `$(FIMGS_EXE) -m -- $(FIMNORCOPTS) | wc -w` -gt 53
if HAVE_FIMGS
diff --git a/Makefile.in b/Makefile.in
index a73512b..0c20059 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -14,7 +14,7 @@
@SET_MAKE@
-# $Id: Makefile.am 2171 2024-04-07 22:08:57Z dezperado $
+# $Id: Makefile.am 2255 2024-05-16 07:58:17Z dezperado $
VPATH = @srcdir@
am__is_gnu_make = { \
@@ -289,6 +289,7 @@ HAVE_CPP = @HAVE_CPP@
HAVE_ECHO = @HAVE_ECHO@
HAVE_FLEX = @HAVE_FLEX@
HAVE_GREP = @HAVE_GREP@
+HAVE_GROFF = @HAVE_GROFF@
HAVE_MAN = @HAVE_MAN@
HAVE_RM = @HAVE_RM@
HAVE_SED = @HAVE_SED@
@@ -406,9 +407,6 @@ psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
-
-# mhmhmhm
-# CLEANFILES = autom4te.cache
srcdir = src
sysconfdir = @sysconfdir@
target_alias = @target_alias@
@@ -487,6 +485,10 @@ FIM_EXE = ./src/fim$(EXEEXT)
FIMGS_EXE = PATH=./src/:$(PATH) $(abs_srcdir)/src/fimgs
TESTS_TMPFILE = file.tmp
+# mhmhmhm
+# CLEANFILES = autom4te.cache
+CLEANFILES = media/icon_smile.bmp src/testdir/test.log src/testdir/*.out
+
#%.sig: %
# gpg -sbv -u 0xE0E669C8EF1258B8 $@ $<
# gpg -sbav -u 0xE0E669C8EF1258B8 $@ $<
@@ -909,6 +911,7 @@ install-strip:
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -1098,6 +1101,7 @@ cacatests: all
# called from aatests and cacatests
.PHONY: autodevtests
+autodevtests: all
test "`SSH_TTY=1 $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -c 'stderr _device_string' -kq 2>&1 > /dev/null`" = $(FIM_USE_ASCII_ART_DEFAULT) # may want to test for TERMUX_VERSION, too
test "`(unset SSH_TTY; $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -t --no-framebuffer -c 'stderr _device_string' -kq ) 2>&1 > /dev/null`" = $(FIM_USE_ASCII_ART_DEFAULT) #
test "`( SSH_TTY= $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -t --no-framebuffer -c 'stderr _device_string' -kq ) 2>&1 > /dev/null`" = $(FIM_USE_ASCII_ART_DEFAULT) #
@@ -1163,7 +1167,7 @@ sdltests: all
$(NO_ASAN) $(TIMEOUT_LARGE) \
$(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl=hhMR20:10% -K ' ' -c 'while(0){1;}quit;' ; # cover: draw help grid, unlock, input poll, misc
$(NO_ASAN) $(TIMEOUT_LARGE) \
- $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl=0:-1 ; test $$? = 252
+ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl=0:-1 ; test $$? = 252 # don't be scared of error messages -- we're testing error handling here
@FIM_HAVE_ANY_CONSOLEFONT_TRUE@ $(NO_ASAN) FBFONT='' \
@FIM_HAVE_ANY_CONSOLEFONT_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o sdl -c quit # TODO: this is only a coverage test
@FIM_WANT_HARDCODED_CONSOLEFONT_TRUE@ $(NO_ASAN) FBFONT=fim:// \
@@ -1177,7 +1181,7 @@ imlib2tests: all
$(NO_ASAN) $(TIMEOUT_LARGE) \
$(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o imlib2=20:10% -K ' ' -c 'while(0){1;}quit;' ; # cover: draw help grid, unlock, input poll, misc
# $(NO_ASAN) $(TIMEOUT_LARGE) \
-# $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o imlib2=0:-1 ; test $$? = 252
+# $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o imlib2=0:-1 ; test $$? = 252 # don't be scared of error messages -- we're testing error handling here
@FIM_HAVE_ANY_CONSOLEFONT_TRUE@ $(NO_ASAN) FBFONT='' \
@FIM_HAVE_ANY_CONSOLEFONT_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o imlib2 -c quit # TODO: this is only a coverage test
@FIM_WANT_HARDCODED_CONSOLEFONT_TRUE@ $(NO_ASAN) FBFONT=fim:// \
@@ -1215,6 +1219,8 @@ dist-tests-clean:
devtests: all
@WITH_SHELLCHECK_TRUE@ $(SHELLCHECK) -e SC2235,SC1117,SC2230,SC2086,SC2006,SC2001 $(top_srcdir)/src/fimgs
! grep '^#' NEWS
+ grep GNU.Linux var/index.html.in # wording check
+ ( ! test -r $(INPUTRC) ) || test `wc -c < $(INPUTRC)` = 0 # must either not exist or deliver zero bytes
! grep -n '^[^ ].\{107,\}' doc/FIM.TXT
! grep -n '^[^ ].\{83,\}' README
! grep -n '^[^ ].\{175,\}' README.md test `grep '[^=]==[^=]' $(top_srcdir)/configure.ac | grep -v ^dnl | wc -l` = 0 # look out for bashisms
@@ -1228,6 +1234,7 @@ devtests: all
! grep '\<'$(USER)'\>' doc/*man* # against namespace leaks
! grep '\.o\>' $(top_srcdir)/src/Makefile.am
! grep '\<OBJECT\>' $(top_srcdir)/src/Makefile.am
+ for p in `grep '^\.PHONY:.*' Makefile.am | sed 's/.PHONY..//g'`; do grep "^$$p:" Makefile.am -q || exit 1 ; done # ensure each .PHONY target exists
@WITH_PERL_TRUE@ test -s doc/FIM.html
@WITH_MAN2HTML_TRUE@@WITH_PERL_TRUE@ test -s doc/fimgs.man.html -a -s doc/fim.man.html -a -s doc/fimrc.man.html
@ENABLE_GIF_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIMGS_EXE) ssh:$$(hostname):$(abs_top_srcdir)/media/numbers/0.gif -- $(FIMNORCOPTS) -o dumb -K q
@@ -1239,13 +1246,24 @@ devtests: all
@HAVE_RUNNABLE_TESTS_TRUE@@HAVE_VALGRIND_TRUE@ make ltests; \
@HAVE_RUNNABLE_TESTS_TRUE@@HAVE_VALGRIND_TRUE@ fi
-.PHONY: multipagetests
-multipagetests: all
+.PHONY: multipagetests_ps
+multipagetests_ps: all
@ENABLE_PS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/multipage/sample.ps -c 'list "sort";a=page; goto;b=page; goto "2p";c=page; goto "1p";d=page; goto _lastpageindex;e=page; stdout a.".".b.".".c.".".d.".".e;quit' | grep 0.0.1.0.0;
@ENABLE_PS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/multipage/sample.ps -c 'list "sort";a=page; goto;b=page; goto "+1p+1p";c=page; goto "+1p+1p";d=page; goto "+1p+1p";e=page; stdout a.".".b.".".c.".".d.".".e;quit' | grep 0.0.1.2.0;
@ENABLE_PS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/multipage/sample.ps -c 'list "sort";a=page; goto;b=page; goto "+1";c=page; goto "+1+1";d=page; goto "+1+1";e=page; stdout a.".".b.".".c.".".d.".".e;quit' | grep 0.0.1.2.0;
@ENABLE_PS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/multipage/sample.ps -c 'list "sort";a=page; goto;b=page; goto "+1f+1f";c=page; goto "+1f+1f";d=page; goto "+1f+1f";e=page; stdout a.".".b.".".c.".".d.".".e;quit' | grep 0.0.0.0.0;
+..PHONY: multipagetests_pdf
+multipagetests_pdf: all
+@ENABLE_PCX_TRUE@@ENABLE_PDF_TRUE@@ENABLE_POPPLER_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/multipage/sample.pdf -c 'goto "+1p" "+1f"; stdout _fileindex.".".page;quit' | grep -F 1.1 # page jump has precedence over file jump (good)
+
+.PHONY: multipagetests
+multipagetests: all
+ if test -f $(top_srcdir)/media/multipage/sample.ps ; then \
+ make multipagetests_ps; fi
+ if test -f $(top_srcdir)/media/multipage/sample.pdf ; then \
+ make multipagetests_pdf; fi
+
# this is the official way of testing fim
.PHONY: tests
tests: all
@@ -1311,6 +1329,7 @@ tests: all
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -C 'bind "n" "goto \"+1f\"";' -Knnnq -F 'quit !(_fileindex==4);'
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -C 'bind "n" "goto \"+1F\"";' -Knnnq -F 'quit !(_fileindex==8);'
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file $(top_srcdir)/media/special/images.desc -c 'list "sort_fsize"; goto 0; reload; stdout i:_filename; quit' | grep 1.pcx
+@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ -c 'quit (i:_filename=~ "//")'
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort"; list;l1=_last_cmd_output;list "random_shuffle";list;l2=_last_cmd_output;if(l1==l2)quit 255; quit'
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c 'list "sort"; next;f=i:_filename;list "swap"; reload;if(f==i:_filename)quit 255; quit'
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_SMALL) $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx $(top_srcdir)/media/numbers_pcx/*.pcx --sort -c 'list "pop"; if(_filelistlen!= 9) quit 255;quit'
@@ -1354,15 +1373,15 @@ tests: all
@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) --NON-existent-OPTIONNN; test $$? = 240 # help function failing
@ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ if which convert; then \
@ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ convert $(top_srcdir)/media/icon_smile.gif -monochrome $(top_srcdir)/media/icon_smile.bmp && \
-@ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/icon_smile.bmp && \
+@ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/media/icon_smile.bmp && \
@ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ if which ppmtobmp ; then \
@ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ convert $(top_srcdir)/media/icon_smile.gif ppm:- | ppmtobmp -bpp 8 > $(top_srcdir)/media/icon_smile.bmp && \
-@ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/icon_smile.bmp && \
+@ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/media/icon_smile.bmp && \
@ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ convert $(top_srcdir)/media/icon_smile.gif ppm:- | ppmtobmp -bpp 4 > $(top_srcdir)/media/icon_smile.bmp && \
-@ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/icon_smile.bmp ; \
+@ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/media/icon_smile.bmp ; \
@ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ fi && \
@ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ convert $(top_srcdir)/media/icon_smile.gif -depth 8 -alpha Disassociate $(top_srcdir)/media/icon_smile.bmp && \
-@ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/icon_smile.bmp; \
+@ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/icon_smile.bmp -c 'stdout _last_file_loader;quit' $(SNTZ)` = bmp && rm -f $(top_srcdir)/media/icon_smile.bmp; \
@ENABLE_BMP_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ fi
@HAVE_RUNNABLE_TESTS_TRUE@ if which convert; then \
@HAVE_RUNNABLE_TESTS_TRUE@ convert $(top_srcdir)/media/icon_smile.gif -depth 8 $(top_srcdir)/media/icon_smile.ppm && \
@@ -1405,9 +1424,9 @@ tests: all
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c '3;list "mark";6;list "mark"; 1,2 stdout "marked {}";q' | grep 'marked.*[01].pcx' | wc -l` = 2
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx -c '3;list "mark";6;list "mark"; toggleLimitMarked;1,2 stdout "marked {}";q' | grep 'marked.*[25].pcx' | wc -l` = 2
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ cd $(top_srcdir)/media/numbers_pcx/; $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-file ../special/images.list -c 'if(_filelistlen!=2)quit 255; quit'
+@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(TIMEOUT_SMALL) $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-file ../special/collated-NON-EXISTING.list ; test $$? = 248
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ cd $(top_srcdir)/media/numbers_pcx/; $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-stdin-elds '!' --read-from-file ../special/images.list -c 'if(_filelistlen!=0)quit 255; quit'
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ cd $(top_srcdir)/media/numbers_pcx/; $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-stdin-elds '!' --read-from-file ../special/collated.list -c 'if(_filelistlen!=2)quit 255; quit'
-@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ $(TIMEOUT_SMALL) $(abs_builddir)/$(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-file ../special/collated-NON-EXISTING.list ; test $$? = 248
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ cat $(top_srcdir)/media/numbers_pcx/1.pcx | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --image-from-stdin -c 'quit !(i:width>0 && i:height>0)'
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ echo | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --image-from-stdin -kq
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READ_STDIN_IMAGE_TRUE@ echo | $(FIM_EXE) $(FIMNORCOPTS) -o dumb --read-from-stdin ; test $$? = 248
@@ -1441,7 +1460,7 @@ tests: all
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ -c 'desc "load" "$(top_srcdir)/media/special/images.desc" "\t"; desc "reload" "$(top_srcdir)/media/special/images.desc" "\t"; desc "-nooverw" "save" "tmp.desc" "X"; quit;' && test `grep X tmp.desc | wc -w` = 10 # need proper 'load' with separator test
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ -c 'desc "load" "$(top_srcdir)/media/special/images.desc" "\t"; desc "reload" "$(top_srcdir)/media/special/images.desc" "\t"; desc "-append" "save" "tmp.desc" "X"; quit;' && test `grep X tmp.desc | wc -w` = 20 && rm tmp.desc # need proper 'load' with separator test
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ if $(CXX11TEST); then $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-shadow-directory $(top_srcdir)/media/../ -c 'scale "shadow"; if (_last_cmd_output =~ "image substituted")quit 0; else quit 255;'; fi
-@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ if $(CXX11TEST); then $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-shadow-directory $(top_srcdir)/var/ -c 'scale "shadow"; if (_last_cmd_output =~ "image substituted")quit 0; else quit 255;'; test $$? = 255; fi
+@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_RECURSIVE_DIRS_TRUE@ if $(CXX11TEST); then $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ --load-shadow-directory $(top_srcdir)/var/ -c 'scale "shadow"; if (_last_cmd_output =~ "image substituted")quit 0; else quit 255;'; test $$? = 255; fi # don't be scared of error messages -- we're testing error handling here
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* -k n -k q -K n -K n -K q -F 'stdout _fileindex;if(_fileindex!=2){quit 255}quit' # -k executes intermingled with -K
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* -k n -k n -k q -K n -K q -F 'stdout _fileindex;if(_fileindex!=3){quit 255}quit' # -k executes intermingled with -K
@ENABLE_PCX_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* -k n -k q -K n -K n -K q -F 'stdout _fileindex;if(_fileindex!=2){quit 255}quit' # -k executes intermingled with -K
@@ -1519,7 +1538,7 @@ tests: all
@HAVE_RUNNABLE_TESTS_TRUE@@WANT_READLINE_TRUE@ rm -f record.fim; $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb -W record.fim -K ':quit 10' -K ''; grep -q quit.10 record.fim && rm record.fim
@ENABLE_HISTORY_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb --no-history --no-history-load --no-history-save -kq # FIXME: bogus test
@ENABLE_HISTORY_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ rm -f .fim_history && HOME=`pwd` $(FIM_EXE) -N --no-etc-fimrc-file $(top_srcdir)/media/ -o dumb -C 'next;next' -c quit && grep -q '^next;next' .fim_history && rm .fim_history # note: history file may contain spaces newlines etc
-@ENABLE_HISTORY_FALSE@@HAVE_RUNNABLE_TESTS_TRUE@ rm -f .fim_history && HOME=`pwd` $(FIM_EXE) -N --no-etc-fimrc-file $(top_srcdir)/media/ -o dumb -C 'next;' -c quit && test -n .fim_history
+@ENABLE_NO_HISTORY_TESTS_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ rm -f .fim_history && HOME=`pwd` $(FIM_EXE) -N --no-etc-fimrc-file $(top_srcdir)/media/ -o dumb -C 'next;' -c quit && ! test -s .fim_history
@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -V | grep upported.file.formats | grep png
@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/media/image.png -c 'next' -c quit # leak fixed
@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WITH_INKSCAPE_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/sample.svg -c 'quit !(i:width>0 && i:height>0)' #
@@ -1545,9 +1564,9 @@ tests: all
@ENABLE_JPEG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ rm -f $(top_srcdir)/media/icon_smile.jpg ; \
@ENABLE_JPEG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ fi # only cover test exif
@ENABLE_JPEG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ cp $(top_srcdir)/media/image.jpg $(abs_srcdir)/media/upc_abs.JPG && $(FIM_EXE) $(FIMNORCOPTS) -o dumb --no-stat-push $(abs_srcdir)/media/upc_abs.JPG -c 'quit !(i:width>0 && i:height>0)' && rm -f $(abs_srcdir)/media/upc_abs.JPG # not really jpg-specific, exploits regexps & co
-@ENABLE_POPPLER_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ if which epstopdf && which epstopdf; then \
-@ENABLE_POPPLER_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ epstopdf $(top_srcdir)/media/special/postscript.eps && \
-@ENABLE_POPPLER_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/media/special/postscript.pdf -c 'quit !(i:width>0 && i:height>0)' ; fi # libpoppler
+@ENABLE_PDF_TRUE@@ENABLE_POPPLER_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ if which epstopdf && which epstopdf; then \
+@ENABLE_PDF_TRUE@@ENABLE_POPPLER_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ epstopdf $(top_srcdir)/media/special/postscript.eps && \
+@ENABLE_PDF_TRUE@@ENABLE_POPPLER_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/media/special/postscript.pdf -c 'quit !(i:width>0 && i:height>0)' ; fi # libpoppler
@ENABLE_PS_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X $(top_srcdir)/media/special/postscript.eps -c 'quit !(i:width>0 && i:height>0)'
@ENABLE_PS_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) -o dumb -X -C '_downscale_huge_at_load=-1;_preferred_rendering_dpi=100' $(top_srcdir)/media/special/postscript.eps -c 'quit !(i:width>0 && i:height>0)'
@ENABLE_PS_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -X -C '_downscale_huge_at_load=-1;_preferred_rendering_dpi=100' $(top_srcdir)/media/special/postscript.eps -c 'stdout i:width;quit'` -lt `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -X -C '_downscale_huge_at_load=-1;_preferred_rendering_dpi=200' $(top_srcdir)/media/special/postscript.eps -c 'stdout i:width;quit'`
@@ -1679,6 +1698,8 @@ tests: all
@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "-" ; w2=i:swidth; quit !(w1 > w2)'
@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "-0.5"; w2=i:swidth; quit !(w1 > w2)'
@ENABLE_PNG_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/image.png $(FIMSCLTSTOPTS) -c 'w1=i:swidth;scale "-10%"; w2=i:swidth; quit !(w1 > w2)'
+@HAVE_RUNNABLE_TESTS_TRUE@ test ! -f nonexistent.desc && ! $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --load-image-descriptions-file nonexistent.desc # ensure error on missing description file
+@HAVE_RUNNABLE_TESTS_TRUE@ test ! -f nonexistent.desc && ! $(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/*.pcx --mark-from-image-descriptions-file nonexistent.desc # ensure error on missing description file
@ENABLE_MOUSE_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ if $(FIM_EXE) --help crop | grep -q is.a.command; then make croptests; fi
@ENABLE_AA_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ @make aatests
@ENABLE_CACA_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ @make cacatests
@@ -1686,7 +1707,7 @@ tests: all
@ENABLE_IMLIB2_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ @make imlib2tests
@ENABLE_SDL_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ @if test -n "$(DISPLAY)"; then make sdltests; fi
@ENABLE_GTK_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ @if test -n "$(DISPLAY)"; then make gtktests; fi
-@HAVE_RUNNABLE_TESTS_TRUE@ @if test -n "$(DISPLAY)" && $(FIM_EXE) -V | grep ' \(gtk\|sdl\)' ; then make anyxtests; fi # space is there to avoid confusion with e.g. --disable-sdl
+@HAVE_RUNNABLE_TESTS_TRUE@ @if test -n "$(DISPLAY)" -a -z "$(SSH_TTY)" && $(FIM_EXE) -V | grep ' \(gtk\|sdl\)' ; then make anyxtests; fi # space is there to avoid confusion with e.g. --disable-sdl
@HAVE_FIMGS_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ make fimgstests
@HAVE_RUNNABLE_TESTS_TRUE@ make ltests
@HAVE_RUNNABLE_TESTS_TRUE@ @echo "[*] TESTS: SUCCESS"
@@ -1708,7 +1729,7 @@ ltests:
.PHONY: fimgstests
fimgstests:
- $(FIMGS_EXE) --help -- $(FIMNORCOPTS) >/dev/null 2>&1 ; echo $$? = 255 # no fimgs --help option yet
+ $(FIMGS_EXE) --help -- $(FIMNORCOPTS) >/dev/null 2>&1 ; echo $$? = 255 # no fimgs --help option yet (so we make sure it ends with error)
test `$(FIMGS_EXE) -h -- $(FIMNORCOPTS) | wc -l` -gt 14
test `$(FIMGS_EXE) -m -- $(FIMNORCOPTS) | wc -w` -gt 53
@HAVE_FIMGS_TRUE@ $(FIMGS_EXE) -- $(FIMNORCOPTS) -o dumb ./media/special/postscript.eps -c 'stdout _last_file_loader;quit 1' -K quit; test $$? = 0 # spaces not accepted by fimgs
@@ -1835,7 +1856,7 @@ changelog:
svn2cl -i ..
.PHONY: release
-release:
+release: all-recursive
make signed-dist
# false # reactivate this once fim-0.7.tar.gz is released and trunk offers anything of interest
make dist-tests
diff --git a/NEWS b/NEWS
index a9582c8..7b12c29 100644
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,39 @@
FIM NEWS -- history of main user-visible changes in FIM.
+ Version 0.7.1
+
+A release with small fixes at build, test, and runtime:
+
+ * Documentation and self-documentation improved and updated
+ * Command "help '/str'" will also search on occurrences of 'str' among set variable identifiers and their help
+ * Default binding of 'N' and 'P' changed to be more flexible: either page goto or category or directory goto
+ * Fix: GTK (-o gtk) mode had mouse coordinates slightly wrong (were including the menu bar)
+ * Fix: SDL mode (-o sdl) now allows fim (emergency) exit per windows quit button also in case no key is bound to 'quit'
+ * Fix: now in 'goto "+1p" "+1f"' the page jump takes precedence over the file jump
+ * Fix: had potential memory error after --sort and with absent files
+ * Fix: Before testing PS pr PDF functionality, Makefile will check if respective sample files are there
+ * Fix: --load-image-descriptions-file (-D) was opening files in append mode for no reason
+ * Fix: --mark-from-descriptions-file was opening files in append mode for no reason
+ * Fix: don't omit last Tab multiple autocompletion entry
+ * Fix: alias command to complain if being provided with one argument which is no alias
+ * Fix: more resilience on missing groff
+ * More and better tests
+ * Fix: SDL-1.2 compilation fix
+ * Fix: 32-bit build fix for GTK3
+ * Fix: pass CFLAGS, CPPFLAGS and LDFLAGS to helper programs
+ * Fix: configure was disabling crop tests by mistake
+ * Fix: configure now uses PKG_CONFIG to determine pkg-config
+ * Fix: configure had mistake leading to a few wrong src/Makefile rules
+ * Fix: configure poppler check: improved diagnostics, reflecting closer required headers, extend check to poppler-cpp
+ * Fix: in configure and Makefile when building with emscripten (WebAssembly)
+ * Fix: input of non-ASCII values to -k and -K was not being carried out correctly on systems with char being unsigned (e.g. aarch64)
+ * Misc minor fixes (e.g.: in tests, djvu error verbosity, readline, configure, configuration ...)
+
Version 0.7.0
+A major release:
+
* New graphical windowed output mode via GTK3 (similar to SDL, but with menus), selected with -o gtk
* -o =OPTS / --output-device==OPTS / --output-device =OPTS will pass OPTS to the auto-selected output device
* Key presses passed at startup via the -k and -K options are executed in the order the options appear
diff --git a/NEWS.in b/NEWS.in
index b95e553..2487d3c 100644
--- a/NEWS.in
+++ b/NEWS.in
@@ -1,8 +1,63 @@
FIM NEWS -- history of main user-visible changes in FIM.
+ Version 0.7.1
+
+A release with small fixes at build, test, and runtime:
+
+# (r2187,r2190,r2216,r2232-r2233,r2245-r2250,r2254,r2256)
+ * Documentation and self-documentation improved and updated
+# (r2232)
+ * Command "help '/str'" will also search on occurrences of 'str' among set variable identifiers and their help
+# (r2249)
+ * Default binding of 'N' and 'P' changed to be more flexible: either page goto or category or directory goto
+# (r2220)
+ * Fix: GTK (-o gtk) mode had mouse coordinates slightly wrong (were including the menu bar)
+# (r2241)
+ * Fix: SDL mode (-o sdl) now allows fim (emergency) exit per windows quit button also in case no key is bound to 'quit'
+# (r2248)
+ * Fix: now in 'goto "+1p" "+1f"' the page jump takes precedence over the file jump
+# (r2197)
+ * Fix: had potential memory error after --sort and with absent files
+# (r2255)
+ * Fix: Before testing PS pr PDF functionality, Makefile will check if respective sample files are there
+# (r2225)
+ * Fix: --load-image-descriptions-file (-D) was opening files in append mode for no reason
+# (r2226)
+ * Fix: --mark-from-descriptions-file was opening files in append mode for no reason
+# (r2227)
+ * Fix: don't omit last Tab multiple autocompletion entry
+# (r2228)
+ * Fix: alias command to complain if being provided with one argument which is no alias
+# (r2231)
+ * Fix: more resilience on missing groff
+# (r2178-r2188,r2190,2211-r2212,r2224,r2233,r2247-r2249)
+ * More and better tests
+# (r2187)
+ * Fix: SDL-1.2 compilation fix
+# (r2203)
+ * Fix: 32-bit build fix for GTK3
+# (r2208)
+ * Fix: pass CFLAGS, CPPFLAGS and LDFLAGS to helper programs
+# (r2193)
+ * Fix: configure was disabling crop tests by mistake
+# (r2194)
+ * Fix: configure now uses PKG_CONFIG to determine pkg-config
+# (r2219)
+ * Fix: configure had mistake leading to a few wrong src/Makefile rules
+# (r2243-r2244,r2246)
+ * Fix: configure poppler check: improved diagnostics, reflecting closer required headers, extend check to poppler-cpp
+# (r2252)
+ * Fix: in configure and Makefile when building with emscripten (WebAssembly)
+# (r2253)
+ * Fix: input of non-ASCII values to -k and -K was not being carried out correctly on systems with char being unsigned (e.g. aarch64)
+# (r2178,r2187,r2189-r2191,r2193-r2194,r2198-r2212,r2215,r2219,r2225-r2228,r2242-r2249,r2251,r2253-r2254)
+ * Misc minor fixes (e.g.: in tests, djvu error verbosity, readline, configure, configuration ...)
+
Version 0.7.0
+A major release:
+
# (r2005-r2038,r2041,r2044-r2046,r2049-r2070,r2072,r2080-r2088,r2095,r2099,r2110-r2116,r2118-r2122,r2125,r2138,r2143,r2147-r2151,r2158-r2165,r2167-r2170)
* New graphical windowed output mode via GTK3 (similar to SDL, but with menus), selected with -o gtk
# (r2112)
diff --git a/README b/README
index e456cef..b6e7dba 100644
--- a/README
+++ b/README
@@ -358,6 +358,8 @@ patch.
be robust, too. Consider writing a new test case.
* In particular, the developer tests should pass:
`make devtests dist dist-tests`.
+ * If you're experimenting on Android's Termux, for gtk3 you may need
+ 'xorgproto' to provide you 'xproto' (applies to Termux version 0.118.0).
-==============================================================================-
8 Availability in Linux distributions
@@ -439,5 +441,5 @@ ChangeLog : http://svn.savannah.nongnu.org/svn/fbi-improved/trunk/ChangeLog
Bugs (official) : http://savannah.nongnu.org/bugs/?group=fbi-improved
- $Id: README 2171 2024-04-07 22:08:57Z dezperado $
+ $Id: README 2233 2024-05-01 11:01:21Z dezperado $
vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=markdown:norl:
diff --git a/README.md b/README.md
index 49c713a..49dbb0e 100644
--- a/README.md
+++ b/README.md
@@ -358,6 +358,8 @@ patch.
be robust, too. Consider writing a new test case.
* In particular, the developer tests should pass:
`make devtests dist dist-tests`.
+ * If you're experimenting on Android's Termux, for gtk3 you may need
+ 'xorgproto' to provide you 'xproto' (applies to Termux version 0.118.0).
## <a id="8availability-in-linux-distributions"></a>[ 8 Availability in Linux distributions](#8availability-in-linux-distributions) ##
diff --git a/VERSION b/VERSION
index faef31a..39e898a 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.7.0
+0.7.1
diff --git a/config.h.in b/config.h.in
index 338cbe1..f36d5fd 100644
--- a/config.h.in
+++ b/config.h.in
@@ -664,6 +664,11 @@
/* Define to 1 if you need to in order for `stat' and other things to work. */
#undef _POSIX_SOURCE
+/* Define to 1 if type `char' is unsigned and you are not using gcc. */
+#ifndef __CHAR_UNSIGNED__
+# undef __CHAR_UNSIGNED__
+#endif
+
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
diff --git a/configure b/configure
index 0099a5e..49473ef 100755
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac Revision.
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for fim 0.7.0.
+# Generated by GNU Autoconf 2.69 for fim 0.7.1.
#
# Report bugs to <dezperado_FOobAr_autistici_Baz_org, by replacing _FOobAr_ with a @ and _Baz_ with a .>.
#
@@ -582,8 +582,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='fim'
PACKAGE_TARNAME='fim'
-PACKAGE_VERSION='0.7.0'
-PACKAGE_STRING='fim 0.7.0'
+PACKAGE_VERSION='0.7.1'
+PACKAGE_STRING='fim 0.7.1'
PACKAGE_BUGREPORT='dezperado_FOobAr_autistici_Baz_org, by replacing _FOobAr_ with a @ and _Baz_ with a .'
PACKAGE_URL=''
@@ -694,6 +694,8 @@ WANT_READ_STDIN_IMAGE_FALSE
WANT_READ_STDIN_IMAGE_TRUE
WANT_RECURSIVE_DIRS_FALSE
WANT_RECURSIVE_DIRS_TRUE
+ENABLE_NO_HISTORY_TESTS_FALSE
+ENABLE_NO_HISTORY_TESTS_TRUE
ENABLE_HISTORY_FALSE
ENABLE_HISTORY_TRUE
WANT_DEFAULT_FIMRC_FALSE
@@ -740,7 +742,6 @@ POPPLER_LIBS
POPPLER_CFLAGS
PKG_CONFIG_LIBDIR
PKG_CONFIG_PATH
-PKG_CONFIG
ENABLE_DJVU_FALSE
ENABLE_DJVU_TRUE
ENABLE_PS_FALSE
@@ -766,7 +767,12 @@ ENABLE_SYSTEM_CALLS_FALSE
ENABLE_SYSTEM_CALLS_TRUE
WITH_EXPECT_FALSE
WITH_EXPECT_TRUE
+PKG_CONFIG
EXPECT
+WITH_MAN_FALSE
+WITH_MAN_TRUE
+WITH_GROFF_FALSE
+WITH_GROFF_TRUE
WITH_PERL_FALSE
WITH_PERL_TRUE
WITH_MAN2HTML_FALSE
@@ -787,6 +793,7 @@ LIBPS
LIBJPEG
LIBGIF
LIBTIFF
+HAVE_GROFF
HAVE_MAN
HAVE_CAT
HAVE_AWK
@@ -1574,7 +1581,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures fim 0.7.0 to adapt to many kinds of systems.
+\`configure' configures fim 0.7.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1641,7 +1648,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of fim 0.7.0:";;
+ short | recursive ) echo "Configuration of fim 0.7.1:";;
esac
cat <<\_ACEOF
@@ -1683,7 +1690,8 @@ Optional Features:
try to detect extra compilation flags. You can
override this by passing configure with
POPPLER_CFLAGS=... .
- --enable-pdf Compile with pdf support
+ --enable-pdf Compile with pdf support (this does *not* imply
+ detection of libpoppler)
--disable-bmp Disable BMP file support (enabled by default).
--disable-pcx Disable PCX file support (enabled by default).
--disable-webp Disable WebP file support.
@@ -1925,7 +1933,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-fim configure 0.7.0
+fim configure 0.7.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2762,7 +2770,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by fim $as_me 0.7.0, which was
+It was created by fim $as_me 0.7.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3115,17 +3123,17 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test x"2176" != x ; then
+if test x"22552256" != x ; then
# The above test gets evaluated when creating the configure script.
-$as_echo "#define SVN_REVISION \"2176\"" >>confdefs.h
+$as_echo "#define SVN_REVISION \"22552256\"" >>confdefs.h
- SVN_REVISION="2176"
+ SVN_REVISION="22552256"
-$as_echo "#define SVN_REVISION_NUMBER 2176" >>confdefs.h
+$as_echo "#define SVN_REVISION_NUMBER 22552256" >>confdefs.h
- SVN_REVISION_NUMBER=2176
+ SVN_REVISION_NUMBER=22552256
fi
@@ -6586,7 +6594,7 @@ fi
# Define the identity of the package.
PACKAGE='fim'
- VERSION='0.7.0'
+ VERSION='0.7.1'
cat >>confdefs.h <<_ACEOF
@@ -7475,6 +7483,39 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5
+$as_echo_n "checking whether char is unsigned... " >&6; }
+if ${ac_cv_c_char_unsigned+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((char) -1) < 0)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_c_char_unsigned=no
+else
+ ac_cv_c_char_unsigned=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5
+$as_echo "$ac_cv_c_char_unsigned" >&6; }
+if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
+ $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h
+
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
@@ -8209,6 +8250,44 @@ $as_echo "no" >&6; }
fi
+# Extract the first word of "groff", so it can be a program name with args.
+set dummy groff; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_HAVE_GROFF+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$HAVE_GROFF"; then
+ ac_cv_prog_HAVE_GROFF="$HAVE_GROFF" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_HAVE_GROFF="yes"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_prog_HAVE_GROFF" && ac_cv_prog_HAVE_GROFF="no"
+fi
+fi
+HAVE_GROFF=$ac_cv_prog_HAVE_GROFF
+if test -n "$HAVE_GROFF"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_GROFF" >&5
+$as_echo "$HAVE_GROFF" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
#AC_CHECK_PROG([HAVE_WHICH],[which],[yes],[no])
#AC_CHECK_PROG([HAVE_GPG],[gpg],[yes],[no])
#AC_CHECK_PROG([HAVE_LS],[ls],[yes],[no])
@@ -8695,6 +8774,22 @@ else
WITH_PERL_FALSE=
fi
+ if test x$ac_cv_prog_HAVE_GROFF != xno; then
+ WITH_GROFF_TRUE=
+ WITH_GROFF_FALSE='#'
+else
+ WITH_GROFF_TRUE='#'
+ WITH_GROFF_FALSE=
+fi
+
+ if test x$ac_cv_prog_HAVE_MAN != xno; then
+ WITH_MAN_TRUE=
+ WITH_MAN_FALSE='#'
+else
+ WITH_MAN_TRUE='#'
+ WITH_MAN_FALSE=
+fi
+
#AC_PATH_PROG([CC],[cc],[no])
#AC_PATH_PROG([WHICH],[which],[no])
#AC_PATH_PROG([GPG],[gpg],[no])
@@ -8741,6 +8836,104 @@ $as_echo "no" >&6; }
fi
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_PKG_CONFIG" = x; then
+ PKG_CONFIG=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
if test x$ac_cv_path_EXPECT != xno; then
WITH_EXPECT_TRUE=
WITH_EXPECT_FALSE='#'
@@ -10097,6 +10290,12 @@ if test x$ac_cv_func_pipe = xyes; then
$as_echo "#define HAVE_PIPE 1" >>confdefs.h
fi
+if test x$CC = x'emcc' -a x$CXX = x'em++'; then
+ using_wasm=yes;
+else
+ using_wasm=no;
+fi
+
for ac_header in FlexLexer.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "FlexLexer.h" "ac_cv_header_FlexLexer_h" "$ac_includes_default"
@@ -10112,6 +10311,12 @@ fi
done
+if test x$ac_cv_header_FlexLexer_h = x"no" -a x"$using_wasm" = x"yes" -a -r /usr/include/FlexLexer.h ; then
+ ac_cv_header_FlexLexer_h=yes;
+ cp /usr/include/FlexLexer.h .;
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: As an exception for WASM mode, copied /usr/include/FlexLexer.h here (it is not provided by emscripten)." >&5
+$as_echo "$as_me: WARNING: As an exception for WASM mode, copied /usr/include/FlexLexer.h here (it is not provided by emscripten)." >&2;}
+fi
if test x$ac_cv_header_FlexLexer_h = xyes; then
@@ -11106,12 +11311,14 @@ else
fi
if test x$fim_handle_pdf != xno ; then
- fim_handle_pdf=yes
- have_poppler=yes
- if test x$with_libpoppler != xno && test -z "$LIBPOPPLER"; then
+ CPPFLAGS_precheck="$CPPFLAGS";
+ if test -z "$LIBPOPPLER"; then
# dear fim hackers, you should install pkg-config to get this macro expanded (p)
- CXXFLAGS="$CXXFLAGS `pkg-config poppler --cflags`";
- CXXFLAGS="$CXXFLAGS `pkg-config poppler-splash --cflags`";
+ # I admit I don't like this much
+ CXXFLAGS="$CXXFLAGS `$PKG_CONFIG poppler --cflags`";
+ CPPFLAGS="$CPPFLAGS `$PKG_CONFIG poppler --cflags-only-I`";
+ CXXFLAGS="$CXXFLAGS `$PKG_CONFIG poppler-splash --cflags`"; CPPFLAGS="$CPPFLAGS `$PKG_CONFIG poppler-splash --cflags-only-I`"; CXXFLAGS="$CXXFLAGS `$PKG_CONFIG poppler-cpp --cflags`";
+ CPPFLAGS="$CPPFLAGS `$PKG_CONFIG poppler-cpp --cflags-only-I`";
POPPLER_REQUIRED=0.8.7
@@ -11292,17 +11499,37 @@ fi
# Put the nasty error message in config.log where it belongs
echo "$POPPLER_PKG_ERRORS" >&5
- enable_pdf=no
+ as_fn_error $? "Package requirements (poppler >= $POPPLER_REQUIRED) were not met:
+
+$POPPLER_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables POPPLER_CFLAGS
+and POPPLER_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- enable_pdf=no
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables POPPLER_CFLAGS
+and POPPLER_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
else
POPPLER_CFLAGS=$pkg_cv_POPPLER_CFLAGS
POPPLER_LIBS=$pkg_cv_POPPLER_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- enable_pdf=yes
+
fi
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5
@@ -11434,6 +11661,7 @@ if test "x$ac_cv_lib_poppler_g_free" = xyes; then :
have_poppler=yes
LIBS="$LIBS $GLIB_LIBS $POPPLER_LIBS";
CXXFLAGS="$CXXFLAGS $GLIB_CFLAGS $POPPLER_CFLAGS";
+ CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS $POPPLER_CFLAGS";
else
have_poppler=no
@@ -11442,23 +11670,24 @@ $as_echo "$as_me: WARNING: *** POPPLER loader will not be built (POPPLER library
fi
if test x"$have_poppler" = xyes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for poppler/poppler-config.h" >&5
-$as_echo_n "checking for poppler/poppler-config.h... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for <cpp/poppler-version.h> <splash/SplashBitmap.h> <splash/SplashTypes.h> <poppler-config.h> <OutputDev.h> <PDFDoc.h> <SplashOutputDev.h> <Page.h> <GlobalParams.h> <glib.h> ..." >&5
+$as_echo_n "checking for <cpp/poppler-version.h> <splash/SplashBitmap.h> <splash/SplashTypes.h> <poppler-config.h> <OutputDev.h> <PDFDoc.h> <SplashOutputDev.h> <Page.h> <GlobalParams.h> <glib.h> ...... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
#undef PACKAGE
#undef VERSION
#undef HAVE_STDLIB_H
- /* fim uses these headers. let us hope poppler will stabilize soon!*/
- #include <poppler/poppler-config.h>
- #include <poppler/PDFDoc.h>
- #include <poppler/OutputDev.h>
- #include <poppler/SplashOutputDev.h>
- #include <poppler/splash/SplashBitmap.h>
- #include <poppler/splash/SplashTypes.h>
- #include <poppler/Page.h>
- #include <poppler/GlobalParams.h> /* globalParams lives here */
+ #include <cpp/poppler-version.h>
+ #include <splash/SplashBitmap.h>
+ #include <splash/SplashTypes.h>
+ #include <poppler-config.h>
+ #include <OutputDev.h>
+ #include <PDFDoc.h>
+ #include <SplashOutputDev.h>
+ #include <Page.h>
+ #include <GlobalParams.h>
+ #include <glib.h>
_ACEOF
if ac_fn_cxx_try_cpp "$LINENO"; then :
@@ -11467,7 +11696,6 @@ else
have_poppler=no
fi
rm -f conftest.err conftest.i conftest.$ac_ext
- have_poppler=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_poppler" >&5
$as_echo "$have_poppler" >&6; }
if test x"$have_poppler" = xyes; then
@@ -11477,6 +11705,7 @@ $as_echo "$have_poppler" >&6; }
$as_echo "$as_me: WARNING: *** POPPLER/PDF loader will not be built (POPPLER header file not found) ***" >&2;}
fi
fi
+ CPPFLAGS="$CPPFLAGS_precheck"; # restore: it's in CXXFLAGS anyway
fi
# the following needs thorough testing
@@ -11488,14 +11717,12 @@ $as_echo "#define HAVE_LIBPOPPLER 1" >>confdefs.h
else
fim_handle_pdf=no
+ as_fn_error $? "*** Could not detect POPPLER, which was requested via --enable-poppler. Please do not use that, or use --disable-poppler ***" "$LINENO" 5
fi
-# if test x$with_libpoppler != xno && test -z "$LIBPOPPLER"; then
-# AC_MSG_ERROR([
-# Checks for POPPLER loader failed. You can build without it by passing
-# --disable-poppler to ./configure. ])
-# fi
else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: POPPLER support (for PDF) not requested." >&5
+$as_echo "$as_me: POPPLER support (for PDF) not requested." >&6;}
fim_handle_pdf=no
fi
if test x$have_poppler = xyes; then
@@ -11515,8 +11742,8 @@ else
fi
-if test "x$enable_pdf" = "xyes"; then
- if test "x$enable_pdf" = "xyes"; then
+if test x"$enable_pdf" = x"yes" -o x"$fim_handle_pdf" = x"yes"; then
+ if test x"$enable_pdf" = x"yes" -a x"$fim_handle_pdf" != x"no" ; then
$as_echo "#define ENABLE_PDF 1" >>confdefs.h
@@ -11526,9 +11753,16 @@ $as_echo "#define ENABLE_PDF 1" >>confdefs.h
fim_save_LIBS=$LIBS
LIBS="$LIBS $GLIB_LIBS $POPPLER_LIBS"
LIBS=$fim_save_LIBS
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"PDF support is disabled since poppler library version $POPPLER_REQUIRED or newer not found\"" >&5
-$as_echo "$as_me: WARNING: \"PDF support is disabled since poppler library version $POPPLER_REQUIRED or newer not found\"" >&2;}
+ fi
+ if test x"$enable_pdf" = x"yes" -a x"$fim_handle_pdf" != x"yes" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"PDF support can' be granted since poppler library version $POPPLER_REQUIRED or newer not found or not requested; perhaps can still open PDF with converters...\"" >&5
+$as_echo "$as_me: WARNING: \"PDF support can' be granted since poppler library version $POPPLER_REQUIRED or newer not found or not requested; perhaps can still open PDF with converters...\"" >&2;}
+ enable_pdf=no;
+ fi
+ if test x"$enable_pdf" != x"yes" -a x"$fim_handle_pdf" = x"yes" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Disabling PDF support as requested\"" >&5
+$as_echo "$as_me: WARNING: \"Disabling PDF support as requested\"" >&2;}
+ fim_handle_pdf=no;
fi
fi
@@ -11629,10 +11863,10 @@ if test "${enable_webp+set}" = set; then :
fi
if test x$fim_handle_webp = xyes; then
- LIBS="$LIBS `pkg-config libwebpdemux --libs`";
- LIBS="$LIBS `pkg-config libwebp --libs`";
- CXXFLAGS="$CXXFLAGS `pkg-config libwebpdemux --cflags`";
- CXXFLAGS="$CXXFLAGS `pkg-config libwebp --cflags`";
+ LIBS="$LIBS `$PKG_CONFIG libwebpdemux --libs`";
+ LIBS="$LIBS `$PKG_CONFIG libwebp --libs`";
+ CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libwebpdemux --cflags`";
+ CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libwebp --cflags`";
{ $as_echo "$as_me:${as_lineno-$LINENO}: Enabling WebP file format support." >&5
$as_echo "$as_me: Enabling WebP file format support." >&6;}
@@ -11679,8 +11913,8 @@ if test "${enable_avif+set}" = set; then :
fi
if test x$fim_handle_avif = xyes; then
- LIBS="$LIBS `pkg-config libavif --libs`";
- CXXFLAGS="$CXXFLAGS `pkg-config libavif --cflags`";
+ LIBS="$LIBS `$PKG_CONFIG libavif --libs`";
+ CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libavif --cflags`";
{ $as_echo "$as_me:${as_lineno-$LINENO}: Enabling AVIF file format support." >&5
$as_echo "$as_me: Enabling AVIF file format support." >&6;}
@@ -12340,11 +12574,6 @@ fi
$as_echo "$have_cv_sdl2_config_ok" >&6; }
LIBS="$LIBS_BEFORE_CHECK"
unset LIBS_BEFORE_CHECK
- if test x"$have_cv_sdl2_config_ok" = xno && test x"$LIBSDL2_CONFIG" != x && pkg-config --version; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Setting PKG_CONFIG=pkg-config, perhaps it can help sdl-config." >&5
-$as_echo "$as_me: Setting PKG_CONFIG=pkg-config, perhaps it can help sdl-config." >&6;}
- export PKG_CONFIG=pkg-config;
- fi
unset LIBSDL2_CONFIG;
fi
if test "x$LIBSDL_CONFIG" = "xno"; then
@@ -12767,6 +12996,13 @@ else
ENABLE_HISTORY_FALSE=
fi
+ if test x$fim_cv_history = xno; then
+ ENABLE_NO_HISTORY_TESTS_TRUE=
+ ENABLE_NO_HISTORY_TESTS_FALSE='#'
+else
+ ENABLE_NO_HISTORY_TESTS_TRUE='#'
+ ENABLE_NO_HISTORY_TESTS_FALSE=
+fi
if test x$fim_cv_history != xyes; then
@@ -13419,7 +13655,7 @@ else
FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_FALSE=
fi
- if test x"$host_cpu" = x"$build_cpu" -a x"$host_os" = x"$build_os" ; then
+ if test x"$host_cpu" = x"$build_cpu" -a x"$host_os" = x"$build_os" -a x"$using_wasm" = x"no" ; then
HAVE_RUNNABLE_TESTS_TRUE=
HAVE_RUNNABLE_TESTS_FALSE='#'
else
@@ -14193,7 +14429,7 @@ cat >>confdefs.h <<_ACEOF
#define FIM_WANT_MOUSE $fim_cv_want_mouse
_ACEOF
- if test x$fim_cv_want_mouse = xyes; then
+ if test x$fim_cv_want_mouse = x1; then
ENABLE_MOUSE_TRUE=
ENABLE_MOUSE_FALSE='#'
else
@@ -14201,6 +14437,7 @@ else
ENABLE_MOUSE_FALSE=
fi
+if test x$fim_cv_want_mouse = x1; then fim_cv_want_mouse=yes ; else fim_cv_want_mouse=no ; fi
# Check whether --enable-scripting was given.
if test "${enable_scripting+set}" = set; then :
@@ -14458,7 +14695,7 @@ else
ENABLE_MATRIX_MARKET_DECODER_FALSE=
fi
- if test x$CC = x'emcc' -a x$CXX = x'em++'; then
+ if test x"$using_wasm" != x"no"; then
WANT_WASM_TRUE=
WANT_WASM_FALSE='#'
else
@@ -14764,6 +15001,14 @@ if test -z "${WITH_PERL_TRUE}" && test -z "${WITH_PERL_FALSE}"; then
as_fn_error $? "conditional \"WITH_PERL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${WITH_GROFF_TRUE}" && test -z "${WITH_GROFF_FALSE}"; then
+ as_fn_error $? "conditional \"WITH_GROFF\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${WITH_MAN_TRUE}" && test -z "${WITH_MAN_FALSE}"; then
+ as_fn_error $? "conditional \"WITH_MAN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${WITH_EXPECT_TRUE}" && test -z "${WITH_EXPECT_FALSE}"; then
as_fn_error $? "conditional \"WITH_EXPECT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -14873,6 +15118,10 @@ if test -z "${ENABLE_HISTORY_TRUE}" && test -z "${ENABLE_HISTORY_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_HISTORY\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${ENABLE_NO_HISTORY_TESTS_TRUE}" && test -z "${ENABLE_NO_HISTORY_TESTS_FALSE}"; then
+ as_fn_error $? "conditional \"ENABLE_NO_HISTORY_TESTS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${WANT_RECURSIVE_DIRS_TRUE}" && test -z "${WANT_RECURSIVE_DIRS_FALSE}"; then
as_fn_error $? "conditional \"WANT_RECURSIVE_DIRS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -15362,7 +15611,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by fim $as_me 0.7.0, which was
+This file was extended by fim $as_me 0.7.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -15428,7 +15677,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-fim config.status 0.7.0
+fim config.status 0.7.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -16332,7 +16581,7 @@ fi
use 'exiftool' for EXIF tags in JPEG:*${fim_cv_exiftool}
framebuffer (built-in) support : ${fim_handle_framebuffer:-yes}
SDL (sdllib) support (-o sdl) : ${fim_handle_sdl}
- GTK (GTK3) support (-o gtk) :*${fim_handle_gtk}
+ GTK (GTK3) support (-o gtk) : ${fim_handle_gtk}
ASCII art (aalib) support (-o aa) : ${fim_cv_aalib}
Colour ASCII art (libcaca) support : ${fim_cv_libcaca}
EXIF (JPEG) tags support (libexif) : ${fim_cv_libexif}
@@ -16401,7 +16650,7 @@ $as_echo "$as_me:
use 'exiftool' for EXIF tags in JPEG:*${fim_cv_exiftool}
framebuffer (built-in) support : ${fim_handle_framebuffer:-yes}
SDL (sdllib) support (-o sdl) : ${fim_handle_sdl}
- GTK (GTK3) support (-o gtk) :*${fim_handle_gtk}
+ GTK (GTK3) support (-o gtk) : ${fim_handle_gtk}
ASCII art (aalib) support (-o aa) : ${fim_cv_aalib}
Colour ASCII art (libcaca) support : ${fim_cv_libcaca}
EXIF (JPEG) tags support (libexif) : ${fim_cv_libexif}
diff --git a/configure.ac b/configure.ac
index 9bcd934..c960502 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-dnl $LastChangedDate: 2024-04-09 21:08:29 +0200 (Tue, 09 Apr 2024) $
+dnl $LastChangedDate: 2024-05-19 14:01:40 +0200 (Sun, 19 May 2024) $
AC_PREREQ([2.69])
@@ -12,7 +12,7 @@ AC_PREREQ([2.69])
define([svnversion],esyscmd([sh -c "svnversion | tr -c '[0-9]' ' ' | sed 's/ *//g;s/^$/-1/g' "]))dnl
# WARNING : here 0.0 denotes the package version, which will be corrected some lines after this.
-AC_INIT([fim],[0.7.0],[dezperado_FOobAr_autistici_Baz_org, by replacing _FOobAr_ with a @ and _Baz_ with a .])
+AC_INIT([fim],[0.7.1],[dezperado_FOobAr_autistici_Baz_org, by replacing _FOobAr_ with a @ and _Baz_ with a .])
AC_CONFIG_SRCDIR([src/fim.cpp])
if test x"svnversion" != x ; then
@@ -109,6 +109,7 @@ AC_C_CONST
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
AC_CHECK_SIZEOF(off_t)
+AC_C_CHAR_UNSIGNED
AM_MAINTAINER_MODE
AH_TEMPLATE([HAVE_GETENV])
@@ -169,6 +170,7 @@ AC_CHECK_PROG([HAVE_CPP],[cpp],[yes],[no])
AC_CHECK_PROG([HAVE_AWK],[awk],[yes],[no])
AC_CHECK_PROG([HAVE_CAT],[cat],[yes],[no])
AC_CHECK_PROG([HAVE_MAN],[man],[yes],[no])
+AC_CHECK_PROG([HAVE_GROFF],[groff],[yes],[no])
#AC_CHECK_PROG([HAVE_WHICH],[which],[yes],[no])
#AC_CHECK_PROG([HAVE_GPG],[gpg],[yes],[no])
#AC_CHECK_PROG([HAVE_LS],[ls],[yes],[no])
@@ -196,12 +198,15 @@ AC_PATH_PROG([SHELLCHECK],[shellcheck],[no])
AM_CONDITIONAL(WITH_SHELLCHECK, test x$ac_cv_path_SHELLCHECK != xno)
AM_CONDITIONAL(WITH_MAN2HTML, test x$ac_cv_path_MAN != xno)
AM_CONDITIONAL(WITH_PERL, test x$ac_cv_path_PERL != xno)
+AM_CONDITIONAL(WITH_GROFF, test x$ac_cv_prog_HAVE_GROFF != xno)
+AM_CONDITIONAL(WITH_MAN, test x$ac_cv_prog_HAVE_MAN != xno)
#AC_PATH_PROG([CC],[cc],[no])
#AC_PATH_PROG([WHICH],[which],[no])
#AC_PATH_PROG([GPG],[gpg],[no])
#AC_PATH_PROG([LS],[ls],[no])
#AC_PATH_PROG([CD],[cd],[no])
AC_PATH_PROG([EXPECT],[expect],[no])
+AC_PATH_TOOL(PKG_CONFIG,pkg-config)
AM_CONDITIONAL(WITH_EXPECT, test x$ac_cv_path_EXPECT != xno)
# FIXME: what if we have no grep and/or no sed ?
# (echo is often a shell builtin)
@@ -385,8 +390,20 @@ if test x$ac_cv_func_pipe = xyes; then
AH_TEMPLATE([HAVE_PIPE])
AC_DEFINE([HAVE_PIPE],[1],[We have pipe()])
fi
+dnl ==================
+if test x$CC = x'emcc' -a x$CXX = x'em++'; then
+ using_wasm=yes;
+else
+ using_wasm=no;
+fi
dnl AC_CHECK_HEADERS([FlexLexer.h], [break], AC_MSG_ERROR([[Cannot find FlexLexer. Fim requires it!]]))
+
AC_CHECK_HEADERS([FlexLexer.h], [break], AC_MSG_WARN([[Cannot find FlexLexer.h. Without it Fim won't be usable!]]))
+if test x$ac_cv_header_FlexLexer_h = x"no" -a x"$using_wasm" = x"yes" -a -r /usr/include/FlexLexer.h ; then
+ ac_cv_header_FlexLexer_h=yes;
+ cp /usr/include/FlexLexer.h .;
+ AC_MSG_WARN([As an exception for WASM mode, copied /usr/include/FlexLexer.h here (it is not provided by emscripten).])
+fi
if test x$ac_cv_header_FlexLexer_h = xyes; then
AH_TEMPLATE([HAVE_FLEXLEXER_H])
AC_DEFINE([HAVE_FLEXLEXER_H],[1],[We have FlexLexer.h])
@@ -874,8 +891,6 @@ AM_CONDITIONAL(ENABLE_DJVU, test x$have_djvu = xyes)
dnl ============= pdf file handling with libpoppler
dnl
-dnl By default, we disable poppler : its API is still immature.
-dnl
fim_handle_pdf=no
AC_ARG_ENABLE(poppler, AS_HELP_STRING([--enable-poppler],[Enable poppler (PDF rendering) support. This will try to detect extra compilation flags. You can override this by passing configure with POPPLER_CFLAGS=... .]),
[ if test x$enableval = xyes ; then
@@ -884,17 +899,18 @@ AC_ARG_ENABLE(poppler, AS_HELP_STRING([--enable-poppler],[Enable poppler (PDF re
], [$LIBPOPPLER_STATIC_EXTRA])
dnl FIXME : checking only for libpoppler-glib, should also check for libpoppler !
if test x$fim_handle_pdf != xno ; then
- fim_handle_pdf=yes
- have_poppler=yes
- if test x$with_libpoppler != xno && test -z "$LIBPOPPLER"; then
+ CPPFLAGS_precheck="$CPPFLAGS";
+ if test -z "$LIBPOPPLER"; then
# dear fim hackers, you should install pkg-config to get this macro expanded (p)
- CXXFLAGS="$CXXFLAGS `pkg-config poppler --cflags`";
- CXXFLAGS="$CXXFLAGS `pkg-config poppler-splash --cflags`";
-dnl # pkg-config --cflags poppler
-dnl # pkg-config --cflags poppler-cpp
-dnl # ...
+ # I admit I don't like this much
+ CXXFLAGS="$CXXFLAGS `$PKG_CONFIG poppler --cflags`";
+ CPPFLAGS="$CPPFLAGS `$PKG_CONFIG poppler --cflags-only-I`";
+ CXXFLAGS="$CXXFLAGS `$PKG_CONFIG poppler-splash --cflags`"; dnl old debian
+ CPPFLAGS="$CPPFLAGS `$PKG_CONFIG poppler-splash --cflags-only-I`"; dnl old debian
+ CXXFLAGS="$CXXFLAGS `$PKG_CONFIG poppler-cpp --cflags`";
+ CPPFLAGS="$CPPFLAGS `$PKG_CONFIG poppler-cpp --cflags-only-I`";
POPPLER_REQUIRED=0.8.7
- PKG_CHECK_MODULES(POPPLER, poppler >= $POPPLER_REQUIRED,enable_pdf=yes,enable_pdf=no) dnl sets POPPLER_LIBS and POPPLER_CFLAGS
+ PKG_CHECK_MODULES(POPPLER, poppler >= $POPPLER_REQUIRED,[],[]) dnl sets POPPLER_LIBS and POPPLER_CFLAGS
PKG_CHECK_MODULES(GLIB, glib-2.0) dnl sets GLIB_CFLAGS GLIB_LIBS
dnl keep next line empty or it may break configure.
@@ -902,26 +918,28 @@ dnl keep next line empty or it may break configure.
have_poppler=yes
LIBS="$LIBS $GLIB_LIBS $POPPLER_LIBS";
CXXFLAGS="$CXXFLAGS $GLIB_CFLAGS $POPPLER_CFLAGS";
+ CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS $POPPLER_CFLAGS";
,
have_poppler=no
AC_MSG_WARN([*** POPPLER loader will not be built (POPPLER library not found) ***]), [$GLIB_LIBS $POPPLER_LIBS])
if test x"$have_poppler" = xyes; then
- AC_MSG_CHECKING([for poppler/poppler-config.h])
+ AC_MSG_CHECKING([for <cpp/poppler-version.h> <splash/SplashBitmap.h> <splash/SplashTypes.h> <poppler-config.h> <OutputDev.h> <PDFDoc.h> <SplashOutputDev.h> <Page.h> <GlobalParams.h> <glib.h> ...])
+ dnl requires proper CPPFLAGS
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#undef HAVE_STDLIB_H
- /* fim uses these headers. let us hope poppler will stabilize soon!*/
- #include <poppler/poppler-config.h>
- #include <poppler/PDFDoc.h>
- #include <poppler/OutputDev.h>
- #include <poppler/SplashOutputDev.h>
- #include <poppler/splash/SplashBitmap.h>
- #include <poppler/splash/SplashTypes.h>
- #include <poppler/Page.h>
- #include <poppler/GlobalParams.h> /* globalParams lives here */
+ #include <cpp/poppler-version.h>
+ #include <splash/SplashBitmap.h>
+ #include <splash/SplashTypes.h>
+ #include <poppler-config.h>
+ #include <OutputDev.h>
+ #include <PDFDoc.h>
+ #include <SplashOutputDev.h>
+ #include <Page.h>
+ #include <GlobalParams.h>
+ #include <glib.h>
]])],[have_poppler=yes],[have_poppler=no])
- have_poppler=yes
AC_MSG_RESULT($have_poppler)
if test x"$have_poppler" = xyes; then
CXXFLAGS="$CXXFLAGS -DFIM_LIBPOPPLER_VERSION_MAYBE=$have_poppler_maybe_version"
@@ -929,6 +947,7 @@ dnl keep next line empty or it may break configure.
AC_MSG_WARN([*** POPPLER/PDF loader will not be built (POPPLER header file not found) ***])
fi
fi
+ CPPFLAGS="$CPPFLAGS_precheck"; # restore: it's in CXXFLAGS anyway
fi
# the following needs thorough testing
@@ -938,25 +957,21 @@ dnl keep next line empty or it may break configure.
AC_DEFINE([HAVE_LIBPOPPLER],[1],[We have libpoppler (Warning: the API could still break! (as of v.0.8.7--0.24.1))])
else
fim_handle_pdf=no
+ AC_MSG_ERROR([*** Could not detect POPPLER, which was requested via --enable-poppler. Please do not use that, or use --disable-poppler ***])
fi
-# if test x$with_libpoppler != xno && test -z "$LIBPOPPLER"; then
-# AC_MSG_ERROR([
-# Checks for POPPLER loader failed. You can build without it by passing
-# --disable-poppler to ./configure. ])
-# fi
else
+ AC_MSG_NOTICE([POPPLER support (for PDF) not requested.])
fim_handle_pdf=no
fi
AM_CONDITIONAL(ENABLE_POPPLER, test x$have_poppler = xyes)
-dnl FIXME : we have two libpoppler checks ... :
dnl ================== pdf checks ===================================================
AC_ARG_ENABLE(pdf,
- [AS_HELP_STRING([--enable-pdf],[Compile with pdf support])],enable_pdf="$enableval",enable_pdf=yes)
+ [AS_HELP_STRING([--enable-pdf],[Compile with pdf support (this does *not* imply detection of libpoppler)])],enable_pdf="$enableval",enable_pdf=yes)
-if test "x$enable_pdf" = "xyes"; then
- if test "x$enable_pdf" = "xyes"; then
+if test x"$enable_pdf" = x"yes" -o x"$fim_handle_pdf" = x"yes"; then
+ if test x"$enable_pdf" = x"yes" -a x"$fim_handle_pdf" != x"no" ; then
AC_DEFINE([ENABLE_PDF], [1], [Enable pdf support.])
SHELL_LIBS="$SHELL_LIBS $POPPLER_LIBS"
SHELL_CXXFLAGS="$SHELL_CXXFLAGS $GLIB_CFLAGS $POPPLER_CFLAGS"
@@ -964,8 +979,14 @@ if test "x$enable_pdf" = "xyes"; then
fim_save_LIBS=$LIBS
LIBS="$LIBS $GLIB_LIBS $POPPLER_LIBS"
LIBS=$fim_save_LIBS
- else
- AC_MSG_WARN(["PDF support is disabled since poppler library version $POPPLER_REQUIRED or newer not found"])
+ fi
+ if test x"$enable_pdf" = x"yes" -a x"$fim_handle_pdf" != x"yes" ; then
+ AC_MSG_WARN(["PDF support can' be granted since poppler library version $POPPLER_REQUIRED or newer not found or not requested; perhaps can still open PDF with converters..."])
+ enable_pdf=no;
+ fi
+ if test x"$enable_pdf" != x"yes" -a x"$fim_handle_pdf" = x"yes" ; then
+ AC_MSG_WARN(["Disabling PDF support as requested"])
+ fim_handle_pdf=no;
fi
fi
@@ -1014,10 +1035,10 @@ AC_ARG_ENABLE(webp, AS_HELP_STRING([--disable-webp],[Disable WebP file support.]
fi
])
if test x$fim_handle_webp = xyes; then
- LIBS="$LIBS `pkg-config libwebpdemux --libs`";
- LIBS="$LIBS `pkg-config libwebp --libs`";
- CXXFLAGS="$CXXFLAGS `pkg-config libwebpdemux --cflags`";
- CXXFLAGS="$CXXFLAGS `pkg-config libwebp --cflags`";
+ LIBS="$LIBS `$PKG_CONFIG libwebpdemux --libs`";
+ LIBS="$LIBS `$PKG_CONFIG libwebp --libs`";
+ CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libwebpdemux --cflags`";
+ CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libwebp --cflags`";
AC_MSG_NOTICE([Enabling WebP file format support.])
AC_DEFINE(FIM_WITH_LIBWEBP, 1, [WebP file support.])
FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffWebP.o"
@@ -1036,8 +1057,8 @@ AC_ARG_ENABLE(avif, AS_HELP_STRING([--disable-avif],[Disable AVIF file support.]
fi
])
if test x$fim_handle_avif = xyes; then
- LIBS="$LIBS `pkg-config libavif --libs`";
- CXXFLAGS="$CXXFLAGS `pkg-config libavif --cflags`";
+ LIBS="$LIBS `$PKG_CONFIG libavif --libs`";
+ CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libavif --cflags`";
AC_MSG_NOTICE([Enabling AVIF file format support.])
AC_DEFINE(FIM_WITH_LIBAVIF, 1, [AVIF file support.])
FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffAVIF.o"
@@ -1274,10 +1295,10 @@ if test x$fim_handle_sdl != xno; then
AC_CACHE_CHECK([Whether sdl2-config gives linkable output with $LIBS], [have_cv_sdl2_config_ok], AC_LINK_IFELSE([AC_LANG_PROGRAM([/*headers*/], [/*main*/])],[have_cv_sdl2_config_ok=yes],[have_cv_sdl2_config_ok=no],[have_cv_sdl2_config_ok=no]))
LIBS="$LIBS_BEFORE_CHECK"
unset LIBS_BEFORE_CHECK
- if test x"$have_cv_sdl2_config_ok" = xno && test x"$LIBSDL2_CONFIG" != x && pkg-config --version; then
- AC_MSG_NOTICE([Setting PKG_CONFIG=pkg-config, perhaps it can help sdl-config.])
- export PKG_CONFIG=pkg-config;
- fi
+dnl if test x"$have_cv_sdl2_config_ok" = xno && test x"$LIBSDL2_CONFIG" != x && pkg-config --version; then
+dnl AC_MSG_NOTICE([Setting PKG_CONFIG=pkg-config, perhaps it can help sdl-config.])
+dnl export PKG_CONFIG=pkg-config;
+dnl fi
unset LIBSDL2_CONFIG;
fi
if test "x$LIBSDL_CONFIG" = "xno"; then
@@ -1456,6 +1477,7 @@ if test x$fim_want_readline = xno; then
fim_cv_history=no;
fi
AM_CONDITIONAL(ENABLE_HISTORY, test x$fim_cv_history != xno)
+AM_CONDITIONAL(ENABLE_NO_HISTORY_TESTS, test x$fim_cv_history = xno) dnl allow disable of ENABLE_HISTORY without enabling else case
AH_TEMPLATE([FIM_NOHISTORY])
if test x$fim_cv_history != xyes; then
@@ -1828,7 +1850,7 @@ fim_cv_want_font_magnify_factor="$withval";
], [])
AM_CONDITIONAL(FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT, test x$fim_cv_want_custom_hardcoded_consolefont = xtrue )
dnl ==================
-AM_CONDITIONAL([HAVE_RUNNABLE_TESTS],[test x"$host_cpu" = x"$build_cpu" -a x"$host_os" = x"$build_os" ])
+AM_CONDITIONAL([HAVE_RUNNABLE_TESTS],[test x"$host_cpu" = x"$build_cpu" -a x"$host_os" = x"$build_os" -a x"$using_wasm" = x"no" ])
dnl ==================
dnl # /tmp/__FIM_TEMPORARY_FILE
AC_ARG_WITH(tmpfile, AS_HELP_STRING([--with-tmpfile=FILE],[Specify where to put temporary files created when interacting with external conversion programs.]),
@@ -2059,7 +2081,8 @@ dnl ==================
AH_TEMPLATE([FIM_WANT_MOUSE])
AC_ARG_ENABLE(mouse, AS_HELP_STRING([--enable-mouse],[Mouse support. (enabled by default)]), [ if test x$enableval = xyes; then fim_cv_want_mouse=1 ; else fim_cv_want_mouse=0 ; fi ],[ fim_cv_want_mouse=1 ])
AC_DEFINE_UNQUOTED([FIM_WANT_MOUSE], $fim_cv_want_mouse, [Scripting. (enabled by default)])
-AM_CONDITIONAL(ENABLE_MOUSE, test x$fim_cv_want_mouse = xyes)
+AM_CONDITIONAL(ENABLE_MOUSE, test x$fim_cv_want_mouse = x1)
+if test x$fim_cv_want_mouse = x1; then fim_cv_want_mouse=yes ; else fim_cv_want_mouse=no ; fi
dnl ==================
AH_TEMPLATE([FIM_WANT_NOSCRIPTING])
AC_ARG_ENABLE(scripting, AS_HELP_STRING([--enable-scripting],[Scripting. (enabled by default)]), [ if test x$enableval = xyes; then fim_cv_want_noscripting=0 ; else fim_cv_want_noscripting=1 ; fi ],[ fim_cv_want_noscripting=0 ])
@@ -2217,7 +2240,7 @@ AC_DEFINE([HAVE_MATRIX_MARKET_DECODER])
])
AM_CONDITIONAL(ENABLE_MATRIX_MARKET_DECODER, test x$ac_cv_func_rsb_lib_init = xyes -a x$want_matrices_rendering = xyes)
dnl ###############################################################################
-AM_CONDITIONAL(WANT_WASM, test x$CC = x'emcc' -a x$CXX = x'em++')
+AM_CONDITIONAL(WANT_WASM, test x"$using_wasm" != x"no")
dnl ###############################################################################
AC_CACHE_CHECK([if you have c++11 ...], [have_cv_cxx11], AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#if __cplusplus<201103L
@@ -2316,7 +2339,7 @@ dnl
dnl
framebuffer (built-in) support : ${fim_handle_framebuffer:-yes}
SDL (sdllib) support (-o sdl) : ${fim_handle_sdl}
- GTK (GTK3) support (-o gtk) :*${fim_handle_gtk}
+ GTK (GTK3) support (-o gtk) : ${fim_handle_gtk}
ASCII art (aalib) support (-o aa) : ${fim_cv_aalib}
Colour ASCII art (libcaca) support : ${fim_cv_libcaca}
dnl X (Imlib2) support(-o imlib2):*${fim_handle_imlib2:-no}
diff --git a/debian/changelog b/debian/changelog
index 3121535..3ad2bd2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+fim (0.7.1-1) unstable; urgency=medium
+
+ * New upstream version 0.7.1
+ * d/p/disable-readline-tests.patch: Refresh for new upstream version
+ * Drop patches (applied upstream):
+ + d/p/gtk-32bit-string-size-type.patch
+ + d/p/fim-exe-version-sh.patch
+ + d/p/hardening-flags.patch
+
+ -- Rafael Laboissière <rafael@debian.org> Mon, 20 May 2024 01:07:02 -0300
+
fim (0.7.0-11) unstable; urgency=medium
* d/clean: Remove leftover file .fim_history
diff --git a/debian/patches/disable-readline-tests.patch b/debian/patches/disable-readline-tests.patch
index f6117bb..2d7c23f 100644
--- a/debian/patches/disable-readline-tests.patch
+++ b/debian/patches/disable-readline-tests.patch
@@ -1,11 +1,11 @@
Description: Do not run unit tests that require readline
Author: Rafael Laboissière <rafael@debian.org>
-Forwarded: no
+Forwarded: not-needed
Last-Update: 2024-04-18
--- fim-0.7.0.orig/Makefile.am
+++ fim-0.7.0/Makefile.am
-@@ -166,12 +166,12 @@ endif
+@@ -167,12 +167,12 @@ endif
$(NO_ASAN) $(TIMEOUT_LARGE) \
$(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o aa=w $(FIMVIDEOTESTOPTS); \
fi
@@ -20,7 +20,7 @@ Last-Update: 2024-04-18
$(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o aa $(top_srcdir)/media/ -K :' 'ne' '' ' -K '' -Kq # completion_display_matches_hook
$(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o aa $(top_srcdir)/media/ -K :' 'n=x' '' ' -K '' -Kq # cover completion of variables
echo q | $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) -o aa $(top_srcdir)/media/ -K : # cover fim_rl_getc
-@@ -191,7 +191,7 @@ endif
+@@ -192,7 +192,7 @@ endif
$(NO_ASAN) $(TIMEOUT_LARGE) \
$(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o ca=w $(FIMVIDEOTESTOPTS); \
fi
@@ -29,7 +29,7 @@ Last-Update: 2024-04-18
if test -n "$(DISPLAY)"; then $(NO_ASAN) $(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o ca=w -C '_debug_commands="k"' -K:quit -K '' | grep pressed.key; fi # readline mode key verbosity
endif
@if test -n "$(DISPLAY)"; then make autodevtests; fi
-@@ -656,7 +656,7 @@ endif
+@@ -679,7 +679,7 @@ endif
$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* --// media/numbers_pcx/4.___ -c 'stdout _fileindex;if(_fileindex!=1){quit 255}quit'
$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/* --// media/numbers_pcx/4.pcx -c 'stdout _fileindex;if(_fileindex!=5){quit 255}quit'
endif
@@ -38,7 +38,7 @@ Last-Update: 2024-04-18
if ENABLE_PCX
test "`$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ -K /pcx -K q -F 'stdout _fileindex'`" -lt "`$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media/numbers_pcx/ -K /pcx -K .q -F 'stdout _fileindex'`" # 2 -lt 3 (. after / does repeat action)
endif
-@@ -748,11 +748,11 @@ else
+@@ -771,11 +771,11 @@ else
endif
test `$(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb -X --etc-fimrc $(top_srcdir)/scripts/example/set_var.fim -c 'stdout variable;quit' $(SNTZ)` = '0' # note: --no-rc-file and --etc-fimrc are incompatible
$(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb -X --no-internal-config -c 'width;quit !(i:width == 0)'
@@ -51,8 +51,8 @@ Last-Update: 2024-04-18
+if ENABLE_HISTORY_TEST_DISABLED_FOR_DEBIAN
$(FIM_EXE) $(FIMNORCOPTS) $(top_srcdir)/media/ -o dumb --no-history --no-history-load --no-history-save -kq # FIXME: bogus test
rm -f .fim_history && HOME=`pwd` $(FIM_EXE) -N --no-etc-fimrc-file $(top_srcdir)/media/ -o dumb -C 'next;next' -c quit && grep -q '^next;next' .fim_history && rm .fim_history # note: history file may contain spaces newlines etc
- else
-@@ -853,7 +853,7 @@ endif
+ endif
+@@ -879,7 +879,7 @@ endif
test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c "bind 'F1' 'stdout 1';_max_iterated_commands=2;" -k 10F1 -k q | tr -d '\n' $(SNTZ)` = 11 # test binding repeat and F1 binding
test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c "bind 'F1' 'stdout 1';_max_iterated_commands=1;" -k 10F1 -k q | tr -d '\n' $(SNTZ)` = 1 # test binding repeat and F1 binding
test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c "bind 'F1' 'stdout 1';_max_iterated_commands=0;" -k 10F1 -k q | tr -d '\n' $(SNTZ)` = 1111111111 # test binding repeat and F1 binding
@@ -61,7 +61,7 @@ Last-Update: 2024-04-18
if ENABLE_GIF
cp -p $(top_srcdir)/media/icon_smile.gif $(top_srcdir)/media/icon_smile.pgm
cp -p $(top_srcdir)/media/icon_smile.gif $(top_srcdir)/media/icon_smile.ppm
-@@ -880,7 +880,7 @@ if ENABLE_GIF
+@@ -906,7 +906,7 @@ if ENABLE_GIF
endif
test "`$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c 'stderr; stdout; quit' 2>&1 > /dev/null | grep echo`" = "echo command" # stdout vs stderr
test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb $(top_srcdir)/media -c 'stderr "out:due";stdout "out:uno";quit' 2>&1 > /dev/null | grep out $(SNTZ)` = "out:due" # stdout vs stderr
@@ -72,7 +72,7 @@ Last-Update: 2024-04-18
test `$(FIM_EXE) $(FIMNORCOPTS) -o dumb -c 'set; stdout _last_cmd_output; quit' | wc -w` -ge 50 # test set
--- fim-0.7.0.orig/configure.ac
+++ fim-0.7.0/configure.ac
-@@ -660,6 +660,8 @@ if test x$have_readline = xyes; then
+@@ -677,6 +677,8 @@ if test x$have_readline = xyes; then
fi
fi
AM_CONDITIONAL(WANT_READLINE, test x$have_readline = xyes)
diff --git a/debian/patches/fim-exe-version-sh.patch b/debian/patches/fim-exe-version-sh.patch
deleted file mode 100644
index f66a2a4..0000000
--- a/debian/patches/fim-exe-version-sh.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Description: Allow setting of fim exectuable via FIM_EXE variable
-Author: Rafael Laboissière <rafael@debian.org>
-Forwarded: no
-Last-Update: 2024-04-19
-
---- fim-0.7.0.orig/scripts/tests/version.sh
-+++ fim-0.7.0/scripts/tests/version.sh
-@@ -3,7 +3,7 @@
- # tests the -V switch in fim
- # TODO : should be integrated in the vim-like test suite.
-
--f=src/fim
-+f=${FIM_EXE-src/fim}
-
- fail()
- {
diff --git a/debian/patches/gtk-32bit-string-size-type.patch b/debian/patches/gtk-32bit-string-size-type.patch
deleted file mode 100644
index 267fa88..0000000
--- a/debian/patches/gtk-32bit-string-size-type.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-Description: Fix FTBFS on armel, armhf, and i386 (type size mismatch)
-Author: Michele Martone <michelemartone@users.sourceforge.net>
-Forwarded: no
-Reviewed-By: Rafael Laboissière <rafael@debian.org>
-Last-Update: 2024-04-19
-
---- fim-0.7.0.orig/src/GTKDevice.cpp
-+++ fim-0.7.0/src/GTKDevice.cpp
-@@ -713,7 +713,7 @@ void do_rebuild_help_aliases_menu(GtkWid
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(aliaMi), aliaMenu_),
- gtk_widget_set_tooltip_text(aliaMi, verbose_specs_?s:"" );
-
-- for (auto a0 = 0UL, a1 = aliases_.find(' '); a0 < a1 && a1!=std::string::npos ; a0 = a1+1, a1 = aliases_.find(' ',a1+1) )
-+ for (decltype(aliases_.find(' ')) a0 = 0UL, a1 = aliases_.find(' '); a0 < a1 && a1!=std::string::npos ; a0 = a1+1, a1 = aliases_.find(' ',a1+1) )
- {
- const auto alias = aliases_.substr(a0,a1-a0);
- GtkWidget * const aliMi = gtk_menu_item_new_with_label(alias.c_str());
-@@ -744,7 +744,7 @@ void do_rebuild_help_variables_menu(GtkW
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(varsMi), varsMenu_),
- gtk_widget_set_tooltip_text(varsMi, verbose_specs_?s:"" );
-
-- for (auto v0 = 0UL, v1 = variables_.find(' '); v0 < v1 && v1!=std::string::npos ; v0 = v1+1, v1 = variables_.find(' ',v1+1) )
-+ for (decltype(variables_.find(' ')) v0 = 0UL, v1 = variables_.find(' '); v0 < v1 && v1!=std::string::npos ; v0 = v1+1, v1 = variables_.find(' ',v1+1) )
- {
- const auto var = variables_.substr(v0,v1-v0);
- //void * vp = (void*) (variables_.c_str()+v0);
-@@ -779,7 +779,7 @@ void do_rebuild_help_commands_menu(GtkWi
- gtk_widget_set_tooltip_text(cmdsMi, verbose_specs_?s:"" );
-
-
-- for (auto c0 = 0UL, c1 = commands_.find(' '); c0 < c1 && c1!=std::string::npos ; c0 = c1+1, c1 = commands_.find(' ',c1+1) )
-+ for (decltype(commands_.find(' ')) c0 = 0UL, c1 = commands_.find(' '); c0 < c1 && c1!=std::string::npos ; c0 = c1+1, c1 = commands_.find(' ',c1+1) )
- {
- const auto cmd = commands_.substr(c0,c1-c0);
- //void * cp = (void*) (commands_.c_str()+c0);
diff --git a/debian/patches/hardening-flags.patch b/debian/patches/hardening-flags.patch
deleted file mode 100644
index 102382a..0000000
--- a/debian/patches/hardening-flags.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-Description: <short summary of the patch>
- TODO: Put a short summary on the line above and replace this paragraph
- with a longer explanation of this change. Complete the meta-information
- with other relevant fields (see below for details). To make it easier, the
- information below has been extracted from the changelog. Adjust it or drop
- it.
- .
- fim (0.7.0-10) unstable; urgency=medium
- .
- * d/t/control: Add package's build-dependencies as dependencies for
- the tests
-Author: Rafael Laboissière <rafael@debian.org>
-
----
-The information above should follow the Patch Tagging Guidelines, please
-checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
-are templates for supplementary fields that you might want to add:
-
-Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
-Bug: <upstream-bugtracker-url>
-Bug-Debian: https://bugs.debian.org/<bugnumber>
-Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
-Forwarded: (no|not-needed|<patch-forwarded-url>)
-Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
-Reviewed-By: <name and email of someone who approved/reviewed the patch>
-Last-Update: 2024-04-20
-
---- fim-0.7.0.orig/doc/Makefile.am
-+++ fim-0.7.0/doc/Makefile.am
-@@ -55,7 +55,7 @@ fimgs.man.html: fimgs.man
- if test ! -s $@ ; then $(MAN2TXT) ./$< > $<.txt && $(srcdir)/vim2html.pl tags $<.txt && mv $<.txt.html $@ ; fi
-
- doctags$(EXEEXT): doctags.c
-- $(CC) -o $@ $<
-+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $<
-
- #clean:
- # $(RM) -f doctags.o doctags$(EXEEXT) FIM.html tags fim-stylesheet.css fim.man.html fimgs.man.html
---- fim-0.7.0.orig/src/Makefile.am
-+++ fim-0.7.0/src/Makefile.am
-@@ -71,7 +71,7 @@ help-acm.cpp: fim.h
- $(ECHO) '//#endif' >> $@
-
- b2ba$(EXEEXT): b2ba.c
-- $(CC) -o $@ $<
-+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $<
-
- if !WANT_WASM
- if HAVE_RUNNABLE_TESTS
diff --git a/debian/patches/series b/debian/patches/series
index c73ba3e..4075ecf 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1 @@
disable-readline-tests.patch
-gtk-32bit-string-size-type.patch
-fim-exe-version-sh.patch
-hardening-flags.patch
diff --git a/distros/Makefile.in b/distros/Makefile.in
index 238dca9..c0cc0ca 100644
--- a/distros/Makefile.in
+++ b/distros/Makefile.in
@@ -236,6 +236,7 @@ HAVE_CPP = @HAVE_CPP@
HAVE_ECHO = @HAVE_ECHO@
HAVE_FLEX = @HAVE_FLEX@
HAVE_GREP = @HAVE_GREP@
+HAVE_GROFF = @HAVE_GROFF@
HAVE_MAN = @HAVE_MAN@
HAVE_RM = @HAVE_RM@
HAVE_SED = @HAVE_SED@
diff --git a/doc/FIM.TXT b/doc/FIM.TXT
index f4a43d2..ed0a2ef 100644
--- a/doc/FIM.TXT
+++ b/doc/FIM.TXT
@@ -1,6 +1,6 @@
------------------------------------------------------------------------------
*FIM.TXT* Tutorial & Miscellaneous documentation for Fim
- last updated $Date: 2023-04-15 00:54:24 +0200 (Sat, 15 Apr 2023) $
+ last updated $Date: 2024-05-10 00:24:27 +0200 (Fri, 10 May 2024) $
Fim - tutorial & misc documentation
@@ -1413,7 +1413,7 @@ See 'man fimrc' for a reference.
==============================================================================
12.FAQs *faq*
- Q: We are in $Date: 2023-04-15 00:54:24 +0200 (Sat, 15 Apr 2023) $,
+ Q: We are in $Date: 2024-05-10 00:24:27 +0200 (Fri, 10 May 2024) $,
so why do you still use the framebuffer, uh ?
A: De gustibus non disputandum est.
Well, actually I do not use it so often anymore.
@@ -1487,6 +1487,20 @@ See 'man fimrc' for a reference.
A: Currently no. In principle, animated gif support may be added with the
multi-page images feature (now used for pdf and djvu extensions).
+ Q: Will you support opening video files ?
+ A: If so, then perhaps in a way similar to gif files.
+
+ Q: Will you support editing image metadata ?
+ A: Not in the plans.
+
+ Q: Why I see so scary error messages in `make tests` ?
+ A: Those are tests for error conditions -- be happy these are detected and
+ reported.
+
+ Q: There's a tarball in the downloads archive -- it keeps changing.
+ A: You must be referring to the archive reflecting the development branch.
+ It's meant to change, so do not count for its checksum to be stable.
+
==============================================================================
13.License *license*
diff --git a/doc/FIM.html b/doc/FIM.html
index c1d6b6b..0892b5e 100644
--- a/doc/FIM.html
+++ b/doc/FIM.html
@@ -8,7 +8,7 @@
<h2>FIM</h2>
<pre>
</pre><hr><pre><b class="vimtag">*<a name="FIM.TXT">FIM.TXT</a>*</b> Tutorial &amp; Miscellaneous documentation for Fim
- last updated $Date: 2023-04-15 00:54:24 +0200 (Sat, 15 Apr 2023) $
+ last updated $Date: 2024-05-10 00:24:27 +0200 (Fri, 10 May 2024) $
Fim - tutorial &amp; misc documentation
@@ -1390,7 +1390,7 @@ See 'man fimrc' for a reference.
</pre><hr><pre>12.FAQs <b class="vimtag">*<a name="faq">faq</a>*</b>
- Q: We are in $Date: 2023-04-15 00:54:24 +0200 (Sat, 15 Apr 2023) $,
+ Q: We are in $Date: 2024-05-10 00:24:27 +0200 (Fri, 10 May 2024) $,
so why do you still use the framebuffer, uh ?
A: De gustibus non disputandum est.
Well, actually I do not use it so often anymore.
@@ -1464,6 +1464,20 @@ See 'man fimrc' for a reference.
A: Currently no. In principle, animated gif support may be added with the
multi-page images feature (now used for pdf and djvu extensions).
+ Q: Will you support opening video files ?
+ A: If so, then perhaps in a way similar to gif files.
+
+ Q: Will you support editing image metadata ?
+ A: Not in the plans.
+
+ Q: Why I see so scary error messages in `make tests` ?
+ A: Those are tests for error conditions -- be happy these are detected and
+ reported.
+
+ Q: There's a tarball in the downloads archive -- it keeps changing.
+ A: You must be referring to the archive reflecting the development branch.
+ It's meant to change, so do not count for its checksum to be stable.
+
</pre><hr><pre>13.License <b class="vimtag">*<a name="license">license</a>*</b>
Fim is free software, licensed under the GPLv2, also known as GNU General
@@ -1474,6 +1488,6 @@ This is stated too in each source file preamble.
</pre><hr><pre>
vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl:
</pre>
-<p><i>Generated by vim2html on 2024-04-09</i></p>
+<p><i>Generated by vim2html on 2024-05-11</i></p>
</body>
</html>
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 5f7e2fa..63a4458 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,21 +1,35 @@
-# $LastChangedDate: 2024-03-08 21:18:58 +0100 (Fri, 08 Mar 2024) $
+# $LastChangedDate: 2024-05-01 01:20:20 +0200 (Wed, 01 May 2024) $
#
HTMLDOCS=
if WITH_PERL
HTMLDOCS+=FIM.html
endif
+if WITH_GROFF
+HTMLDOCS+=fim.man.html fimgs.man.html fimrc.man.html
+else
if WITH_MAN2HTML
-if WITH_PERL
HTMLDOCS+=fim.man.html fimgs.man.html fimrc.man.html
+else
+if WITH_MAN
+HTMLDOCS+=fim.man.html fimgs.man.html fimrc.man.html
+endif
endif
endif
CLEANFILES= doctags$(EXEEXT) *.o tags $(HTMLDOCS)
EXTRA_DIST = FIM.TXT fim.man doctags.c fim-stylesheet.css ./vim2html.pl fimgs.man fimrc.man fim.man.in fimgs.man.in fimrc.man.in
-#MAN2HTML=man2html
-#MAN2HTML=$(MAN) --html=cat
+if WITH_GROFF
MAN2HTML=groff -Thtml -man
+else
+if WITH_MAN2HTML
+MAN2HTML=man2html
+else
+if WITH_MAN
+MAN2HTML=$(MAN) --html=cat
+endif
+endif
+endif
MAN2HTMLS = sed 's/&minus;/-/g'
MAN2TXT=$(MAN) --ascii # when having e.g. a minimal groff installation
@@ -55,7 +69,7 @@ fimgs.man.html: fimgs.man
if test ! -s $@ ; then $(MAN2TXT) ./$< > $<.txt && $(srcdir)/vim2html.pl tags $<.txt && mv $<.txt.html $@ ; fi
doctags$(EXEEXT): doctags.c
- $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $<
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $<
#clean:
# $(RM) -f doctags.o doctags$(EXEEXT) FIM.html tags fim-stylesheet.css fim.man.html fimgs.man.html
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 9f6ab97..fcbfb91 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -87,7 +87,9 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
@WITH_PERL_TRUE@am__append_1 = FIM.html
-@WITH_MAN2HTML_TRUE@@WITH_PERL_TRUE@am__append_2 = fim.man.html fimgs.man.html fimrc.man.html
+@WITH_GROFF_TRUE@am__append_2 = fim.man.html fimgs.man.html fimrc.man.html
+@WITH_GROFF_FALSE@@WITH_MAN2HTML_TRUE@am__append_3 = fim.man.html fimgs.man.html fimrc.man.html
+@WITH_GROFF_FALSE@@WITH_MAN2HTML_FALSE@@WITH_MAN_TRUE@am__append_4 = fim.man.html fimgs.man.html fimrc.man.html
subdir = doc
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
@@ -205,6 +207,7 @@ HAVE_CPP = @HAVE_CPP@
HAVE_ECHO = @HAVE_ECHO@
HAVE_FLEX = @HAVE_FLEX@
HAVE_GREP = @HAVE_GREP@
+HAVE_GROFF = @HAVE_GROFF@
HAVE_MAN = @HAVE_MAN@
HAVE_RM = @HAVE_RM@
HAVE_SED = @HAVE_SED@
@@ -331,14 +334,15 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-# $LastChangedDate: 2024-03-08 21:18:58 +0100 (Fri, 08 Mar 2024) $
+# $LastChangedDate: 2024-05-01 01:20:20 +0200 (Wed, 01 May 2024) $
#
-HTMLDOCS = $(am__append_1) $(am__append_2)
+HTMLDOCS = $(am__append_1) $(am__append_2) $(am__append_3) \
+ $(am__append_4)
CLEANFILES = doctags$(EXEEXT) *.o tags $(HTMLDOCS)
EXTRA_DIST = FIM.TXT fim.man doctags.c fim-stylesheet.css ./vim2html.pl fimgs.man fimrc.man fim.man.in fimgs.man.in fimrc.man.in
-#MAN2HTML=man2html
-#MAN2HTML=$(MAN) --html=cat
-MAN2HTML = groff -Thtml -man
+@WITH_GROFF_FALSE@@WITH_MAN2HTML_FALSE@@WITH_MAN_TRUE@MAN2HTML = $(MAN) --html=cat
+@WITH_GROFF_FALSE@@WITH_MAN2HTML_TRUE@MAN2HTML = man2html
+@WITH_GROFF_TRUE@MAN2HTML = groff -Thtml -man
MAN2HTMLS = sed 's/&minus;/-/g'
MAN2TXT = $(MAN) --ascii # when having e.g. a minimal groff installation
man1_MANS = fim.man fimgs.man
@@ -696,7 +700,7 @@ fimgs.man.html: fimgs.man
if test ! -s $@ ; then $(MAN2TXT) ./$< > $<.txt && $(srcdir)/vim2html.pl tags $<.txt && mv $<.txt.html $@ ; fi
doctags$(EXEEXT): doctags.c
- $(CC) -o $@ $<
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $<
#clean:
# $(RM) -f doctags.o doctags$(EXEEXT) FIM.html tags fim-stylesheet.css fim.man.html fimgs.man.html
diff --git a/doc/fim.man b/doc/fim.man
index 9f7509b..09c01c6 100644
--- a/doc/fim.man
+++ b/doc/fim.man
@@ -218,8 +218,9 @@ The \fBfb\fP option selects the Linux framebuffer. Presence of \fR\fI{gfxopts}\f
The \fBca\fP option (coloured ASCII\-art) can be specified as \fBca\fP\fB[={['w']['h']['H']['d:'DITHERMODE]}] \fP; if supplied, \fB'w'\fP selects windowed mode, provided libcaca is running under X; by default (or with \fB'W'\fP), windowed mode is being turned off internally during initialization by unsetting the DISPLAY environment variable. If \fB'd:'\fP is present, the \fBDITHERMODE\fP following it will be passed as dither algorithm string (alternatively, it can be a non\-negative number, too).
The \fBaa\fP (monochrome ASCII\-art) option can be specified as \fBaa[={['w'|'W']}]\fP; if supplied, \fB'w'\fP selects windowed mode, provided aalib is running under X; by default (or with \fB'W'\fP), windowed mode is being turned off internally during initialization by unsetting the DISPLAY environment variable.
Please note that the readline (internal command line) functionality in \fBca\fP and \fBaa\fP modes is limited.
-If the graphical windowed mode is \fBsdl\fP it can be followed by \fB \:={['w']['m']['r']['h']['W']['M']['R']['H'][width[:height]]['%']}\fP, where \fBwidth\fP and \fBheight\fP are integer numbers specifying the desired resolution (if \fBheight\fP not specified, it takes the value of \fBwidth\fP); the \fB'w'\fP character requests windowed mode (instead of \fB'W'\fP for fullscreen); the \fB'm'\fP character requests mouse pointer display; the \fB'h'\fP character requests help grid map draw (can be repeated for variants); the \fB'r'\fP character requests support for window resize; the \fB'%'\fP character requests to treat \fBwidth\fP and \fBheight\fP as percentage of possible window resolution. The same letters uppercase request explicit negation of the mentioned features.
-Additionally, in \fBgtk\fP mode: \fB'b'\fP hides the menu bar, \fB'e'\fP starts with empty menus, \fB'f'\fP rebuilds the menus, and \fB'D'\fP removes the menus. \fBWarning\fP: the \fBgtk\fP mode is still work in progress. The \fBimlib2\fP option requests imlib2 and is unfinished: do not use it.
+If the graphical windowed mode is \fBsdl\fP or \fBgtk\fP it can be followed by \fB \:={['w']['m']['r']['h']['W']['M']['R']['H'][width[:height]]['%']}\fP, where \fBwidth\fP and \fBheight\fP are integer numbers specifying the desired resolution (if \fBheight\fP not specified, it takes the value of \fBwidth\fP); the \fB'w'\fP character requests windowed mode (instead of \fB'W'\fP for fullscreen); the \fB'm'\fP character requests mouse pointer display; the \fB'h'\fP character requests help grid map draw (can be repeated for variants); the \fB'r'\fP character requests support for window resize; the \fB'%'\fP character requests to treat \fBwidth\fP and \fBheight\fP as percentage of possible window resolution. The same letters uppercase request explicit negation of the mentioned features.
+Additionally, in \fBgtk\fP mode: \fB'b'\fP hides the menu bar, \fB'e'\fP starts with empty menus, \fB'f'\fP rebuilds the menus, and \fB'D'\fP removes the menus. \fBNote\fP: the \fBgtk\fP mode is a recent addition and may have defects. The \fBsdl\fP mode works best with libsdl\-2; libsdl\-1.2 support is being discontinued.
+ The \fBimlib2\fP option requests imlib2 and is unfinished: do not use it.
The \fBdumb\fP test mode is there only for test purposes and is not interactive.
.TP
@@ -586,7 +587,7 @@ The system\-wide \fBfim\fP initialization file (executed at startup, after execu
The personal \fBfim\fP initialization file (executed at startup, after the system\-wide initialization file).
.TP 15
.B ~/.fim_history
-File where to load from or save. See (man \fR\fIfimrc\fR(5), man \fR\fIreadline\fR(3)).
+File where to load from or save command history. See (man \fR\fIfimrc\fR(5), man \fR\fIreadline\fR(3)).
.TP 15
.B ~/.inputrc
If \fBfim\fP is built with GNU readline support, it is susceptible to changes in the user set ~/.inputrc configuration file contents. For details, see (man \fR\fIreadline\fR(3)).
diff --git a/doc/fim.man.html b/doc/fim.man.html
index a570dff..e425166 100644
--- a/doc/fim.man.html
+++ b/doc/fim.man.html
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.4 -->
-<!-- CreationDate: Tue Apr 9 19:09:58 2024 -->
+<!-- CreationDate: Sun May 19 12:02:42 2024 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -520,7 +520,7 @@ internally during initialization by unsetting the DISPLAY
environment variable. Please note that the readline
(internal command line) functionality in <b>ca</b> and
<b>aa</b> modes is limited. If the graphical windowed mode
-is <b>sdl</b> it can be followed by
+is <b>sdl</b> or <b>gtk</b> it can be followed by
<b>={[&rsquo;w&rsquo;][&rsquo;m&rsquo;][&rsquo;r&rsquo;][&rsquo;h&rsquo;][&rsquo;W&rsquo;][&rsquo;M&rsquo;][&rsquo;R&rsquo;][&rsquo;H&rsquo;][width[:height]][&rsquo;%&rsquo;]}</b>,
where <b>width</b> and <b>height</b> are integer numbers
specifying the desired resolution (if <b>height</b> not
@@ -538,10 +538,12 @@ request explicit negation of the mentioned features.
Additionally, in <b>gtk</b> mode: <b>&rsquo;b&rsquo;</b>
hides the menu bar, <b>&rsquo;e&rsquo;</b> starts with empty
menus, <b>&rsquo;f&rsquo;</b> rebuilds the menus, and
-<b>&rsquo;D&rsquo;</b> removes the menus. <b>Warning</b>:
-the <b>gtk</b> mode is still work in progress. The
-<b>imlib2</b> option requests imlib2 and is unfinished: do
-not use it. <br>
+<b>&rsquo;D&rsquo;</b> removes the menus. <b>Note</b>: the
+<b>gtk</b> mode is a recent addition and may have defects.
+The <b>sdl</b> mode works best with libsdl-2; libsdl-1.2
+support is being discontinued. <br>
+The <b>imlib2</b> option requests imlib2 and is unfinished:
+do not use it. <br>
The <b>dumb</b> test mode is there only for test purposes
and is not interactive.</p>
@@ -1402,8 +1404,8 @@ startup, after the system-wide initialization file).</p></td></tr>
<td width="66%">
-<p>File where to load from or save. See (man
-<i>fimrc</i>(5), man <i>readline</i>(3)).</p></td></tr>
+<p>File where to load from or save command history. See
+(man <i>fimrc</i>(5), man <i>readline</i>(3)).</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="21%">
diff --git a/doc/fim.man.in b/doc/fim.man.in
index 9cf04fe..4f7b6bf 100644
--- a/doc/fim.man.in
+++ b/doc/fim.man.in
@@ -218,8 +218,9 @@ The \fBfb\fP option selects the Linux framebuffer. Presence of \fR\fI{gfxopts}\f
The \fBca\fP option (coloured ASCII-art) can be specified as \fBca\fP\fB[={['w']['h']['H']['d:'DITHERMODE]}] \fP; if supplied, \fB'w'\fP selects windowed mode, provided libcaca is running under X; by default (or with \fB'W'\fP), windowed mode is being turned off internally during initialization by unsetting the DISPLAY environment variable. If \fB'd:'\fP is present, the \fBDITHERMODE\fP following it will be passed as dither algorithm string (alternatively, it can be a non-negative number, too).
The \fBaa\fP (monochrome ASCII-art) option can be specified as \fBaa[={['w'|'W']}]\fP; if supplied, \fB'w'\fP selects windowed mode, provided aalib is running under X; by default (or with \fB'W'\fP), windowed mode is being turned off internally during initialization by unsetting the DISPLAY environment variable.
Please note that the readline (internal command line) functionality in \fBca\fP and \fBaa\fP modes is limited.
-If the graphical windowed mode is \fBsdl\fP it can be followed by \fB \:={['w']['m']['r']['h']['W']['M']['R']['H'][width[:height]]['%']}\fP, where \fBwidth\fP and \fBheight\fP are integer numbers specifying the desired resolution (if \fBheight\fP not specified, it takes the value of \fBwidth\fP); the \fB'w'\fP character requests windowed mode (instead of \fB'W'\fP for fullscreen); the \fB'm'\fP character requests mouse pointer display; the \fB'h'\fP character requests help grid map draw (can be repeated for variants); the \fB'r'\fP character requests support for window resize; the \fB'%'\fP character requests to treat \fBwidth\fP and \fBheight\fP as percentage of possible window resolution. The same letters uppercase request explicit negation of the mentioned features.
-Additionally, in \fBgtk\fP mode: \fB'b'\fP hides the menu bar, \fB'e'\fP starts with empty menus, \fB'f'\fP rebuilds the menus, and \fB'D'\fP removes the menus. \fBWarning\fP: the \fBgtk\fP mode is still work in progress. The \fBimlib2\fP option requests imlib2 and is unfinished: do not use it.
+If the graphical windowed mode is \fBsdl\fP or \fBgtk\fP it can be followed by \fB \:={['w']['m']['r']['h']['W']['M']['R']['H'][width[:height]]['%']}\fP, where \fBwidth\fP and \fBheight\fP are integer numbers specifying the desired resolution (if \fBheight\fP not specified, it takes the value of \fBwidth\fP); the \fB'w'\fP character requests windowed mode (instead of \fB'W'\fP for fullscreen); the \fB'm'\fP character requests mouse pointer display; the \fB'h'\fP character requests help grid map draw (can be repeated for variants); the \fB'r'\fP character requests support for window resize; the \fB'%'\fP character requests to treat \fBwidth\fP and \fBheight\fP as percentage of possible window resolution. The same letters uppercase request explicit negation of the mentioned features.
+Additionally, in \fBgtk\fP mode: \fB'b'\fP hides the menu bar, \fB'e'\fP starts with empty menus, \fB'f'\fP rebuilds the menus, and \fB'D'\fP removes the menus. \fBNote\fP: the \fBgtk\fP mode is a recent addition and may have defects. The \fBsdl\fP mode works best with libsdl-2; libsdl-1.2 support is being discontinued.
+ The \fBimlib2\fP option requests imlib2 and is unfinished: do not use it.
The \fBdumb\fP test mode is there only for test purposes and is not interactive.
.TP
@@ -586,7 +587,7 @@ The system-wide \fBfim\fP initialization file (executed at startup, after execut
The personal \fBfim\fP initialization file (executed at startup, after the system-wide initialization file).
.TP 15
.B ~/.fim_history
-File where to load from or save. See (man \fR\fIfimrc\fR(5), man \fR\fIreadline\fR(3)).
+File where to load from or save command history. See (man \fR\fIfimrc\fR(5), man \fR\fIreadline\fR(3)).
.TP 15
.B ~/.inputrc
If \fBfim\fP is built with GNU readline support, it is susceptible to changes in the user set ~/.inputrc configuration file contents. For details, see (man \fR\fIreadline\fR(3)).
diff --git a/doc/fimgs.man.html b/doc/fimgs.man.html
index 809fd2a..c547f33 100644
--- a/doc/fimgs.man.html
+++ b/doc/fimgs.man.html
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.4 -->
-<!-- CreationDate: Tue Apr 9 19:09:58 2024 -->
+<!-- CreationDate: Sun May 19 12:02:42 2024 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
diff --git a/doc/fimrc.man b/doc/fimrc.man
index bf6b85c..d8b24d3 100644
--- a/doc/fimrc.man
+++ b/doc/fimrc.man
@@ -34,6 +34,9 @@ fimrc \- \fB fim \fP configuration file and language reference
.B fim
\-\-chars\-press :\fR\fI{commands}\fR \-\-chars\-press '' [ \fR\fI{options}\fR ]
.br
+.B fim
+\-\-keysym\-press \fR\fI{keysym}\fR [ \fR\fI{options}\fR ]
+.br
.SH DESCRIPTION
This page explains the
@@ -237,13 +240,15 @@ basename \fR\fI{filename}\fR: returns the basename of \fR\fI{filename}\fR in the
.B
bind
.fi
-bind [\fR\fI{keysym}\fR [\fR\fI{commands}\fR]]: bind a keyboard symbol/shortcut \fR\fI{keysym}\fR to \fR\fI{commands}\fR.
+bind [\fR\fI{keysym}\fR [\fR\fI{commands}\fR [\fR\fI{description}\fR]]]: bind a key \fR\fI{keysym}\fR to \fR\fI{commands}\fR.
+.fi
+Optional \fR\fI{description}\fR specifies a documentation string.
.fi
If \fR\fI{keysym}\fR is at least two characters long and begins with 0 (zero), the integer number after the 0 will be treated as a raw keycode to bind the specified \fR\fI{keysym}\fR to.
.fi
Use the '_verbose_keys' variable to discover (display device dependent) raw keys.
.fi
-Key binding is dynamical, so you can rebind keys even during program's execution.
+Key binding is dynamical, so you can bind keys even during program's execution.
.fi
You can get a list of valid symbols (keysyms) by invoking dump_key_codes or in the man page.
.fi
@@ -367,7 +372,7 @@ echo \fR\fI{args}\fR: print the \fR\fI{args}\fR on console.
.B
else
.fi
-if(\fR\fIexpression\fR){\fR\fIaction\fR;}['else'{\fR\fIaction\fR;}]: see else.
+if(\fR\fIexpression\fR){\fR\fIaction\fR;}['else'{\fR\fIaction\fR;}]: see if.
.fi
.na
@@ -392,7 +397,7 @@ font 'scan' [\fR\fI{dirname}\fR]: scan \fR\fI{dirname}\fR or /usr/share/consolef
.fi
font 'load' \fR\fI{filename}\fR: load font \fR\fI{filename}\fR.
.fi
-font 'next'/'prev': load next/previous font in the internal fonts list.
+font {'next'|'prev'}: load next or previous font from the internal fonts list.
.fi
font 'info': print current font filename.
.fi
@@ -449,7 +454,7 @@ help [\fR\fI{identifier}\fR]: provide online help, assuming \fR\fI{identifier}\f
.fi
If \fR\fI{identifier}\fR begins with '/', search on the help contents, and show a list of matching items.
.fi
-A list of commands can be obtained simply invoking 'commands'; a list of aliases with 'alias'; a list of bindings with 'bind'.
+A list of commands can be obtained simply invoking 'commands'; a list of aliases with 'alias'; a list of bindings with 'bind'; a list of variables with 'variables'.
.fi
.na
@@ -731,21 +736,21 @@ set: returns a list of variables which are set.
.fi
set \fR\fI{identifier}\fR: returns the value of variable \fR\fI{identifier}\fR.
.fi
-set \fR\fI{identifier}\fR \fR\fI{commands}\fR: sets variable \fR\fI{identifier}\fR to value \fR\fI{commands}\fR.
+set \fR\fI{identifier}\fR \fR\fI{value}\fR: sets variable \fR\fI{identifier}\fR to value \fR\fI{value}\fR.
.fi
.na
.B
set_commandline_mode
.fi
-set_commandline_mode: set console mode.
+set_commandline_mode: set console mode. Note that the mode will change only after the current block of commands is evaluated.
.fi
.na
.B
set_interactive_mode
.fi
-set_interactive_mode: set interactive mode.
+set_interactive_mode: set interactive mode. Note that the mode will change only after the current block of commands is evaluated.
.fi
.na
@@ -998,7 +1003,7 @@ _display_console
.na
.B
_display_status
-[in,g:] if 1, display display the status bar.
+[in,g:] if 1, display the status bar.
.fi
.na
.B
@@ -1123,7 +1128,7 @@ _ignorecase
.na
.B
_info_fmt_str
-[in,g:] custom info format string, displayed in the lower right corner of the status bar; may contain ordinary text and special 'expando' sequences. These are: %p for current scale, in percentage; %w for width; %h for height; %i for image index in list; %k for the value of i:_comment (comment description) variable in square brackets; %l for current image list length; %L for flip/mirror/orientation information; %P for page information; %F for file size; %M for screen image memory size; %m for memory used by mipmap; %C for memory used by cache; %T for total memory used (approximation); %R for total max memory used (as detected by getrusage()); %n for the current file path name; %N for the current file path name basename; ; %c for centering information; %v for the fim program/version identifier string; %% for an ordinary %. A sequence like %?VAR?EXP? expands to EXP if i:VAR is set (or, otherwise, if VAR); EXP is copied verbatim except for contained sequences of the form %:VAR:, which expand to the value of variable i:VAR (or, if unset, VAR); this is meant to be used like in e.g. '%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?', where the EXIF\-set variable EXIF_DateTimeOriginal (make sure you have libexif for this) are used only if present.
+[in,g:] custom info format string, displayed in the lower right corner of the status bar; may contain ordinary text and special 'expando' sequences. These are: %p for current scale, in percentage; %w for width; %h for height; %i for image index in list; %k for the value of i:_comment (comment description) variable in square brackets (if non empty); %l for current image list length; %L for flip/mirror/orientation information; %P for page information; %F for file size; %M for screen image memory size; %m for memory used by mipmap; %C for memory used by cache; %T for total memory used (approximation); %R for total max memory used (as detected by getrusage()); %n for the current file path name; %N for the current file path name basename; ; %c for centering information; %v for the fim program/version identifier string; %% for an ordinary %. A sequence like %?VAR?EXP? expands to EXP if i:VAR is set (or, otherwise, if VAR); EXP is copied verbatim except for contained sequences of the form %:VAR:, which expand to the value of variable i:VAR (or, if unset, VAR); this is meant to be used like in e.g. '%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?', where the EXIF\-set variable EXIF_DateTimeOriginal (make sure you have libexif for this) are used only if present.
.fi
.na
.B
@@ -1502,7 +1507,7 @@ Hardcoded aliases are:
alias
.B
"A"
-"'_autotop=1\-_autotop;'"
+"_autotop=1\-_autotop;"
.fi
alias
.B
@@ -1600,7 +1605,7 @@ Part of the default configuration comes from the \fB_fim_default_config_file_con
One can skip its loading by using the \fB_no_default_configuration\fP variable.
.nf
-# $LastChangedDate: 2024\-04\-02 15:34:32 +0200 (Tue, 02 Apr 2024) $
+# $LastChangedDate: 2024\-05\-15 01:34:42 +0200 (Wed, 15 May 2024) $
# Contents of the default 'fimrc' file, hardcoded in the fim executable.
# Read the documentation (man fimrc) to discover how to change this default hardcoded file and how to make your own.
# Note that usually a ~/.fimrc file is read after these options take effect, so you could reset all of this with ease.
@@ -1742,9 +1747,9 @@ autocmd "PreRedisplay" "" "i:_will_display=1";
autocmd "PreRedisplay" "" "if(_scale_style!='' && i:fresh){i:fresh=0;scale _scale_style ;i:fresh=0;}";
autocmd "PostRedisplay" "" "i:_will_display=0";
# Display device specific config
-alias "aalib_fix_do" "{if(aascale==''){ascale='2.0';}else{ascale=aascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'screen+aalib?expect binding problems!'}}" "See aalib_fix.";
+alias "aalib_fix_do" "{if(aascale==''){ascale='2.0';}else{ascale=aascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'Detected screen+aalib: key bindings may not work as intended.'}}" "See aalib_fix.";
alias "aalib_fix" "if(_device_string=~'^aa'){aalib_fix_do;scale 'a';}" "When using the aalib (ASCII art) library we face a problem: glyph proportions are seldom square (as pixels are), and are tricky to detect; for this reason, we need to reshape the image with respect to the font ratio, but we have to make a guess in the scaling factor to compensate. If at runtime a better value is known for the terminal font height/with ratio, it may be fed in the 'aascale' variable for an accurate scaling.";
-alias "cacalib_fix_do" "{if(cacascale==''){ascale='1.18';}else{scale=cacascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'screen+cacalib?expect binding problems!'}}" "See cacalib_fix.";
+alias "cacalib_fix_do" "{if(cacascale==''){ascale='1.18';}else{scale=cacascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'Detected screen+cacalib: key bindings may not work as intended.'}}" "See cacalib_fix.";
alias "cacalib_fix" "getenv 'DISPLAY';if(_device_string=~'^ca' && ENV_DISPLAY==''){cacalib_fix_do;scale 'a';}" "When using the libcaca (Coloured ASCII art) library we face a problem: glyph proportions are seldom square (as pixels are), and are tricky to detect; for this reason, we need to reshape the image with respect to the font ratio, but we have to make a guess in the scaling factor to compensate. If at runtime a better value is known for the terminal font height/with ratio, it may be fed in the 'cacascale' variable for an accurate scaling.";
autocmd "PostReload" "" "aalib_fix";
autocmd "PostLoad" "" "aalib_fix";
@@ -1768,10 +1773,10 @@ autocmd "PostInteractiveCommand" "" "if(_display_console==0 && i:fresh){redisp
autocmd "PostInteractiveCommand" "" "idempotent_cmd"; # Bug workaround: without it console scroll is broken.
autocmd "PostInteractiveCommand" "" "_gtk_check_for_toggle_gtk_menus;_gtk_check_for_toggle_fullscreen";
-alias "next10" "i=0;while(i<10){i=i+1;next;display;sleep '1';}" "goes forward 10 images";
-alias "prev10" "i=0;while(i<10){i=i+1;prev;display;sleep '1';}" "goes backward 10 images";
-bind 'N' 'next10';
-bind 'P' 'prev10';
+#alias "next10" "i=0;while(i<10){i=i+1;next;display;sleep '1';}" "goes forward 10 images";
+#alias "prev10" "i=0;while(i<10){i=i+1;prev;display;sleep '1';}" "goes backward 10 images";
+bind 'N' "goto '+1p' '+museum|series|city|category|artist+' '+/S' '+10';" "goto by jump or category or directory or just ahead";
+bind 'P' "goto '\-1p' '\-museum|series|city|category|artist+' '\-/S' '\-10';" "goto by jump or category or directory or just back ";
bind 'C\-n' "goto '+//'";
bind 'C\-p' "goto '\-//'";
bind 'C\-b' "goto '\-//'"; # Warning: many configurations cannot detect C\-b.
@@ -1981,6 +1986,7 @@ if( _device_string=~'^gtk[^e]*$' ) {
"_Custom actions/Webcam shot (needs vgrabbj) webcam"
"_Custom actions/Say something (needs espeak) espeak"
"_Custom actions/Max cached memory: 256MiB _max_cached_memory=262144 unlimited _max_cached_memory=0 very little _max_cached_memory=1 80MiB _max_cached_memory=81920 "
+ "_Custom actions/Max cached images: unlimited _max_cached_images=0 5 _max_cached_images=5 10 _max_cached_images=10 100 _max_cached_images=100 "
"_All actions/_Commands FimMenuCommands/"
"_All actions/_Aliases FimMenuAliases/"
"_All actions/_Key Bindings FimMenuKeyBindings/"
diff --git a/doc/fimrc.man.html b/doc/fimrc.man.html
index 9fe685d..e61e98d 100644
--- a/doc/fimrc.man.html
+++ b/doc/fimrc.man.html
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.4 -->
-<!-- CreationDate: Tue Apr 9 19:09:58 2024 -->
+<!-- CreationDate: Sun May 19 12:02:42 2024 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -71,7 +71,9 @@ fim</b> --write-scriptout /dev/stdout [ <i>{options}</i> ]
fim</b> --chars-press :<i>{commands}</i> [ <i>{options}</i>
] <b><br>
fim</b> --chars-press :<i>{commands}</i> --chars-press
-&rsquo;&rsquo; [ <i>{options}</i> ]</p>
+&rsquo;&rsquo; [ <i>{options}</i> ] <b><br>
+fim</b> --keysym-press <i>{keysym}</i> [ <i>{options}</i>
+]</p>
<h2>DESCRIPTION
<a name="DESCRIPTION"></a>
@@ -419,15 +421,18 @@ variable.</p>
<p style="margin-left:11%; margin-top: 1em"><b>bind</b>
<br>
-bind [<i>{keysym}</i> [<i>{commands}</i>]]: bind a keyboard
-symbol/shortcut <i>{keysym}</i> to <i>{commands}</i>. <br>
+bind [<i>{keysym}</i> [<i>{commands}</i>
+[<i>{description}</i>]]]: bind a key <i>{keysym}</i> to
+<i>{commands}</i>. <br>
+Optional <i>{description}</i> specifies a documentation
+string. <br>
If <i>{keysym}</i> is at least two characters long and
begins with 0 (zero), the integer number after the 0 will be
treated as a raw keycode to bind the specified
<i>{keysym}</i> to. <br>
Use the &rsquo;_verbose_keys&rsquo; variable to discover
(display device dependent) raw keys. <br>
-Key binding is dynamical, so you can rebind keys even during
+Key binding is dynamical, so you can bind keys even during
program&rsquo;s execution. <br>
You can get a list of valid symbols (keysyms) by invoking
dump_key_codes or in the man page.</p>
@@ -592,7 +597,7 @@ echo <i>{args}</i>: print the <i>{args}</i> on console.</p>
<br>
if(<i>expression</i>){<i>action</i>;}[&rsquo;else&rsquo;{<i>action</i>;}]:
-see else.</p>
+see if.</p>
<p style="margin-left:11%; margin-top: 1em"><b>eval</b>
<br>
@@ -611,8 +616,8 @@ font &rsquo;scan&rsquo; [<i>{dirname}</i>]: scan
fonts in the internal fonts list. <br>
font &rsquo;load&rsquo; <i>{filename}</i>: load font
<i>{filename}</i>. <br>
-font &rsquo;next&rsquo;/&rsquo;prev&rsquo;: load
-next/previous font in the internal fonts list. <br>
+font {&rsquo;next&rsquo;|&rsquo;prev&rsquo;}: load next or
+previous font from the internal fonts list. <br>
font &rsquo;info&rsquo;: print current font filename.</p>
<p style="margin-left:11%; margin-top: 1em"><b>getenv</b>
@@ -692,7 +697,8 @@ on the help contents, and show a list of matching items.
A list of commands can be obtained simply invoking
&rsquo;commands&rsquo;; a list of aliases with
&rsquo;alias&rsquo;; a list of bindings with
-&rsquo;bind&rsquo;.</p>
+&rsquo;bind&rsquo;; a list of variables with
+&rsquo;variables&rsquo;.</p>
<p style="margin-left:11%; margin-top: 1em"><b>if</b> <br>
@@ -976,18 +982,22 @@ Executes autocommands for events PrePan and PostPan.</p>
set: returns a list of variables which are set. <br>
set <i>{identifier}</i>: returns the value of variable
<i>{identifier}</i>. <br>
-set <i>{identifier} {commands}</i>: sets variable
-<i>{identifier}</i> to value <i>{commands}</i>.</p>
+set <i>{identifier} {value}</i>: sets variable
+<i>{identifier}</i> to value <i>{value}</i>.</p>
<p style="margin-left:11%; margin-top: 1em"><b>set_commandline_mode</b>
<br>
-set_commandline_mode: set console mode.</p>
+set_commandline_mode: set console mode. Note that the mode
+will change only after the current block of commands is
+evaluated.</p>
<p style="margin-left:11%; margin-top: 1em"><b>set_interactive_mode</b>
<br>
-set_interactive_mode: set interactive mode.</p>
+set_interactive_mode: set interactive mode. Note that the
+mode will change only after the current block of commands is
+evaluated.</p>
<p style="margin-left:11%; margin-top: 1em"><b>sleep</b>
<br>
@@ -1239,8 +1249,8 @@ _display_busy</b> [in,g:] if 1, display a message on the
status bar when processing. <b><br>
_display_console</b> [in,g:] if 1, display the output
console. <b><br>
-_display_status</b> [in,g:] if 1, display display the status
-bar. <b><br>
+_display_status</b> [in,g:] if 1, display the status bar.
+<b><br>
_display_status_bar</b> [in,g:] if 1, display the status
bar. <b><br>
_display_status_fmt</b> [in,g:] custom info format string,
@@ -1307,13 +1317,13 @@ contain ordinary text and special &rsquo;expando&rsquo;
sequences. These are: %p for current scale, in percentage;
%w for width; %h for height; %i for image index in list; %k
for the value of i:_comment (comment description) variable
-in square brackets; %l for current image list length; %L for
-flip/mirror/orientation information; %P for page
-information; %F for file size; %M for screen image memory
-size; %m for memory used by mipmap; %C for memory used by
-cache; %T for total memory used (approximation); %R for
-total max memory used (as detected by getrusage()); %n for
-the current file path name; %N for the current file path
+in square brackets (if non empty); %l for current image list
+length; %L for flip/mirror/orientation information; %P for
+page information; %F for file size; %M for screen image
+memory size; %m for memory used by mipmap; %C for memory
+used by cache; %T for total memory used (approximation); %R
+for total max memory used (as detected by getrusage()); %n
+for the current file path name; %N for the current file path
name basename; ; %c for centering information; %v for the
fim program/version identifier string; %% for an ordinary %.
A sequence like %?VAR?EXP? expands to EXP if i:VAR is set
@@ -1544,8 +1554,7 @@ width</b> [out,i:] the current image original width.</p>
aliases are:</p>
<p style="margin-left:11%; margin-top: 1em">alias
-<b>&quot;A&quot;</b>
-&quot;&rsquo;_autotop=1-_autotop;&rsquo;&quot; <br>
+<b>&quot;A&quot;</b> &quot;_autotop=1-_autotop;&quot; <br>
alias <b>&quot;magnify&quot;</b> &quot;scale
&rsquo;+&rsquo;&quot; # magnify the displayed image by the
_magnify_factor variable or <i>{args}</i> <br>
@@ -1629,7 +1638,7 @@ One can skip its loading by using the
<b>_no_default_configuration</b> variable.</p>
<p style="margin-left:11%; margin-top: 1em">#
-$LastChangedDate: 2024-04-02 15:34:32 +0200 (Tue, 02 Apr
+$LastChangedDate: 2024-05-15 01:34:42 +0200 (Wed, 15 May
2024) $ <br>
# Contents of the default &rsquo;fimrc&rsquo; file,
hardcoded in the fim executable. <br>
@@ -1909,8 +1918,8 @@ autocmd &quot;PostRedisplay&quot; &quot;&quot;
alias &quot;aalib_fix_do&quot;
&quot;{if(aascale==&rsquo;&rsquo;){ascale=&rsquo;2.0&rsquo;;}else{ascale=aascale;}
i:fresh=1;display;if(_TERM=~&rsquo;screen&rsquo;){echo
-&rsquo;screen+aalib?expect binding problems!&rsquo;}}&quot;
-&quot;See aalib_fix.&quot;; <br>
+&rsquo;Detected screen+aalib: key bindings may not work as
+intended.&rsquo;}}&quot; &quot;See aalib_fix.&quot;; <br>
alias &quot;aalib_fix&quot;
&quot;if(_device_string=~&rsquo;^aa&rsquo;){aalib_fix_do;scale
&rsquo;a&rsquo;;}&quot; &quot;When using the aalib (ASCII
@@ -1925,8 +1934,8 @@ scaling.&quot;; <br>
alias &quot;cacalib_fix_do&quot;
&quot;{if(cacascale==&rsquo;&rsquo;){ascale=&rsquo;1.18&rsquo;;}else{scale=cacascale;}
i:fresh=1;display;if(_TERM=~&rsquo;screen&rsquo;){echo
-&rsquo;screen+cacalib?expect binding
-problems!&rsquo;}}&quot; &quot;See cacalib_fix.&quot;; <br>
+&rsquo;Detected screen+cacalib: key bindings may not work as
+intended.&rsquo;}}&quot; &quot;See cacalib_fix.&quot;; <br>
alias &quot;cacalib_fix&quot; &quot;getenv
&rsquo;DISPLAY&rsquo;;if(_device_string=~&rsquo;^ca&rsquo;
&amp;&amp; ENV_DISPLAY==&rsquo;&rsquo;){cacalib_fix_do;scale
@@ -1998,17 +2007,23 @@ console scroll is broken. <br>
autocmd &quot;PostInteractiveCommand&quot; &quot;&quot;
&quot;_gtk_check_for_toggle_gtk_menus;_gtk_check_for_toggle_fullscreen&quot;;</p>
-<p style="margin-left:11%; margin-top: 1em">alias
+<p style="margin-left:11%; margin-top: 1em">#alias
&quot;next10&quot;
&quot;i=0;while(i&lt;10){i=i+1;next;display;sleep
&rsquo;1&rsquo;;}&quot; &quot;goes forward 10 images&quot;;
<br>
-alias &quot;prev10&quot;
+#alias &quot;prev10&quot;
&quot;i=0;while(i&lt;10){i=i+1;prev;display;sleep
&rsquo;1&rsquo;;}&quot; &quot;goes backward 10 images&quot;;
<br>
-bind &rsquo;N&rsquo; &rsquo;next10&rsquo;; <br>
-bind &rsquo;P&rsquo; &rsquo;prev10&rsquo;; <br>
+bind &rsquo;N&rsquo; &quot;goto &rsquo;+1p&rsquo;
+&rsquo;+museum|series|city|category|artist+&rsquo;
+&rsquo;+/S&rsquo; &rsquo;+10&rsquo;;&quot; &quot;goto by
+jump or category or directory or just ahead&quot;; <br>
+bind &rsquo;P&rsquo; &quot;goto &rsquo;-1p&rsquo;
+&rsquo;-museum|series|city|category|artist+&rsquo;
+&rsquo;-/S&rsquo; &rsquo;-10&rsquo;;&quot; &quot;goto by
+jump or category or directory or just back &quot;; <br>
bind &rsquo;C-n&rsquo; &quot;goto &rsquo;+//&rsquo;&quot;;
<br>
bind &rsquo;C-p&rsquo; &quot;goto &rsquo;-//&rsquo;&quot;;
@@ -3845,6 +3860,25 @@ _max_cached_memory=81920 &quot;</p></td>
<td width="8%">
+<p>&quot;_Custom actions/Max cached images: unlimited
+_max_cached_images=0 5 _max_cached_images=5 10
+_max_cached_images=10 100 _max_cached_images=100 &quot;</p></td>
+<td width="77%"></td>
+</td></tr>
+<tr valign="top" align="left">
+<td width="8%"></td>
+<td width="7%">
+</td>
+<td width="8%">
+</td>
+<td width="77%"></td>
+</td></tr>
+<tr valign="top" align="left">
+<td width="8%"></td>
+<td width="7%"></td>
+<td width="8%">
+
+
<p>&quot;_All actions/_Commands FimMenuCommands/&quot;</p></td>
<td width="77%"></td>
</td></tr>
diff --git a/doc/fimrc.man.in b/doc/fimrc.man.in
index 629e0d4..a65542b 100644
--- a/doc/fimrc.man.in
+++ b/doc/fimrc.man.in
@@ -34,6 +34,9 @@ fimrc - \fB fim \fP configuration file and language reference
.B fim
--chars-press :\fR\fI{commands}\fR --chars-press '' [ \fR\fI{options}\fR ]
.br
+.B fim
+--keysym-press \fR\fI{keysym}\fR [ \fR\fI{options}\fR ]
+.br
.SH DESCRIPTION
This page explains the
@@ -237,13 +240,15 @@ basename \fR\fI{filename}\fR: returns the basename of \fR\fI{filename}\fR in the
.B
bind
.fi
-bind [\fR\fI{keysym}\fR [\fR\fI{commands}\fR]]: bind a keyboard symbol/shortcut \fR\fI{keysym}\fR to \fR\fI{commands}\fR.
+bind [\fR\fI{keysym}\fR [\fR\fI{commands}\fR [\fR\fI{description}\fR]]]: bind a key \fR\fI{keysym}\fR to \fR\fI{commands}\fR.
+.fi
+Optional \fR\fI{description}\fR specifies a documentation string.
.fi
If \fR\fI{keysym}\fR is at least two characters long and begins with 0 (zero), the integer number after the 0 will be treated as a raw keycode to bind the specified \fR\fI{keysym}\fR to.
.fi
Use the '_verbose_keys' variable to discover (display device dependent) raw keys.
.fi
-Key binding is dynamical, so you can rebind keys even during program's execution.
+Key binding is dynamical, so you can bind keys even during program's execution.
.fi
You can get a list of valid symbols (keysyms) by invoking dump_key_codes or in the man page.
.fi
@@ -367,7 +372,7 @@ echo \fR\fI{args}\fR: print the \fR\fI{args}\fR on console.
.B
else
.fi
-if(\fR\fIexpression\fR){\fR\fIaction\fR;}['else'{\fR\fIaction\fR;}]: see else.
+if(\fR\fIexpression\fR){\fR\fIaction\fR;}['else'{\fR\fIaction\fR;}]: see if.
.fi
.na
@@ -392,7 +397,7 @@ font 'scan' [\fR\fI{dirname}\fR]: scan \fR\fI{dirname}\fR or /usr/share/consolef
.fi
font 'load' \fR\fI{filename}\fR: load font \fR\fI{filename}\fR.
.fi
-font 'next'/'prev': load next/previous font in the internal fonts list.
+font {'next'|'prev'}: load next or previous font from the internal fonts list.
.fi
font 'info': print current font filename.
.fi
@@ -449,7 +454,7 @@ help [\fR\fI{identifier}\fR]: provide online help, assuming \fR\fI{identifier}\f
.fi
If \fR\fI{identifier}\fR begins with '/', search on the help contents, and show a list of matching items.
.fi
-A list of commands can be obtained simply invoking 'commands'; a list of aliases with 'alias'; a list of bindings with 'bind'.
+A list of commands can be obtained simply invoking 'commands'; a list of aliases with 'alias'; a list of bindings with 'bind'; a list of variables with 'variables'.
.fi
.na
@@ -731,21 +736,21 @@ set: returns a list of variables which are set.
.fi
set \fR\fI{identifier}\fR: returns the value of variable \fR\fI{identifier}\fR.
.fi
-set \fR\fI{identifier}\fR \fR\fI{commands}\fR: sets variable \fR\fI{identifier}\fR to value \fR\fI{commands}\fR.
+set \fR\fI{identifier}\fR \fR\fI{value}\fR: sets variable \fR\fI{identifier}\fR to value \fR\fI{value}\fR.
.fi
.na
.B
set_commandline_mode
.fi
-set_commandline_mode: set console mode.
+set_commandline_mode: set console mode. Note that the mode will change only after the current block of commands is evaluated.
.fi
.na
.B
set_interactive_mode
.fi
-set_interactive_mode: set interactive mode.
+set_interactive_mode: set interactive mode. Note that the mode will change only after the current block of commands is evaluated.
.fi
.na
@@ -998,7 +1003,7 @@ _display_console
.na
.B
_display_status
-[in,g:] if 1, display display the status bar.
+[in,g:] if 1, display the status bar.
.fi
.na
.B
@@ -1123,7 +1128,7 @@ _ignorecase
.na
.B
_info_fmt_str
-[in,g:] custom info format string, displayed in the lower right corner of the status bar; may contain ordinary text and special 'expando' sequences. These are: %p for current scale, in percentage; %w for width; %h for height; %i for image index in list; %k for the value of i:_comment (comment description) variable in square brackets; %l for current image list length; %L for flip/mirror/orientation information; %P for page information; %F for file size; %M for screen image memory size; %m for memory used by mipmap; %C for memory used by cache; %T for total memory used (approximation); %R for total max memory used (as detected by getrusage()); %n for the current file path name; %N for the current file path name basename; ; %c for centering information; %v for the fim program/version identifier string; %% for an ordinary %. A sequence like %?VAR?EXP? expands to EXP if i:VAR is set (or, otherwise, if VAR); EXP is copied verbatim except for contained sequences of the form %:VAR:, which expand to the value of variable i:VAR (or, if unset, VAR); this is meant to be used like in e.g. '%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?', where the EXIF-set variable EXIF_DateTimeOriginal (make sure you have libexif for this) are used only if present.
+[in,g:] custom info format string, displayed in the lower right corner of the status bar; may contain ordinary text and special 'expando' sequences. These are: %p for current scale, in percentage; %w for width; %h for height; %i for image index in list; %k for the value of i:_comment (comment description) variable in square brackets (if non empty); %l for current image list length; %L for flip/mirror/orientation information; %P for page information; %F for file size; %M for screen image memory size; %m for memory used by mipmap; %C for memory used by cache; %T for total memory used (approximation); %R for total max memory used (as detected by getrusage()); %n for the current file path name; %N for the current file path name basename; ; %c for centering information; %v for the fim program/version identifier string; %% for an ordinary %. A sequence like %?VAR?EXP? expands to EXP if i:VAR is set (or, otherwise, if VAR); EXP is copied verbatim except for contained sequences of the form %:VAR:, which expand to the value of variable i:VAR (or, if unset, VAR); this is meant to be used like in e.g. '%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?', where the EXIF-set variable EXIF_DateTimeOriginal (make sure you have libexif for this) are used only if present.
.fi
.na
.B
@@ -1502,7 +1507,7 @@ Hardcoded aliases are:
alias
.B
"A"
-"'_autotop=1-_autotop;'"
+"_autotop=1-_autotop;"
.fi
alias
.B
@@ -1600,7 +1605,7 @@ Part of the default configuration comes from the \fB_fim_default_config_file_con
One can skip its loading by using the \fB_no_default_configuration\fP variable.
.nf
-# $LastChangedDate: 2024-04-02 15:34:32 +0200 (Tue, 02 Apr 2024) $
+# $LastChangedDate: 2024-05-15 01:34:42 +0200 (Wed, 15 May 2024) $
# Contents of the default 'fimrc' file, hardcoded in the fim executable.
# Read the documentation (man fimrc) to discover how to change this default hardcoded file and how to make your own.
# Note that usually a ~/.fimrc file is read after these options take effect, so you could reset all of this with ease.
@@ -1742,9 +1747,9 @@ autocmd "PreRedisplay" "" "i:_will_display=1";
autocmd "PreRedisplay" "" "if(_scale_style!='' && i:fresh){i:fresh=0;scale _scale_style ;i:fresh=0;}";
autocmd "PostRedisplay" "" "i:_will_display=0";
# Display device specific config
-alias "aalib_fix_do" "{if(aascale==''){ascale='2.0';}else{ascale=aascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'screen+aalib?expect binding problems!'}}" "See aalib_fix.";
+alias "aalib_fix_do" "{if(aascale==''){ascale='2.0';}else{ascale=aascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'Detected screen+aalib: key bindings may not work as intended.'}}" "See aalib_fix.";
alias "aalib_fix" "if(_device_string=~'^aa'){aalib_fix_do;scale 'a';}" "When using the aalib (ASCII art) library we face a problem: glyph proportions are seldom square (as pixels are), and are tricky to detect; for this reason, we need to reshape the image with respect to the font ratio, but we have to make a guess in the scaling factor to compensate. If at runtime a better value is known for the terminal font height/with ratio, it may be fed in the 'aascale' variable for an accurate scaling.";
-alias "cacalib_fix_do" "{if(cacascale==''){ascale='1.18';}else{scale=cacascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'screen+cacalib?expect binding problems!'}}" "See cacalib_fix.";
+alias "cacalib_fix_do" "{if(cacascale==''){ascale='1.18';}else{scale=cacascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'Detected screen+cacalib: key bindings may not work as intended.'}}" "See cacalib_fix.";
alias "cacalib_fix" "getenv 'DISPLAY';if(_device_string=~'^ca' && ENV_DISPLAY==''){cacalib_fix_do;scale 'a';}" "When using the libcaca (Coloured ASCII art) library we face a problem: glyph proportions are seldom square (as pixels are), and are tricky to detect; for this reason, we need to reshape the image with respect to the font ratio, but we have to make a guess in the scaling factor to compensate. If at runtime a better value is known for the terminal font height/with ratio, it may be fed in the 'cacascale' variable for an accurate scaling.";
autocmd "PostReload" "" "aalib_fix";
autocmd "PostLoad" "" "aalib_fix";
@@ -1768,10 +1773,10 @@ autocmd "PostInteractiveCommand" "" "if(_display_console==0 && i:fresh){redisp
autocmd "PostInteractiveCommand" "" "idempotent_cmd"; # Bug workaround: without it console scroll is broken.
autocmd "PostInteractiveCommand" "" "_gtk_check_for_toggle_gtk_menus;_gtk_check_for_toggle_fullscreen";
-alias "next10" "i=0;while(i<10){i=i+1;next;display;sleep '1';}" "goes forward 10 images";
-alias "prev10" "i=0;while(i<10){i=i+1;prev;display;sleep '1';}" "goes backward 10 images";
-bind 'N' 'next10';
-bind 'P' 'prev10';
+#alias "next10" "i=0;while(i<10){i=i+1;next;display;sleep '1';}" "goes forward 10 images";
+#alias "prev10" "i=0;while(i<10){i=i+1;prev;display;sleep '1';}" "goes backward 10 images";
+bind 'N' "goto '+1p' '+museum|series|city|category|artist+' '+/S' '+10';" "goto by jump or category or directory or just ahead";
+bind 'P' "goto '-1p' '-museum|series|city|category|artist+' '-/S' '-10';" "goto by jump or category or directory or just back ";
bind 'C-n' "goto '+//'";
bind 'C-p' "goto '-//'";
bind 'C-b' "goto '-//'"; # Warning: many configurations cannot detect C-b.
@@ -1981,6 +1986,7 @@ if( _device_string=~'^gtk[^e]*$' ) {
"_Custom actions/Webcam shot (needs vgrabbj) webcam"
"_Custom actions/Say something (needs espeak) espeak"
"_Custom actions/Max cached memory: 256MiB _max_cached_memory=262144 unlimited _max_cached_memory=0 very little _max_cached_memory=1 80MiB _max_cached_memory=81920 "
+ "_Custom actions/Max cached images: unlimited _max_cached_images=0 5 _max_cached_images=5 10 _max_cached_images=10 100 _max_cached_images=100 "
"_All actions/_Commands FimMenuCommands/"
"_All actions/_Aliases FimMenuAliases/"
"_All actions/_Key Bindings FimMenuKeyBindings/"
diff --git a/media/Makefile.in b/media/Makefile.in
index ff207cd..665cfab 100644
--- a/media/Makefile.in
+++ b/media/Makefile.in
@@ -224,6 +224,7 @@ HAVE_CPP = @HAVE_CPP@
HAVE_ECHO = @HAVE_ECHO@
HAVE_FLEX = @HAVE_FLEX@
HAVE_GREP = @HAVE_GREP@
+HAVE_GROFF = @HAVE_GROFF@
HAVE_MAN = @HAVE_MAN@
HAVE_RM = @HAVE_RM@
HAVE_SED = @HAVE_SED@
diff --git a/media/multipage/Makefile.in b/media/multipage/Makefile.in
index d2e1296..dca81e5 100644
--- a/media/multipage/Makefile.in
+++ b/media/multipage/Makefile.in
@@ -168,6 +168,7 @@ HAVE_CPP = @HAVE_CPP@
HAVE_ECHO = @HAVE_ECHO@
HAVE_FLEX = @HAVE_FLEX@
HAVE_GREP = @HAVE_GREP@
+HAVE_GROFF = @HAVE_GROFF@
HAVE_MAN = @HAVE_MAN@
HAVE_RM = @HAVE_RM@
HAVE_SED = @HAVE_SED@
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index 6ee133d..abd8898 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -226,6 +226,7 @@ HAVE_CPP = @HAVE_CPP@
HAVE_ECHO = @HAVE_ECHO@
HAVE_FLEX = @HAVE_FLEX@
HAVE_GREP = @HAVE_GREP@
+HAVE_GROFF = @HAVE_GROFF@
HAVE_MAN = @HAVE_MAN@
HAVE_RM = @HAVE_RM@
HAVE_SED = @HAVE_SED@
diff --git a/scripts/tests/font.sh b/scripts/tests/font.sh
index fb18c66..e8cafe6 100755
--- a/scripts/tests/font.sh
+++ b/scripts/tests/font.sh
@@ -3,7 +3,7 @@
# tests font functionality in fim
# this script shall work whatever its configure options (even if fim was compiled 'dumb')
-f=src/fim
+f=${FIM_EXE-src/fim} # for e.g. Debian's post-installation tests
if test x != "$top_srcdir"; then true ; else top_srcdir=./ ; fi
ff="$top_srcdir/media/fim.png media/icon_smile.gif"
fa="-b -c quit $ff "
diff --git a/scripts/tests/version.sh b/scripts/tests/version.sh
index 72a9bf7..1b3e93f 100755
--- a/scripts/tests/version.sh
+++ b/scripts/tests/version.sh
@@ -3,7 +3,7 @@
# tests the -V switch in fim
# TODO : should be integrated in the vim-like test suite.
-f=${FIM_EXE-src/fim}
+f=${FIM_EXE-src/fim} # for e.g. Debian's post-installation tests
fail()
{
diff --git a/src/Browser.cpp b/src/Browser.cpp
index e694dda..1136262 100644
--- a/src/Browser.cpp
+++ b/src/Browser.cpp
@@ -1,4 +1,4 @@
-/* $LastChangedDate: 2024-04-08 00:08:57 +0200 (Mon, 08 Apr 2024) $ */
+/* $LastChangedDate: 2024-05-11 20:15:30 +0200 (Sat, 11 May 2024) $ */
/*
Browser.cpp : Fim image browser
@@ -97,6 +97,12 @@ namespace fim
return flist_.cf();
}
+ fim_int Browser::current_p(void)const
+ {
+ // TODO: needs proper diffusion in the code...
+ return getGlobalIntVariable(FIM_VID_PAGE);
+ }
+
#if FIM_WANT_PIC_LBFL
fim_cxr Browser::limit_to_variables(size_t min_vals, bool expanded) const
{
@@ -970,8 +976,8 @@ nostat:
#endif
if ( ! ( dir = opendir(dn.c_str() ) ))
goto ret;
-
- dn += FIM_CNS_DIRSEP_STRING;
+ if ( dn.back() != FIM_CNS_DIRSEP_CHAR )
+ dn += FIM_CNS_DIRSEP_STRING;
re = getGlobalStringVariable(FIM_VID_PUSHDIR_RE);
if( re == FIM_CNS_EMPTY_STRING )
re = FIM_CNS_PUSHDIR_RE;
@@ -1402,8 +1408,11 @@ ret:
if( args.size() > 0 )
{
const fim_int cfi = current_n();
- for(size_t i = 0; i<args.size() && current_n() == cfi ; ++i)
+ const fim_int cpi = current_p();
+ for(size_t i = 0; i<args.size() && current_n() == cfi && current_p() == cpi ; ++i)
+ {
result = goto_image_internal(args[i].c_str(),FIM_X_NULL);
+ }
}
else
result = goto_image_internal(FIM_NULL,FIM_X_NULL);
@@ -2705,7 +2714,7 @@ void flist_t::erase_at_bitset(const fim_bitset_t& bs, fim_bool_t negative)
for(auto fit=bit;fit!=eit;++fit)
if(bs.at(fit-bit) != negative)
this->erase(fit-ecount),ecount++;
- // TODO: updating cf_ here would make sense, but is redundant
+ cf_=size()?std::min(size()-1,cf_):0;// TODO: need tests and connection with adj_cf and copy_from_bitset
}
fim_bool_t flist_t::pop_current(void)
{
diff --git a/src/Browser.h b/src/Browser.h
index cca9517..065ee15 100644
--- a/src/Browser.h
+++ b/src/Browser.h
@@ -1,4 +1,4 @@
-/* $LastChangedDate: 2024-04-08 00:08:57 +0200 (Mon, 08 Apr 2024) $ */
+/* $LastChangedDate: 2024-05-11 14:46:02 +0200 (Sat, 11 May 2024) $ */
/*
Browser.h : Image browser header file
@@ -159,6 +159,7 @@ class Browser FIM_FINAL
public:
flist_t get_file_list(void)const { return flist_; }
int current_n(void)const;
+ fim_int current_p(void)const;
fim::string get_next_filename(int n)const; // FIXME: should be private
fim::string last_regexp_; // was private
fim_int last_src_dir_;
diff --git a/src/CommandConsole-help.cpp b/src/CommandConsole-help.cpp
index d8ca899..ccaf406 100644
--- a/src/CommandConsole-help.cpp
+++ b/src/CommandConsole-help.cpp
@@ -1,4 +1,4 @@
-/* $LastChangedDate: 2024-04-08 00:08:57 +0200 (Mon, 08 Apr 2024) $ */
+/* $LastChangedDate: 2024-04-15 23:19:28 +0200 (Mon, 15 Apr 2024) $ */
/*
CommandConsole-help.cpp : Fim console dispatcher--help member functions
@@ -99,6 +99,7 @@ manmode:
FIM_MAN_Bh("fim", "--" FIM_OSW_DUMP_SCRIPTOUT " " FIM_LINUX_STDOUT_FILE " [ " FIM_CNS_EX_OPTIONS " ]")
FIM_MAN_Bh("fim", "--" FIM_OSW_CHARS_PRESS " " ":" FIM_CNS_EX_CMDS_STRING " [ " FIM_CNS_EX_OPTIONS " ]")
FIM_MAN_Bh("fim", "--" FIM_OSW_CHARS_PRESS " " ":" FIM_CNS_EX_CMDS_STRING " --" FIM_OSW_CHARS_PRESS " '' [ " FIM_CNS_EX_OPTIONS " ]")
+ FIM_MAN_Bh("fim", "--" FIM_OSW_KEYSYM_PRESS " " FIM_CNS_EX_KSY_STRING " [ " FIM_CNS_EX_OPTIONS " ]")
"\n"
".SH DESCRIPTION\n"
"This page explains the \n.B fim\nscripting language, which is used for the \n.B fimrc\nconfiguration files, " FIM_CNS_EX_SCRIPTFILE "s, or " FIM_CNS_EX_CMDS_STRING " passed via command line " FIM_CNS_EX_OPTIONS ".\n"
diff --git a/src/CommandConsole-init.cpp b/src/CommandConsole-init.cpp
index 4fd9137..129ca1a 100644
--- a/src/CommandConsole-init.cpp
+++ b/src/CommandConsole-init.cpp
@@ -1,4 +1,4 @@
-/* $LastChangedDate: 2024-03-29 12:09:04 +0100 (Fri, 29 Mar 2024) $ */
+/* $LastChangedDate: 2024-04-21 23:09:14 +0200 (Sun, 21 Apr 2024) $ */
/*
CommandConsole-init.cpp : Fim console initialization
@@ -375,8 +375,7 @@ static fim_err_t fim_bench_subsystem(Benchmarkable * bo)
#ifndef FIM_NOFIMRC
#ifndef FIM_WANT_NOSCRIPTING
- fim_char_t rcfile[FIM_PATH_MAX];
- const fim_char_t * const e = fim_getenv(FIM_CNS_HOME_VAR);
+ const std::string home_env_var = fim_getenv(FIM_CNS_HOME_VAR);
FIM_AUTOCMD_EXEC(FIM_ACM_PREGFIMRC,"");
@@ -405,14 +404,13 @@ static fim_err_t fim_bench_subsystem(Benchmarkable * bo)
#ifndef FIM_NOFIMRC
#ifndef FIM_WANT_NOSCRIPTING
- if(e && strlen(e)<FIM_PATH_MAX-8)//strlen("/" FIM_CNS_USR_RC_FILEPATH)+2
+ if(home_env_var.size())//strlen("/" FIM_CNS_USR_RC_FILEPATH)+2
{
- strcpy(rcfile,e);
- strcat(rcfile,"/" FIM_CNS_USR_RC_FILEPATH);
+ const std::string rcfile = home_env_var + "/" FIM_CNS_USR_RC_FILEPATH;
if(getIntVariable(FIM_VID_NO_RC_FILE)!=1 )
{
if(
- (!is_file(rcfile) || FIM_ERR_NO_ERROR!=executeFile(rcfile))
+ (!is_file(rcfile) || FIM_ERR_NO_ERROR!=executeFile(rcfile.c_str()))
// && (!is_file(FIM_CNS_SYS_RC_FILEPATH) || FIM_ERR_NO_ERROR!=executeFile(FIM_CNS_SYS_RC_FILEPATH))
)
#endif /* FIM_WANT_NOSCRIPTING */
diff --git a/src/CommandConsole.cpp b/src/CommandConsole.cpp
index 9989e9e..6f61f1d 100644
--- a/src/CommandConsole.cpp
+++ b/src/CommandConsole.cpp
@@ -1,4 +1,4 @@
-/* $LastChangedDate: 2024-04-08 00:08:57 +0200 (Mon, 08 Apr 2024) $ */
+/* $LastChangedDate: 2024-05-15 01:19:33 +0200 (Wed, 15 May 2024) $ */
/*
CommandConsole.cpp : Fim console dispatcher
@@ -69,6 +69,7 @@ extern fim_sys_int yyparse();
#include <chrono>
#endif /* */
+#define FIM_CHAR_TO_KEY_T(C) static_cast<signed char>(C)
#define FIM_CNS_IFELSE "if(" FIM_CNS_EX_NBEXP_STRING "){" FIM_CNS_EX_ACT_STRING ";}['else'{" FIM_CNS_EX_ACT_STRING ";}]"
#if FIM_WANT_PIPE_IN_LEXER
@@ -220,7 +221,7 @@ namespace fim
if((item.at(0))==FIM_CNS_SLASH_CHAR)
{
/* regexp-based would be nicer */
- fim::string hstr,cstr,astr,bstr,ptn;
+ fim::string astr,bstr,cstr,hstr,vstr,ptn;
ptn = item.substr(1,item.size());
if(flt&FIM_H_CMD)
@@ -283,14 +284,30 @@ namespace fim
}
}
}
+
+ if(flt&FIM_H_VAR)
+ for( auto & vr : variables_)
+ {
+ // may fuse with Namespace::find_matching_list
+ if ( vr.first.find(ptn) != vr.first.npos || // var i
+ fim_var_help_db_query(vr.first).find(ptn) != fim_var_help_db_query(vr.first).npos // help contents
+ //vr.second.getString().find(ptn.c_str()) != vr.second.getString().npos // var contents
+ )
+ {
+ vstr += vr.first;
+ vstr += " ";
+ }
+ }
/* FIXME: may extend to autocmd's */
if(!cstr.empty())
- hstr+="Commands (type 'help' and one quoted command name to get more info):\n " + cstr + "\n";
+ hstr+="Commands (type '" FIM_FLT_HELP "' and one quoted command name to get more info):\n " + cstr + "\n";
if(!astr.empty())
- hstr+="Aliases (type 'alias' and one quoted alias to get more info):\n " + astr + "\n";
+ hstr+="Aliases (type '" FIM_FLT_ALIAS "' and one quoted alias to get more info):\n " + astr + "\n";
if(!bstr.empty())
- hstr+="Bindings (type 'bind' and one quoted binding to get more info):\n " + bstr + "\n";
+ hstr+="Bindings (type '" FIM_FLT_BIND "' and one quoted binding to get more info):\n " + bstr + "\n";
+ if(!vstr.empty())
+ hstr+="Variables (type '" FIM_FLT_HELP "' and one quoted variable name to get more info):\n " + vstr + "\n";
if(!hstr.empty() && !ptn.empty())
return "The following help items matched \"" + ptn + "\":\n" + hstr;
else
@@ -453,7 +470,10 @@ ret: return key;
}
if(args.size()<2)
{
- return get_alias_info(args[0]);
+ if(aliasRecall(args[0])!=FIM_CNS_EMPTY_STRING)
+ return get_alias_info(args[0]);
+ else
+ return "sorry, no such alias:`" + args[0] + "'\n";
}
if(args.size()>=2)
cmdlist+=args[1];
@@ -3019,13 +3039,13 @@ void CommandConsole::push_chars_press(const char *cp)
if ((!clkpv_.empty()) || !cp || !*cp)
clkpv_.push(FIM_SYM_ENTER);
for (; cp && *cp; ++cp)
- clkpv_.push(*cp);
+ clkpv_.push(FIM_CHAR_TO_KEY_T(*cp));
}
void CommandConsole::push_key_press(const char *c_str)
{
for(;isdigit(*c_str);++c_str)
- clkpv_.push(*c_str);
+ clkpv_.push(FIM_CHAR_TO_KEY_T(*c_str));
if( *c_str )
clkpv_.push(kstr_to_key(c_str));
}
diff --git a/src/DisplayDevice.h b/src/DisplayDevice.h
index 33fcf2f..fb06c18 100644
--- a/src/DisplayDevice.h
+++ b/src/DisplayDevice.h
@@ -1,4 +1,4 @@
-/* $LastChangedDate: 2024-04-07 19:28:17 +0200 (Sun, 07 Apr 2024) $ */
+/* $LastChangedDate: 2024-05-12 11:54:03 +0200 (Sun, 12 May 2024) $ */
/*
DisplayDevice.h : virtual device Fim driver header file
@@ -28,6 +28,8 @@
#define FIM_WANT_MOUSE_PAN FIM_WANT_MOUSE /* experimental mouse support */
#define FIM_WANT_MOUSE_WHEEL_SCROLL FIM_WANT_MOUSE /* experimental mouse support */
+#define FIM_DD_HURRY_QUIT() cc.execute(FIM_FLT_QUIT, {}, false, false, true); // calling exit() requires a clean terminal
+
#if FIM_WANT_PROOF_OF_CONCEPT_MOUSE_SUPPORT
#define FIM_MOUSE_LBUTTON_MASK 1
#define FIM_MOUSE_MBUTTON_MASK 2
diff --git a/src/FbiStuffDjvu.cpp b/src/FbiStuffDjvu.cpp
index cc01a68..89c335a 100644
--- a/src/FbiStuffDjvu.cpp
+++ b/src/FbiStuffDjvu.cpp
@@ -1,8 +1,8 @@
-/* $LastChangedDate: 2022-11-06 17:05:18 +0100 (Sun, 06 Nov 2022) $ */
+/* $LastChangedDate: 2024-04-16 14:31:00 +0200 (Tue, 16 Apr 2024) $ */
/*
FbiStuffDjvu.cpp : fim functions for decoding DJVU files
- (c) 2008-2022 Michele Martone
+ (c) 2008-2024 Michele Martone
based on code (c) 1998-2006 Gerd Knorr <kraxel@bytesex.org>
This program is free software; you can redistribute it and/or modify
@@ -169,14 +169,20 @@ djvu_read(fim_byte_t *dst, unsigned int line, void *data)
ds->first_row_dst = dst;
else return;
- int rs=ddjvu_page_render (ds->dp, DDJVU_RENDER_COLOR,
+ const int rs=ddjvu_page_render (ds->dp, DDJVU_RENDER_COLOR,
& (ds->prect),
& (ds->rrect),
ds->pf,
ds->row_stride,
(fim_libdjvu_char*)dst);
if(rs)
- ;/* FIXME: missing error handling */
+ {
+ }
+ else
+ {
+ std::cerr << " error rendering current DJVU document page: perhaps it's damaged?\n";
+ /* error handling can be improved ... */
+ }
return ;
}
@@ -203,7 +209,7 @@ static struct ida_loader djvu_loader = {
moff: 12,
mlen: 3,*/
- /*magic:*/ "AT&TFORM",// FI/*XME :*/ are sure this is enough ?
+ /*magic:*/ "AT&TFORM",// FIXME :*/ are sure this is enough ?
/*moff:*/ 0,
/*mlen:*/ 8,
/*name:*/ "libdjvu",
diff --git a/src/FbiStuffQoi.cpp b/src/FbiStuffQoi.cpp
index 741a9e4..161263a 100644
--- a/src/FbiStuffQoi.cpp
+++ b/src/FbiStuffQoi.cpp
@@ -1,4 +1,4 @@
-/* $LastChangedDate: 2024-02-07 23:00:40 +0100 (Wed, 07 Feb 2024) $ */
+/* $LastChangedDate: 2024-05-09 00:45:30 +0200 (Thu, 09 May 2024) $ */
/*
FbiStuffQoi.cpp : open QOI files
@@ -53,7 +53,7 @@ fim_qoi_init(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida
{
/* it is safe to ignore filename, page, thumbnail */
struct qoi_state *h = FIM_NULL;
- fim_err_t errval = FIM_ERR_GENERIC;
+ //fim_err_t errval = FIM_ERR_GENERIC;
qoi_desc desc;
long fo = 0;
@@ -64,7 +64,7 @@ fim_qoi_init(FILE *fp, const fim_char_t *filename, unsigned int page, struct ida
if(fseek(fp,0,SEEK_END)!=0)
goto oops;
- if((h->flen=ftell(fp))==-1)
+ if(ftell(fp)==-1)
goto oops;
h->fp = fp;
@@ -114,8 +114,7 @@ fim_qoi_read(fim_byte_t *dst, unsigned int line, void *data)
{
struct qoi_state *h = (struct qoi_state *) data;
- if ( line == 0 )
- if ( data )
+ if ( line == 0 && data )
{
memcpy(dst,h->rgb,h->height * h->bytes_per_line );
}
diff --git a/src/GTKDevice.cpp b/src/GTKDevice.cpp
index c5589bb..be9e9f7 100644
--- a/src/GTKDevice.cpp
+++ b/src/GTKDevice.cpp
@@ -1386,7 +1386,7 @@ static gboolean cb_destroy(void*)
std::exit(0); // calling exit() requires a clean terminal
last_pressed_key_ = cc.find_keycode_for_bound_cmd(FIM_FLT_QUIT);
if (!last_pressed_key_ )
- cc.execute(FIM_FLT_QUIT, {}, false, false, do_queue_);
+ FIM_DD_HURRY_QUIT();
return TRUE;
}
@@ -1464,7 +1464,7 @@ fim_err_t GTKDevice::initialize(fim::sym_keys_t&sym_keys)
gtk_window_set_position(GTK_WINDOW(window_), GTK_WIN_POS_CENTER);
gtk_window_set_default_size(GTK_WINDOW(window_), FIM_DEFAULT_WINDOW_WIDTH, FIM_DEFAULT_WINDOW_HEIGHT);
set_wm_caption(wtitle_.c_str());
- gtk_widget_add_events(GTK_WIDGET(window_), /*GDK_EXPOSURE_MASK |*/ GDK_KEY_PRESS_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK
+ gtk_widget_add_events(GTK_WIDGET(window_), /*GDK_EXPOSURE_MASK |*/ GDK_KEY_PRESS_MASK
#if FIM_WANT_MOUSE_WHEEL_SCROLL
| GDK_SCROLL_MASK
#endif /* FIM_WANT_MOUSE_WHEEL_SCROLL */
@@ -1483,6 +1483,7 @@ fim_err_t GTKDevice::initialize(fim::sym_keys_t&sym_keys)
drawingarea_ = gtk_drawing_area_new();
gtk_widget_set_vexpand(GTK_WIDGET(drawingarea_), TRUE);
gtk_widget_set_hexpand(GTK_WIDGET(drawingarea_), TRUE);
+ gtk_widget_add_events(GTK_WIDGET(drawingarea_), /*GDK_EXPOSURE_MASK |*/ GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK);
#if !FIM_GTK_WITH_RENDERED_STATUSBAR
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(statusbar_), "context");
gtk_statusbar_push (GTK_STATUSBAR(statusbar_), context_id, "Waiting for you to do something...");
@@ -1507,9 +1508,9 @@ fim_err_t GTKDevice::initialize(fim::sym_keys_t&sym_keys)
g_signal_connect(G_OBJECT(window_), "destroy", G_CALLBACK(cb_destroy), NULL); // TODO: need test in test suite
gtk_container_add(GTK_CONTAINER(window_), grid_);
- g_signal_connect(G_OBJECT(window_), "motion-notify-event", G_CALLBACK(cb_mouse_moved), NULL);
+ g_signal_connect(G_OBJECT(drawingarea_), "motion-notify-event", G_CALLBACK(cb_mouse_moved), NULL);
g_signal_connect(G_OBJECT(window_), "scroll-event", G_CALLBACK(cb_mouse_scroll), NULL);
- g_signal_connect(G_OBJECT(window_), "button-press-event", G_CALLBACK(cb_mouse_pressed), NULL);
+ g_signal_connect(G_OBJECT(drawingarea_), "button-press-event", G_CALLBACK(cb_mouse_pressed), NULL);
g_signal_connect(G_OBJECT(window_), "key-press-event", G_CALLBACK(cb_key_pressed), NULL);
g_signal_connect(G_OBJECT(window_), "key-release-event", G_CALLBACK(cb_key_pressed), NULL);
g_signal_connect(G_OBJECT(window_), "window-state-event", G_CALLBACK(cb_window_state_event), NULL);
diff --git a/src/Image.h b/src/Image.h
index 35f0f85..052f502 100644
--- a/src/Image.h
+++ b/src/Image.h
@@ -1,4 +1,4 @@
-/* $LastChangedDate: 2024-03-25 02:17:19 +0100 (Mon, 25 Mar 2024) $ */
+/* $LastChangedDate: 2024-04-29 13:28:40 +0200 (Mon, 29 Apr 2024) $ */
/*
Image.h : Image class headers
@@ -289,11 +289,11 @@ public:
return ds;
#endif /* FIM_WANT_DESC_VEXP */
}
- void fetch(const fim_fn_t& dfn, const fim_char_t sc)
+ bool fetch(const fim_fn_t& dfn, const fim_char_t sc)
{
/* dfn: descriptions file name */
/* sc: separator char */
- std::ifstream mfs (dfn.c_str(),std::ios::app);
+ std::ifstream mfs (dfn.c_str(),std::ios::in);
std::string ln;
#if FIM_WANT_PIC_CCMT
std::string cps,cas,din; // contextual prepend/append/dirname string
@@ -309,6 +309,12 @@ public:
// fim_fms_t dt;
// dt = - getmilliseconds();
+ if( !mfs.is_open() )
+ {
+ std::cerr << "File " << dfn << " could not be opened!" << std::endl;
+ return false; // a proper FIM_ERR.. would be better
+ }
+
while( std::getline(mfs,ln))
{
std::stringstream ls(ln);
@@ -507,6 +513,7 @@ public:
}
}
}
+ mfs.close();
reset();
#if FIM_WANT_PIC_LVDN
// print(std::cout) << "\n";
@@ -515,6 +522,7 @@ public:
#endif /* FIM_WANT_PIC_LVDN */
// dt += getmilliseconds();
// std::cout << fim::string("fetched images descriptions in ") << dt << " ms" << std::endl;
+ return true;
}
key_type fk(const mapped_type & sk)
{
diff --git a/src/Makefile.am b/src/Makefile.am
index a10424b..4051087 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-# $Id: Makefile.am 2171 2024-04-07 22:08:57Z dezperado $
+# $Id: Makefile.am 2252 2024-05-12 09:54:03Z dezperado $
subdir = src
AUTOMAKE_OPTIONS = no-dependencies dejagnu subdir-objects
@@ -9,6 +9,10 @@ bin_PROGRAMS = fim
bin_SCRIPTS = fimgs
doc_DATA = fimrc
+if WANT_WASM
+all: fim.html
+endif
+
LFLAGS = -+ # --nounistd
YFLAGS = -v -d
@@ -120,6 +124,9 @@ EXTRA_fim_SOURCES += FbiStuffWebP.cpp
EXTRA_fim_SOURCES += FbiStuffAVIF.cpp
CLEANFILES=$(BUILT_SOURCES) yacc.output b2ba$(EXEEXT)
+if WANT_WASM
+CLEANFILES += fim.html fim.js
+endif
#CPP_FLAGS="$CPP_FLAGS -D X_DISPLAY_MISSING"
#AM_CPPFLAGS=
@@ -235,7 +242,7 @@ if WANT_WASM
# your mileage may vary
PRELOAD_FILES = 0.pcx 1.pcx 2.pcx 3.pcx 4.pcx 5.pcx 6.pcx 7.pcx 8.pcx 9.pcx
EXTRA_DIST += $(PRELOAD_FILES)
-am_CXXFLAGS = --preload-file 0.pcx --preload-file 1.pcx --preload-file 2.pcx --preload-file 3.pcx --preload-file 4.pcx --preload-file 5.pcx --preload-file 6.pcx --preload-file 7.pcx --preload-file 8.pcx --preload-file 9.pcx
+AM_CXXFLAGS = --preload-file 0.pcx --preload-file 1.pcx --preload-file 2.pcx --preload-file 3.pcx --preload-file 4.pcx --preload-file 5.pcx --preload-file 6.pcx --preload-file 7.pcx --preload-file 8.pcx --preload-file 9.pcx
$(fim_OBJECTS): $(PRELOAD_FILES)
$(PRELOAD_FILES):
cp ../media/numbers_pcx/0.pcx .
diff --git a/src/Makefile.in b/src/Makefile.in
index b6d42c5..dbe50ec 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -14,7 +14,7 @@
@SET_MAKE@
-# $Id: Makefile.am 2171 2024-04-07 22:08:57Z dezperado $
+# $Id: Makefile.am 2252 2024-05-12 09:54:03Z dezperado $
@@ -93,7 +93,8 @@ POST_UNINSTALL = :
check_PROGRAMS = fim$(EXEEXT)
bin_PROGRAMS = fim$(EXEEXT)
@WITH_FLEXLEXER_TRUE@am__append_1 = lex.yy.cc yacc.tab.cpp conf.h yacc.tab.hpp
-@WANT_WASM_TRUE@am__append_2 = $(PRELOAD_FILES)
+@WANT_WASM_TRUE@am__append_2 = fim.html fim.js
+@WANT_WASM_TRUE@am__append_3 = $(PRELOAD_FILES)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -357,6 +358,7 @@ HAVE_CPP = @HAVE_CPP@
HAVE_ECHO = @HAVE_ECHO@
HAVE_FLEX = @HAVE_FLEX@
HAVE_GREP = @HAVE_GREP@
+HAVE_GROFF = @HAVE_GROFF@
HAVE_MAN = @HAVE_MAN@
HAVE_RM = @HAVE_RM@
HAVE_SED = @HAVE_SED@
@@ -498,7 +500,8 @@ EXTRA_fim_SOURCES = FbiStuffGif.cpp FbiStuffJasPer.cpp \
FbiStuffPdf.cpp FbiStuffPs.cpp Imlib2Device.cpp \
FbiStuffXyz.cpp FbiStuffPcx.cpp FbiStuffBmp.cpp \
FbiStuffWebP.cpp FbiStuffAVIF.cpp
-CLEANFILES = $(BUILT_SOURCES) yacc.output b2ba$(EXEEXT)
+CLEANFILES = $(BUILT_SOURCES) yacc.output b2ba$(EXEEXT) \
+ $(am__append_2)
#CPP_FLAGS="$CPP_FLAGS -D X_DISPLAY_MISSING"
#AM_CPPFLAGS=
@@ -595,10 +598,10 @@ fim_SOURCES = $(BUILT_SOURCES) \
# regex.c is work in progress and awaits for integration
EXTRA_DIST = lex.lex yacc.ypp fimrc defaultConfiguration.cpp fimgs \
testdir/*ok testdir/*in testdir/Makefile testsuite/*/* regex.c \
- b2ba.c $(am__append_2)
+ b2ba.c $(am__append_3)
# your mileage may vary
@WANT_WASM_TRUE@PRELOAD_FILES = 0.pcx 1.pcx 2.pcx 3.pcx 4.pcx 5.pcx 6.pcx 7.pcx 8.pcx 9.pcx
-@WANT_WASM_TRUE@am_CXXFLAGS = --preload-file 0.pcx --preload-file 1.pcx --preload-file 2.pcx --preload-file 3.pcx --preload-file 4.pcx --preload-file 5.pcx --preload-file 6.pcx --preload-file 7.pcx --preload-file 8.pcx --preload-file 9.pcx
+@WANT_WASM_TRUE@AM_CXXFLAGS = --preload-file 0.pcx --preload-file 1.pcx --preload-file 2.pcx --preload-file 3.pcx --preload-file 4.pcx --preload-file 5.pcx --preload-file 6.pcx --preload-file 7.pcx --preload-file 8.pcx --preload-file 9.pcx
RUNTESTDEFAULTFLAGS = --tool ./fim$(EXEEXT) FIM=$$srcdir/./fim$(EXEEXT) --srcdir $$srcdir/testsuite
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -1098,6 +1101,8 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
.PRECIOUS: Makefile
+@WANT_WASM_TRUE@all: fim.html
+
#lex.yy.cc : lex.lex
lex.yy.cc: lex.lex yacc.tab.cpp
$(LEX) $(LFLAGS) $<
@@ -1151,7 +1156,7 @@ help-acm.cpp: fim.h
$(ECHO) '//#endif' >> $@
b2ba$(EXEEXT): b2ba.c
- $(CC) -o $@ $<
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $<
@FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_WASM_FALSE@default_font_byte_array.h: $(FIM_CUSTOM_HARDCODED_CONSOLEFONT) b2ba$(EXEEXT)
@FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@@WANT_WASM_FALSE@ ./b2ba$(EXEEXT) < $< > $@
diff --git a/src/SDLDevice.cpp b/src/SDLDevice.cpp
index 97e228a..b0f77a1 100644
--- a/src/SDLDevice.cpp
+++ b/src/SDLDevice.cpp
@@ -1,4 +1,4 @@
-/* $LastChangedDate: 2024-04-07 21:40:35 +0200 (Sun, 07 Apr 2024) $ */
+/* $LastChangedDate: 2024-05-09 00:45:30 +0200 (Thu, 09 May 2024) $ */
/*
SDLDevice.cpp : sdllib device Fim driver file
@@ -706,7 +706,7 @@ fim_sys_int SDLDevice::get_input_inner(fim_key_t * c, SDL_Event*eventp, fim_sys_
break;
case SDL_DROPFILE:
cc.push(event.drop.file,FIM_FLAG_PUSH_REC/*|FIM_FLAG_PUSH_BACKGROUND|FIM_FLAG_PUSH_FILE_NO_CHECK*/); // TODO: perhaps add flag to jump there; and make FIM_FLAG_PUSH_REC effective from this context.
- cc.browser_.fcmd_goto(args_t{"?"+std::string(event.drop.file)}); // mere $ could not cope with jump to existing
+ cc.browser_.fcmd_goto(args_t{std::string("?")+event.drop.file}); // mere $ could not cope with jump to existing
sdl2_redraw();
break;
case SDL_DISPLAYEVENT:
@@ -742,6 +742,8 @@ fim_sys_int SDLDevice::get_input_inner(fim_key_t * c, SDL_Event*eventp, fim_sys_
case SDL_QUIT:
#if FIM_SDL_ALLOW_QUIT
*c=cc.find_keycode_for_bound_cmd(FIM_FLT_QUIT);
+ if (!*c)
+ FIM_DD_HURRY_QUIT();
return 1;
#endif /* FIM_SDL_ALLOW_QUIT */
*keypressp = 1; // fixme
@@ -961,12 +963,7 @@ done:
case SDL_KEYUP:
return 0;
break;
- case SDL_MOUSEWHEEL:
-#if FIM_WANT_MOUSE_WHEEL_SCROLL
- if(Viewport* cv = cc.current_viewport())
- cv->mouse_scroll(event.wheel.y);
-#endif /* FIM_WANT_MOUSE_WHEEL_SCROLL */
- break;
+ /* Note: No SDL_MOUSEWHEEL in SDL-1.2: SDL_BUTTON_WHEELUP, SDL_BUTTON_WHEELDOWN */
case SDL_MOUSEMOTION:
#if FIM_WANT_MOUSE_PAN
if(Viewport* cv = cc.current_viewport())
diff --git a/src/defaultConfiguration.cpp b/src/defaultConfiguration.cpp
index aa65c36..fcbd640 100644
--- a/src/defaultConfiguration.cpp
+++ b/src/defaultConfiguration.cpp
@@ -1,4 +1,4 @@
-/* $LastChangedDate: 2024-03-31 00:37:24 +0100 (Sun, 31 Mar 2024) $ */
+/* $LastChangedDate: 2024-04-17 22:32:40 +0200 (Wed, 17 Apr 2024) $ */
/*
defaultConfiguration.cpp :
The following code contains key bindings and aliases definitions
@@ -36,10 +36,10 @@
alias("scale_factor_shrink","scale '+/'","divide the scale factors " FIM_VID_REDUCE_FACTOR " and " FIM_VID_MAGNIFY_FACTOR " by " FIM_VID_SCALE_FACTOR_MULTIPLIER "");
alias("scale_factor_decrease","scale '+-'","subtract " FIM_VID_SCALE_FACTOR_DELTA " to the scale factors " FIM_VID_REDUCE_FACTOR " and " FIM_VID_MAGNIFY_FACTOR "");
alias("scale_factor_increase","scale '++'","add " FIM_VID_SCALE_FACTOR_DELTA " to the scale factors " FIM_VID_REDUCE_FACTOR " and " FIM_VID_MAGNIFY_FACTOR "");
- alias('A',"'" FIM_VID_AUTOTOP "=1-" FIM_VID_AUTOTOP ";'");
+ alias('A',FIM_VID_AUTOTOP "=1-" FIM_VID_AUTOTOP ";");
#endif
#if 0
- alias('A',"'autotop=1-autotop;'");
+ alias('A',"autotop=1-autotop;");
alias(FIM_FLA_TOGGLE_VERBOSITY,"verbose=1-verbose;display;");
alias("toggleKeyVerbosity","_verbose_keys=1-_verbose_keys;display;");
#endif
diff --git a/src/fim.cpp b/src/fim.cpp
index 149818e..dd7cceb 100644
--- a/src/fim.cpp
+++ b/src/fim.cpp
@@ -1,4 +1,4 @@
-/* $LastChangedDate: 2024-04-09 21:08:29 +0200 (Tue, 09 Apr 2024) $ */
+/* $LastChangedDate: 2024-04-29 14:03:11 +0200 (Mon, 29 Apr 2024) $ */
/*
fim.cpp : Fim main program and accessory functions
@@ -311,9 +311,10 @@ FIM_MAN_fB("'b'") " hides the menu bar, "
FIM_MAN_fB("'e'") " starts with empty menus, "
FIM_MAN_fB("'" FIM_CNS_GTK_MNRBCHR_STR "'") " rebuilds the menus, and "
FIM_MAN_fB("'" FIM_CNS_GTK_MNDLCHR_STR "'") " removes the menus."
-" " FIM_MAN_fB("Warning") ": the \\fB" "gtk" "\\fP mode is still work in progress."
+" " FIM_MAN_fB("Note") ": the \\fB" "gtk" "\\fP mode is a recent addition and may have defects."
#endif /* FIM_WANT_SDL_OPTIONS_STRING FIM_WITH_LIBGTK */
//#ifdef FIM_WITH_LIBIMLIB2
+" The " FIM_MAN_fB(FIM_DDN_INN_SDL) " mode works best with libsdl-2; libsdl-1.2 support is being discontinued.\n"
" The " FIM_MAN_fB(FIM_DDN_INN_IL2) " option requests imlib2 and is unfinished: do not use it.\n"
" The " FIM_MAN_fB(FIM_DDN_INN_DUMB) " test mode is there only for test purposes and is not interactive.\n"
//#endif /* FIM_WITH_LIBIMLIB2 */
@@ -1129,7 +1130,7 @@ FIM_MAN_fB("fim")
".TP 15\n"
".B " FIM_CNS_HIST_COMPLETE_FILENAME "\n"
-"File where to load from or save. See"
+"File where to load from or save command history. See"
" (man " FIM_MAN_fR("fimrc") "(5),"
" man " FIM_MAN_fR("readline") "(3))."
"\n"
@@ -1268,13 +1269,19 @@ ret:
return 0;
}
-void fim_args_from_desc_file(args_t& argsc, const fim_fn_t& dfn, const fim_char_t sc)
+bool fim_args_from_desc_file(args_t& argsc, const fim_fn_t& dfn, const fim_char_t sc)
{
/* dfn: descriptions file name */
/* sc: separator char */
- std::ifstream mfs (dfn.c_str(),std::ios::app);
+ std::ifstream mfs (dfn.c_str(),std::ios::in);
std::string ln;
+ if( !mfs.is_open() )
+ {
+ std::cerr << "Description file " << dfn << " could not be opened!" << std::endl;
+ return false; // a proper FIM_ERR.. would be better
+ }
+
while( std::getline(mfs,ln))
{
std::stringstream ls(ln);
@@ -1287,6 +1294,8 @@ void fim_args_from_desc_file(args_t& argsc, const fim_fn_t& dfn, const fim_char_
if(std::getline(ls,fn,sc))
argsc.push_back(fn);
}
+ mfs.close();
+ return true;
}
std::string guess_output_device(void)const
@@ -1892,8 +1901,11 @@ std::string guess_output_device(void)const
break;
#if FIM_WANT_PIC_LISTUNMARK
case 0x6d666466:
- fim_args_from_desc_file(argsc,optarg,g_sc);
- break;
+ if(!fim_args_from_desc_file(argsc,optarg,g_sc))
+ {
+ retcode=FIM_PERR_BAD_PARAMS;
+ goto ret;
+ }
#endif /* FIM_WANT_PIC_LISTUNMARK */
#if FIM_WANT_PIC_CMTS
case /*0x69646673*/'S': /* FIM_OSW_IMG_DSC_FILE_SEPC */
@@ -1901,7 +1913,12 @@ std::string guess_output_device(void)const
g_sc = *optarg;
break;
case /*0x6c696466*/'D': /* FIM_OSW_LOAD_IMG_DSC_FILE */
- cc.id_.fetch(optarg,g_sc);
+ if(!cc.id_.fetch(optarg,g_sc))
+ {
+ std::cerr << "Descriptions file could not be opened!" << std::endl;
+ retcode=FIM_PERR_BAD_PARAMS;
+ goto ret;
+ }
#if FIM_WANT_PIC_CMTS_RELOAD
cc.browser_.dfl_.push_back({optarg,g_sc});
#endif /* FIM_WANT_PIC_CMTS_RELOAD */
@@ -2191,7 +2208,7 @@ extern "C" {
" )"
#else /* SVN_REVISION */
/* obsolete */
- # define FIM_REPOSITORY_VERSION "$LastChangedDate: 2024-04-09 21:08:29 +0200 (Tue, 09 Apr 2024) $"
+ # define FIM_REPOSITORY_VERSION "$LastChangedDate: 2024-04-29 14:03:11 +0200 (Mon, 29 Apr 2024) $"
# ifdef FIM_REPOSITORY_VERSION
" ( repository version "
FIM_REPOSITORY_VERSION
diff --git a/src/fim.h b/src/fim.h
index 5eb7149..bb284bf 100644
--- a/src/fim.h
+++ b/src/fim.h
@@ -1,4 +1,4 @@
-/* $LastChangedDate: 2024-04-08 14:22:00 +0200 (Mon, 08 Apr 2024) $ */
+/* $LastChangedDate: 2024-05-11 18:22:53 +0200 (Sat, 11 May 2024) $ */
/*
fim.h : Fim main header file
@@ -766,7 +766,7 @@ namespace fim
#define FIM_VID_CACHE_STATUS "_cache_status" /* "[out,g:] string with current information on cache status." */
#define FIM_VID_DISPLAY_CONSOLE "_display_console" /* "[in,g:] if 1, display the output console." */
#define FIM_VID_DEVICE_DRIVER "_device_string" /* "[out,g:] the current display device string, in the form " FIM_DDN_VARS "." " See option --" FIM_OSW_OUTPUT_DEVICE " for a description." */
-#define FIM_VID_DISPLAY_STATUS "_display_status" /* "[in,g:] if 1, display display the status bar." */
+#define FIM_VID_DISPLAY_STATUS "_display_status" /* "[in,g:] if 1, display the status bar." */
#define FIM_VID_DISPLAY_STATUS_FMT "_display_status_fmt" /* "[in,g:] custom info format string, displayed in the lower left corner of the status bar; if unset: full pathname; otherwise a custom format string specified just as " FIM_VID_INFO_FMT_STR"." */
#define FIM_VID_PUSH_PUSHES_DIRS "_push_pushes_dirs" /* "[in,g:] if 1, the push command also accepts and pushes directories (using pushdir). if 2, also push hidden files/directories, that is, ones whose names begin with a dot (.)." */
#define FIM_VID_SANITY_CHECK "_do_sanity_check" /* "[in,experimental,g:] if 1, execute a sanity check on startup." */
@@ -805,7 +805,7 @@ namespace fim
#define FIM_VID_LASTPAGEINDEX "_lastpageindex" /* "[out,g:] the last visited file page index." */
#define FIM_VID_LASTGOTODIRECTION "_lastgotodirection" /* "[out,g:] the last file goto direction (either string '+1' or string '-1')." */
#define FIM_VID_FILELISTLEN "_filelistlen" /* "[out,g:] current image list length (number of visible images)." */
-#define FIM_VID_INFO_FMT_STR "_info_fmt_str" /* "[in,g:] custom info format string, displayed in the lower right corner of the status bar; may contain ordinary text and special 'expando' sequences. These are: %p for current scale, in percentage; %w for width; %h for height; %i for image index in list; %k for the value of i:_comment (comment description) variable in square brackets; %l for current image list length; %L for flip/mirror/orientation information; %P for page information; %F for file size; %M for screen image memory size; %m for memory used by mipmap; %C for memory used by cache; %T for total memory used (approximation); %R for total max memory used (as detected by getrusage()); %n for the current file path name; %N for the current file path name basename; ; %c for centering information; %v for the fim program/version identifier string; %% for an ordinary %. A sequence like %?VAR?EXP? expands to EXP if i:VAR is set (or, otherwise, if VAR); EXP is copied verbatim except for contained sequences of the form %:VAR:, which expand to the value of variable i:VAR (or, if unset, VAR); this is meant to be used like in e.g. '%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?', where the EXIF-set variable EXIF_DateTimeOriginal (make sure you have libexif for this) are used only if present." */
+#define FIM_VID_INFO_FMT_STR "_info_fmt_str" /* "[in,g:] custom info format string, displayed in the lower right corner of the status bar; may contain ordinary text and special 'expando' sequences. These are: %p for current scale, in percentage; %w for width; %h for height; %i for image index in list; %k for the value of i:_comment (comment description) variable in square brackets (if non empty); %l for current image list length; %L for flip/mirror/orientation information; %P for page information; %F for file size; %M for screen image memory size; %m for memory used by mipmap; %C for memory used by cache; %T for total memory used (approximation); %R for total max memory used (as detected by getrusage()); %n for the current file path name; %N for the current file path name basename; ; %c for centering information; %v for the fim program/version identifier string; %% for an ordinary %. A sequence like %?VAR?EXP? expands to EXP if i:VAR is set (or, otherwise, if VAR); EXP is copied verbatim except for contained sequences of the form %:VAR:, which expand to the value of variable i:VAR (or, if unset, VAR); this is meant to be used like in e.g. '%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?', where the EXIF-set variable EXIF_DateTimeOriginal (make sure you have libexif for this) are used only if present." */
#define FIM_VID_FILENAME "_filename" /* "[out,i:] the current file name string." */
#define FIM_VID_FIM_DEFAULT_CONFIG_FILE_CONTENTS "_fim_default_config_file_contents"/* "[out,g:] the contents of the default (hardcoded) configuration file (executed after the minimal hardcoded config)." */
#define FIM_VID_FIM_DEFAULT_GRAMMAR_FILE_CONTENTS "_fim_default_grammar_file_contents" /* "[out,g:] the contents of the default (hardcoded) grammar file." */
@@ -1163,7 +1163,7 @@ namespace fim
#define FIM_CMD_HELP_AUTOCMD FIM_FLT_AUTOCMD " " FIM_CNS_EX_EVT_STRING " " FIM_CNS_EX_PAT_STRING " " FIM_CNS_EX_CMDS_STRING ": manipulate autocommands (inspired from Vim autocmd's)." FIM_CNS_CMDSEP "Without arguments, list autocommands." FIM_CNS_CMDSEP "With arguments, specifies for which type of event and which current file open, which commands to execute." FIM_CNS_CMDSEP "See the default built-in configuration files for examples."
#define FIM_CMD_HELP_AUTOCMD_DEL FIM_FLT_AUTOCMD_DEL ": specify autocommands to delete." FIM_CNS_CMDSEP "Usage: " FIM_FLT_AUTOCMD_DEL " " FIM_CNS_EX_EVT_STRING " " FIM_CNS_EX_PAT_STRING " " FIM_CNS_EX_CMDS_STRING "."
#define FIM_CMD_HELP_BASENAME FIM_FLT_BASENAME" " FIM_CNS_EX_FN_STRING ": returns the basename of " FIM_CNS_EX_FN_STRING " in the '" FIM_VID_LAST_CMD_OUTPUT "' variable."
-#define FIM_CMD_HELP_BIND FIM_FLT_BIND" [" FIM_CNS_EX_KSY_STRING " [" FIM_CNS_EX_CMDS_STRING "]]: bind a keyboard symbol/shortcut " FIM_CNS_EX_KSY_STRING " to " FIM_CNS_EX_CMDS_STRING "." FIM_CNS_CMDSEP FIM_CNS_RAW_KEYS_MESG FIM_CNS_CMDSEP "Key binding is dynamical, so you can rebind keys even during program's execution." FIM_CNS_CMDSEP "You can get a list of valid symbols (keysyms) by invoking " FIM_FLT_DUMP_KEY_CODES " or in the man page."
+#define FIM_CMD_HELP_BIND FIM_FLT_BIND " [" FIM_CNS_EX_KSY_STRING " [" FIM_CNS_EX_CMDS_STRING " [" FIM_CNS_EX_DSC_STRING "]]]: bind a key " FIM_CNS_EX_KSY_STRING " to " FIM_CNS_EX_CMDS_STRING "." FIM_CNS_CMDSEP "Optional " FIM_CNS_EX_DSC_STRING " specifies a documentation string." FIM_CNS_CMDSEP FIM_CNS_RAW_KEYS_MESG FIM_CNS_CMDSEP "Key binding is dynamical, so you can bind keys even during program's execution." FIM_CNS_CMDSEP "You can get a list of valid symbols (keysyms) by invoking " FIM_FLT_DUMP_KEY_CODES " or in the man page."
#define FIM_CMD_HELP_LIST FIM_FLT_LIST ": display the files list." FIM_CNS_CMDSEP FIM_FLT_LIST " 'random_shuffle': randomly shuffle the file list." FIM_CNS_CMDSEP FIM_FLT_LIST " 'reverse': reverse the file list." FIM_CNS_CMDSEP FIM_FLT_LIST " 'clear': clear the file list." FIM_CNS_CMDSEP FIM_FLT_LIST " 'sort': sort the file list." FIM_CNS_CMDSEP FIM_FLT_LIST " 'sort_basename': sort the file list according to base name." FIM_CNS_CMDSEP FIM_FLT_LIST " 'sort_comment': sort the file list according to the value of the " FIM_VID_COMMENT " variable." FIM_CNS_CMDSEP FIM_FLT_LIST " 'sort_var' " FIM_CNS_EX_VAR_STRING ": sort the file list according to the value of the i:" FIM_CNS_EX_VAR_STRING " variable." FIM_CNS_CMDSEP FIM_FLT_LIST " 'vars'|'variables': list variables in all i:* read from description file." FIM_CNS_CMDSEP FIM_FLT_LIST " 'sort_fsize': sort the file list according to file size." FIM_CNS_CMDSEP FIM_FLT_LIST " 'sort_mtime': sort the file list according to modification date. " FIM_CNS_CMDSEP FIM_FLT_LIST " 'pop': remove the current file from the files list, and step back." FIM_CNS_CMDSEP FIM_FLT_LIST " 'remove' [" FIM_CNS_EX_FNS_STRING "]: remove the current file, or the " FIM_CNS_EX_FNS_STRING ", if specified." FIM_CNS_CMDSEP FIM_FLT_LIST " 'push' " FIM_CNS_EX_FNS_STRING ": push " FIM_CNS_EX_FNS_STRING " to the back of the files list." FIM_CNS_CMDSEP FIM_FLT_LIST " 'filesnum': display the number of files in the files list." FIM_CNS_CMDSEP FIM_FLT_LIST " 'mark' [" FIM_CNS_EX_ARGS_STRING "]: mark image file names for stdout printing at exit, with " FIM_CNS_EX_ARGS_STRING " mark the ones matching according to the rules of the '" FIM_FLT_LIMIT "' command, otherwise the current file." FIM_CNS_CMDSEP FIM_FLT_LIST " 'unmark' [" FIM_CNS_EX_ARGS_STRING "]: unmark marked image file names, with " FIM_CNS_EX_ARGS_STRING " unmark the ones matching according to the rules of the '" FIM_FLT_LIMIT "' command, otherwise the current file." FIM_CNS_CMDSEP FIM_FLT_LIST " 'marked': show which files have been marked so far." FIM_CNS_CMDSEP FIM_FLT_LIST " 'dumpmarked': dump to stdout the marked files (you usually want to 'unmarkall' afterwards)." FIM_CNS_CMDSEP FIM_FLT_LIST " 'markall': mark all the current list files." FIM_CNS_CMDSEP FIM_FLT_LIST " 'unmarkall': unmark all the marked files." FIM_CNS_CMDSEP FIM_FLT_LIST " 'pushdir' " FIM_CNS_EX_DIRNAME ": push all the files in " FIM_CNS_EX_DIRNAME ", when matching the regular expression in variable " FIM_VID_PUSHDIR_RE " or, if empty, from constant regular expression '" FIM_CNS_PUSHDIR_RE "'." FIM_CNS_CMDSEP FIM_FLT_LIST " 'pushdirr' " FIM_CNS_EX_DIRNAME ": like pushdir, but also push encountered directory entries recursively." FIM_CNS_CMDSEP FIM_FLT_LIST " 'swap': move the current image filename to the first in the list (you'll have to invoke " FIM_FLT_RELOAD " to see the effect)." FIM_CNS_CMDSEP "Of the above commands, several are temporarily not available for the duration of a background load (enabled by --" FIM_OSW_BGREC "), which lasts until " FIM_VID_LOADING_IN_BACKGROUND " is 0."
#define FIM_CMD_HELP_CLEAR FIM_FLT_CLEAR ": clear the virtual console."
#define FIM_CMD_HELP_CROP \
@@ -1185,12 +1185,12 @@ namespace fim
FIM_CNS_CMDSEP "To get back the original, you have to reload the image."
#define FIM_CMD_HELP_DUMP_KEY_CODES FIM_FLT_DUMP_KEY_CODES ": dump the active key codes (unescaped, for inspection purposes)."
#define FIM_CMD_HELP_ECHO FIM_FLT_ECHO " " FIM_CNS_EX_ARGS_STRING ": print the " FIM_CNS_EX_ARGS_STRING " on console."
-#define FIM_CMD_HELP_ELSE FIM_CNS_IFELSE ": see " FIM_FLT_ELSE "."
+#define FIM_CMD_HELP_ELSE FIM_CNS_IFELSE ": see " FIM_FLT_IF "."
#define FIM_CMD_HELP_EXEC FIM_FLT_EXEC " " FIM_CNS_EX_FNS_STRING ": execute script " FIM_CNS_EX_FNS_STRING "."
#define FIM_CMD_HELP_FONT \
FIM_FLT_FONT " 'scan' [" FIM_CNS_EX_DIRNAME "]: scan " FIM_CNS_EX_DIRNAME " or " FIM_LINUX_CONSOLEFONTS_DIR " looking for fonts in the internal fonts list."\
FIM_CNS_CMDSEP FIM_FLT_FONT " 'load' " FIM_CNS_EX_FN_STRING ": load font " FIM_CNS_EX_FN_STRING "."\
- FIM_CNS_CMDSEP FIM_FLT_FONT " 'next'/'prev': load next/previous font in the internal fonts list."\
+ FIM_CNS_CMDSEP FIM_FLT_FONT " {'next'|'prev'}: load next or previous font from the internal fonts list."\
FIM_CNS_CMDSEP FIM_FLT_FONT " 'info': print current font filename."
#define FIM_CMD_HELP_CD FIM_FLT_CD " " FIM_CNS_EX_PATH_STRING ": change the current directory to " FIM_CNS_EX_PATH_STRING "." FIM_CNS_CMDSEP "If " FIM_CNS_EX_PATH_STRING " is a file, use its base directory name." FIM_CNS_CMDSEP FIM_FLT_CD " '-' changes to the previous current directory (before the last ':" FIM_FLT_CD " " FIM_CNS_EX_PATH_STRING "' command)."
#define FIM_CMD_HELP_GETENV FIM_FLT_GETENV " " FIM_CNS_EX_ID_STRING ": create a variable with the same value as the '" FIM_CNS_EX_ID_STRING "' environment variable, but with an identifier prefixed by 'ENV_'. So e.g. " FIM_FLT_GETENV " 'DISPLAY' creates 'ENV_DISPLAY'. Nothing is being printed; no variable is created if " FIM_CNS_EX_ID_STRING " is empty."
@@ -1212,8 +1212,9 @@ namespace fim
#define FIM_CMD_HELP_RELOAD FIM_FLT_RELOAD" [" FIM_CNS_EX_ARG_STRING "]: load the image into memory." FIM_CNS_CMDSEP "If " FIM_CNS_EX_ARG_STRING " is present, force reloading, bypassing the cache (see also '" FIM_FLT_LOAD "')." FIM_CMD_ACM_INFO(FIM_ACM_PRERELOAD,FIM_ACM_POSTRELOAD)
#define FIM_CMD_HELP_ROTATE FIM_FLT_ROTATE " " FIM_CNS_EX_NUM_STRING ": rotate the image the specified amount of degrees. If unspecified, by one. If you are interested in orthogonal rotations, see '" FIM_VID_ORIENTATION "' and related aliases." FIM_CMD_ACM_INFO(FIM_ACM_PRESCALE,FIM_ACM_POSTSCALE)
#define FIM_CMD_HELP_SCROLL FIM_FLT_SCROLL ": scroll down the image, going next when hitting the bottom." FIM_CNS_CMDSEP FIM_FLT_SCROLL " 'forward': scroll the image as we were reading left to right (see '" FIM_VID_SKIP_SCROLL "' variable)." FIM_CMD_ACM_INFO(FIM_ACM_PREPAN,FIM_ACM_POSTPAN)
-#define FIM_CMD_HELP_SET_CONSOLE_MODE FIM_FLT_SET_CONSOLE_MODE ": set console mode."
-#define FIM_CMD_HELP_SET_INTERACTIVE_MODE FIM_FLT_SET_INTERACTIVE_MODE ": set interactive mode."
+#define FIM_CMD_HELP_SET_CONSOLE_MODE_WARNING " Note that the mode will change only after the current block of commands is evaluated."
+#define FIM_CMD_HELP_SET_CONSOLE_MODE FIM_FLT_SET_CONSOLE_MODE ": set console mode." FIM_CMD_HELP_SET_CONSOLE_MODE_WARNING
+#define FIM_CMD_HELP_SET_INTERACTIVE_MODE FIM_FLT_SET_INTERACTIVE_MODE ": set interactive mode." FIM_CMD_HELP_SET_CONSOLE_MODE_WARNING
#define FIM_CMD_HELP_SLEEP FIM_FLT_SLEEP " [" FIM_CNS_EX_NUM_STRING "]: sleep for the specified number of seconds (or 1, if unspecified)."
#define FIM_CMD_HELP_STATUS FIM_FLT_STATUS ": set the status line to the collation of the given arguments."
#define FIM_CMD_HELP_STDERR FIM_FLT_STDERR " " FIM_CNS_EX_ARGS_STRING ": writes to stderr its arguments " FIM_CNS_EX_ARGS_STRING "."
@@ -1222,7 +1223,7 @@ namespace fim
#define FIM_CMD_HELP_UNALIAS FIM_FLT_UNALIAS " " FIM_CNS_EX_ID_STRING " | '-a': delete the alias " FIM_CNS_EX_ID_STRING " or all aliases (use '-a', not -a)."
#define FIM_CMD_HELP_UNBIND FIM_FLT_UNBIND " " FIM_CNS_EX_KSY_STRING ": unbind the action associated to a specified " FIM_CNS_EX_KSY_STRING FIM_CNS_CMDSEP FIM_CNS_RAW_KEYS_MESG ""
#define FIM_CMD_HELP_WHILE "while(" FIM_CNS_EX_NBEXP_STRING "){" FIM_CNS_EX_ACT_STRING ";}: A conditional cycle construct." FIM_CNS_CMDSEP "May be interrupted by hitting the '" FIM_KBD_ESC "' or the '" FIM_KBD_COLON "' key."
-#define FIM_CMD_HELP_SET FIM_FLT_SET ": returns a list of variables which are set." FIM_CNS_CMDSEP FIM_FLT_SET " " FIM_CNS_EX_ID_STRING ": returns the value of variable " FIM_CNS_EX_ID_STRING "." FIM_CNS_CMDSEP FIM_FLT_SET " " FIM_CNS_EX_ID_STRING " " FIM_CNS_EX_CMDS_STRING ": sets variable " FIM_CNS_EX_ID_STRING " to value " FIM_CNS_EX_CMDS_STRING "."
+#define FIM_CMD_HELP_SET FIM_FLT_SET ": returns a list of variables which are set." FIM_CNS_CMDSEP FIM_FLT_SET " " FIM_CNS_EX_ID_STRING ": returns the value of variable " FIM_CNS_EX_ID_STRING "." FIM_CNS_CMDSEP FIM_FLT_SET " " FIM_CNS_EX_ID_STRING " " FIM_CNS_EX_VALUE ": sets variable " FIM_CNS_EX_ID_STRING " to value " FIM_CNS_EX_VALUE "."
#define FIM_CMD_HELP_PWD FIM_FLT_PWD ": print the current directory name, and updates the '" FIM_VID_PWD "' variable."
#define FIM_CMD_HELP_EVAL FIM_FLT_EVAL " " FIM_CNS_EX_ARGS_STRING ": evaluate " FIM_CNS_EX_ARGS_STRING " as commands, executing them."
#define FIM_CMD_HELP_SYSTEM FIM_FLT_SYSTEM " " FIM_CNS_EX_SYSC_STRING ": get the output of executing the " FIM_CNS_EX_SYSC_STRING " system command. Uses the popen() system call. Usually popen invokes \"" FIM_CNS_SHELL " -c " FIM_CNS_EX_SYSC_STRING "\". This might not handle a multi-word command; in that case you have to put it into a script. See 'man popen' for more." FIM_CNS_SYS_DISABLE
@@ -1233,7 +1234,7 @@ namespace fim
#endif /* FIM_DISABLE_WINDOW_SPLITTING */
#define FIM_CMD_HELP_GOTO FIM_FLT_GOTO " {['+'|'-']" FIM_CNS_EX_NUM_STRING "['%']['f'|'p'|'F'|'P']}+ | {/" FIM_CNS_EX_RE_STRING "/} | {" FIM_SYM_BW_SEARCH_KEY_STR FIM_CNS_EX_FN_STRING "} | {'+//'} | {'+/'|'-/'}[" FIM_MAN_fR("C") "] | {{'+'|'-'}" FIM_CNS_EX_ID_STRING "['+']}: jump to an image." FIM_CNS_CMDSEP "If " FIM_CNS_EX_NUM_STRING " is given, and not surrounded by any specifier, go to image at index " FIM_CNS_EX_NUM_STRING "." FIM_CNS_CMDSEP "If followed by '%', the effective index is computed as a percentage to the current available images." FIM_CNS_CMDSEP "If prepended by '-' or '+', the jump is relative to the current index." FIM_CNS_CMDSEP "The 'f' specifier asks for the jump to occur within the files (same for 'F', but accelerates if keep pressing)." FIM_CNS_CMDSEP "The 'p' specifier asks for the jump to occur in terms of pages, within the current file (same for 'P', but accelerates if keep pressing)." FIM_CNS_CMDSEP "If there's only one file in the list and no 'f' specified, a 'p' will be implied, for a page jump." FIM_CNS_CMDSEP "The above form can be concatenated several times, but only the last occurrence of either file or page goto will be effective." FIM_CNS_CMDSEP "If /" FIM_CNS_EX_RE_STRING "/ is given, jump to the first image matching the given /" FIM_CNS_EX_RE_STRING "/ regular expression pattern." FIM_CNS_CMDSEP "If the argument starts with " FIM_SYM_BW_SEARCH_KEY_STR ", jump to the filename following " FIM_SYM_BW_SEARCH_KEY_STR "." FIM_CNS_CMDSEP "If given '+//', jump to the first different image matching the last given regular expression pattern." FIM_CNS_CMDSEP "With '+/'" FIM_MAN_fR("C") " or '-/'" FIM_MAN_fR("C") ", jump to the next or the previous file according to " FIM_MAN_fR("C") ": if 's' if same directory, if 'd' if down the directory hierarchy, if 'u' if down the directory hierarchy, if 'b' if same basename, if upper case match is negative, if missing defaults to 'S' (jump to file in different dir)." FIM_CNS_CMDSEP "If " FIM_CNS_EX_IDS_STRING " is encountered after a '+' or '-' sign, jump to the next or the previous image having a different value for any corresponding i:" FIM_CNS_EX_ID_STRING " (a trailing '+' requires a non empty value)." FIM_CNS_CMDSEP "Matching can occur on both file name and description, possibly loaded via " FIM_FLT_DESC " or --" FIM_OSW_LOAD_IMG_DSC_FILE "; see also '" FIM_VID_LASTGOTODIRECTION "' and '" FIM_VID_RE_SEARCH_OPTS "'." FIM_CNS_CMDSEP " You can specify multiple arguments to " FIM_FLT_GOTO ": those after the first one triggering a jump are ignored." FIM_CMD_ACM_INFO(FIM_ACM_PREGOTO,FIM_ACM_POSTGOTO) " Keeping pressed shall accelerate images browsing."
#define FIM_CMD_HELP_SCALE FIM_FLT_SCALE " {['+'|'-']" FIM_CNS_EX_VALUE "['%']|'*'" FIM_CNS_EX_VALUE "|'w'|'h'|'a'|'b'|'+[+-*/]'|['<'|'>']|'shadow'}: scale the image according to a scale " FIM_CNS_EX_VALUE " (e.g.: 0.5,40%,'w','h','a','b')." FIM_CNS_CMDSEP "If given '*' and a value, multiply the current scale by that value." FIM_CNS_CMDSEP "If given 'w', scale according to the screen width." FIM_CNS_CMDSEP "If given 'h', scale to the screen height." FIM_CNS_CMDSEP "If given 'a', to the minimum of 'w' and 'h'." FIM_CNS_CMDSEP "If given 'b', like 'a', provided that the image width exceeds 'w' or 'h'." FIM_CNS_CMDSEP "If " FIM_CNS_EX_VALUE " is a number, scale relatively to the original image width." FIM_CNS_CMDSEP "If the number is followed by '%', the relative scale is treated as a percentage." FIM_CNS_CMDSEP "If given '++'('+-'), increment (decrement) the '" FIM_VID_MAGNIFY_FACTOR "', '" FIM_VID_REDUCE_FACTOR "' variables by '" FIM_VID_SCALE_FACTOR_DELTA "'." FIM_CNS_CMDSEP "If given '+*'('+/'), multiply (divide) the '" FIM_VID_MAGNIFY_FACTOR "', '" FIM_VID_REDUCE_FACTOR "' variables by '" FIM_VID_SCALE_FACTOR_MULTIPLIER "'." FIM_CNS_CMDSEP "If given '<' (or '>'), shrink (or magnify) image using nearest mipmap (cached pre-scaled version). If given 'shadow' as a parameter, search a same-named file in one of the directories specified to --load-shadow-dir." FIM_CMD_ACM_INFO(FIM_ACM_PRESCALE,FIM_ACM_POSTSCALE)
-#define FIM_CMD_HELP_HELP FIM_FLT_HELP " [" FIM_CNS_EX_ID_STRING "]: provide online help, assuming " FIM_CNS_EX_ID_STRING " is a variable, alias, or command identifier." FIM_CNS_CMDSEP "If " FIM_CNS_EX_ID_STRING " begins with '" FIM_CNS_SLASH_STRING "', search on the help contents, and show a list of matching items." FIM_CNS_CMDSEP "A list of commands can be obtained simply invoking '" FIM_FLT_COMMANDS "'; a list of aliases with '" FIM_FLT_ALIAS "'; a list of bindings with '" FIM_FLT_BIND "'."
+#define FIM_CMD_HELP_HELP FIM_FLT_HELP " [" FIM_CNS_EX_ID_STRING "]: provide online help, assuming " FIM_CNS_EX_ID_STRING " is a variable, alias, or command identifier." FIM_CNS_CMDSEP "If " FIM_CNS_EX_ID_STRING " begins with '" FIM_CNS_SLASH_STRING "', search on the help contents, and show a list of matching items." FIM_CNS_CMDSEP "A list of commands can be obtained simply invoking '" FIM_FLT_COMMANDS "'; a list of aliases with '" FIM_FLT_ALIAS "'; a list of bindings with '" FIM_FLT_BIND "'; a list of variables with '" FIM_FLT_VARIABLES "'."
#define FIM_FLT_HELP_DESC FIM_FLT_DESC " 'load' " FIM_CNS_EX_FN_STRING " [" FIM_CNS_EX_SEPCHAR "]: load description file " FIM_CNS_EX_FN_STRING ", using the optional " FIM_CNS_EX_SEPCHAR " character as separator." FIM_CNS_CMDSEP FIM_FLT_DESC " 'reload': load once again description files specified at the command line with --" FIM_OSW_LOAD_IMG_DSC_FILE ", with respective separators." FIM_CNS_CMDSEP FIM_FLT_DESC " ['-all'] ['-append'] ['-nooverw'] 'save' " FIM_CNS_EX_FN_STRING " [" FIM_CNS_EX_SEPCHAR "]: save current list descriptions to file " FIM_CNS_EX_FN_STRING ", using the optional " FIM_CNS_EX_SEPCHAR " character as separator, and if '-all' is present then save the variables, and if '-append' is present then only append, and if '-nooverw' is present then do not overwrite existing files." FIM_CNS_CMDSEP "See documentation of --" FIM_OSW_LOAD_IMG_DSC_FILE " for the format of " FIM_CNS_EX_FN_STRING "."
#define FIM_FLT_HELP_DISPLAY FIM_FLT_DISPLAY " ['reinit' " FIM_CNS_EX_STRING " | 'resize' " FIM_CNS_EX_W " " FIM_CNS_EX_H " | ['menuadd' " FIM_CNS_EX_MENUSPEC_STRING "|'menudel'|'v'|'V'] ]: display the current file contents or change display settings." FIM_CNS_CMDSEP "If 'reinit' switch is supplied, the " FIM_CNS_EX_STRING " specifier is used to reinitialize the display device parameters like e.g. resolution, window system options; see the --" FIM_OSW_OUTPUT_DEVICE " command line switch for allowed values." FIM_CNS_CMDSEP "If 'resize' and no argument, ask the window manager to resize the window like the image." FIM_CNS_CMDSEP "If 'resize' and two arguments, these are used to reset width and height of the current window." FIM_CNS_CMDSEP \
"In the 'menuadd' case, use " FIM_CNS_EX_MENUSPEC_STRING " as GTK window menu specification. This specification string argument can be repeated. Each argument has form M/S. M is a slash-separated submenu location, with optional '_' (underscore) before a GTK accelerator character (e.g. \"File\", \"_File\", \"View/Scale\", \"_View/Scale\"). M cannot be empty and must be followed by a '/'. S can specify a simple entry, a toggle entry, or radio buttons. If a simple entry, it consists of one to three sections separated by \" \" (two spaces). If M begins with two non-alphanumeric symbols, these will be used as separators, instead of the two spaces. The first section is the name of the menu entry (a label), the second is a command specification, the third is a shortcut character. The following labels are special and if followed by '/', they create custom menus: FimMenuLimit (pre-categorized \"" FIM_FLT_LIMIT "\"-based commands based on actual \"" FIM_FLT_DESC "\" command data), FimMenuCommands (with commands), FimMenuAliases (with aliases), FimMenuKeyBindings (with bindings), FimMenuVariables (with variables' values), FimMenuCommandsHelp (commands help), FimMenuAliasesHelp (aliases help), FimMenuKeyBindingsHelp (bindings help), FimMenuVariablesHelp (variables' help). A toggle button specification can take the form 'toggle__'" FIM_CNS_EX_ID_STRING "'__'" FIM_CNS_EX_VALUE "'__'" FIM_CNS_EX_VALUE " and starts the toggle button with the second " FIM_CNS_EX_VALUE " (which has to be different). Actually, between 'toggle' and the second value, instead of '__' you can use any two same punctuation signs or Tab characters consistently. E.g. \"menu/label toggle___v__1__2 \" or \"menu/label toggle::_v::1::2 \" are ok, but \"menu/label toggle___v__1__1 \" or \"menu/label toggle___v::1::2 \" are not. A radio buttons specification has as many sections as radio buttons, separated internally by double spaces, and consisting each by a string, two spaces, an assignment " FIM_CNS_EX_ID_STRING "=" FIM_CNS_EX_VALUE " (notice no quotes are necessary around " FIM_CNS_EX_VALUE ", and repetitions are illegal), two spaces, and an optional accelerator character (e.g. \"m/first: v=1 a second: v=2 b third: v=3 c\" is ok, but \"m/first: v=1 a second: v=2 b third: v=2 c\" is not)." FIM_CNS_CMDSEP \
diff --git a/src/fimrc b/src/fimrc
index 3328efe..16799a1 100644
--- a/src/fimrc
+++ b/src/fimrc
@@ -1,4 +1,4 @@
-# $LastChangedDate: 2024-04-02 15:34:32 +0200 (Tue, 02 Apr 2024) $
+# $LastChangedDate: 2024-05-15 01:34:42 +0200 (Wed, 15 May 2024) $
# Contents of the default 'fimrc' file, hardcoded in the fim executable.
# Read the documentation (man fimrc) to discover how to change this default hardcoded file and how to make your own.
# Note that usually a ~/.fimrc file is read after these options take effect, so you could reset all of this with ease.
@@ -160,9 +160,9 @@ autocmd "PreRedisplay" "" "i:_will_display=1";
autocmd "PreRedisplay" "" "if(_scale_style!='' && i:fresh){i:fresh=0;scale _scale_style ;i:fresh=0;}";
autocmd "PostRedisplay" "" "i:_will_display=0";
# Display device specific config
-alias "aalib_fix_do" "{if(aascale==''){ascale='2.0';}else{ascale=aascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'screen+aalib?expect binding problems!'}}" "See aalib_fix.";
+alias "aalib_fix_do" "{if(aascale==''){ascale='2.0';}else{ascale=aascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'Detected screen+aalib: key bindings may not work as intended.'}}" "See aalib_fix.";
alias "aalib_fix" "if(_device_string=~'^aa'){aalib_fix_do;scale 'a';}" "When using the aalib (ASCII art) library we face a problem: glyph proportions are seldom square (as pixels are), and are tricky to detect; for this reason, we need to reshape the image with respect to the font ratio, but we have to make a guess in the scaling factor to compensate. If at runtime a better value is known for the terminal font height/with ratio, it may be fed in the 'aascale' variable for an accurate scaling.";
-alias "cacalib_fix_do" "{if(cacascale==''){ascale='1.18';}else{scale=cacascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'screen+cacalib?expect binding problems!'}}" "See cacalib_fix.";
+alias "cacalib_fix_do" "{if(cacascale==''){ascale='1.18';}else{scale=cacascale;} i:fresh=1;display;if(_TERM=~'screen'){echo 'Detected screen+cacalib: key bindings may not work as intended.'}}" "See cacalib_fix.";
alias "cacalib_fix" "getenv 'DISPLAY';if(_device_string=~'^ca' && ENV_DISPLAY==''){cacalib_fix_do;scale 'a';}" "When using the libcaca (Coloured ASCII art) library we face a problem: glyph proportions are seldom square (as pixels are), and are tricky to detect; for this reason, we need to reshape the image with respect to the font ratio, but we have to make a guess in the scaling factor to compensate. If at runtime a better value is known for the terminal font height/with ratio, it may be fed in the 'cacascale' variable for an accurate scaling.";
###alias "exif_fix" "i:_orientation=exif_orientation;exif_orientation='';i:mirrored=exif_mirrored;exif_mirrored='';i:flipped=exif_flipped;exif_flipped=''" "";
###autocmd "PostReload" "" "aalib_fix;exif_fix";
@@ -190,10 +190,10 @@ autocmd "PostInteractiveCommand" "" "if(_display_console==0 && i:fresh){redisp
autocmd "PostInteractiveCommand" "" "idempotent_cmd"; # Bug workaround: without it console scroll is broken.
autocmd "PostInteractiveCommand" "" "_gtk_check_for_toggle_gtk_menus;_gtk_check_for_toggle_fullscreen";
-alias "next10" "i=0;while(i<10){i=i+1;next;display;sleep '1';}" "goes forward 10 images";
-alias "prev10" "i=0;while(i<10){i=i+1;prev;display;sleep '1';}" "goes backward 10 images";
-bind 'N' 'next10';
-bind 'P' 'prev10';
+#alias "next10" "i=0;while(i<10){i=i+1;next;display;sleep '1';}" "goes forward 10 images";
+#alias "prev10" "i=0;while(i<10){i=i+1;prev;display;sleep '1';}" "goes backward 10 images";
+bind 'N' "goto '+1p' '+museum|series|city|category|artist+' '+/S' '+10';" "goto by jump or category or directory or just ahead";
+bind 'P' "goto '-1p' '-museum|series|city|category|artist+' '-/S' '-10';" "goto by jump or category or directory or just back ";
bind 'C-n' "goto '+//'";
bind 'C-p' "goto '-//'";
bind 'C-b' "goto '-//'"; # Warning: many configurations cannot detect C-b.
@@ -445,6 +445,7 @@ if( _device_string=~'^gtk[^e]*$' ) {
"_Custom actions/Webcam shot (needs vgrabbj) webcam"
"_Custom actions/Say something (needs espeak) espeak"
"_Custom actions/Max cached memory: 256MiB _max_cached_memory=262144 unlimited _max_cached_memory=0 very little _max_cached_memory=1 80MiB _max_cached_memory=81920 "
+ "_Custom actions/Max cached images: unlimited _max_cached_images=0 5 _max_cached_images=5 10 _max_cached_images=10 100 _max_cached_images=100 "
"_All actions/_Commands FimMenuCommands/"
"_All actions/_Aliases FimMenuAliases/"
"_All actions/_Key Bindings FimMenuKeyBindings/"
diff --git a/src/help.cpp b/src/help.cpp
index a9d6e4d..43edffe 100644
--- a/src/help.cpp
+++ b/src/help.cpp
@@ -8,7 +8,7 @@ fim_var_help_db[FIM_VID_CACHE_CONTROL]= "[in,g:] string for cache control. If it
fim_var_help_db[FIM_VID_CACHE_STATUS]= "[out,g:] string with current information on cache status." ;
fim_var_help_db[FIM_VID_DISPLAY_CONSOLE]= "[in,g:] if 1, display the output console." ;
fim_var_help_db[FIM_VID_DEVICE_DRIVER]= "[out,g:] the current display device string, in the form " FIM_DDN_VARS "." " See option --" FIM_OSW_OUTPUT_DEVICE " for a description." ;
-fim_var_help_db[FIM_VID_DISPLAY_STATUS]= "[in,g:] if 1, display display the status bar." ;
+fim_var_help_db[FIM_VID_DISPLAY_STATUS]= "[in,g:] if 1, display the status bar." ;
fim_var_help_db[FIM_VID_DISPLAY_STATUS_FMT]= "[in,g:] custom info format string, displayed in the lower left corner of the status bar; if unset: full pathname; otherwise a custom format string specified just as " FIM_VID_INFO_FMT_STR"." ;
fim_var_help_db[FIM_VID_PUSH_PUSHES_DIRS]= "[in,g:] if 1, the push command also accepts and pushes directories (using pushdir). if 2, also push hidden files/directories, that is, ones whose names begin with a dot (.)." ;
fim_var_help_db[FIM_VID_SANITY_CHECK]= "[in,experimental,g:] if 1, execute a sanity check on startup." ;
@@ -44,7 +44,7 @@ fim_var_help_db[FIM_VID_LASTFILEINDEX]= "[out,g:] the last visited image numeric
fim_var_help_db[FIM_VID_LASTPAGEINDEX]= "[out,g:] the last visited file page index." ;
fim_var_help_db[FIM_VID_LASTGOTODIRECTION]= "[out,g:] the last file goto direction (either string '+1' or string '-1')." ;
fim_var_help_db[FIM_VID_FILELISTLEN]= "[out,g:] current image list length (number of visible images)." ;
-fim_var_help_db[FIM_VID_INFO_FMT_STR]= "[in,g:] custom info format string, displayed in the lower right corner of the status bar; may contain ordinary text and special 'expando' sequences. These are: %p for current scale, in percentage; %w for width; %h for height; %i for image index in list; %k for the value of i:_comment (comment description) variable in square brackets; %l for current image list length; %L for flip/mirror/orientation information; %P for page information; %F for file size; %M for screen image memory size; %m for memory used by mipmap; %C for memory used by cache; %T for total memory used (approximation); %R for total max memory used (as detected by getrusage()); %n for the current file path name; %N for the current file path name basename; ; %c for centering information; %v for the fim program/version identifier string; %% for an ordinary %. A sequence like %?VAR?EXP? expands to EXP if i:VAR is set (or, otherwise, if VAR); EXP is copied verbatim except for contained sequences of the form %:VAR:, which expand to the value of variable i:VAR (or, if unset, VAR); this is meant to be used like in e.g. '%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?', where the EXIF-set variable EXIF_DateTimeOriginal (make sure you have libexif for this) are used only if present." ;
+fim_var_help_db[FIM_VID_INFO_FMT_STR]= "[in,g:] custom info format string, displayed in the lower right corner of the status bar; may contain ordinary text and special 'expando' sequences. These are: %p for current scale, in percentage; %w for width; %h for height; %i for image index in list; %k for the value of i:_comment (comment description) variable in square brackets (if non empty); %l for current image list length; %L for flip/mirror/orientation information; %P for page information; %F for file size; %M for screen image memory size; %m for memory used by mipmap; %C for memory used by cache; %T for total memory used (approximation); %R for total max memory used (as detected by getrusage()); %n for the current file path name; %N for the current file path name basename; ; %c for centering information; %v for the fim program/version identifier string; %% for an ordinary %. A sequence like %?VAR?EXP? expands to EXP if i:VAR is set (or, otherwise, if VAR); EXP is copied verbatim except for contained sequences of the form %:VAR:, which expand to the value of variable i:VAR (or, if unset, VAR); this is meant to be used like in e.g. '%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?', where the EXIF-set variable EXIF_DateTimeOriginal (make sure you have libexif for this) are used only if present." ;
fim_var_help_db[FIM_VID_FILENAME]= "[out,i:] the current file name string." ;
fim_var_help_db[FIM_VID_FIM_DEFAULT_CONFIG_FILE_CONTENTS]= "[out,g:] the contents of the default (hardcoded) configuration file (executed after the minimal hardcoded config)." ;
fim_var_help_db[FIM_VID_FIM_DEFAULT_GRAMMAR_FILE_CONTENTS]= "[out,g:] the contents of the default (hardcoded) grammar file." ;
diff --git a/src/readline.cpp b/src/readline.cpp
index 12a53d3..db7ac8d 100644
--- a/src/readline.cpp
+++ b/src/readline.cpp
@@ -1,4 +1,4 @@
-/* $LastChangedDate: 2024-04-02 21:01:17 +0200 (Tue, 02 Apr 2024) $ */
+/* $LastChangedDate: 2024-04-29 23:31:37 +0200 (Mon, 29 Apr 2024) $ */
/*
readline.cpp : Code dealing with the GNU readline library.
@@ -39,6 +39,7 @@
#define FIM_RL_KEY_DBG(C) " pressed key: '" << (isascii(C)?(fim_char_t)C:' ') << "' code: " << (int)(C) << " as hex: " << fim_get_int_as_hex(C) << " is esc: " << (C==FIM_SYM_ESC)
#define FIM_PR(OP) if (FIM_WANT_RL_VERBOSE) FIM_RL_DBG_COUT(OP)
#define FIM_DR(C) if (cc.getVariable(FIM_VID_DBG_COMMANDS).find('k') >= 0) std::cout << FIM_RL_KEY_DBG(C) << std::endl // TODO: add --verbose-keys option as _debug_commands="k"
+#define FIM_SHOULD_SUGGEST_POSSIBLE_COMPLETIONS 1
/*
* This file is severely messed up :).
@@ -166,37 +167,21 @@ static fim_char_t ** fim_completion (const fim_char_t *text, int start,int end)
}
/*
- * this function is called to display the proposed autocompletions
+ * this function is called to display the suggested autocompletions
*/
static void completion_display_matches_hook(fim_char_t **matches,int num,int max)
{
/* FIXME : fix the oddities of this code */
- fim_char_t buffer[FIM_RL_COMPLETION_BUFSIZE];
- int w,f,l;w=0;f=sizeof(buffer)-1;l=0;
- buffer[0]='\0';
- if(!matches)return;
-#define FIM_SHOULD_SUGGEST_POSSIBLE_COMPLETIONS 1
+ if(!matches)
+ return;
#if FIM_SHOULD_SUGGEST_POSSIBLE_COMPLETIONS
if(num>1)
fim::cout << "possible completions for \""<<matches[0]<<"\":\n" ;
-#endif /* FIM_SHOULD_SUGGEST_POSSIBLE_COMPLETIONS */
- for(int i=/*0*/1;i<num && matches[i] && f>0;++i)
+ for(int i=0;i<num+1 && matches[i];++i)
{
-#if FIM_SHOULD_SUGGEST_POSSIBLE_COMPLETIONS
fim::cout << matches[i] << "\n";
-#endif /* FIM_SHOULD_SUGGEST_POSSIBLE_COMPLETIONS */
- w=min(strlen(matches[i])+1,(size_t)f);
- if(f>0){
- strncpy(buffer+l,matches[i],w);
- w=strlen(buffer+l);l+=w;f-=w;}
- if(f>0){strcpy(buffer+l," ");--f;++l;}
- buffer[l]='\0';
-// strcpy(buffer+strlen(buffer),matches[i]);
-// strcpy(buffer+strlen(buffer)," ");
}
-
-// std::cout << buffer << "\n" ;
- // status((fim_byte_t*)"here shall be autocompletions", FIM_NULL);
+#endif /* FIM_SHOULD_SUGGEST_POSSIBLE_COMPLETIONS */
}
/*
@@ -465,6 +450,9 @@ void initialize_readline (fim_bool_t with_no_display_device, fim_bool_t wcs)
|| is_using_output_device(FIM_DDN_INN_SDL)
|| is_using_output_device(FIM_DDN_INN_GTK)
|| is_using_output_device(FIM_DDN_INN_IL2)
+ || is_using_output_device(FIM_DDN_INN_AA)
+ || is_using_output_device(FIM_DDN_INN_CACA)
+ || is_using_output_device(FIM_DDN_INN_DUMB)
)
rl_prep_term_function=fim_rl_prep_dummy; // default rl_prep_term_function is rl_prep_terminal which call tcsetattr -- not needed here
diff --git a/src/testdir/test20.in b/src/testdir/test20.in
index 8625872..2b9177f 100644
--- a/src/testdir/test20.in
+++ b/src/testdir/test20.in
@@ -1,4 +1,4 @@
-# A test for the help system (will fail if using pre-C++11).
+# A test for the help system (will fail if using pre-C++11 of --disable-readline).
# Its results need update on each help system update.
alias 'dump' "stdout _last_cmd_output; stdout '*';";
echo "A test for the help system";
@@ -15,6 +15,15 @@ help '--';
dump;
help '--help';
dump;
+help '/cached'; # match on variable name
+dump;
+help '/given image'; # match on variable help, which will fail because __exif_flipped is not set
+dump;
+__exif_flipped=1;
+help '/given image'; # match on variable help, which will now work
+dump;
+help '/current image list length'; # match on variable help, which will pass because _filelistlen is set
+dump;
#
#help 'commands';
#dump;
@@ -25,6 +34,8 @@ dump;
#dump;
alias;
dump;
+alias "unassigned";
+dump;
#
#help 'variables';
#dump;
@@ -49,11 +60,15 @@ dump;
unbind '?';
dump;
unbind ':';
-dump;
+unbind_out=_last_cmd_output;
+if (_console_key!=-1 && !(unbind_out=~'special.key')) { stdout "problem!"; } else { stdout "ok :1"; }
+if (_console_key==-1 && !(unbind_out=~'no.such.bin')) { stdout "problem!"; } else { stdout "ok :2"; }
help '/';
dump;
help '?';
dump;
help ':';
-dump;
+help_out=_last_cmd_output;
+if (_console_key!=-1 && !(help_out=~'activate.co')) { stdout "problem!"; } else { stdout "ok :3"; }
+if (_console_key==-1 && !(help_out=~'no.such.com')) { stdout "problem!"; } else { stdout "ok :4"; }
#
diff --git a/src/testdir/test20.ok b/src/testdir/test20.ok
index 4c59033..ec132e0 100644
--- a/src/testdir/test20.ok
+++ b/src/testdir/test20.ok
@@ -19,11 +19,33 @@ The long command options of fim are: --autozoom --binary --as-text --cd-and-read
Print program invocation help, and exit. Depending on the option, output can be: short, descriptive, long from man, or complete man. For each further argument {help-item} passed to fim, an individual help message is shown. If {help-item} starts with a /, it is treated as a search string (not a regexp, though).
*
+The following help items matched "cached":
+Commands (type 'help' and one quoted command name to get more info):
+ scale
+Variables (type 'help' and one quoted variable name to get more info):
+ _max_cached_images _max_cached_memory _min_cached_images _use_mipmaps
+
+*
+No item matched "given image"
+
+*
+The following help items matched "given image":
+Variables (type 'help' and one quoted variable name to get more info):
+ __exif_flipped
+
+*
+The following help items matched "current image list length":
+Variables (type 'help' and one quoted variable name to get more info):
+ _filelistlen _info_fmt_str
+
+*
alias align autocmd autocmd_del basename bind cd clear commands color crop desc display dump_key_codes echo else eval exec font getenv goto help if info limit list load pan popen pread prefetch pwd quit recording redisplay reload rotate scale scroll set set_commandline_mode set_interactive_mode sleep status stderr stdout system variables unalias unbind while window
*
*
-_TERM __internal_state_changed _all_file_loaders _cache_control _caption_over_image_fmt _command_expansion _console_buffer_free _console_buffer_total _console_buffer_used _console_key _console_lines _console_offset _debug_commands _device_string _display_as_binary _display_busy _display_console _display_status _display_status_fmt _downscale_huge_at_load _fbfont _filelistlen _fim_bpp _fim_default_config_file_contents _fim_default_grammar_file_contents _fim_version _ignorecase _info_fmt_str _last_cmd_output _load_default_etc_fimrc _load_fim_history _max_cached_images _max_cached_memory _max_iterated_commands _min_cached_images _no_external_loader_programs _no_rc_file _push_checks _push_pushes_dirs _pwd _re_search_opts _save_fim_history _scale_style _screen_height _screen_width _scroll_skip_page_fraction _slideshow_sleep_time _steps _sys_rc_file _use_mipmaps _verbose_keys _want_exif_orientation _want_prefetch _want_wm_caption_status _want_wm_mouse_ctrl allow_round_scroll ascale console_scroll_n _orientation angle ascale desaturated negated scale
+
+*
+_TERM __exif_flipped __internal_state_changed _all_file_loaders _cache_control _caption_over_image_fmt _command_expansion _console_buffer_free _console_buffer_total _console_buffer_used _console_key _console_lines _console_offset _debug_commands _device_string _display_as_binary _display_busy _display_console _display_status _display_status_fmt _downscale_huge_at_load _fbfont _filelistlen _fim_bpp _fim_default_config_file_contents _fim_default_grammar_file_contents _fim_version _ignorecase _info_fmt_str _last_cmd_output _load_default_etc_fimrc _load_fim_history _max_cached_images _max_cached_memory _max_iterated_commands _min_cached_images _no_external_loader_programs _no_rc_file _push_checks _push_pushes_dirs _pwd _re_search_opts _save_fim_history _scale_style _screen_height _screen_width _scroll_skip_page_fraction _slideshow_sleep_time _steps _sys_rc_file _use_mipmaps _verbose_keys _want_exif_orientation _want_prefetch _want_wm_caption_status _want_wm_mouse_ctrl allow_round_scroll ascale console_scroll_n _orientation angle ascale desaturated negated scale
*
bind "C-a" "if(_scale_style!='a'){_scale_style='a';scale 'a';}else{_scale_style='';scale '100%';}" # scale to height
bind "C-b" "goto '-//'"
@@ -64,8 +86,8 @@ bind "H" "scale 'H'"
bind "I" "toggleautonegate"
bind "K" 'if(_display_console==0){echo i:_filename.": ".i:_comment;toggleVerbosity}else{toggleVerbosity;}'
bind "M" "mirroronce"
-bind "N" "next10"
-bind "P" "prev10"
+bind "N" "goto '+1p' '+museum|series|city|category|artist+' '+/S' '+10';" # goto by jump or category or directory or just ahead
+bind "P" "goto '-1p' '-museum|series|city|category|artist+' '-/S' '-10';" # goto by jump or category or directory or just back
bind "Q" "recording 'stop'"
bind "R" "rotate270"
bind "S" "toggleDisplayStatus"
@@ -126,12 +148,11 @@ unbind: special key, cannot be unbound
unbind: special key, cannot be unbound
*
-unbind: special key, cannot be unbound
-
-*
+ok :1
+ok :2
activate forward search
*
activate backward search
*
-activate console mode
-*
+ok :3
+ok :4
diff --git a/src/version.h b/src/version.h
index 4cfaab9..1d2b692 100644
--- a/src/version.h
+++ b/src/version.h
@@ -59,6 +59,7 @@
"+FIM_WITH_LIBAVIF "
"+FIM_WITH_LIBCACA "
"+FIM_WITH_LIBEXIF "
+"+FIM_WITH_LIBGTK "
"+FIM_WITH_LIBPNG "
"+FIM_WITH_LIBSDL "
"+FIM_WITH_LIBWEBP "
@@ -67,9 +68,9 @@
"FIM_AUTHOR = \"Michele Martone <dezperado _CUT_ autistici _CUT_ org>\"\n"
"FIM_AUTHOR_EMAIL = \"<dezperado _CUT_ autistici _CUT_ org>\"\n"
"FIM_AUTHOR_NAME = \"Michele Martone\"\n"
-"FIM_CONFIGURATION = \"./configure \"\n"
+"FIM_CONFIGURATION = \"./configure ./configure CXXFLAGS=-O0 -pipe -ggdb build_alias=./configure host_alias=./configure target_alias=./configure --no-create --no-recursion\"\n"
"FIM_TMP_FILENAME = \"\"\n"
-"FIM_VERSION = \"0.7.0\"\n"
+"FIM_VERSION = \"0.7.1\"\n"
"-FIM_BIG_ENDIAN "
"-FIM_CACHE_DEBUG "
"-FIM_DEFAULT_CONSOLEFONT "
@@ -87,7 +88,6 @@
"-FIM_WANT_STATIC_BINARY "
"-FIM_WITH_ARCHIVE "
"-FIM_WITH_DEBUG "
-"-FIM_WITH_LIBGTK "
"-FIM_WITH_LIBIMLIB2 "
"-FIM_WITH_LIBJASPER "
"-FIM_WITH_LIBXYZ "