1
0
Fork 0

- added 'editor' as pseudo external program.

This commit is contained in:
cage 2022-01-06 17:59:22 +01:00
parent 6cbad4b3fd
commit e7d413162b
4 changed files with 21 additions and 5 deletions

View File

@ -200,6 +200,10 @@ gemini.exclusive.mode.toc.width = 1/5
# ▼▼▼▼▼▼▼▼▼ buffer 20 Mib
# open "mp4$" with "xterm -e mpv" no wait buffer 20
# to open some kind of files use "editor" as program name
# ▼▼▼▼▼▼▼▼
#open "txt$" with "editor"
# finally if you want to open some kind of file with tinmop try the
# following: valid values are "tinmop" "me" "internal"
# ▼▼▼▼▼▼▼▼
@ -208,6 +212,8 @@ open "^((gemini://)|(\\.)|(/)).+txt$" with "tinmop"
open "^((gemini://)|(\\.)|(/)).+sh$" with "tinmop"
open ".gpub$" with "tinmop"
#########################
# ⚠ EXPERIMENTAL ZONE ⚠ #
#########################

View File

@ -169,11 +169,17 @@
(defun open-resource-with-external-program (resource give-focus-to-message-window)
(let ((program (swconf:link-regex->program-to-use resource)))
(if program
(if (swconf:use-tinmop-as-external-program-p program)
(gemini-viewer:load-gemini-url resource
:give-focus-to-message-window
give-focus-to-message-window)
(os-utils:open-link-with-program program resource))
(cond
((swconf:use-editor-as-external-program-p program)
(croatoan:end-screen)
(tui:with-notify-errors
(os-utils:open-with-editor resource)))
((swconf:use-tinmop-as-external-program-p program)
(gemini-viewer:load-gemini-url resource
:give-focus-to-message-window
give-focus-to-message-window))
(t
(os-utils:open-link-with-program program resource)))
(os-utils:xdg-open resource))))
(defun unzip-file (zip-file destination-dir)

View File

@ -1245,6 +1245,7 @@
:link-regex->program-to-use
:link-regex->program-to-use-buffer-size
:use-tinmop-as-external-program-p
:use-editor-as-external-program-p
:thread-message-symbol
:thread-message-read-colors
:thread-message-unread-colors

View File

@ -1036,6 +1036,9 @@
(defun use-tinmop-as-external-program-p (program)
(cl-ppcre:scan "(^me$)|(^internal$)|(tinmop)" program))
(defun use-editor-as-external-program-p (program)
(cl-ppcre:scan "(^ed$)|(^editor$)" program))
(defun config-win-focus-mark ()
(values (access:accesses *software-configuration*
+key-window+