From: Thierry Volpiatto Date: Wed, 27 Apr 2016 07:50:54 +0000 (+0200) Subject: Switch to lexical-binding. X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/6e29e825fc44a57f98cc988880498f3af6c34014 Switch to lexical-binding. * 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. --- diff --git a/async-bytecomp.el b/async-bytecomp.el index 54313c0e0..0e452b1a1 100644 --- a/async-bytecomp.el +++ b/async-bytecomp.el @@ -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. diff --git a/async.el b/async.el index 080fd34a4..dc732707b 100644 --- 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)) diff --git a/dired-async.el b/dired-async.el index 8c09f1f87..b253ca217 100644 --- a/dired-async.el +++ b/dired-async.el @@ -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 diff --git a/smtpmail-async.el b/smtpmail-async.el index 5ac426d6c..0a65a98a3 100644 --- a/smtpmail-async.el +++ b/smtpmail-async.el @@ -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.