aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2017-12-26 16:08:21 -0500
committerStefan Monnier2017-12-26 16:08:21 -0500
commitda94ea92bc3ba6c236b394c00e6bbb725131a149 (patch)
tree4003e09722563503f2bd557d1bde630a76e82972
parent9f9b56b7da323bc91cdde0bcc1e1863c523e7ee3 (diff)
downloademacs-da94ea92bc3ba6c236b394c00e6bbb725131a149.tar.gz
emacs-da94ea92bc3ba6c236b394c00e6bbb725131a149.zip
Eliminate last uses of 'cl' in lisp/mail/
* lisp/mail/binhex.el: Use lexical-binding and avoid cl. (binhex-push-char): Remove unused arg 'count'. (binhex-decode-region-external): Remove unused var 'status'. * lisp/mail/flow-fill.el: Use lexical-binding and avoid cl. * lisp/mail/footnote.el: Reduce redundancy. (footnote-roman-lower-regexp, footnote-roman-upper-regexp) (footnote-roman-upper-list): Auto-generate from footnote-roman-lower-list. (footnote-hebrew-numeric-regex): Auto-generate from footnote-hebrew-numeric. (footnote--hebrew-numeric): Simplify. (footnote-hebrew-symbolic-regex): Generate from footnote-hebrew-symbolic. * lisp/mail/hashcash.el: Use lexical-binding and avoid cl. (hashcash-verify-payment): Use pcase. * lisp/mail/ietf-drums.el: Use lexical-binding and avoid cl. (ietf-drums-token-to-list): Remove unused var 'e'. * lisp/mail/rfc2231.el: Use lexical-binding and avoid cl. * lisp/mail/uudecode.el: Use lexical-binding and avoid cl. (uudecode-char-int): Remove unused 'eval-and-compile' wrapper. (uudecode-decode-region-external): Remove unused 'status' var. (uudecode-string-to-multibyte): Remove. (uudecode-decode-region-internal): Use decode-coding-string instead. * lisp/mail/yenc.el: Use lexical-binding and avoid cl.
-rw-r--r--lisp/mail/binhex.el20
-rw-r--r--lisp/mail/flow-fill.el3
-rw-r--r--lisp/mail/footnote.el2
-rw-r--r--lisp/mail/hashcash.el10
-rw-r--r--lisp/mail/ietf-drums.el12
-rw-r--r--lisp/mail/rfc2231.el3
-rw-r--r--lisp/mail/smtpmail.el2
-rw-r--r--lisp/mail/uudecode.el37
-rw-r--r--lisp/mail/yenc.el8
9 files changed, 38 insertions, 59 deletions
diff --git a/lisp/mail/binhex.el b/lisp/mail/binhex.el
index f055215a8c6..12d143ecb37 100644
--- a/lisp/mail/binhex.el
+++ b/lisp/mail/binhex.el
@@ -1,4 +1,4 @@
1;;; binhex.el --- decode BinHex-encoded text 1;;; binhex.el --- decode BinHex-encoded text -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 1998-2017 Free Software Foundation, Inc. 3;; Copyright (C) 1998-2017 Free Software Foundation, Inc.
4 4
@@ -29,8 +29,6 @@
29 29
30;;; Code: 30;;; Code:
31 31
32(eval-when-compile (require 'cl))
33
34(eval-and-compile 32(eval-and-compile
35 (defalias 'binhex-char-int 33 (defalias 'binhex-char-int
36 (if (fboundp 'char-int) 34 (if (fboundp 'char-int)
@@ -193,7 +191,7 @@ input and write the converted data to its standard output."
193(defvar binhex-last-char) 191(defvar binhex-last-char)
194(defvar binhex-repeat) 192(defvar binhex-repeat)
195 193
196(defun binhex-push-char (char &optional count ignored buffer) 194(defun binhex-push-char (char &optional ignored buffer)
197 (cond 195 (cond
198 (binhex-repeat 196 (binhex-repeat
199 (if (eq char 0) 197 (if (eq char 0)
@@ -241,10 +239,10 @@ If HEADER-ONLY is non-nil only decode header and return filename."
241 counter (1+ counter) 239 counter (1+ counter)
242 inputpos (1+ inputpos)) 240 inputpos (1+ inputpos))
243 (cond ((= counter 4) 241 (cond ((= counter 4)
244 (binhex-push-char (lsh bits -16) 1 nil work-buffer) 242 (binhex-push-char (lsh bits -16) nil work-buffer)
245 (binhex-push-char (logand (lsh bits -8) 255) 1 nil 243 (binhex-push-char (logand (lsh bits -8) 255) nil
246 work-buffer) 244 work-buffer)
247 (binhex-push-char (logand bits 255) 1 nil 245 (binhex-push-char (logand bits 255) nil
248 work-buffer) 246 work-buffer)
249 (setq bits 0 counter 0)) 247 (setq bits 0 counter 0))
250 (t (setq bits (lsh bits 6))))) 248 (t (setq bits (lsh bits 6)))))
@@ -263,12 +261,12 @@ If HEADER-ONLY is non-nil only decode header and return filename."
263 (setq tmp (and tmp (not (eq inputpos end))))) 261 (setq tmp (and tmp (not (eq inputpos end)))))
264 (cond 262 (cond
265 ((= counter 3) 263 ((= counter 3)
266 (binhex-push-char (logand (lsh bits -16) 255) 1 nil 264 (binhex-push-char (logand (lsh bits -16) 255) nil
267 work-buffer) 265 work-buffer)
268 (binhex-push-char (logand (lsh bits -8) 255) 1 nil 266 (binhex-push-char (logand (lsh bits -8) 255) nil
269 work-buffer)) 267 work-buffer))
270 ((= counter 2) 268 ((= counter 2)
271 (binhex-push-char (logand (lsh bits -10) 255) 1 nil 269 (binhex-push-char (logand (lsh bits -10) 255) nil
272 work-buffer)))) 270 work-buffer))))
273 (if header-only nil 271 (if header-only nil
274 (binhex-verify-crc work-buffer 272 (binhex-verify-crc work-buffer
@@ -287,7 +285,7 @@ If HEADER-ONLY is non-nil only decode header and return filename."
287(defun binhex-decode-region-external (start end) 285(defun binhex-decode-region-external (start end)
288 "Binhex decode region between START and END using external decoder." 286 "Binhex decode region between START and END using external decoder."
289 (interactive "r") 287 (interactive "r")
290 (let ((cbuf (current-buffer)) firstline work-buffer status 288 (let ((cbuf (current-buffer)) firstline work-buffer
291 (file-name (expand-file-name 289 (file-name (expand-file-name
292 (concat (binhex-decode-region-internal start end t) 290 (concat (binhex-decode-region-internal start end t)
293 ".data") 291 ".data")
diff --git a/lisp/mail/flow-fill.el b/lisp/mail/flow-fill.el
index 130e1640572..00818ddee3d 100644
--- a/lisp/mail/flow-fill.el
+++ b/lisp/mail/flow-fill.el
@@ -1,4 +1,4 @@
1;;; flow-fill.el --- interpret RFC2646 "flowed" text 1;;; flow-fill.el --- interpret RFC2646 "flowed" text -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2000-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2000-2017 Free Software Foundation, Inc.
4 4
@@ -49,7 +49,6 @@
49 49
50;;; Code: 50;;; Code:
51 51
52(eval-when-compile (require 'cl))
53 52
54(defcustom fill-flowed-display-column 'fill-column 53(defcustom fill-flowed-display-column 'fill-column
55 "Column beyond which format=flowed lines are wrapped, when displayed. 54 "Column beyond which format=flowed lines are wrapped, when displayed.
diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el
index 121e771c550..1cb966769e5 100644
--- a/lisp/mail/footnote.el
+++ b/lisp/mail/footnote.el
@@ -2,7 +2,7 @@
2 2
3;; Copyright (C) 1997, 2000-2017 Free Software Foundation, Inc. 3;; Copyright (C) 1997, 2000-2017 Free Software Foundation, Inc.
4 4
5;; Author: Steven L Baur <steve@xemacs.org> (1997-) 5;; Author: Steven L Baur <steve@xemacs.org> (1997-2011)
6;; Boruch Baum <boruch_baum@gmx.com> (2017-) 6;; Boruch Baum <boruch_baum@gmx.com> (2017-)
7;; Keywords: mail, news 7;; Keywords: mail, news
8;; Version: 0.19 8;; Version: 0.19
diff --git a/lisp/mail/hashcash.el b/lisp/mail/hashcash.el
index ff00ce4069e..9f7152a9b0b 100644
--- a/lisp/mail/hashcash.el
+++ b/lisp/mail/hashcash.el
@@ -1,4 +1,4 @@
1;;; hashcash.el --- Add hashcash payments to email 1;;; hashcash.el --- Add hashcash payments to email -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2003-2005, 2007-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2003-2005, 2007-2017 Free Software Foundation, Inc.
4 4
@@ -47,7 +47,7 @@
47 47
48;;; Code: 48;;; Code:
49 49
50(eval-when-compile (require 'cl)) ; for case 50(eval-when-compile (require 'cl-lib))
51 51
52(defgroup hashcash nil 52(defgroup hashcash nil
53 "Hashcash configuration." 53 "Hashcash configuration."
@@ -139,12 +139,12 @@ For example, you may want to set this to (\"-Z2\") to reduce header length."
139(defun hashcash-token-substring () 139(defun hashcash-token-substring ()
140 (save-excursion 140 (save-excursion
141 (let ((token "")) 141 (let ((token ""))
142 (loop 142 (cl-loop
143 (setq token 143 (setq token
144 (concat token (buffer-substring (point) (hashcash-point-at-eol)))) 144 (concat token (buffer-substring (point) (hashcash-point-at-eol))))
145 (goto-char (hashcash-point-at-eol)) 145 (goto-char (hashcash-point-at-eol))
146 (forward-char 1) 146 (forward-char 1)
147 (unless (looking-at "[ \t]") (return token)) 147 (unless (looking-at "[ \t]") (cl-return token))
148 (while (looking-at "[ \t]") (forward-char 1)))))) 148 (while (looking-at "[ \t]") (forward-char 1))))))
149 149
150(defun hashcash-payment-required (addr) 150(defun hashcash-payment-required (addr)
@@ -298,7 +298,7 @@ BUFFER defaults to the current buffer."
298 (let* ((split (split-string token ":")) 298 (let* ((split (split-string token ":"))
299 (key (if (< (hashcash-version token) 1.2) 299 (key (if (< (hashcash-version token) 1.2)
300 (nth 1 split) 300 (nth 1 split)
301 (case (string-to-number (nth 0 split)) 301 (pcase (string-to-number (nth 0 split))
302 (0 (nth 2 split)) 302 (0 (nth 2 split))
303 (1 (nth 3 split)))))) 303 (1 (nth 3 split))))))
304 (cond ((null resource) 304 (cond ((null resource)
diff --git a/lisp/mail/ietf-drums.el b/lisp/mail/ietf-drums.el
index 86496beb0fd..aadfc7fa985 100644
--- a/lisp/mail/ietf-drums.el
+++ b/lisp/mail/ietf-drums.el
@@ -1,4 +1,4 @@
1;;; ietf-drums.el --- Functions for parsing RFC822bis headers 1;;; ietf-drums.el --- Functions for parsing RFC822bis headers -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 1998-2017 Free Software Foundation, Inc. 3;; Copyright (C) 1998-2017 Free Software Foundation, Inc.
4 4
@@ -37,7 +37,7 @@
37 37
38;;; Code: 38;;; Code:
39 39
40(eval-when-compile (require 'cl)) 40(eval-when-compile (require 'cl-lib))
41 41
42(defvar ietf-drums-no-ws-ctl-token "\001-\010\013\014\016-\037\177" 42(defvar ietf-drums-no-ws-ctl-token "\001-\010\013\014\016-\037\177"
43 "US-ASCII control characters excluding CR, LF and white space.") 43 "US-ASCII control characters excluding CR, LF and white space.")
@@ -78,10 +78,10 @@ backslash and doublequote.")
78(defun ietf-drums-token-to-list (token) 78(defun ietf-drums-token-to-list (token)
79 "Translate TOKEN into a list of characters." 79 "Translate TOKEN into a list of characters."
80 (let ((i 0) 80 (let ((i 0)
81 b e c out range) 81 b c out range)
82 (while (< i (length token)) 82 (while (< i (length token))
83 (setq c (aref token i)) 83 (setq c (aref token i))
84 (incf i) 84 (cl-incf i)
85 (cond 85 (cond
86 ((eq c ?-) 86 ((eq c ?-)
87 (if b 87 (if b
@@ -90,7 +90,7 @@ backslash and doublequote.")
90 (range 90 (range
91 (while (<= b c) 91 (while (<= b c)
92 (push (make-char 'ascii b) out) 92 (push (make-char 'ascii b) out)
93 (incf b)) 93 (cl-incf b))
94 (setq range nil)) 94 (setq range nil))
95 ((= i (length token)) 95 ((= i (length token))
96 (push (make-char 'ascii c) out)) 96 (push (make-char 'ascii c) out))
@@ -115,7 +115,7 @@ backslash and doublequote.")
115 (setq c (char-after)) 115 (setq c (char-after))
116 (cond 116 (cond
117 ((eq c ?\") 117 ((eq c ?\")
118 (condition-case err 118 (condition-case nil
119 (forward-sexp 1) 119 (forward-sexp 1)
120 (error (goto-char (point-max))))) 120 (error (goto-char (point-max)))))
121 ((eq c ?\() 121 ((eq c ?\()
diff --git a/lisp/mail/rfc2231.el b/lisp/mail/rfc2231.el
index e27113a9e39..dab78070e43 100644
--- a/lisp/mail/rfc2231.el
+++ b/lisp/mail/rfc2231.el
@@ -1,4 +1,4 @@
1;;; rfc2231.el --- Functions for decoding rfc2231 headers 1;;; rfc2231.el --- Functions for decoding rfc2231 headers -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 1998-2017 Free Software Foundation, Inc. 3;; Copyright (C) 1998-2017 Free Software Foundation, Inc.
4 4
@@ -22,7 +22,6 @@
22 22
23;;; Code: 23;;; Code:
24 24
25(eval-when-compile (require 'cl))
26(require 'ietf-drums) 25(require 'ietf-drums)
27(require 'rfc2047) 26(require 'rfc2047)
28(autoload 'mm-encode-body "mm-bodies") 27(autoload 'mm-encode-body "mm-bodies")
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index aff90d33ed3..09b5578029a 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -941,7 +941,7 @@ Returns an error if the server cannot be contacted."
941 941
942 (if (and (multibyte-string-p data) 942 (if (and (multibyte-string-p data)
943 smtpmail-code-conv-from) 943 smtpmail-code-conv-from)
944 (setq data (string-as-multibyte 944 (setq data (string-as-multibyte ;FIXME: ???
945 (encode-coding-string data smtpmail-code-conv-from)))) 945 (encode-coding-string data smtpmail-code-conv-from))))
946 946
947 (if smtpmail-debug-info 947 (if smtpmail-debug-info
diff --git a/lisp/mail/uudecode.el b/lisp/mail/uudecode.el
index 2811b0bf44a..91171011860 100644
--- a/lisp/mail/uudecode.el
+++ b/lisp/mail/uudecode.el
@@ -1,4 +1,4 @@
1;;; uudecode.el -- elisp native uudecode 1;;; uudecode.el -- elisp native uudecode -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 1998-2017 Free Software Foundation, Inc. 3;; Copyright (C) 1998-2017 Free Software Foundation, Inc.
4 4
@@ -24,13 +24,10 @@
24 24
25;;; Code: 25;;; Code:
26 26
27(eval-when-compile (require 'cl)) 27(defalias 'uudecode-char-int
28 28 (if (fboundp 'char-int)
29(eval-and-compile 29 'char-int
30 (defalias 'uudecode-char-int 30 'identity))
31 (if (fboundp 'char-int)
32 'char-int
33 'identity)))
34 31
35(defgroup uudecode nil 32(defgroup uudecode nil
36 "Decoding of uuencoded data." 33 "Decoding of uuencoded data."
@@ -78,7 +75,7 @@ input and write the converted data to its standard output."
78If FILE-NAME is non-nil, save the result to FILE-NAME. The program 75If FILE-NAME is non-nil, save the result to FILE-NAME. The program
79used is specified by `uudecode-decoder-program'." 76used is specified by `uudecode-decoder-program'."
80 (interactive "r\nP") 77 (interactive "r\nP")
81 (let ((cbuf (current-buffer)) tempfile firstline status) 78 (let ((cbuf (current-buffer)) tempfile firstline)
82 (save-excursion 79 (save-excursion
83 (goto-char start) 80 (goto-char start)
84 (when (re-search-forward uudecode-begin-line nil t) 81 (when (re-search-forward uudecode-begin-line nil t)
@@ -110,7 +107,7 @@ used is specified by `uudecode-decoder-program'."
110 (insert "begin 600 " (file-name-nondirectory tempfile) "\n") 107 (insert "begin 600 " (file-name-nondirectory tempfile) "\n")
111 (insert-buffer-substring cbuf firstline end) 108 (insert-buffer-substring cbuf firstline end)
112 (cd (file-name-directory tempfile)) 109 (cd (file-name-directory tempfile))
113 (apply 'call-process-region 110 (apply #'call-process-region
114 (point-min) 111 (point-min)
115 (point-max) 112 (point-max)
116 uudecode-decoder-program 113 uudecode-decoder-program
@@ -128,20 +125,6 @@ used is specified by `uudecode-decoder-program'."
128 (message "Can not uudecode"))) 125 (message "Can not uudecode")))
129 (ignore-errors (or file-name (delete-file tempfile)))))) 126 (ignore-errors (or file-name (delete-file tempfile))))))
130 127
131(eval-and-compile
132 (defalias 'uudecode-string-to-multibyte
133 (cond
134 ((featurep 'xemacs)
135 'identity)
136 ((fboundp 'string-to-multibyte)
137 'string-to-multibyte)
138 (t
139 (lambda (string)
140 "Return a multibyte string with the same individual chars as string."
141 (mapconcat
142 (lambda (ch) (string-as-multibyte (char-to-string ch)))
143 string ""))))))
144
145;;;###autoload 128;;;###autoload
146(defun uudecode-decode-region-internal (start end &optional file-name) 129(defun uudecode-decode-region-internal (start end &optional file-name)
147 "Uudecode region between START and END without using an external program. 130 "Uudecode region between START and END without using an external program.
@@ -216,13 +199,13 @@ If FILE-NAME is non-nil, save the result to FILE-NAME."
216 (if file-name 199 (if file-name
217 (with-temp-file file-name 200 (with-temp-file file-name
218 (unless (featurep 'xemacs) (set-buffer-multibyte nil)) 201 (unless (featurep 'xemacs) (set-buffer-multibyte nil))
219 (insert (apply 'concat (nreverse result)))) 202 (insert (apply #'concat (nreverse result))))
220 (or (markerp end) (setq end (set-marker (make-marker) end))) 203 (or (markerp end) (setq end (set-marker (make-marker) end)))
221 (goto-char start) 204 (goto-char start)
222 (if enable-multibyte-characters 205 (if enable-multibyte-characters
223 (dolist (x (nreverse result)) 206 (dolist (x (nreverse result))
224 (insert (uudecode-string-to-multibyte x))) 207 (insert (decode-coding-string x 'binary)))
225 (insert (apply 'concat (nreverse result)))) 208 (insert (apply #'concat (nreverse result))))
226 (delete-region (point) end)))))) 209 (delete-region (point) end))))))
227 210
228;;;###autoload 211;;;###autoload
diff --git a/lisp/mail/yenc.el b/lisp/mail/yenc.el
index b84b16144d3..956427c3ed6 100644
--- a/lisp/mail/yenc.el
+++ b/lisp/mail/yenc.el
@@ -1,4 +1,4 @@
1;;; yenc.el --- elisp native yenc decoder 1;;; yenc.el --- elisp native yenc decoder -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2002-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2002-2017 Free Software Foundation, Inc.
4 4
@@ -32,7 +32,7 @@
32 32
33;;; Code: 33;;; Code:
34 34
35(eval-when-compile (require 'cl)) 35(eval-when-compile (require 'cl-lib))
36 36
37(defconst yenc-begin-line 37(defconst yenc-begin-line
38 "^=ybegin.*$") 38 "^=ybegin.*$")
@@ -97,14 +97,14 @@
97 (cond ((or (eq char ?\r) 97 (cond ((or (eq char ?\r)
98 (eq char ?\n))) 98 (eq char ?\n)))
99 ((eq char ?=) 99 ((eq char ?=)
100 (setq char (char-after (incf first))) 100 (setq char (char-after (cl-incf first)))
101 (with-current-buffer work-buffer 101 (with-current-buffer work-buffer
102 (insert-char (mod (- char 106) 256) 1))) 102 (insert-char (mod (- char 106) 256) 1)))
103 (t 103 (t
104 (with-current-buffer work-buffer 104 (with-current-buffer work-buffer
105 ;;(insert-char (mod (- char 42) 256) 1) 105 ;;(insert-char (mod (- char 42) 256) 1)
106 (insert-char (aref yenc-decoding-vector char) 1)))) 106 (insert-char (aref yenc-decoding-vector char) 1))))
107 (incf first)) 107 (cl-incf first))
108 (setq bytes (buffer-size work-buffer)) 108 (setq bytes (buffer-size work-buffer))
109 (unless (and (= (cdr (assq 'size header-alist)) bytes) 109 (unless (and (= (cdr (assq 'size header-alist)) bytes)
110 (= (cdr (assq 'size footer-alist)) bytes)) 110 (= (cdr (assq 'size footer-alist)) bytes))