]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/dnd.el: Use lexical-binding. Remove redundant :group
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 9 Sep 2020 17:33:15 +0000 (13:33 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 9 Sep 2020 17:33:15 +0000 (13:33 -0400)
(dnd--unescape-uri): Mark it internal, but don't mark it inlinable.

* lisp/cus-edit.el (dnd): Move the group to dnd.el.

lisp/cus-edit.el
lisp/dnd.el

index cb1a78d8e204bba79c9c6ef0c20e7afb5982f3e5..6d0ec5d14868e5d256f70dcbc852dde244307209 100644 (file)
@@ -408,10 +408,6 @@ Use group `text' for this instead.  This group is deprecated."
   "Input from the menus."
   :group 'environment)
 
-(defgroup dnd nil
-  "Handling data from drag and drop."
-  :group 'environment)
-
 (defgroup auto-save nil
   "Preventing accidental loss of data."
   :group 'files)
index 1d0e26cb0137cdd4c6b043f39517ccd0bbc2a835..815a4afbecd73df8696898ccc2d63d0bbc3cdcc5 100644 (file)
@@ -1,4 +1,4 @@
-;;; dnd.el --- drag and drop support
+;;; dnd.el --- drag and drop support  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2005-2020 Free Software Foundation, Inc.
 
@@ -33,6 +33,9 @@
 
 ;;; Customizable variables
 
+(defgroup dnd nil
+  "Handling data from drag and drop."
+  :group 'environment)
 
 ;;;###autoload
 (defcustom dnd-protocol-alist
@@ -54,14 +57,13 @@ If no match is found, the URL is inserted as text by calling `dnd-insert-text'.
 The function shall return the action done (move, copy, link or private)
 if some action was made, or nil if the URL is ignored."
   :version "22.1"
-  :type '(repeat (cons (regexp) (function)))
-  :group 'dnd)
+  :type '(repeat (cons (regexp) (function))))
 
 
 (defcustom dnd-open-remote-file-function
   (if (eq system-type 'windows-nt)
-      'dnd-open-local-file
-    'dnd-open-remote-url)
+      #'dnd-open-local-file
+    #'dnd-open-remote-url)
   "The function to call when opening a file on a remote machine.
 The function will be called with two arguments, URI and ACTION.
 See `dnd-open-file' for details.
@@ -71,15 +73,13 @@ Predefined functions are `dnd-open-local-file' and `dnd-open-remote-url'.
 is the default on MS-Windows.  `dnd-open-remote-url' uses `url-handler-mode'
 and is the default except for MS-Windows."
   :version "22.1"
-  :type 'function
-  :group 'dnd)
+  :type 'function)
 
 
 (defcustom dnd-open-file-other-window nil
   "If non-nil, always use find-file-other-window to open dropped files."
   :version "22.1"
-  :type 'boolean
-  :group 'dnd)
+  :type 'boolean)
 
 
 ;; Functions
@@ -133,7 +133,8 @@ Return nil if URI is not a local file."
                     (string-equal sysname-no-dot hostname)))
        (concat "file://" (substring uri (+ 7 (length hostname))))))))
 
-(defsubst dnd-unescape-uri (uri)
+(defun dnd--unescape-uri (uri)
+  ;; Merge with corresponding code in URL library.
   (replace-regexp-in-string
    "%[[:xdigit:]][[:xdigit:]]"
    (lambda (arg)
@@ -157,7 +158,7 @@ Return nil if URI is not a local file."
                    'utf-8
                  (or file-name-coding-system
                      default-file-name-coding-system))))
-    (and f (setq f (decode-coding-string (dnd-unescape-uri f) coding)))
+    (and f (setq f (decode-coding-string (dnd--unescape-uri f) coding)))
     (when (and f must-exist (not (file-readable-p f)))
       (setq f nil))
     f))