emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/hyperbole 28a1e0c 18/50: Use xdg-open to dispatch to us


From: Stefan Monnier
Subject: [elpa] externals/hyperbole 28a1e0c 18/50: Use xdg-open to dispatch to user preferences for display alist (#40)
Date: Wed, 17 Mar 2021 18:44:16 -0400 (EDT)

branch: externals/hyperbole
commit 28a1e0c43ee36b63fef4f93219b9f7eda4c2eadf
Author: Mats Lidell <mats.lidell@lidells.se>
Commit: GitHub <noreply@github.com>

    Use xdg-open to dispatch to user preferences for display alist (#40)
    
    * Use xdg-open to dispatch to user preferences for display alist
    
    Default is gimp and office extensions but can be customized.
    
    * Add defcustom to display alists
    
    * Add documentation
    
    Co-authored-by: Mats Lidell <matsl@gnu.org>
---
 Changes  |  7 +++++++
 hpath.el | 51 +++++++++++++++++++++++++++++++++------------------
 2 files changed, 40 insertions(+), 18 deletions(-)

diff --git a/Changes b/Changes
index a624e46..1ce1c12 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,10 @@
+2020-11-02  Mats Lidell  <matsl@gnu.org>
+
+* hpath.el (hpath:external-display-alist-mswindows):
+           (hpath:internal-display-alist): Add customization.
+           (hpath:external-display-alist-x): Add customization. Use
+    xdg-open to use users preferred app in window system.
+
 2020-10-25  Bob Weiner  <rsw@gnu.org>
 
 * hibtypes.el:
diff --git a/hpath.el b/hpath.el
index 58d5dc4..348b3f7 100644
--- a/hpath.el
+++ b/hpath.el
@@ -4,7 +4,7 @@
 ;;
 ;; Orig-Date:     1-Nov-91 at 00:44:23
 ;;
-;; Copyright (C) 1991-2019  Free Software Foundation, Inc.
+;; Copyright (C) 1991-2020  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
 ;;
 ;; This file is part of GNU Hyperbole.
@@ -252,29 +252,42 @@ possible suffixes."
                                                          "open"))
   "*An alist of (FILENAME-REGEXP . DISPLAY-PROGRAM-STRING-OR-LIST) elements 
for the macOS window system.
 See the function `hpath:get-external-display-alist' for detailed format 
documentation."
-  :type 'regexp
+  :type '(alist :key-type regexp :value-type string)
+  :group 'hyperbole-commands)
+
+;; (defvar hpath:external-display-alist-mswindows (list '("\\.vba$" . 
"/c/Windows/System32/cmd.exe //c start \"${@//&/^&}\"")
+;;                                                  (cons (format 
"\\.\\(%s\\)$" hpath:external-open-office-suffixes)
+;;                                                        "openoffice.exe"))
+
+(defcustom hpath:external-display-alist-mswindows (list '("\\.vba$" . 
"/c/Windows/System32/cmd.exe //c start \"${@//&/^&}\"")
+                                                       (cons (format 
"\\.\\(%s\\)$" hpath:external-open-office-suffixes)
+                                                             "openoffice.exe"))
+  "*An alist of (FILENAME-REGEXP . DISPLAY-PROGRAM-STRING-OR-LIST) elements 
for MS Windows.
+See the function `hpath:get-external-display-alist' for detailed format 
documentation."
+  :type '(alist :key-type regexp :value-type string)
   :group 'hyperbole-commands)
 
-(defvar hpath:external-display-alist-mswindows (list '("\\.vba$" . 
"/c/Windows/System32/cmd.exe //c start \"${@//&/^&}\"")
-                                                    (cons (format 
"\\.\\(%s\\)$" hpath:external-open-office-suffixes)
-                                                          "openoffice.exe"))
-    "*An alist of (FILENAME-REGEXP . DISPLAY-PROGRAM-STRING-OR-LIST) elements 
for MS Windows.
-See the function `hpath:get-external-display-alist' for detailed format 
documentation.")
-
-(defvar hpath:external-display-alist-x (list '("\\.e?ps$" . "ghostview")
-                                            '("\\.dvi$"  . "xdvi")
-                                            (cons (format "\\.\\(%s\\)$" 
hpath:external-open-office-suffixes) "openoffice")
-                                            '("\\.pdf$"  . ("xpdf" "acroread"))
-                                            '("\\.ps\\.g?[zZ]$" . "zcat %s | 
ghostview -")
-                                            
'("\\.\\(gif\\|tiff?\\|xpm\\|xbm\\|xwd\\|pm\\|pbm\\|jpe?g\\)"  . "xv")
-                                            '("\\.ra?s$" . "snapshot -l"))
+
+;; (defvar hpath:external-display-alist-x (list '("\\.e?ps$" . "ghostview")
+;;                                          '("\\.dvi$"  . "xdvi")
+;;                                          (cons (format "\\.\\(%s\\)$" 
hpath:external-open-office-suffixes) "openoffice")
+;;                                          '("\\.pdf$"  . ("xpdf" "acroread"))
+;;                                          '("\\.ps\\.g?[zZ]$" . "zcat %s | 
ghostview -")
+;;                                          
'("\\.\\(gif\\|tiff?\\|xpm\\|xbm\\|xwd\\|pm\\|pbm\\|jpe?g\\)"  . "xv")
+;;                                          '("\\.ra?s$" . "snapshot -l"))
+
+(defcustom hpath:external-display-alist-x (list (cons (format 
"\\.\\(xcf\\|%s\\)$"
+                                                             
hpath:external-open-office-suffixes)
+                                                     "setsid -w xdg-open"))
   "*An alist of (FILENAME-REGEXP . DISPLAY-PROGRAM-STRING-OR-LIST) elements 
for the X Window System.
-See the function `hpath:get-external-display-alist' for detailed format 
documentation.")
+See the function `hpath:get-external-display-alist' for detailed format 
documentation."
+  :type '(alist :key-type regexp :value-type string)
+  :group 'hyperbole-commands)
 
 (defvar hpath:info-suffix "\\.info\\(-[0-9]+\\)?\\(\\.gz\\|\\.Z\\|-z\\)?\\'"
   "Regexp matching to the end of Info manual file names.")
 
-(defvar hpath:internal-display-alist
+(defcustom hpath:internal-display-alist
   (let ((info-suffix "\\.info\\(-[0-9]+\\)?\\(\\.gz\\|\\.Z\\|-z\\)?\\'"))
     (delq
      nil
@@ -313,7 +326,9 @@ See the function `hpath:get-external-display-alist' for 
detailed format document
       )))
   "*Alist of (FILENAME-REGEXP . EDIT-FUNCTION) elements for calling special
 functions to display particular file types within Emacs.  See also
-the function (hpath:get-external-display-alist) for external display program 
settings.")
+the function (hpath:get-external-display-alist) for external display program 
settings."
+  :type '(alist :key-type regexp :value-type sexp)
+  :group 'hyperbole-commands)
 
 (defvar hpath:display-buffer-alist
   (list



reply via email to

[Prev in Thread] Current Thread [Next in Thread]