mirror of https://codeberg.org/cage/tinmop/
- added 'open-manual'.
This commit is contained in:
parent
a4d58b665b
commit
5f91506dd3
|
@ -308,6 +308,7 @@ LTLIBICONV = @LTLIBICONV@
|
|||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MAN = @MAN@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGFMT_015 = @MSGFMT_015@
|
||||
|
|
|
@ -594,6 +594,7 @@ GIT
|
|||
OPENSSL
|
||||
XDG_OPEN
|
||||
BASH
|
||||
MAN
|
||||
UNZIP
|
||||
GPG
|
||||
CURL
|
||||
|
@ -6362,6 +6363,53 @@ if test "$UNZIP" = "no" ; then
|
|||
$as_echo "$as_me: WARNING: Can not find unzip, genpub support will be disabled." >&2;}
|
||||
fi
|
||||
|
||||
# Extract the first word of "man", so it can be a program name with args.
|
||||
set dummy man; 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_MAN+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $MAN in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_MAN="$MAN" # 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_MAN="$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
|
||||
|
||||
test -z "$ac_cv_path_MAN" && ac_cv_path_MAN="no"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
MAN=$ac_cv_path_MAN
|
||||
if test -n "$MAN"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAN" >&5
|
||||
$as_echo "$MAN" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test "$MAN" = "no" ; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can not find man." >&5
|
||||
$as_echo "$as_me: WARNING: Can not find man." >&2;}
|
||||
fi
|
||||
|
||||
# Extract the first word of "bash", so it can be a program name with args.
|
||||
set dummy bash; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
|
|
|
@ -49,6 +49,12 @@ if test "$UNZIP" = "no" ; then
|
|||
AC_MSG_WARN([Can not find unzip, genpub support will be disabled.])
|
||||
fi
|
||||
|
||||
AC_PATH_PROG([MAN],[man],[no])
|
||||
|
||||
if test "$MAN" = "no" ; then
|
||||
AC_MSG_WARN([Can not find man.])
|
||||
fi
|
||||
|
||||
AC_PATH_PROG([BASH],[bash],[no])
|
||||
|
||||
if test "$BASH" = "no" ; then
|
||||
|
|
|
@ -143,6 +143,8 @@
|
|||
|
||||
(define-key "C-h a" #'apropos-help)
|
||||
|
||||
(define-key "C-h m" #'open-manual)
|
||||
|
||||
(define-key "!" #'gemini-search)
|
||||
|
||||
(define-key ">" #'open-gemini-address)
|
||||
|
|
|
@ -19,10 +19,18 @@
|
|||
|
||||
(alexandria:define-constant +unzip-bin+ "@UNZIP@" :test #'string=)
|
||||
|
||||
(alexandria:define-constant +man-bin+ "@MAN@" :test #'string=)
|
||||
|
||||
(eval-when (:compile-toplevel :load-toplevel :execute)
|
||||
(when (and (not (member :gempub-support *features*))
|
||||
(string/= +unzip-bin+ "no"))
|
||||
(push :gempub-support *features*)))
|
||||
|
||||
(defun allow-features (test-value feature-keyword)
|
||||
(when (and (not (member feature-keyword *features*))
|
||||
(string/= test-value "no"))
|
||||
(push feature-keyword *features*)))
|
||||
|
||||
(allow-features +unzip-bin+ :gempub-support)
|
||||
|
||||
(allow-features +man-bin+ :man-bin))
|
||||
|
||||
(defmacro with-return-untranslated ((untranslated) &body body)
|
||||
`(handler-bind ((i18n-conditions:no-translation-table-error
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
:+openssl-bin+
|
||||
:+xdg-open-bin+
|
||||
:+unzip-bin+
|
||||
:+man-bin+
|
||||
:_
|
||||
:n_))
|
||||
|
||||
|
@ -2500,6 +2501,7 @@
|
|||
(:shadowing-import-from :misc :random-elt :shuffle)
|
||||
(:export
|
||||
:delete-message-status-marked-to-delete
|
||||
:open-manual
|
||||
:quit-program
|
||||
:clean-close-program
|
||||
:notify
|
||||
|
|
|
@ -20,6 +20,21 @@
|
|||
(defun boolean-input-accepted-p (user-input)
|
||||
(string-equal user-input (_ "y")))
|
||||
|
||||
(defun open-manual ()
|
||||
#+man-bin
|
||||
(progn
|
||||
(croatoan:end-screen)
|
||||
(tui:with-notify-errors
|
||||
(os-utils::run-external-program +man-bin+
|
||||
(list +program-name+)
|
||||
:search t
|
||||
:wait t
|
||||
:input t
|
||||
:output t
|
||||
:error t)))
|
||||
#-man-bin
|
||||
(notify (_ "No manpage binary found on this system") :as-error t))
|
||||
|
||||
(defun quit-program ()
|
||||
"This is not the right function to quit the program, use
|
||||
'clean-close-program'."
|
||||
|
|
Loading…
Reference in New Issue