diff options
| author | Stefan Monnier | 2013-08-29 15:55:58 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2013-08-29 15:55:58 -0400 |
| commit | 40f7e0e853bf21003fdffeac35e47616f393055d (patch) | |
| tree | 25770d0dcff8956a77b577d5467caffe37fb0e0f /lisp/net | |
| parent | 7763d67c87ae050d4e7cc28f1e0c4b14df037d2e (diff) | |
| download | emacs-40f7e0e853bf21003fdffeac35e47616f393055d.tar.gz emacs-40f7e0e853bf21003fdffeac35e47616f393055d.zip | |
Misc changes to reduce use of `(lambda...); and other cleanups.
* lisp/cus-edit.el: Use lexical-binding.
(customize-push-and-save, customize-apropos)
(custom-buffer-create-internal): Use closures.
* lisp/progmodes/bat-mode.el (bat-mode-syntax-table): "..." are strings.
* lisp/progmodes/ada-xref.el: Use setq.
* lisp/net/tramp.el (with-tramp-progress-reporter): Avoid setq.
* lisp/dframe.el: Use lexical-binding.
(dframe-frame-mode): Fix calling convention for hooks. Use a closure.
* lisp/speedbar.el (speedbar-frame-mode): Adjust call accordingly.
* lisp/descr-text.el: Use lexical-binding.
(describe-text-widget, describe-text-sexp, describe-property-list):
Use closures.
* lisp/comint.el (comint-history-isearch-push-state): Use a closure.
* lisp/calculator.el: Use lexical-binding.
(calculator-number-to-string): Make it work with lexical-binding.
(calculator-funcall): Same and use cl-letf.
Diffstat (limited to 'lisp/net')
| -rw-r--r-- | lisp/net/tramp.el | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 5f473a496e2..43aa0031cb1 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1654,24 +1654,27 @@ If VAR is nil, then we bind `v' to the structure and `method', `user', | |||
| 1654 | If LEVEL does not fit for visible messages, there are only traces | 1654 | If LEVEL does not fit for visible messages, there are only traces |
| 1655 | without a visible progress reporter." | 1655 | without a visible progress reporter." |
| 1656 | (declare (indent 3) (debug t)) | 1656 | (declare (indent 3) (debug t)) |
| 1657 | `(let ((result "failed") | 1657 | `(progn |
| 1658 | pr tm) | ||
| 1659 | (tramp-message ,vec ,level "%s..." ,message) | 1658 | (tramp-message ,vec ,level "%s..." ,message) |
| 1660 | ;; We start a pulsing progress reporter after 3 seconds. Feature | 1659 | (let ((result "failed") |
| 1661 | ;; introduced in Emacs 24.1. | 1660 | (tm |
| 1662 | (when (and tramp-message-show-message | 1661 | ;; We start a pulsing progress reporter after 3 seconds. Feature |
| 1663 | ;; Display only when there is a minimum level. | 1662 | ;; introduced in Emacs 24.1. |
| 1664 | (<= ,level (min tramp-verbose 3))) | 1663 | (when (and tramp-message-show-message |
| 1665 | (ignore-errors | 1664 | ;; Display only when there is a minimum level. |
| 1666 | (setq pr (tramp-compat-funcall 'make-progress-reporter ,message) | 1665 | (<= ,level (min tramp-verbose 3))) |
| 1667 | tm (when pr | 1666 | (ignore-errors |
| 1668 | (run-at-time 3 0.1 'tramp-progress-reporter-update pr))))) | 1667 | (let ((pr (tramp-compat-funcall |
| 1669 | (unwind-protect | 1668 | #'make-progress-reporter ,message))) |
| 1670 | ;; Execute the body. | 1669 | (when pr |
| 1671 | (prog1 (progn ,@body) (setq result "done")) | 1670 | (run-at-time 3 0.1 |
| 1672 | ;; Stop progress reporter. | 1671 | #'tramp-progress-reporter-update pr))))))) |
| 1673 | (if tm (tramp-compat-funcall 'cancel-timer tm)) | 1672 | (unwind-protect |
| 1674 | (tramp-message ,vec ,level "%s...%s" ,message result)))) | 1673 | ;; Execute the body. |
| 1674 | (prog1 (progn ,@body) (setq result "done")) | ||
| 1675 | ;; Stop progress reporter. | ||
| 1676 | (if tm (tramp-compat-funcall 'cancel-timer tm)) | ||
| 1677 | (tramp-message ,vec ,level "%s...%s" ,message result))))) | ||
| 1675 | 1678 | ||
| 1676 | (tramp-compat-font-lock-add-keywords | 1679 | (tramp-compat-font-lock-add-keywords |
| 1677 | 'emacs-lisp-mode '("\\<with-tramp-progress-reporter\\>")) | 1680 | 'emacs-lisp-mode '("\\<with-tramp-progress-reporter\\>")) |