]> code.delx.au - gnu-emacs-elpa/commitdiff
Switch to lexical-binding.
authorThierry Volpiatto <thierry.volpiatto@gmail.com>
Wed, 27 Apr 2016 07:50:54 +0000 (09:50 +0200)
committerThierry Volpiatto <thierry.volpiatto@gmail.com>
Wed, 27 Apr 2016 07:50:54 +0000 (09:50 +0200)
* async-bytecomp.el: Switch to lex.
* async.el:          Switch to lex.
(async-when-done): Fix unused arg.
(async-receive):   Same.
* dired-async.el: Switch to lex.
(dired-async-create-files): Remove unused stuff
and fix vars for lex env.
* smtpmail-async.el: Switch to lex.

async-bytecomp.el
async.el
dired-async.el
smtpmail-async.el

index 54313c0e0120aad049f9e313aa930e22264cc469..0e452b1a18b1ed2f07f864fe2828c03e2a05e1cd 100644 (file)
@@ -1,4 +1,4 @@
-;;; async-bytecomp.el --- Async functions to compile elisp files async
+;;; async-bytecomp.el --- Compile elisp files asynchronously -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2014-2016 Free Software Foundation, Inc.
 
index 080fd34a43d03be82f6f71eccbeb14cb46a19a19..dc732707b85ff91992f4e7eba2128366cf1c479a 100644 (file)
--- a/async.el
+++ b/async.el
@@ -1,4 +1,4 @@
-;;; async.el --- Asynchronous processing in Emacs
+;;; async.el --- Asynchronous processing in Emacs -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2012-2016 Free Software Foundation, Inc.
 
@@ -95,8 +95,8 @@ as follows:
       (unless async-debug
         (kill-buffer buf)))))
 
-(defun async-when-done (proc &optional change)
-  "Process sentinal used to retrieve the value from the child process."
+(defun async-when-done (proc &optional _change)
+  "Process sentinel used to retrieve the value from the child process."
   (when (eq 'exit (process-status proc))
     (with-current-buffer (process-buffer proc)
       (let ((async-current-process proc))
@@ -201,7 +201,7 @@ its FINISH-FUNC is nil."
             (funcall async-callback args))
       (async--transmit-sexp (car args) (list 'quote (cdr args))))))
 
-(defun async-receive (&rest args)
+(defun async-receive ()
   "Send the given messages to the asychronous Emacs PROCESS."
   (async--receive-sexp))
 
index 8c09f1f8704c3fbd03bbe9852d835597517c62fd..b253ca2177cb8be65a3a74a64ea95f912556c7ca 100644 (file)
@@ -1,4 +1,4 @@
-;;; dired-async.el --- Copy/move/delete asynchronously in dired.
+;;; dired-async.el --- Asynchronous dired actions -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2012-2016 Free Software Foundation, Inc.
 
@@ -144,19 +144,18 @@ Should take same args as `message'."
                                        (buffer-name b)) b))))
        (when buf (kill-buffer buf))))))
 
+(defvar overwrite-query)
 (defun dired-async-create-files (file-creator operation fn-list name-constructor
-                                 &optional marker-char)
+                                 &optional _marker-char)
   "Same as `dired-create-files' but asynchronous.
 
 See `dired-create-files' for the behavior of arguments."
   (setq dired-async-operation nil)
-  (let (dired-create-files-failures
-        failures async-fn-list
-        skipped (success-count 0)
-        (total (length fn-list))
-        callback)
-    (let (to overwrite-query
-             overwrite-backup-query)    ; for dired-handle-overwrite
+  (setq overwrite-query nil)
+  (let ((total (length fn-list))
+        dired-create-files-failures
+        failures async-fn-list skipped callback)
+    (let (to)
       (dolist (from fn-list)
         (setq to (funcall name-constructor from))
         (if (equal to from)
@@ -175,14 +174,7 @@ Type SPC or `y' to overwrite file `%s',
 DEL or `n' to skip to next,
 ESC or `q' to not overwrite any of the remaining files,
 `!' to overwrite all remaining files with no more questions." to)))
-                           (dired-query 'overwrite-query
-                                        "Overwrite `%s'?" to))))
-                   ;; must determine if FROM is marked before file-creator
-                   ;; gets a chance to delete it (in case of a move).
-                   (actual-marker-char
-                    (cond  ((integerp marker-char) marker-char)
-                           (marker-char (dired-file-marker from)) ; slow
-                           (t nil))))
+                           (dired-query 'overwrite-query "Overwrite `%s'?" to)))))
               ;; Handle the `dired-copy-file' file-creator specially
               ;; When copying a directory to another directory or
               ;; possibly to itself or one of its subdirectories.
@@ -246,9 +238,7 @@ ESC or `q' to not overwrite any of the remaining files,
         (format "%s: %d of %d file%s skipped"
                 operation (length skipped) total
                 (dired-plural-s total))
-        skipped))
-      (t (message "%s: %s file%s"
-                  operation success-count (dired-plural-s success-count))))
+        skipped)))
     ;; Start async process.
     (when async-fn-list
       (async-start `(lambda ()
@@ -258,6 +248,7 @@ ESC or `q' to not overwrite any of the remaining files,
                           (let ((dired-recursive-copies (quote always))
                                 (dired-copy-preserve-time
                                  ,dired-copy-preserve-time))
+                            (setq overwrite-backup-query nil)
                             ;; Inline `backup-file' as long as it is not
                             ;; available in emacs.
                             (defalias 'backup-file
index 5ac426d6c87a1f85e7ba509d821a07133e7a0a67..0a65a98a36d200b9902303a27666c86cc59f4b1f 100644 (file)
@@ -1,4 +1,4 @@
-;;; smtpmail-async.el --- Send e-mail with smtpmail.el asynchronously
+;;; smtpmail-async.el --- Send e-mail with smtpmail.el asynchronously -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2012-2016 Free Software Foundation, Inc.