add bulk mimetype app search
This commit is contained in:
parent
fd7a972eea
commit
54a8083914
9
conf.org
9
conf.org
|
@ -264,7 +264,8 @@ event of an error or nonlocal exit."
|
||||||
"Return all applications that can open a given MIMETYPE. The list
|
"Return all applications that can open a given MIMETYPE. The list
|
||||||
is comprised of lists of two elements, the first of which is the
|
is comprised of lists of two elements, the first of which is the
|
||||||
command (Exec) and the second which is the application name"
|
command (Exec) and the second which is the application name"
|
||||||
(let* ((mime-regex (concat "^MimeType=.*" mimetype ".*$"))
|
(let* ((case-fold-search nil)
|
||||||
|
(mime-regex (concat "^MimeType=.*" mimetype ";.*$"))
|
||||||
(app-regex )
|
(app-regex )
|
||||||
(desktop-dirs '("/usr/share/applications"
|
(desktop-dirs '("/usr/share/applications"
|
||||||
"/usr/local/share/applications"
|
"/usr/local/share/applications"
|
||||||
|
@ -283,6 +284,12 @@ command (Exec) and the second which is the application name"
|
||||||
(match-string 1 tb))
|
(match-string 1 tb))
|
||||||
exec)))
|
exec)))
|
||||||
(setq app-list (cons (list exec name) app-list)))))))))
|
(setq app-list (cons (list exec name) app-list)))))))))
|
||||||
|
|
||||||
|
(defun nd/get-apps-bulk-from-mime (mimetype)
|
||||||
|
"Like `nd/get-apps-from-mime' but only includes apps that can open
|
||||||
|
multiple files at once for given MIMETYPE."
|
||||||
|
(let ((case-fold-search nil))
|
||||||
|
(seq-filter (lambda (a) (string-match ".*%[FU].*" (car a))) (nd/get-apps-from-mime mimetype))))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** interactive
|
** interactive
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
Loading…
Reference in New Issue